[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+55aFzoh5GRD-R8Pm+gTqNb9St=x=2ebv_mDgzSP2_-8LFkkA@mail.gmail.com>
Date: Wed, 18 Jul 2018 16:16:59 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: David Howells <dhowells@...hat.com>
Cc: Al Viro <viro@...iv.linux.org.uk>,
Miklos Szeredi <mszeredi@...hat.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] call_with_creds()
On Wed, Jul 18, 2018 at 2:27 PM David Howells <dhowells@...hat.com> wrote:
>
> As I may have said, I have tried modifying the kernel to pass the cred pointer
> down.
It should always be there in the 'struct file *'.
Now, we may have some broken stuff that passes only inodes down, but
they probably really should be fixed.
> The drivers and ioctl() implementations are/were particularly nasty in
> this respect. So many of them were doing checks against the current thread,
> not f_cred.
So ioctl() may be ok, simply because at least you shouldn't be able to
fool suid programs to do ioctl's on untrusted file descriptors.
So using current_cred() is still technically very wrong, but it's
probably not a huge problem in practice.
Now, if there's some cachefs kind of "do ioctl at the behest of
somebody else", then *that* would be a problem. I'm hoping there
isn't.
Linus
Powered by blists - more mailing lists