]> git.ipfire.org Git - thirdparty/linux.git/commit
net: mana: validate rx_req_idx to prevent out-of-bounds array access
authorAditya Garg <gargaditya@linux.microsoft.com>
Wed, 20 May 2026 05:15:53 +0000 (22:15 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 May 2026 15:14:11 +0000 (08:14 -0700)
commitb809d0409991b75a6cff846a5ac27c3062953f84
treec2805438cf187f213804b4ca3b415d6c4c1a72a1
parent9eddc819f00b5b74bb4ac91396f80bd35f5f3561
net: mana: validate rx_req_idx to prevent out-of-bounds array access

In mana_hwc_rx_event_handler(), rx_req_idx is derived from
sge->address in DMA-coherent memory. In Confidential VMs
(SEV-SNP/TDX), this memory is shared unencrypted and HW can modify
WQE contents at any time. No bounds check exists on rx_req_idx,
which can lead to an out-of-bounds access into reqs[].

Add bounds check on rx_req_idx in mana_hwc_rx_event_handler() before
using it to index the reqs[] array.

Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Signed-off-by: Aditya Garg <gargaditya@linux.microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://patch.msgid.link/20260520051553.857120-1-gargaditya@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microsoft/mana/hw_channel.c