Files
qemu/hw/9pfs
Christian Schoenebeck b72d15f47c hw/9pfs: fix missing EOPNOTSUPP on Twstat and Trenameat for fs synth driver
Renaming files/dirs is only supported by path-based fs drivers. EOPNOTSUPP
should be returned on any renaming attempt for not path-based fs drivers.
This was already the case for 9p "Trename" request type. However for 9p
request types "Trenameat" and "Twstat" this was yet missing.

So fix this by checking in Twstat and Trenameat request handlers whether
the fs driver in use is really path based, if not return EOPNOTSUPP and
abort further handling of the request.

This fixes a crash with the 9p "synth" fs driver which is not path-based.

The crash happened because the synth driver stores and expects a raw
V9fsSynthNode pointer instead of a C-string on V9fsPath.data. So the
C-string delivered by 9p server to synth fs driver was incorrectly
casted to a V9fsSynthNode pointer, eventually causing a segfault.

Reported-by: Oliver Chang <ochang@google.com>
Fixes: https://issues.oss-fuzz.com/issues/477990727
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3298
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Link: https://lore.kernel.org/qemu-devel/E1vrbaP-000Gqb-B3@kylie.crudebyte.com/
2026-02-28 13:46:42 +01:00
..
2025-09-18 21:21:29 +02:00
2025-09-18 21:21:29 +02:00
2025-09-18 21:21:29 +02:00
2022-06-28 11:06:44 +02:00
2021-07-05 13:03:16 +02:00
2025-07-16 14:18:48 +02:00
2025-05-05 11:28:29 +02:00
2025-05-05 11:28:29 +02:00
2025-09-18 21:21:29 +02:00
2025-02-06 17:10:46 +01:00
2025-12-09 20:42:59 +01:00