Patch "usb: host: xhci: use snprintf() in xhci_decode_trb()" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    usb: host: xhci: use snprintf() in xhci_decode_trb()

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-host-xhci-use-snprintf-in-xhci_decode_trb.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7c454ff6d25f2878609a100248567a29a0392af9
Author: Sergey Shtylyov <s.shtylyov@xxxxxx>
Date:   Thu Jun 30 15:46:45 2022 +0300

    usb: host: xhci: use snprintf() in xhci_decode_trb()
    
    [ Upstream commit 1ce69c35b86038dd11d3a6115a04501c5b89a940 ]
    
    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@xxxxxx>
    Signed-off-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220630124645.1805902-2-mathias.nyman@xxxxxxxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index a9031f494984..5a6ad776858e 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -2376,7 +2376,7 @@ static inline const char *xhci_decode_trb(char *str, size_t size,
 			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),



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux