]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xhci: fix possible null pointer dereference at secondary interrupter removal
authorMathias Nyman <mathias.nyman@linux.intel.com>
Thu, 25 Jan 2024 15:27:34 +0000 (17:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 May 2025 07:44:08 +0000 (09:44 +0200)
commitfe465003bb63df8d5ea15fc17ff6aa9a5fe7daeb
treeeb2935219df8ffeea074283f60e5efda8e9b493c
parent3efb29f6a78d4746f958c1ab6cd7981c5762f03b
xhci: fix possible null pointer dereference at secondary interrupter removal

commit a54a594d72f25b08f39d743880a76721fba9ae77 upstream.

Don't try to remove a secondary interrupter that is known to be invalid.
Also check if the interrupter is valid inside the spinlock that protects
the array of interrupters.

Found by smatch static checker

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-usb/ffaa0a1b-5984-4a1f-bfd3-9184630a97b9@moroto.mountain/
Fixes: c99b38c41234 ("xhci: add support to allocate several interrupters")
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20240125152737.2983959-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mem.c