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] [day] [month] [year] [list]
Message-ID: <20241113075840.q2ydNS-D@linutronix.de>
Date: Wed, 13 Nov 2024 08:58:40 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Tejun Heo <tj@...nel.org>
Cc: Boqun Feng <boqun.feng@...il.com>, Hillf Danton <hdanton@...a.com>,
	"Paul E. McKenney" <paulmck@...nel.org>,
	Marco Elver <elver@...gle.com>, linux-kernel@...r.kernel.org,
	gregkh@...uxfoundation.org, tglx@...utronix.de,
	syzbot <syzbot+6ea37e2e6ffccf41a7e6@...kaller.appspotmail.com>
Subject: Re: [PATCH] kernfs: Use RCU for kernfs_node::name lookup.

On 2024-11-12 09:02:53 [-1000], Tejun Heo wrote:
> Hello, Sebastian.
Hi Tejun,

> Sorry about late reply. Have been sick for a bit.

No worries, hopefully you are getting better.

> On Mon, Nov 11, 2024 at 06:04:50PM +0100, Sebastian Andrzej Siewior wrote:
> ...
> > Let me check if I understood. We have three users of kernfs:
> > 
> > - cgroup
> >   cgroup1_rename(): parent check (would get the new KERNFS_ROOT flag)
> > 
> > - resctrl
> >   rdtgroup_rename(): seems to allow any "mon group" directory
> >   different parent possible.
> > 
> > - sysfs
> >   sysfs_move_dir_ns(): reame to a different parent
> 
> I'm not sure about resctrl but here we just need to add that flag to cgroup,
> right?

Correct. I was just puzzling your answer together ;)

> > That new RCU interface would be used by cgroup only and sysfs/ resctrl
> > would remain using the "old" code?
> > If so, would you  prefer 
> > |struct kernfs_node {
> > |	…
> > |	union {
> > |		const char              name;
> > |		const char              __rcu *name_rcu;
> > |	}
> > 
> > to avoid patching resctrl + sysfs for for the rcu_derference name
> > lookup?
> 
> As replied on the patches, it probably is cleaner to always use __rcu and
> apply the additional locking on the reader side if renaming across different
> parents is allowed.

Yes, on it.

> Thanks.

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ