]> Git Repo - qemu.git/commit
usb-mtp: use O_NOFOLLOW and O_CLOEXEC.
authorGerd Hoffmann <[email protected]>
Thu, 13 Dec 2018 12:25:11 +0000 (13:25 +0100)
committerGerd Hoffmann <[email protected]>
Fri, 14 Dec 2018 07:52:14 +0000 (08:52 +0100)
commitbab9df35ce73d1c8e19a37e2737717ea1c984dc1
tree074f3cdcf4a28ad4ebd121ea5c08a1581eca69a6
parentb7d3a7e1a8830af78e71952e82f186b12b70ff1f
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 <[email protected]>
Cc: Bandan Das <[email protected]>
Reported-by: Michael Hanselmann <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Michael Hanselmann <[email protected]>
Message-id: 20181213122511[email protected]
hw/usb/dev-mtp.c
This page took 0.025817 seconds and 4 git commands to generate.