patch 'vhost: fix mmap error check in VDUSE IOTLB miss handler' has been queued to stable release 25.11.1
Kevin Traynor
ktraynor at redhat.com
Thu Feb 26 14:08:52 CET 2026
Hi,
FYI, your patch has been queued to stable release 25.11.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/02/26. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/62b8eb9551da9409b927ffac2bd1e0a7b6435298
Thanks.
Kevin
---
>From 62b8eb9551da9409b927ffac2bd1e0a7b6435298 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Wed, 14 Jan 2026 16:34:45 +0100
Subject: [PATCH] vhost: fix mmap error check in VDUSE IOTLB miss handler
[ upstream commit 970e569b85a499f5bf72192c8e4d51451acc4727 ]
The mmap() function returns MAP_FAILED on failure, not NULL.
The current check for !mmap_addr will never detect mmap failures.
When mmap fails but the error is not detected, an invalid address (-1)
is inserted into the IOTLB cache via vhost_user_iotlb_cache_insert().
Subsequent attempts to access this address will cause memory
corruption or crash.
Fix by checking for MAP_FAILED instead of NULL. Also add strerror to
the error message for easier debugging.
Fixes: f27d5206c598 ("vhost: add VDUSE callback for IOTLB miss")
Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
Reviewed-by: Chenbo Xia <chenbox at nvidia.com>
---
lib/vhost/vduse.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c
index 897dee9f1b..0b5d158fee 100644
--- a/lib/vhost/vduse.c
+++ b/lib/vhost/vduse.c
@@ -87,7 +87,8 @@ vduse_iotlb_miss(struct virtio_net *dev, uint64_t iova, uint8_t perm __rte_unuse
size = entry.last - entry.start + 1;
mmap_addr = mmap(0, size + entry.offset, entry.perm, MAP_SHARED, fd, 0);
- if (!mmap_addr) {
+ if (mmap_addr == MAP_FAILED) {
VHOST_CONFIG_LOG(dev->ifname, ERR,
- "Failed to mmap IOTLB entry for 0x%" PRIx64, iova);
+ "Failed to mmap IOTLB entry for 0x%" PRIx64 ": %s",
+ iova, strerror(errno));
ret = -1;
goto close_fd;
--
2.53.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-02-26 10:16:49.077324076 +0000
+++ 0050-vhost-fix-mmap-error-check-in-VDUSE-IOTLB-miss-handl.patch 2026-02-26 10:16:46.965459299 +0000
@@ -1 +1 @@
-From 970e569b85a499f5bf72192c8e4d51451acc4727 Mon Sep 17 00:00:00 2001
+From 62b8eb9551da9409b927ffac2bd1e0a7b6435298 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 970e569b85a499f5bf72192c8e4d51451acc4727 ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list