xhci: fix unsafe memory usage in xhci tracing
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 20 Aug 2021 12:34:58 +0000 (15:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Aug 2021 11:06:02 +0000 (13:06 +0200)
commitcbf286e8ef8337308c259ff5b9ce2e74d403be5a
tree479a55e4b2d6287bbeb785e4a129085995aa4cd3
parentd7428bc26fc767942c38d74b80299bcd4f01e7cb
xhci: fix unsafe memory usage in xhci tracing

Removes static char buffer usage in the following decode functions:
xhci_decode_trb()
xhci_decode_ptortsc()

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

Minor chanes are needed in xhci debugfs code as these functions are also
used there. Changes include moving XHCI_MSG_MAX definititon from
xhci-trace.h to xhci.h

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