Patch "net/sched: cbs: Fix integer overflow in cbs_set_port_rate()" 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

    net/sched: cbs: Fix integer overflow in cbs_set_port_rate()

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:
     net-sched-cbs-fix-integer-overflow-in-cbs_set_port_r.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 8dd4ac9c59d17cc7ba2212bbafda9a785c118a9a
Author: Elena Salomatkina <esalomatkina@xxxxxxxxx>
Date:   Sun Oct 13 15:45:29 2024 +0300

    net/sched: cbs: Fix integer overflow in cbs_set_port_rate()
    
    [ Upstream commit 397006ba5d918f9b74e734867e8fddbc36dc2282 ]
    
    The subsequent calculation of port_rate = speed * 1000 * BYTES_PER_KBIT,
    where the BYTES_PER_KBIT is of type LL, may cause an overflow.
    At least when speed = SPEED_20000, the expression to the left of port_rate
    will be greater than INT_MAX.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Signed-off-by: Elena Salomatkina <esalomatkina@xxxxxxxxx>
    Link: https://patch.msgid.link/20241013124529.1043-1-esalomatkina@xxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/sched/sch_cbs.c b/net/sched/sch_cbs.c
index 2eaac2ff380fa..db92ae819fd28 100644
--- a/net/sched/sch_cbs.c
+++ b/net/sched/sch_cbs.c
@@ -309,7 +309,7 @@ static void cbs_set_port_rate(struct net_device *dev, struct cbs_sched_data *q)
 {
 	struct ethtool_link_ksettings ecmd;
 	int speed = SPEED_10;
-	int port_rate;
+	s64 port_rate;
 	int err;
 
 	err = __ethtool_get_link_ksettings(dev, &ecmd);




[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