Patch "net: atlantic: verify hw_head_ lies within TX buffer ring" has been added to the 5.15-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: atlantic: verify hw_head_ lies within TX buffer ring

to the 5.15-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-atlantic-verify-hw_head_-lies-within-tx-buffer-r.patch
and it can be found in the queue-5.15 subdirectory.

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



commit c6b7ecc7d69908e21a4df97ffd3d5b60ea1d953d
Author: Grant Grundler <grundler@xxxxxxxxxxxx>
Date:   Mon May 9 19:28:26 2022 -0700

    net: atlantic: verify hw_head_ lies within TX buffer ring
    
    [ Upstream commit 2120b7f4d128433ad8c5f503a9584deba0684901 ]
    
    Bounds check hw_head index provided by NIC to verify it lies
    within the TX buffer ring.
    
    Reported-by: Aashay Shringarpure <aashay@xxxxxxxxxx>
    Reported-by: Yi Chou <yich@xxxxxxxxxx>
    Reported-by: Shervin Oloumi <enlightened@xxxxxxxxxx>
    Signed-off-by: Grant Grundler <grundler@xxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
index 9f1b15077e7d..45c17c585d74 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
@@ -889,6 +889,13 @@ int hw_atl_b0_hw_ring_tx_head_update(struct aq_hw_s *self,
 		err = -ENXIO;
 		goto err_exit;
 	}
+
+	/* Validate that the new hw_head_ is reasonable. */
+	if (hw_head_ >= ring->size) {
+		err = -ENXIO;
+		goto err_exit;
+	}
+
 	ring->hw_head = hw_head_;
 	err = aq_hw_err_from_flags(self);
 



[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