Thread (7 messages) 7 messages, 5 authors, 2023-02-02

RE: [PATCH net 1/1] hv_netvsc: Fix missed pagebuf entries in netvsc_dma_map/unmap()

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: 2023-01-31 17:01:20
Also in: linux-hyperv, lkml, stable

-----Original Message-----
From: Michael Kelley (LINUX) <redacted>
Sent: Monday, January 30, 2023 10:33 PM
To: KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
[off-list ref]; wei.liu@kernel.org; Dexuan Cui
[off-list ref]; davem@davemloft.net; edumazet@google.com;
kuba@kernel.org; pabeni@redhat.com; netdev@vger.kernel.org; linux-
hyperv@vger.kernel.org; linux-kernel@vger.kernel.org
Cc: Michael Kelley (LINUX) <redacted>; stable@vger.kernel.org
Subject: [PATCH net 1/1] hv_netvsc: Fix missed pagebuf entries in
netvsc_dma_map/unmap()

netvsc_dma_map() and netvsc_dma_unmap() currently check the cp_partial
flag and adjust the page_count so that pagebuf entries for the RNDIS
portion of the message are skipped when it has already been copied into
a send buffer. But this adjustment has already been made by code in
netvsc_send(). The duplicate adjustment causes some pagebuf entries to
not be mapped. In a normal VM, this doesn't break anything because the
mapping doesn’t change the PFN. But in a Confidential VM,
dma_map_single() does bounce buffering and provides a different PFN.
Failing to do the mapping causes the wrong PFN to be passed to Hyper-V,
and various errors ensue.

Fix this by removing the duplicate adjustment in netvsc_dma_map() and
netvsc_dma_unmap().

Fixes: 846da38de0e8 ("net: netvsc: Add Isolation VM support for netvsc
driver")
Cc: stable@vger.kernel.org
Signed-off-by: Michael Kelley <redacted>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>

Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help