aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/9p.h
diff options
context:
space:
mode:
authorChristian Schoenebeck <qemu_oss@crudebyte.com>2021-06-04 19:52:18 +0200
committerChristian Schoenebeck <qemu_oss@crudebyte.com>2021-07-05 13:03:16 +0200
commit110243750dc4389fe8715c1db87a6ce6c2b9e645 (patch)
tree64d18fa3c35de4905d3ae39afab8e233bc11a72a /hw/9pfs/9p.h
parent8bf27550effb124221100c3c6f5d513dd29ec37d (diff)
9pfs: capture root stat
We already capture the QID of the exported 9p root path, i.e. to prevent client access outside the defined, exported filesystem's tree. This is currently checked by comparing the root QID with another FID's QID. The problem with the latter is that resolving a QID of any given 9p path can only be done on 9p server's main thread, that's because it might mutate the server's state if inode remapping is enabled. For that reason also capture the POSIX stat info of the root path for being able to identify on any (e.g. worker) thread whether an arbitrary given path is identical to the export root. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <eb07d6c2e9925788454cfe33d3802e4ffb23ea9a.1622821729.git.qemu_oss@crudebyte.com>
Diffstat (limited to 'hw/9pfs/9p.h')
-rw-r--r--hw/9pfs/9p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index 00381591ff..6f0b4c78c0 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -356,6 +356,7 @@ struct V9fsState {
Error *migration_blocker;
V9fsConf fsconf;
V9fsQID root_qid;
+ struct stat root_st;
dev_t dev_id;
struct qht qpd_table;
struct qht qpp_table;