kernel_samsung_a53x/drivers/usb/gadget
Oliver Neukum e17ee48ce2 usb: gadget: printer: fix races against disable
commit e587a7633dfee8987a999cf253f7c52a8e09276c upstream.

printer_read() and printer_write() guard against the race
against disable() by checking the dev->interface flag,
which in turn is guarded by a spinlock.
These functions, however, drop the lock on multiple occasions.
This means that the test has to be redone after reacquiring
the lock and before doing IO.

Add the tests.

This also addresses CVE-2024-25741

Fixes: 7f2ca14d2f9b9 ("usb: gadget: function: printer: Interface is disabled and returns error")
Cc: stable <stable@kernel.org>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Link: https://lore.kernel.org/r/20240620114039.5767-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-19 14:19:33 +01:00
..
function usb: gadget: printer: fix races against disable 2024-11-19 14:19:33 +01:00
legacy usb: raw-gadget: properly handle interrupted requests 2024-11-18 10:58:48 +01:00
udc usb: udc: remove warning when queue disabled ep 2024-11-19 09:22:43 +01:00
composite.c usb: gadget: composite: fix OS descriptors w_value logic 2024-11-19 11:32:48 +01:00
config.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
configfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
configfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
epautoconf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
functions.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
u_f.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
u_f.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
u_os_desc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
usbstring.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00