summaryrefslogtreecommitdiffstats
path: root/fs/fcntl.c
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@amacapital.net>2013-08-01 21:44:31 -0700
committerAl Viro <viro@zeniv.linux.org.uk>2013-08-05 18:24:11 +0400
commitbb2314b47996491bbc5add73633905c3120b6268 (patch)
treea7ce9012a84c22c5a08f89db6fb88dee093a0f88 /fs/fcntl.c
parente305f48bc453da773a3601135a2cce40b8e62856 (diff)
downloadlinux-stable-bb2314b47996491bbc5add73633905c3120b6268.tar.gz
linux-stable-bb2314b47996491bbc5add73633905c3120b6268.tar.bz2
linux-stable-bb2314b47996491bbc5add73633905c3120b6268.zip
fs: Allow unprivileged linkat(..., AT_EMPTY_PATH) aka flink
Every now and then someone proposes a new flink syscall, and this spawns a long discussion of whether it would be a security problem. I think that this is missing the point: flink is *already* allowed without privilege as long as /proc is mounted -- it's called AT_SYMLINK_FOLLOW. Now that O_TMPFILE is here, the ability to create a file with O_TMPFILE, write it, and link it in is very convenient. The only problem is that it requires that /proc be mounted so that you can do: linkat(AT_FDCWD, "/proc/self/fd/<tmpfd>", dfd, path, AT_SYMLINK_NOFOLLOW) This sucks -- it's much nicer to do: linkat(tmpfd, "", dfd, path, AT_EMPTY_PATH) Let's allow it. If this turns out to be excessively scary, it we could instead require that the inode in question be I_LINKABLE, but this seems pointless given the /proc situation Signed-off-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fcntl.c')
0 files changed, 0 insertions, 0 deletions