]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: fix even more unsafe memory usage in xhci tracing
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 20 Aug 2021 12:34:59 +0000 (15:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Aug 2021 11:06:02 +0000 (13:06 +0200)
commit59fcefaaeeb20a8815ac1f47988ee055ada2711f
treec2694d4470a60cb6a17665b25f755f2e803576d5
parentc8af135cd196095b4b7f1c991749bc3924f2d7cd
xhci: fix even more unsafe memory usage in xhci tracing

Removes static char buffer usage in the following decode functions:
xhci_decode_ctrl_ctx()
xhci_decode_slot_context()
xhci_decode_usbsts()
xhci_decode_doorbell()
xhci_decode_ep_context()

Caller must provide a buffer to use.
In tracing use __get_str() as recommended to pass buffer.

Minor changes are needed in other xhci code as these functions are also
used elsewhere

Cc: <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20210820123503.2605901-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-debugfs.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci-trace.h
drivers/usb/host/xhci.h