Commit 38649ffc authored by Alan Stern's avatar Alan Stern Committed by openeuler-sync-bot
Browse files

USB: core: Change usb_get_device_descriptor() API

stable inclusion
from stable-v5.10.195
commit 6ceffc2ecf3de8acdce2202db1c32d8c520a230e
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I819LJ
CVE: CVE-2023-37453

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6ceffc2ecf3de8acdce2202db1c32d8c520a230e



--------------------------------

commit de28e469 upstream.

The usb_get_device_descriptor() routine reads the device descriptor
from the udev device and stores it directly in udev->descriptor.  This
interface is error prone, because the USB subsystem expects in-memory
copies of a device's descriptors to be immutable once the device has
been initialized.

The interface is changed so that the device descriptor is left in a
kmalloc-ed buffer, not copied into the usb_device structure.  A
pointer to the buffer is returned to the caller, who is then
responsible for kfree-ing it.  The corresponding changes needed in the
various callers are fairly small.

Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/d0111bb6-56c1-4f90-adf2-6cfe152f6561@rowland.harvard.edu


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarLin Yujun <linyujun809@huawei.com>
(cherry picked from commit 4e85a930)
parent 96ec11d3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment