From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org, qemu-stable@nongnu.org
Cc: Greg Kurz <groug@kaod.org>, Jia Jia <physicalmtea@gmail.com>,
Fabiano Rosas <farosas@suse.de>,
Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH 0/6] 9pfs: fix V9fsPath heap buffer overflow
Date: Mon, 18 May 2026 19:40:34 +0200 [thread overview]
Message-ID: <cover.1779126034.git.qemu_oss@crudebyte.com> (raw)
This series fixes a heap buffer overflow vulnerability in the 9pfs local
backend. The vulnerability occurs when handling paths exceeding 65536 bytes,
due to the V9fsPath.size field being limited to 16 bits.
The fix consists of:
- Changing V9fsPath.size from uint16_t to size_t.
- Converting v9fs_path_sprintf() to return int for error handling.
- Adding error propagation through all path manipulation functions.
Invididual Patches:
- Patch 1 is just an additional defensive patch.
- Actual fixes are patches 2..4, where patch 2..3 are prepatory, and
patch 4 is the actual behaviour fix.
- Patch 5 adds a reset function to the virtio test client for the new
test to work.
- Patch 6 adds a new test to guard this buffer overflow issue.
It must be enabled explicitly by -m slow for it to run.
More details about this issue:
https://gitlab.com/qemu-project/qemu/-/issues/3358
Christian Schoenebeck (6):
hw/9pfs: add NULL check in v9fs_path_is_ancestor()
hw/9pfs: change V9fsPath.size to size_t and v9fs_path_sprintf() return
type
hw/9pfs: add error handling to v9fs_fix_path()
hw/9pfs: let callers of v9fs_path_sprintf() and v9fs_fix_path() handle
errors
tests/qtest/libqos: add qvirtqueue_reset_pool() for descriptor pool
reset
tests/9pfs: add deep absolute path test
fsdev/file-op-9p.h | 2 +-
hw/9pfs/9p-local.c | 23 ++++++++----
hw/9pfs/9p.c | 41 +++++++++++++++------
hw/9pfs/9p.h | 4 +--
tests/qtest/libqos/virtio.c | 23 ++++++++++++
tests/qtest/libqos/virtio.h | 2 ++
tests/qtest/virtio-9p-test.c | 69 ++++++++++++++++++++++++++++++++++++
7 files changed, 144 insertions(+), 20 deletions(-)
--
2.47.3
next reply other threads:[~2026-05-18 18:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 17:40 Christian Schoenebeck [this message]
2026-05-18 17:35 ` [PATCH 1/6] hw/9pfs: add NULL check in v9fs_path_is_ancestor() Christian Schoenebeck
2026-05-18 17:35 ` [PATCH 2/6] hw/9pfs: change V9fsPath.size to size_t and v9fs_path_sprintf() return type Christian Schoenebeck
2026-05-18 17:35 ` [PATCH 3/6] hw/9pfs: add error handling to v9fs_fix_path() Christian Schoenebeck
2026-05-18 17:35 ` [PATCH 4/6] hw/9pfs: let callers of v9fs_path_sprintf() and v9fs_fix_path() handle errors Christian Schoenebeck
2026-05-18 17:36 ` [PATCH 5/6] tests/qtest/libqos: add qvirtqueue_reset_pool() for descriptor pool reset Christian Schoenebeck
2026-05-19 7:51 ` Fabiano Rosas
2026-05-18 17:36 ` [PATCH 6/6] tests/9pfs: add deep absolute path test Christian Schoenebeck
2026-05-27 14:35 ` [PATCH 0/6] 9pfs: fix V9fsPath heap buffer overflow Christian Schoenebeck
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=cover.1779126034.git.qemu_oss@crudebyte.com \
--to=qemu_oss@crudebyte.com \
--cc=farosas@suse.de \
--cc=groug@kaod.org \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=physicalmtea@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/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 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.