aboutsummaryrefslogtreecommitdiff
path: root/fsdev/file-op-9p.h
diff options
context:
space:
mode:
authorAntonios Motakis <antonios.motakis@huawei.com>2019-10-10 11:36:05 +0200
committerGreg Kurz <groug@kaod.org>2019-10-10 11:36:05 +0200
commit3b5ee9e86b68fff5db5f68499311239485776ea9 (patch)
tree9c3407e38aaf2604bb2e846170dce6f782b7f15c /fsdev/file-op-9p.h
parentea52cdd443840448c198fec48e5a9ea5f40564f0 (diff)
9p: Treat multiple devices on one export as an error
The QID path should uniquely identify a file. However, the inode of a file is currently used as the QID path, which on its own only uniquely identifies files within a device. Here we track the device hosting the 9pfs share, in order to prevent security issues with QID path collisions from other devices. We only print a warning for now but a subsequent patch will allow users to have finer control over the desired behaviour. Failing the I/O will be one the proposed behaviour, so we also change stat_to_qid() to return an error here in order to keep other patches simpler. Signed-off-by: Antonios Motakis <antonios.motakis@huawei.com> [CS: - Assign dev_id to export root's device already in v9fs_device_realize_common(), not postponed in stat_to_qid(). - error_report_once() if more than one device was shared by export. - Return -ENODEV instead of -ENOSYS in stat_to_qid(). - Fixed typo in log comment. ] Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> [groug, changed to warning, updated message and changelog] Signed-off-by: Greg Kurz <groug@kaod.org>
Diffstat (limited to 'fsdev/file-op-9p.h')
0 files changed, 0 insertions, 0 deletions