From: sashiko-bot@kernel.org
To: "Long Li" <longli@microsoft.com>
Cc: linux-hyperv@vger.kernel.org
Subject: Re: [PATCH net v4 2/7] net: mana: fix HWC RQ/SQ buffer size swap
Date: Sun, 09 Aug 2026 02:35:00 +0000 [thread overview]
Message-ID: <20260809023501.50E141F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260808023417.1746886-3-longli@microsoft.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Unvalidated hardware/hypervisor input `inline_oob_size_div4` causes an out-of-bounds read of the DMA ring buffer, potentially leading to a guest kernel panic.
--
--- Patch [2]: [PATCH net v4 2/7] net: mana: fix HWC RQ/SQ buffer size swap ---
commit a84c17edbd298a723626b1c82f2d180dc7a76163
Author: Long Li <longli@microsoft.com>
net: mana: fix HWC RQ/SQ buffer size swap
This commit fixes a latent bug where the HWC RQ and SQ buffer sizes were
swapped during queue initialization. It corrects the RQ to use the max
response message size, the SQ to use the max request message size, and
updates the RX slot index computation to use the correct stride.
> diff --git a/drivers/net/ethernet/microsoft/mana/hw_channel.c b/drivers/net/ethernet/microsoft/mana/hw_channel.c
> index 409e20caeccdc..3f011ebbe7b3e 100644
> --- a/drivers/net/ethernet/microsoft/mana/hw_channel.c
> +++ b/drivers/net/ethernet/microsoft/mana/hw_channel.c
> @@ -263,7 +263,7 @@ static void mana_hwc_rx_event_handler(void *ctx, u32 gdma_rxq_id,
>
> /* Select the RX work request for virtual address and for reposting. */
> rq_base_addr = hwc_rxq->msg_buf->mem_info.dma_handle;
> - rx_req_idx = (sge->address - rq_base_addr) / hwc->max_req_msg_size;
> + rx_req_idx = (sge->address - rq_base_addr) / hwc->max_resp_msg_size;
[Severity: High]
This is a pre-existing issue, but could an untrusted hypervisor or hardware
trigger an out-of-bounds read here when dereferencing sge->address?
In mana_hwc_rx_event_handler(), the driver computes the sge pointer using
dma_oob->inline_oob_size_div4, which is read from shared DMA memory. Because
this input is unvalidated, a malicious hypervisor in a Confidential VM
environment could potentially modify it.
If inline_oob_size_div4 is maliciously set to a large value like 7, the sge
calculation (wqe + 8 + dma_oob->inline_oob_size_div4 * 4) might yield a
pointer past the end of the DMA allocation boundary. The access to
sge->address on this line would then read out of bounds, potentially causing
a guest kernel panic.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260803234355.636038-1-longli@microsoft.com?part=2
next prev parent reply other threads:[~2026-08-09 2:35 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 23:43 [PATCH net v3 0/6] net: mana: HW channel reliability and hardening fixes Long Li
2026-08-03 23:43 ` [PATCH net v3 1/6] net: mana: RCU-protect gc->cq_table lookups against concurrent CQ destroy Long Li
2026-08-04 23:44 ` sashiko-bot
2026-08-06 17:23 ` Jakub Kicinski
2026-08-03 23:43 ` [PATCH net v3 2/6] net: mana: fix HWC RQ/SQ buffer size swap Long Li
2026-08-04 23:44 ` sashiko-bot
2026-08-06 17:23 ` Jakub Kicinski
2026-08-03 23:43 ` [PATCH net v3 3/6] net: mana: free HWC comp_buf after destroying the EQ Long Li
2026-08-04 23:44 ` sashiko-bot
2026-08-06 17:23 ` Jakub Kicinski
2026-08-03 23:43 ` [PATCH net v3 4/6] net: mana: validate hardware-supplied values in the HWC RX path Long Li
2026-08-04 23:44 ` sashiko-bot
2026-08-06 17:24 ` Jakub Kicinski
2026-08-03 23:43 ` [PATCH net v3 5/6] net: mana: fix HWC teardown safety with setup_active flag and destroy ordering Long Li
2026-08-04 23:44 ` sashiko-bot
2026-08-06 17:24 ` Jakub Kicinski
2026-08-03 23:43 ` [PATCH net v3 6/6] net: mana: fix stale HWC response after command timeout Long Li
2026-08-04 23:44 ` sashiko-bot
2026-08-06 17:24 ` Jakub Kicinski
2026-08-08 2:10 ` [EXTERNAL] " Long Li
2026-08-08 2:34 ` [PATCH net v4 0/7] net: mana: HW channel reliability and hardening fixes Long Li
2026-08-08 2:34 ` [PATCH net v4 1/7] net: mana: RCU-protect gc->cq_table lookups against concurrent CQ destroy Long Li
2026-08-09 2:34 ` sashiko-bot
2026-08-08 2:34 ` [PATCH net v4 2/7] net: mana: fix HWC RQ/SQ buffer size swap Long Li
2026-08-09 2:35 ` sashiko-bot [this message]
2026-08-08 2:34 ` [PATCH net v4 3/7] net: mana: free HWC comp_buf after destroying the EQ Long Li
2026-08-09 2:35 ` sashiko-bot
2026-08-08 2:34 ` [PATCH net v4 4/7] net: mana: validate hardware-supplied values in the HWC RX path Long Li
2026-08-09 2:34 ` sashiko-bot
2026-08-08 2:34 ` [PATCH net v4 5/7] net: mana: fix HWC teardown safety with setup_active flag and destroy ordering Long Li
2026-08-08 2:34 ` [PATCH net v4 6/7] net: mana: fix stale HWC response after command timeout Long Li
2026-08-09 2:34 ` sashiko-bot
2026-08-08 2:34 ` [PATCH net v4 7/7] net: mana: keep max_num_cqs immutable once cq_table is allocated Long Li
2026-08-09 2:35 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260809023501.50E141F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox