Re: Commit 13c164b1a186 - regression for LSMs/SELinux?

Linus Torvalds <[email protected]>
Newsgroups org.kernel.vger.autofs,org.kernel.vger.linux-security-module,org.kernel.vger.selinux
Message-ID <CAHk-=wgTz9h-WCtkEcByebaqv3arZWuUQ7TzfHejo10=bztZeA@mail.gmail.com>
On Mon, Sep 21, 2020 at 9:09 AM Christoph Hellwig <[email protected]> wrote:
>
> So we obviously should not break existing user space and need to fix
> this ASAP.  The trivial "fix" would be to export __kernel_write again
> and switch autofs to use it.  The other option would be a FMODE flag
> to bypass security checks, only to be set if the callers ensures
> they've been valided (i.e. in autofs_prepare_pipe).
>
> Any opinions?

I'd much rather do the former than add a new dynamic flag that we then
have to worry about somebody being able to set thanks to a bug.

Static behavior is a lot easier to verify and document (ie just a
comment in the code explaining why autofs cannot use the regular
kernel_write()). There's no chance of that static behavior then
leaking to other call sites.

                   Linus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.