History | View | Annotate | Download (33.3 kB)
hw/9pfs: use O_NOFOLLOW for mapped readlink operation
With mapped security models like mapped-xattr and mapped-file, we save thesymlink target as file contents. Now if we ever expose a normal directorywith mapped security model and find real symlinks in export path, never...
hw/9pfs: Use O_NOFOLLOW when opening files on server
9p server should never follow a symlink. So use O_NOFOLLOW with all opensyscall
Tested-by: "M. Mohan Kumar" <mohan@in.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
remove double semicolons
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw: move headers to include/
Many of these should be cleaned up with proper qdev-/QOM-ification.Right now there are many catch-all headers in include/hw/ARCH dependingon cpu.h, and this makes it necessary to compile these files per-target.However, fixing this does not belong in these patches....
hw/9pfs: Fix unchecked strdup() by converting to g_strdup()
Note: the allocation in virtio_9p_init() is still leaked. To be fixedin a followup commit.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/9pfs: Preserve S_ISGID
In passthrough security model in local fs driver, after a file creationchown and chmod are done to set the file credentials and mode as requestedby 9p client. But if there was a request to create a file with S_ISGIDbit, doing chown on that file resets the S_ISGID bit. So first call...
hw/9pfs: Add new security model mapped-file.
This enable us to do passthrough equivalent security model on NFS directory.NFS server mostly do root squashing and don't support xattr. Hence we cannotuse 'passthrough' or 'mapped' security model
Also added "mapped-xattr" security to indicate earlier "mapped" security model...
hw/9pfs: Move opt validation to FsDriver callback
This remove all conditional code from common code path andmake opt validation a FSDriver callback.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Use the correct file descriptor in Fsdriver Callback
Fsdriver callback that operate on file descriptor need todifferentiate between directory fd and file fd.
Based on the original patch from Sassan Panahinejad <sassan@sassan.me.uk>
9pfs: improve portability to older systems
I guess we can also make sure we don't call local_ioc_getversion atall.
Reported-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Small requirements on "new" features have percolated to virtio-9p-local.c.In particular, the utimensat wrapper actually only supports dirfd = AT_FDCWDand flags = AT_SYMLINK_NOFOLLOW in the fallback code. Remove the arguments...
configure: fix detection for xattr.h on modern distributions
Modern distributions place xattr.h in /usr/include/sys, and foldlibattr.so into libc. They also don't have an ENOATTR.
Make configure detect this, and add a qemu-xattr.h file thatdirects the #include to the right place....
hw/9pfs: Abstract open state of fid to V9fsFidOpenState
To implement synthetic file system in Qemu we may not reallyrequire file descriptor and Dir *. Make generic code useV9fsFidOpenState instead.
hw/9pfs: Fix error handling in local_mknod
Update local_chown to remove unnecessary if loop
hw/9pfs: Add st_gen support in getattr reply
This patch use file system specific ioctl for getting i_generationvalue. Not all file system support the ioctl. So we add an exportspecific extended operation and assign right callback for thefile system that support i_generation ioctl...
hw/9pfs: Use export_flag for indicating whether fs driver use path names.
This allows us to remove another member from the struct
hw/9pfs: Use export flag for indicating security model
This helps to remove some of the structure members
hw/9pfs: Add new virtfs option writeout=immediate skip host page cache
writeout=immediate implies the after pwritev we do a sync_file_range.
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Move fid pathname tracking to seperate data type.
This enables us to add handles to track fids later. TheV9fsPath added is similar to V9fsString except that thesize include the NULL byte also.
hw/9pfs: Add init callback to fs driver
This call back can be used to do fs driver specific initialization.
hw/9pfs: Add fs driver specific details to fscontext
Add a new context flag PATHNAME_FSCONTEXT and indicate whetherthe fs driver track fid using path names. Also add a privatepointer that help us to track fs driver specific values in there
use readdir_r instead of readdir for reentrancy
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
[virtio-9p] Make rpath thread safe
Current rpath inline function is heavily used in all system calls.This function has a static buffer making it a non-thread safe function.This patch introduces new thread-safe routine and makes use of it.
Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
virtio-9p: Use relative includes for files in hw
Commit 353ac78d495ef976242abd868f68d78420861c2c moved the fileswithout fixing the include paths. It used a modified CFLAGSto add hw to the include search path, but this breaks buildswhere the user wants to set special CFLAGS. Long include paths...
hw/virtio-9p-local.c: Remove unnecessary null char in symlink file
This patch removes the addition of null char in symlink filewhich is being appended to file in case of mapped security model.Without this patch, the extra null char causes LTP testcase lstat03...
virtio-9p: move 9p files around
Now that we start adding more files related to 9pfsit make sense to move them to a separate directory
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>