summary refs log tree commit diff stats
path: root/scripts/qapi-commands.py
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2017-02-26 23:42:18 +0100
committerGreg Kurz <groug@kaod.org>2017-02-28 11:21:15 +0100
commit996a0d76d7e756e4023ef79bc37bfe629b9eaca7 (patch)
tree78bbc93d08e0142f0a845fd549598cffe58f4302 /scripts/qapi-commands.py
parent0e35a3782948c6154d7fafe9a02a86bc130199c7 (diff)
downloadfocaccia-qemu-996a0d76d7e756e4023ef79bc37bfe629b9eaca7.tar.gz
focaccia-qemu-996a0d76d7e756e4023ef79bc37bfe629b9eaca7.zip
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>
Diffstat (limited to 'scripts/qapi-commands.py')
0 files changed, 0 insertions, 0 deletions