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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEf4BzY5fy1VVykbSdcLbVhaHRuT6pRNYNgpYteaD79vRM7N5A@mail.gmail.com>
Date: Fri, 4 Oct 2024 12:58:00 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Christian Brauner <brauner@...nel.org>
Cc: Andrii Nakryiko <andrii@...nel.org>, linux-trace-kernel@...r.kernel.org, 
	peterz@...radead.org, oleg@...hat.com, rostedt@...dmis.org, 
	mhiramat@...nel.org, bpf@...r.kernel.org, linux-kernel@...r.kernel.org, 
	jolsa@...nel.org, paulmck@...nel.org, willy@...radead.org, surenb@...gle.com, 
	akpm@...ux-foundation.org, linux-mm@...ck.org, mjguzik@...il.com, 
	jannh@...gle.com, mhocko@...nel.org, vbabka@...e.cz, mingo@...nel.org, 
	Amir Goldstein <amir73il@...il.com>
Subject: Re: [PATCH v2 tip/perf/core 3/5] fs: add back RCU-delayed freeing of
 FMODE_BACKING file

On Fri, Oct 4, 2024 at 1:01 AM Christian Brauner <brauner@...nel.org> wrote:
>
> On Thu, Oct 03, 2024 at 11:13:54AM GMT, Christian Brauner wrote:
> > On Tue, Oct 01, 2024 at 03:52:05PM GMT, Andrii Nakryiko wrote:
> > > 6cf41fcfe099 ("backing file: free directly") switched FMODE_BACKING
> > > files to direct freeing as back then there were no use cases requiring
> > > RCU protected access to such files.
> > >
> > > Now, with speculative lockless VMA-to-uprobe lookup logic, we do need to
> > > have a guarantee that struct file memory is not going to be freed from
> > > under us during speculative check. So add back RCU-delayed freeing
> > > logic.
> > >
> > > We use headless kfree_rcu_mightsleep() variant, as file_free() is only
> > > called for FMODE_BACKING files in might_sleep() context.
> > >
> > > Suggested-by: Suren Baghdasaryan <surenb@...gle.com>
> > > Cc: Christian Brauner <brauner@...nel.org>
> > > Cc: Amir Goldstein <amir73il@...il.com>
> > > Signed-off-by: Andrii Nakryiko <andrii@...nel.org>
> > > ---
> >
> > Reviewed-by: Christian Brauner <brauner@...nel.org>
>
> Fwiw, I have another patch series for files that I'm testing that will
> require me to switch FMODE_BACKING to a SLAB_TYPSAFE_BY_RCU cache. That
> shouldn't matter for your use-case though.

Correct, we assume SLAB_TYPESAFE_BY_RCU semantics for the common case
anyways. But hopefully my change won't cause major merge conflicts
with your patch set.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ