[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 2/3] 9pfs: forbid . and .. in file names
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v4 2/3] 9pfs: forbid . and .. in file names |
Date: |
Tue, 30 Aug 2016 13:06:31 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 08/30/2016 12:13 PM, Greg Kurz wrote:
> 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 <address@hidden>
> Signed-off-by: Greg Kurz <address@hidden>
>
> v3: - rename and renameat now return EISDIR instead of EBUSY
The v3 comment could occur after the '---' separator.
> ---
> hw/9pfs/9p.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 51 insertions(+)
Maintainer can touch that up, then add
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v4 0/3] 9pfs security fixes, Greg Kurz, 2016/08/30
- [Qemu-devel] [PATCH v4 1/3] 9pfs: forbid illegal path names, Greg Kurz, 2016/08/30
- [Qemu-devel] [PATCH v4 2/3] 9pfs: forbid . and .. in file names, Greg Kurz, 2016/08/30
- Re: [Qemu-devel] [PATCH v4 2/3] 9pfs: forbid . and .. in file names,
Eric Blake <=
- Re: [Qemu-devel] [PATCH v4 0/3] 9pfs security fixes, Michael S. Tsirkin, 2016/08/30
- Re: [Qemu-devel] [PATCH v4 0/3] 9pfs security fixes, Peter Maydell, 2016/08/30
- [Qemu-devel] [PATCH v4 3/3] 9pfs: handle walk of ".." in the root directory, Greg Kurz, 2016/08/30