[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8288a08e-448b-43c2-82dc-59f87d0d9072@yandex.ru>
Date: Sat, 9 Nov 2024 00:06:09 +0300
From: stsp <stsp2@...dex.ru>
To: Kees Cook <kees@...nel.org>, linux-kernel@...r.kernel.org
Cc: Eric Biederman <ebiederm@...ssion.com>, Andy Lutomirski
<luto@...nel.org>, Aleksa Sarai <cyphar@...har.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
Thomas Gleixner <tglx@...utronix.de>, Jeff Layton <jlayton@...nel.org>,
John Johansen <john.johansen@...onical.com>,
Chengming Zhou <chengming.zhou@...ux.dev>,
Casey Schaufler <casey@...aufler-ca.com>,
Adrian Ratiu <adrian.ratiu@...labora.com>,
Felix Moessbauer <felix.moessbauer@...mens.com>, Jens Axboe
<axboe@...nel.dk>, Oleg Nesterov <oleg@...hat.com>,
"Serge E. Hallyn" <serge@...lyn.com>, linux-fsdevel@...r.kernel.org,
"Peter Zijlstra (Intel)" <peterz@...radead.org>
Subject: Re: [PATCH v2 1/2] procfs: avoid some usages of seq_file private data
08.11.2024 18:32, Kees Cook пишет:
> On November 8, 2024 2:13:38 AM PST, Stas Sergeev <stsp2@...dex.ru> wrote:
>> seq_file private data carries the inode pointer here.
>> Replace
>> `struct inode *inode = m->private;`
>> with:
>> `struct inode *inode = file_inode(m->file);`
>> to avoid the reliance on private data.
> Conceptually this seems good, though I'd expect to see the removal of _setting_ m->private too in this patch.
Done and sent v3.
>> This is needed so that `proc_single_show()` can be used by
>> custom fops that utilize seq_file private data for other things.
>> This is used in the next patch.
> Now that next patch is pretty wild. I think using proc is totally wrong for managing uid/gid. If that's going to happen at all,
And if not - it would be good if someone
tells how to fix the actual problem then.
I think the closest thing was credfd discussed
here:
https://lkml2.uits.iu.edu/hypermail/linux/kernel/1403.3/01528.html
But /proc/self/status already carries creds,
so what else is it if not credfd? :)
I can't even think of what else the read()
syscall should return on an actual hypothetical
credfd - other than what it returns now when
reading /proc/self/status.
> I think it should be tied to pidfd which will already do the correct process lifetime management, etc.
Please let me know the exact scheme
you have in mind so that I can try it out.
I don't see any obvious mapping of my
current proposal to pidfd, so I can't guess.
Powered by blists - more mailing lists