diff options
author | Greg Kurz | 2017-02-26 23:44:20 +0100 |
---|---|---|
committer | Greg Kurz | 2017-02-28 11:21:15 +0100 |
commit | ad0b46e6ac769b187cb4dcf0065675ef8a198a5e (patch) | |
tree | 1e09a595f88b4a6ca6f737d12eca5ad579ebe743 /hw/intc/mips_gic.c | |
parent | 9pfs: local: improve error handling in link op (diff) | |
download | qemu-ad0b46e6ac769b187cb4dcf0065675ef8a198a5e.tar.gz qemu-ad0b46e6ac769b187cb4dcf0065675ef8a198a5e.tar.xz qemu-ad0b46e6ac769b187cb4dcf0065675ef8a198a5e.zip |
9pfs: local: link: don't follow symlinks
The local_link() callback is vulnerable to symlink attacks because it calls:
(1) link() which follows symbolic links for all path elements but the
rightmost one
(2) local_create_mapped_attr_dir()->mkdir() which follows symbolic links
for all path elements but the rightmost one
This patch converts local_link() to rely on opendir_nofollow() and linkat()
to fix (1), mkdirat() to fix (2).
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/intc/mips_gic.c')
0 files changed, 0 insertions, 0 deletions