mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-04 04:02:26 +00:00
net: atlantic: verify hw_head_ lies within TX buffer ring
Bounds check hw_head index provided by NIC to verify it lies within the TX buffer ring. Reported-by: Aashay Shringarpure <aashay@google.com> Reported-by: Yi Chou <yich@google.com> Reported-by: Shervin Oloumi <enlightened@google.com> Signed-off-by: Grant Grundler <grundler@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6aecbba12b
commit
2120b7f4d1
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user