]> git.baikalelectronics.ru Git - kernel.git/commit
VFS: don't do protected {sym,hard}links by default
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Oct 2012 17:05:07 +0000 (10:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Oct 2012 17:05:07 +0000 (10:05 -0700)
commitfbc33f391c7880f26ecf46cca13fd4fad3f6ce65
treeb18cc05a8fb8375a1d2788821f5894d2cdcfd117
parent8a05eaf7b5716612fe532bf7f5b15d73c6895f9f
VFS: don't do protected {sym,hard}links by default

In commit 83abb20cb45b ("This adds symlink and hardlink restrictions to
the Linux VFS"), the new link protections were enabled by default, in
the hope that no actual application would care, despite it being
technically against legacy UNIX (and documented POSIX) behavior.

However, it does turn out to break some applications.  It's rare, and
it's unfortunate, but it's unacceptable to break existing systems, so
we'll have to default to legacy behavior.

In particular, it has broken the way AFD distributes files, see

  http://www.dwd.de/AFD/

along with some legacy scripts.

Distributions can end up setting this at initrd time or in system
scripts: if you have security problems due to link attacks during your
early boot sequence, you have bigger problems than some kernel sysctl
setting. Do:

echo 1 > /proc/sys/fs/protected_symlinks
echo 1 > /proc/sys/fs/protected_hardlinks

to re-enable the link protections.

Alternatively, we may at some point introduce a kernel config option
that sets these kinds of "more secure but not traditional" behavioural
options automatically.

Reported-by: Nick Bowler <nbowler@elliptictech.com>
Reported-by: Holger Kiehl <Holger.Kiehl@dwd.de>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org # v3.6
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/namei.c