All of lore.kernel.org
 help / color / mirror / Atom feed
* [Virtio-fs] [PATCH] virtiofsd: fix double fuse_mbuf_iter_advance when do_removemapping
@ 2019-12-05  9:01 Catherine Ho
  2019-12-05  9:19 ` Peng Tao
  0 siblings, 1 reply; 5+ messages in thread
From: Catherine Ho @ 2019-12-05  9:01 UTC (permalink / raw)
  To: Dr. David Alan Gilbert, Stefan Hajnoczi, virtio-fs; +Cc: Catherine Ho

Commit 8e92b1fc98f7 ("DAX: virtiofsd: make FUSE_REMOVEMAPPING support
multiple entries") forgot to remove one fuse_mbuf_iter_advance in
do_removemapping.

Without this patch, virtiofsd will report:
[ID: 00000123] do_removemapping: invalid in, expected 1 * 16, has 60 - 60
[ID: 00000123]    unique: 232, error: -22 (Invalid argument), outsize: 16

Fixes: 8e92b1fc98f7 ("DAX: virtiofsd: make FUSE_REMOVEMAPPING support multiple entries")
Cc: Peng Tao <tao.peng@linux.alibaba.com>
Signed-off-by: Catherine Ho <catherine.hecx@gmail.com>
---
 contrib/virtiofsd/fuse_lowlevel.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/contrib/virtiofsd/fuse_lowlevel.c b/contrib/virtiofsd/fuse_lowlevel.c
index bde66c72c3..752e7d97b9 100644
--- a/contrib/virtiofsd/fuse_lowlevel.c
+++ b/contrib/virtiofsd/fuse_lowlevel.c
@@ -1894,14 +1894,6 @@ static void do_removemapping(fuse_req_t req, fuse_ino_t nodeid,
 		return;
 	}
 
-	one = fuse_mbuf_iter_advance(iter, sizeof(*one));
-	if (!one) {
-		fuse_log(FUSE_LOG_ERR, "do_removemapping: invalid in, expected %d * %ld, has %ld - %ld\n",
-			 arg->count, sizeof(*one), iter->size, iter->pos);
-		fuse_reply_err(req, EINVAL);
-		return;
-	}
-
 	if (req->se->op.removemapping)
 		req->se->op.removemapping(req, req->se, nodeid, arg->count, one);
 	else
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-05 10:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-05  9:01 [Virtio-fs] [PATCH] virtiofsd: fix double fuse_mbuf_iter_advance when do_removemapping Catherine Ho
2019-12-05  9:19 ` Peng Tao
2019-12-05  9:34   ` Catherine Ho
2019-12-05 10:04     ` Peng Tao
2019-12-05 10:41       ` Dr. David Alan Gilbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.