]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
firewire: core: fix invalid port index for parent device
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Fri, 25 Oct 2024 03:41:37 +0000 (12:41 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Nov 2024 01:02:41 +0000 (02:02 +0100)
commit90753a38bc3d058820981f812a908a99f7b337c1
treeb543a073c50b05343e4f2a010f7b5b2dee91fff9
parent5dbe014a9c7c85a41f705ffed5c93edfc9e6242d
firewire: core: fix invalid port index for parent device

commit f6a6780e0b9bbcf311a727afed06fee533a5e957 upstream.

In a commit 24b7f8e5cd65 ("firewire: core: use helper functions for self
ID sequence"), the enumeration over self ID sequence was refactored with
some helper functions with KUnit tests. These helper functions are
guaranteed to work expectedly by the KUnit tests, however their application
includes a mistake to assign invalid value to the index of port connected
to parent device.

This bug affects the case that any extra node devices which has three or
more ports are connected to 1394 OHCI controller. In the case, the path
to update the tree cache could hits WARN_ON(), and gets general protection
fault due to the access to invalid address computed by the invalid value.

This commit fixes the bug to assign correct port index.

Cc: stable@vger.kernel.org
Reported-by: Edmund Raile <edmund.raile@proton.me>
Closes: https://lore.kernel.org/lkml/8a9902a4ece9329af1e1e42f5fea76861f0bf0e8.camel@proton.me/
Fixes: 24b7f8e5cd65 ("firewire: core: use helper functions for self ID sequence")
Link: https://lore.kernel.org/r/20241025034137.99317-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firewire/core-topology.c