[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20201209040731.GK3579531@ZenIV.linux.org.uk>
Date: Wed, 9 Dec 2020 04:07:31 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
criu@...nvz.org, bpf@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Christian Brauner <christian.brauner@...ntu.com>,
Oleg Nesterov <oleg@...hat.com>,
Cyrill Gorcunov <gorcunov@...il.com>,
Jann Horn <jann@...jh.net>, Kees Cook <keescook@...omium.org>,
Daniel P . Berrangé <berrange@...hat.com>,
Jeff Layton <jlayton@...hat.com>,
Miklos Szeredi <miklos@...redi.hu>,
Matthew Wilcox <willy@...radead.org>,
"J. Bruce Fields" <bfields@...ldses.org>,
Trond Myklebust <trond.myklebust@...merspace.com>,
Chris Wright <chrisw@...hat.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Andrii Nakryiko <andriin@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...omium.org>,
Andy Lavr <andy.lavr@...il.com>
Subject: Re: [PATCH v2 15/24] proc/fd: In proc_readfd_common use
task_lookup_next_fd_rcu
On Tue, Dec 08, 2020 at 04:38:09PM -0600, Eric W. Biederman wrote:
> Is there any reason we don't simply rcu free the files_struct?
> That would remove the need for the task_lock entirely.
Umm... Potentially interesting part here is the interaction with
close_files(); currently that can't overlap with any of those
3rd-party accesses to descriptor table, but with your changes
here it's very much possible.
OTOH, it's not like close_files() did much beyond the effects of already
possible close(2) done by one of the threads sharing that sucker.
It's _probably_ safe (at least for proc_readfd_common()), but I'll need
to look at the other places doing that kind of access. Especially the
BPF foulness...
Oh, and in any case, the trick with repurposing ->rcu of embedded
fdtable deserves a comment. It's not hard to explain, so...
Powered by blists - more mailing lists