[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201210231050.GA101335@ZenIV.linux.org.uk>
Date: Thu, 10 Dec 2020 23:10:50 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Christian Brauner <christian.brauner@...ntu.com>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Oleg Nesterov <oleg@...hat.com>, Jann Horn <jann@...jh.net>
Subject: Re: [PATCH] files: rcu free files_struct
On Thu, Dec 10, 2020 at 10:54:05PM +0000, Al Viro wrote:
> On Thu, Dec 10, 2020 at 11:30:24PM +0100, Christian Brauner wrote:
> > (requiring btf), i.e. security_file_open, then follow
> > file->f_inode->i_sb->s_type->s_magic. If we change the say struct
> > super_block I'd expect these bpf programs to break.
>
> To break they would need to have compiled in the first place;
> ->s_type is struct file_system_type and it contains no ->s_magic
> (nor would it be possible, really - ->s_magic can vary between
> filesystems that *do* share ->s_type).
Incidentally, a lot of things in e.g. struct dentry need care when
accessing; the fields are there, but e.g. blind access to name or
parent really can oops. Moreover, blindly following a chain of
->d_parent pointers without taking appropriate precautions might
end up reading from arbitrary kernel address, including iomem ones.
I don't see anything that would prevent that...
TAINT_BPF would probably be too impractical, since there's a lot
of boxen using it more reasonably on the networking side. But
it really looks like we *do* need annotations with their violation
triggering a taint, so that BS bug reports could be discarded.
Powered by blists - more mailing lists