lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <618F0D80-F2E1-49C1-AA25-B2C0CC46F519@kernel.org>
Date: Fri, 08 Nov 2024 07:32:04 -0800
From: Kees Cook <kees@...nel.org>
To: Stas Sergeev <stsp2@...dex.ru>, 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



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.

>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, I think it should be tied to pidfd which will already do the correct process lifetime management, etc.

-Kees

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ