From: Al Viro <viro@ZenIV.linux.org.uk>
To: Mattias Nissler <mnissler@chromium.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] [PATCH] Add a "nolinks" mount option.
Date: Fri, 14 Oct 2016 15:55:15 +0100 [thread overview]
Message-ID: <20161014145515.GA19539@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1476455305-35554-1-git-send-email-mnissler@chromium.org>
On Fri, Oct 14, 2016 at 04:28:25PM +0200, Mattias Nissler wrote:
> For mounts that have the new "nolinks" option, don't follow symlinks
> and reject to open files with a hard link count larger than one. The
> new option is similar in spirit to the existing "nodev", "noexec", and
> "nosuid" options.
>
> Note that symlinks and hard links may still be created on mounts where
> the "nolinks" option is present. readlink() remains functional, so
> user space code that is aware of symlinks can still choose to follow
> them explicitly. Similarly, hard-linked files can be identified from
> userspace using stat() output while the "nolinks" option is set.
>
> Setting the "nolinks" mount option helps prevent privileged writers
> from modifying files unintentionally in case there is an unexpected
> link along the accessed path. The "nolinks" option is thus useful as a
> defensive measure against persistent exploits (i.e. a system getting
> re-exploited after a reboot) for systems that employ a read-only or
> dm-verity-protected rootfs. These systems prevent non-legit binaries
> from running after reboot. However, legit code typically still reads
> from and writes to a writable file system previously under full
> control of the attacker, who can place symlinks to trick file writes
> after reboot to target a file of their choice. "nolinks" fundamentally
> prevents this.
Which parts of the tree would be on that "protected" rootfs and which would
you mount with that option? Description above is rather vague and I'm
not convinced that it actually buys you anything. Details, please...
next prev parent reply other threads:[~2016-10-14 14:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-14 14:28 [RFC] [PATCH] Add a "nolinks" mount option Mattias Nissler
2016-10-14 14:55 ` Al Viro [this message]
2016-10-14 15:00 ` Al Viro
2016-10-14 15:50 ` Mattias Nissler
2016-10-14 16:22 ` Mattias Nissler
2016-10-17 13:02 ` Mattias Nissler
2016-10-17 14:14 ` Austin S. Hemmelgarn
2016-10-18 15:14 ` Colin Walters
2016-10-19 11:28 ` Mattias Nissler
2016-10-19 14:35 ` Colin Walters
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161014145515.GA19539@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mnissler@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).