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: <aCLs8rUaO2q4NViq@google.com>
Date: Tue, 13 May 2025 06:55:46 +0000
From: Matt Bobrowski <mattbobrowski@...gle.com>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc: Viktor Malik <vmalik@...hat.com>, bpf@...r.kernel.org,
	Alexei Starovoitov <ast@...nel.org>,
	Daniel Borkmann <daniel@...earbox.net>,
	Andrii Nakryiko <andrii@...nel.org>,
	Martin KaFai Lau <martin.lau@...ux.dev>,
	Eduard Zingerman <eddyz87@...il.com>, Song Liu <song@...nel.org>,
	Yonghong Song <yonghong.song@...ux.dev>,
	John Fastabend <john.fastabend@...il.com>,
	KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...ichev.me>,
	Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v4 2/4] uaccess: Define pagefault lock guard

On Fri, May 09, 2025 at 11:20:48AM -0700, Andrii Nakryiko wrote:
> On Thu, May 8, 2025 at 3:01 AM Matt Bobrowski <mattbobrowski@...gle.com> wrote:
> >
> > On Wed, May 07, 2025 at 08:40:37AM +0200, Viktor Malik wrote:
> > > Define a pagefault lock guard which allows to simplify functions that
> > > need to disable page faults.
> > >
> > > Signed-off-by: Viktor Malik <vmalik@...hat.com>
> > > ---
> > >  include/linux/uaccess.h | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
> > > index 7c06f4795670..1beb5b395d81 100644
> > > --- a/include/linux/uaccess.h
> > > +++ b/include/linux/uaccess.h
> > > @@ -296,6 +296,8 @@ static inline bool pagefault_disabled(void)
> > >   */
> > >  #define faulthandler_disabled() (pagefault_disabled() || in_atomic())
> > >
> > > +DEFINE_LOCK_GUARD_0(pagefault, pagefault_disable(), pagefault_enable())
> >
> > I can't help but mention that naming this scope-based cleanup helper
> > `pagefault` just seems overly ambiguous. That's just me though...
> 
> I do see the concern, but
> 
> DEFINE_LOCK_GUARD_0(preempt, preempt_disable(), preempt_enable())
> DEFINE_LOCK_GUARD_0(irq, local_irq_disable(), local_irq_enable())
> 
> so we are just staying consistent here? But also "guard (against) the
> pagefault" does (internally) read somewhat meaningfully, no?

Now that you've written it out like that, yes I do agree, that does
read somewhat meaningfully. I also don't have any better suggestions
at this point, so I think leaving it as it is now is also totally
fine.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ