]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
net: ena: avoid memory access violation by validating req_id properly
authorArthur Kiyanovski <akiyano@amazon.com>
Tue, 17 Mar 2020 07:06:41 +0000 (09:06 +0200)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 4 Sep 2020 19:28:50 +0000 (16:28 -0300)
commitb183347ddefb156a7997d7edad8c460300e00fcb
tree6141cc7ec502b0cfa53cd11eca5151889cc8ca90
parentefc868afc4ce16225e98556a4a2ba3511cab7982
net: ena: avoid memory access violation by validating req_id properly

BugLink: https://bugs.launchpad.net/bugs/1890845
commit 30623e1ed116bcd1785217d0a98eec643687e091 upstream.

Rx req_id is an index in struct ena_eth_io_rx_cdesc_base.
The driver should validate that the Rx req_id it received from
the device is in range [0, ring_size -1].  Failure to do so could
yield to potential memory access violoation.
The validation was mistakenly done when refilling
the Rx submission queue and not in Rx completion queue.

Fixes: ad974baef2a1 ("net: ena: add support for out of order rx buffers refill")
Signed-off-by: Noam Dagan <ndagan@amazon.com>
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/ethernet/amazon/ena/ena_netdev.c