* [PATCH] usb: host: xhci: use snprintf() in xhci_decode_trb()
@ 2022-03-16 20:36 Sergey Shtylyov
2022-05-17 19:13 ` Sergey Shtylyov
0 siblings, 1 reply; 3+ messages in thread
From: Sergey Shtylyov @ 2022-03-16 20:36 UTC (permalink / raw)
To: Mathias Nyman, linux-usb, Greg Kroah-Hartman
Commit cbf286e8ef83 ("xhci: fix unsafe memory usage in xhci tracing")
apparently missed one sprintf() call in xhci_decode_trb() -- replace
it with the snprintf() call as well...
Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.
Fixes: cbf286e8ef83 ("xhci: fix unsafe memory usage in xhci tracing")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
This patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo.
drivers/usb/host/xhci.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: usb/drivers/usb/host/xhci.h
===================================================================
--- usb.orig/drivers/usb/host/xhci.h
+++ usb/drivers/usb/host/xhci.h
@@ -2391,7 +2391,7 @@ static inline const char *xhci_decode_tr
field3 & TRB_CYCLE ? 'C' : 'c');
break;
case TRB_STOP_RING:
- sprintf(str,
+ snprintf(str, size,
"%s: slot %d sp %d ep %d flags %c",
xhci_trb_type_string(type),
TRB_TO_SLOT_ID(field3),
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] usb: host: xhci: use snprintf() in xhci_decode_trb()
2022-03-16 20:36 [PATCH] usb: host: xhci: use snprintf() in xhci_decode_trb() Sergey Shtylyov
@ 2022-05-17 19:13 ` Sergey Shtylyov
2022-05-18 8:32 ` Mathias Nyman
0 siblings, 1 reply; 3+ messages in thread
From: Sergey Shtylyov @ 2022-05-17 19:13 UTC (permalink / raw)
To: Mathias Nyman, linux-usb, Greg Kroah-Hartman
Hello!
On 3/16/22 11:36 PM, Sergey Shtylyov wrote:
> Commit cbf286e8ef83 ("xhci: fix unsafe memory usage in xhci tracing")
> apparently missed one sprintf() call in xhci_decode_trb() -- replace
> it with the snprintf() call as well...
>
> Found by Linux Verification Center (linuxtesting.org) with the SVACE static
> analysis tool.
>
> Fixes: cbf286e8ef83 ("xhci: fix unsafe memory usage in xhci tracing")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
>
> ---
> This patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo.
Mathias, Greg, what's going on with this patch? It was posted 2 months ago
and seemingly ignored... :-/
MBR, Sergey
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] usb: host: xhci: use snprintf() in xhci_decode_trb()
2022-05-17 19:13 ` Sergey Shtylyov
@ 2022-05-18 8:32 ` Mathias Nyman
0 siblings, 0 replies; 3+ messages in thread
From: Mathias Nyman @ 2022-05-18 8:32 UTC (permalink / raw)
To: Sergey Shtylyov, Mathias Nyman, linux-usb, Greg Kroah-Hartman
On 17.5.2022 22.13, Sergey Shtylyov wrote:
> Hello!
>
> On 3/16/22 11:36 PM, Sergey Shtylyov wrote:
>
>> Commit cbf286e8ef83 ("xhci: fix unsafe memory usage in xhci tracing")
>> apparently missed one sprintf() call in xhci_decode_trb() -- replace
>> it with the snprintf() call as well...
>>
>> Found by Linux Verification Center (linuxtesting.org) with the SVACE static
>> analysis tool.
>>
>> Fixes: cbf286e8ef83 ("xhci: fix unsafe memory usage in xhci tracing")
>> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
>>
>> ---
>> This patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo.
>
> Mathias, Greg, what's going on with this patch? It was posted 2 months ago
> and seemingly ignored... :-/
>
> MBR, Sergey
Must have missed it
I'll queue it up for 5.20 unless Greg still picks it up for 5.19.
Not urgent.
-Mathias
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-18 8:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-16 20:36 [PATCH] usb: host: xhci: use snprintf() in xhci_decode_trb() Sergey Shtylyov
2022-05-17 19:13 ` Sergey Shtylyov
2022-05-18 8:32 ` Mathias Nyman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.