mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-02 00:40:59 -05:00
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 <[email protected]> Reported-by: Yi Chou <[email protected]> Reported-by: Shervin Oloumi <[email protected]> Signed-off-by: Grant Grundler <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
e5307704c4
commit
1c450bdf2e
1 changed files with 7 additions and 0 deletions
|
|
@ -674,6 +674,13 @@ static 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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue