summary refs log tree commit diff stats
path: root/fsdev/qemu-fsdev.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-12-13 13:25:11 +0100
committerGerd Hoffmann <kraxel@redhat.com>2018-12-14 08:52:14 +0100
commitbab9df35ce73d1c8e19a37e2737717ea1c984dc1 (patch)
tree074f3cdcf4a28ad4ebd121ea5c08a1581eca69a6 /fsdev/qemu-fsdev.c
parentb7d3a7e1a8830af78e71952e82f186b12b70ff1f (diff)
downloadfocaccia-qemu-bab9df35ce73d1c8e19a37e2737717ea1c984dc1.tar.gz
focaccia-qemu-bab9df35ce73d1c8e19a37e2737717ea1c984dc1.zip
usb-mtp: use O_NOFOLLOW and O_CLOEXEC.
Open files and directories with O_NOFOLLOW to avoid symlinks attacks.
While being at it also add O_CLOEXEC.

usb-mtp only handles regular files and directories and ignores
everything else, so users should not see a difference.

Because qemu ignores symlinks, carrying out a successful symlink attack
requires swapping an existing file or directory below rootdir for a
symlink and winning the race against the inotify notification to qemu.

Fixes: CVE-2018-16872
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: Bandan Das <bsd@redhat.com>
Reported-by: Michael Hanselmann <public@hansmi.ch>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michael Hanselmann <public@hansmi.ch>
Message-id: 20181213122511.13853-1-kraxel@redhat.com
Diffstat (limited to 'fsdev/qemu-fsdev.c')
0 files changed, 0 insertions, 0 deletions