diff options
| author | Greg Kurz <groug@kaod.org> | 2017-02-26 23:43:17 +0100 |
|---|---|---|
| committer | Greg Kurz <groug@kaod.org> | 2017-02-28 11:21:15 +0100 |
| commit | a33eda0dd99e00faa3bacae43d19490bb9500e07 (patch) | |
| tree | 82dddab6b93ce1d9fa0743055c16aa8a211392f4 /scripts/qapi-commands.py | |
| parent | a0e640a87210b1e986bcd4e7f7de03beb3db0a4a (diff) | |
| download | focaccia-qemu-a33eda0dd99e00faa3bacae43d19490bb9500e07.tar.gz focaccia-qemu-a33eda0dd99e00faa3bacae43d19490bb9500e07.zip | |
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>
Diffstat (limited to 'scripts/qapi-commands.py')
0 files changed, 0 insertions, 0 deletions