Patch "netdev: Enforce index cap in netdev_get_tx_queue" has been added to the 6.3-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

    netdev: Enforce index cap in netdev_get_tx_queue

to the 6.3-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:
     netdev-enforce-index-cap-in-netdev_get_tx_queue.patch
and it can be found in the queue-6.3 subdirectory.

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



commit ea5bcad95921a77446d1eaa01c0204756e82d01e
Author: Nick Child <nnac123@xxxxxxxxxxxxx>
Date:   Tue Mar 21 10:07:25 2023 -0500

    netdev: Enforce index cap in netdev_get_tx_queue
    
    [ Upstream commit 1cc6571f562774f1d928dc8b3cff50829b86e970 ]
    
    When requesting a TX queue at a given index, warn on out-of-bounds
    referencing if the index is greater than the allocated number of
    queues.
    
    Specifically, since this function is used heavily in the networking
    stack use DEBUG_NET_WARN_ON_ONCE to avoid executing a new branch on
    every packet.
    
    Signed-off-by: Nick Child <nnac123@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230321150725.127229-2-nnac123@xxxxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c35f04f636f15..7db9f960221d3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2463,6 +2463,7 @@ static inline
 struct netdev_queue *netdev_get_tx_queue(const struct net_device *dev,
 					 unsigned int index)
 {
+	DEBUG_NET_WARN_ON_ONCE(index >= dev->num_tx_queues);
 	return &dev->_tx[index];
 }
 



[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