#
99f2cf4b |
| 26-Feb-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: local: renameat: don't follow symlinks
The local_renameat() callback is currently a wrapper around local_rename() which is vulnerable to symlink attacks.
This patch rewrites local_renameat()
9pfs: local: renameat: don't follow symlinks
The local_renameat() callback is currently a wrapper around local_rename() which is vulnerable to symlink attacks.
This patch rewrites local_renameat() to have its own implementation, based on local_opendir_nofollow() and renameat().
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
f9aef99b |
| 26-Feb-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: local: lstat: don't follow symlinks
The local_lstat() callback is vulnerable to symlink attacks because it calls:
(1) lstat() which follows symbolic links in all path elements but the rig
9pfs: local: lstat: don't follow symlinks
The local_lstat() callback is vulnerable to symlink attacks because it calls:
(1) lstat() which follows symbolic links in all path elements but the rightmost one (2) getxattr() which follows symbolic links in all path elements (3) local_mapped_file_attr()->local_fopen()->openat(O_NOFOLLOW) which follows symbolic links in all path elements but the rightmost one
This patch converts local_lstat() to rely on opendir_nofollow() and fstatat(AT_SYMLINK_NOFOLLOW) to fix (1), fgetxattrat_nofollow() to fix (2).
A new local_fopenat() helper is introduced as a replacement to local_fopen() to fix (3). No effort is made to factor out code because local_fopen() will be dropped when all users have been converted to call local_fopenat().
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
bec1e954 |
| 26-Feb-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: local: readlink: don't follow symlinks
The local_readlink() callback is vulnerable to symlink attacks because it calls:
(1) open(O_NOFOLLOW) which follows symbolic links for all path elements
9pfs: local: readlink: don't follow symlinks
The local_readlink() callback is vulnerable to symlink attacks because it calls:
(1) open(O_NOFOLLOW) which follows symbolic links for all path elements but the rightmost one (2) readlink() which follows symbolic links for all path elements but the rightmost one
This patch converts local_readlink() to rely on open_nofollow() to fix (1) and opendir_nofollow(), readlinkat() to fix (2).
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
ac125d99 |
| 26-Feb-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: local: truncate: don't follow symlinks
The local_truncate() callback is vulnerable to symlink attacks because it calls truncate() which follows symbolic links in all path elements.
This patch
9pfs: local: truncate: don't follow symlinks
The local_truncate() callback is vulnerable to symlink attacks because it calls truncate() which follows symbolic links in all path elements.
This patch converts local_truncate() to rely on open_nofollow() and ftruncate() instead.
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
31e51d1c |
| 26-Feb-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: local: statfs: don't follow symlinks
The local_statfs() callback is vulnerable to symlink attacks because it calls statfs() which follows symbolic links in all path elements.
This patch conve
9pfs: local: statfs: don't follow symlinks
The local_statfs() callback is vulnerable to symlink attacks because it calls statfs() which follows symbolic links in all path elements.
This patch converts local_statfs() to rely on open_nofollow() and fstatfs() instead.
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
a33eda0d |
| 26-Feb-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: local: utimensat: don't follow symlinks
The local_utimensat() callback is vulnerable to symlink attacks because it calls qemu_utimens()->utimensat(AT_SYMLINK_NOFOLLOW) which follows symbolic l
9pfs: local: utimensat: don't follow symlinks
The local_utimensat() callback is vulnerable to symlink attacks because it calls qemu_utimens()->utimensat(AT_SYMLINK_NOFOLLOW) which follows symbolic links in all path elements but the rightmost one or qemu_utimens()->utimes() which follows symbolic links for all path elements.
This patch converts local_utimensat() to rely on opendir_nofollow() and utimensat(AT_SYMLINK_NOFOLLOW) directly instead of using qemu_utimens(). It is hence assumed that the OS supports utimensat(), i.e. has glibc 2.6 or higher and linux 2.6.22 or higher, which seems reasonable nowadays.
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
a0e640a8 |
| 26-Feb-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: local: remove: don't follow symlinks
The local_remove() callback is vulnerable to symlink attacks because it calls:
(1) lstat() which follows symbolic links in all path elements but the r
9pfs: local: remove: don't follow symlinks
The local_remove() callback is vulnerable to symlink attacks because it calls:
(1) lstat() which follows symbolic links in all path elements but the rightmost one (2) remove() which follows symbolic links in all path elements but the rightmost one
This patch converts local_remove() to rely on opendir_nofollow(), fstatat(AT_SYMLINK_NOFOLLOW) to fix (1) and unlinkat() to fix (2).
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
df4938a6 |
| 26-Feb-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: local: unlinkat: don't follow symlinks
The local_unlinkat() callback is vulnerable to symlink attacks because it calls remove() which follows symbolic links in all path elements but the rightm
9pfs: local: unlinkat: don't follow symlinks
The local_unlinkat() callback is vulnerable to symlink attacks because it calls remove() which follows symbolic links in all path elements but the rightmost one.
This patch converts local_unlinkat() to rely on opendir_nofollow() and unlinkat() instead.
Most of the code is moved to a separate local_unlinkat_common() helper which will be reused in a subsequent patch to fix the same issue in local_remove().
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
996a0d76 |
| 26-Feb-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: local: open/opendir: don't follow symlinks
The local_open() and local_opendir() callbacks are vulnerable to symlink attacks because they call:
(1) open(O_NOFOLLOW) which follows symbolic link
9pfs: local: open/opendir: don't follow symlinks
The local_open() and local_opendir() callbacks are vulnerable to symlink attacks because they call:
(1) open(O_NOFOLLOW) which follows symbolic links in all path elements but the rightmost one (2) opendir() which follows symbolic links in all path elements
This patch converts both callbacks to use new helpers based on openat_nofollow() to only open files and directories if they are below the virtfs shared folder
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
0e35a378 |
| 26-Feb-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: local: keep a file descriptor on the shared folder
This patch opens the shared folder and caches the file descriptor, so that it can be used to do symlink-safe path walk.
Signed-off-by: Greg
9pfs: local: keep a file descriptor on the shared folder
This patch opens the shared folder and caches the file descriptor, so that it can be used to do symlink-safe path walk.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
21328e1e |
| 26-Feb-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: remove side-effects in local_open() and local_opendir()
If these functions fail, they should not change *fs. Let's use local variables to fix this.
Signed-off-by: Greg Kurz <groug@kaod.org> R
9pfs: remove side-effects in local_open() and local_opendir()
If these functions fail, they should not change *fs. Let's use local variables to fix this.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
00c90bd1 |
| 26-Feb-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: remove side-effects in local_init()
If this function fails, it should not modify *ctx.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
|
#
b8bbdb88 |
| 28-Feb-2017 |
Pradeep Jagadeesh <pradeep.jagadeesh@huawei.com> |
fsdev: add IO throttle support to fsdev devices
This patchset adds the throttle support for the 9p-local driver. For now this functionality can be enabled only through qemu cli options. QMP interfac
fsdev: add IO throttle support to fsdev devices
This patchset adds the throttle support for the 9p-local driver. For now this functionality can be enabled only through qemu cli options. QMP interface and support to other drivers need further extensions. To make it simple for other 9p drivers, the throttle code has been put in separate files.
Signed-off-by: Pradeep Jagadeesh <pradeep.jagadeesh@huawei.com> Reviewed-by: Alberto Garcia <berto@igalia.com> (pass extra NULL CoMutex * argument to qemu_co_queue_wait(), added options to qemu-options.hx, Greg Kurz) Signed-off-by: Greg Kurz <groug@kaod.org>
show more ...
|
#
6fe76acc |
| 23-Jan-2017 |
Greg Kurz <groug@kaod.org> |
9pfs: local: trivial cosmetic fix in pwritev op
Signed-off-by: Greg Kurz <groug@kaod.org>
|
#
e3e83f2e |
| 16-Sep-2016 |
Greg Kurz <groug@kaod.org> |
9pfs: introduce v9fs_path_sprintf() helper
This helper is similar to v9fs_string_sprintf(), but it includes the terminating NUL character in the size field.
This is to avoid doing v9fs_string_sprin
9pfs: introduce v9fs_path_sprintf() helper
This helper is similar to v9fs_string_sprintf(), but it includes the terminating NUL character in the size field.
This is to avoid doing v9fs_string_sprintf((V9fsString *) &path) and then bumping the size.
Affected users are changed to use this new helper.
Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
#
635324e8 |
| 06-Jun-2016 |
Greg Kurz <gkurz@linux.vnet.ibm.com> |
9p: switch back to readdir()
This patch changes the 9p code to use readdir() again instead of readdir_r(), which is deprecated in glibc 2.24.
All the locking was put in place by a previous patch.
9p: switch back to readdir()
This patch changes the 9p code to use readdir() again instead of readdir_r(), which is deprecated in glibc 2.24.
All the locking was put in place by a previous patch.
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
show more ...
|
#
f314ea4e |
| 06-Jun-2016 |
Greg Kurz <gkurz@linux.vnet.ibm.com> |
9p: introduce the V9fsDir type
If we are to switch back to readdir(), we need a more complex type than DIR * to be able to serialize concurrent accesses to the directory stream.
This patch introduc
9p: introduce the V9fsDir type
If we are to switch back to readdir(), we need a more complex type than DIR * to be able to serialize concurrent accesses to the directory stream.
This patch introduces a placeholder type and fixes all users.
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
show more ...
|
#
f348b6d1 |
| 20-Mar-2016 |
Veronia Bahaa <veroniabahaa@gmail.com> |
util: move declarations out of qemu-common.h
Move declarations out of qemu-common.h for functions declared in utils/ files: e.g. include/qemu/path.h for utils/path.c. Move inline functions out of qe
util: move declarations out of qemu-common.h
Move declarations out of qemu-common.h for functions declared in utils/ files: e.g. include/qemu/path.h for utils/path.c. Move inline functions out of qemu-common.h and into new files (e.g. include/qemu/bcd.h)
Signed-off-by: Veronia Bahaa <veroniabahaa@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
fbc04127 |
| 26-Jan-2016 |
Peter Maydell <peter.maydell@linaro.org> |
9pfs: Clean up includes
Clean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
Signed-off-
9pfs: Clean up includes
Clean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1453832250-766-18-git-send-email-peter.maydell@linaro.org
show more ...
|
#
63325b18 |
| 22-Jan-2016 |
Greg Kurz <gkurz@linux.vnet.ibm.com> |
9pfs: use error_report() instead of fprintf(stderr)
Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
|
#
ebe74f8b |
| 07-Jan-2016 |
Wei Liu <wei.liu2@citrix.com> |
9pfs: break out 9p.h from virtio-9p.h
Move out generic definitions from virtio-9p.h to 9p.h. Fix header inclusions.
Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Aneesh Kumar K.V <ane
9pfs: break out 9p.h from virtio-9p.h
Move out generic definitions from virtio-9p.h to 9p.h. Fix header inclusions.
Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
show more ...
|
#
267ae092 |
| 18-Nov-2015 |
Wei Liu <wei.liu2@citrix.com> |
9pfs: rename virtio-9p-xattr{,-user}.{c,h} to 9p-xattr{,-user}.{c,h}
These three files are not virtio specific. Rename them to generic names.
Fix comments and header inclusion in various files.
Si
9pfs: rename virtio-9p-xattr{,-user}.{c,h} to 9p-xattr{,-user}.{c,h}
These three files are not virtio specific. Rename them to generic names.
Fix comments and header inclusion in various files.
Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
show more ...
|
#
f00d4f59 |
| 18-Nov-2015 |
Wei Liu <wei.liu2@citrix.com> |
9pfs: rename virtio-9p-local.c to 9p-local.c
This file is not virtio specific. Rename it to use generic name.
Fix comment and remove unneeded inclusion of virtio.h.
Signed-off-by: Wei Liu <wei.liu
9pfs: rename virtio-9p-local.c to 9p-local.c
This file is not virtio specific. Rename it to use generic name.
Fix comment and remove unneeded inclusion of virtio.h.
Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
show more ...
|
#
0289a412 |
| 08-Mar-2015 |
Stefan Weil <sw@weilnetz.de> |
9pfs: Fix warnings from Sparse
Sparse report:
9pfs/virtio-9p.c:1953:9: warning: returning void-valued expression 9pfs/virtio-9p-handle.c:143:5: warning: returning void-valued expression 9pfs/virtio
9pfs: Fix warnings from Sparse
Sparse report:
9pfs/virtio-9p.c:1953:9: warning: returning void-valued expression 9pfs/virtio-9p-handle.c:143:5: warning: returning void-valued expression 9pfs/virtio-9p-handle.c:160:5: warning: returning void-valued expression 9pfs/virtio-9p-local.c:384:5: warning: returning void-valued expression 9pfs/virtio-9p-local.c:415:5: warning: returning void-valued expression 9pfs/virtio-9p-proxy.c:672:5: warning: returning void-valued expression 9pfs/virtio-9p-proxy.c:689:5: warning: returning void-valued expression
Cc: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
show more ...
|
#
4ed7b2c3 |
| 14-Mar-2015 |
Stefan Weil <sw@weilnetz.de> |
virtio: Fix memory leaks reported by Coverity
All four leaks are similar, so fix them in one patch. Success path was not doing memory free.
Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by
virtio: Fix memory leaks reported by Coverity
All four leaks are similar, so fix them in one patch. Success path was not doing memory free.
Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
show more ...
|