Files
qemu/hw/usb
Gerd Hoffmann 7347a04da3 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
(cherry picked from commit bab9df35ce)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2019-04-01 20:36:21 -05:00
..
2017-05-29 14:18:09 +02:00
2018-06-01 19:20:38 +03:00
2016-02-23 12:43:05 +00:00
2017-05-29 14:03:35 +02:00
2018-07-03 09:50:39 +02:00
2017-05-29 14:03:35 +02:00
2013-02-19 12:30:05 +01:00
2016-01-29 15:07:23 +00:00
2016-01-29 15:07:23 +00:00