diff options
author | Greg Kurz <groug@kaod.org> | 2016-08-30 19:13:11 +0200 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-08-30 19:21:56 +0100 |
commit | 805b5d98c649d26fc44d2d7755a97f18e62b438a (patch) | |
tree | b23bce9bbabd7efa1d3624a3206ef92ab48316b9 /qom | |
parent | fff39a7ad09da07ef490de05c92c91f22f8002f2 (diff) | |
download | qemu-805b5d98c649d26fc44d2d7755a97f18e62b438a.zip qemu-805b5d98c649d26fc44d2d7755a97f18e62b438a.tar.gz qemu-805b5d98c649d26fc44d2d7755a97f18e62b438a.tar.bz2 |
9pfs: forbid . and .. in file names
According to the 9P spec http://man.cat-v.org/plan_9/5/open about the
create request:
The names . and .. are special; it is illegal to create files with these
names.
This patch causes the create and lcreate requests to fail with EINVAL if
the file name is either "." or "..".
Even if it isn't explicitly written in the spec, this patch extends the
checking to all requests that may cause a directory entry to be created:
- mknod
- rename
- renameat
- mkdir
- link
- symlink
The unlinkat request also gets patched for consistency (even if
rmdir("foo/..") is expected to fail according to POSIX.1-2001).
The various error values come from the linux manual pages.
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qom')
0 files changed, 0 insertions, 0 deletions