The 9P open and create operations cause QEMU to call the open(2) syscall on
the backend. Unfortunately, it doesn't check if the given pathname already
exists and points to something that could cause open(2) to hang (like a named
pipe for example).

This series fixes the issues for open (only allow directories and regular
files) and create (enforce O_EXCL). It also adds the corresponding tests in
virtio-9p-test.

---

Greg Kurz (7):
      9pfs: restrict open to regular files and directories
      tests: virtio-9p: improve error reporting
      tests: virtio-9p: add LOPEN operation test
      tests: virtio-9p: TLOPEN should fail to open a FIFO
      9pfs: don't create files if pathname already exists
      tests: virtio-9p: add LCREATE operation test
      tests: virtio-9p: TLCREATE should fail if pathname exists


 hw/9pfs/9p.c           |   10 ++
 tests/virtio-9p-test.c |  197 +++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 199 insertions(+), 8 deletions(-)

--
Greg


Reply via email to