Greg Kurz a33eda0dd9 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>
2017-02-28 11:21:15 +01:00
..
2017-02-22 11:28:28 +11:00
2016-10-04 13:28:07 +01:00
2017-01-27 18:08:00 +01:00
2017-01-31 10:10:13 +11:00
2017-01-20 11:15:06 +00:00
2017-02-02 16:08:28 +00:00
2016-05-18 15:04:27 +03:00
2017-02-06 12:33:21 +11:00
2017-01-27 18:07:59 +01:00
2017-02-24 10:37:21 +00:00
2017-02-02 18:48:06 +00:00
2017-02-24 10:13:57 +00:00
2016-01-29 15:07:25 +00:00
2016-10-28 18:17:24 +03:00
2016-09-15 15:32:22 +03:00
2017-02-23 16:18:03 +01:00
2017-02-03 12:31:40 +00:00