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: <aQIsBlf4O7cyrXq8@devvm11784.nha0.facebook.com>
Date: Wed, 29 Oct 2025 08:00:22 -0700
From: Bobby Eshleman <bobbyeshleman@...il.com>
To: Mina Almasry <almasrymina@...gle.com>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Simon Horman <horms@...nel.org>,
	Kuniyuki Iwashima <kuniyu@...gle.com>,
	Willem de Bruijn <willemb@...gle.com>,
	Neal Cardwell <ncardwell@...gle.com>,
	David Ahern <dsahern@...nel.org>,
	Stanislav Fomichev <sdf@...ichev.me>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Bobby Eshleman <bobbyeshleman@...a.com>
Subject: Re: [PATCH net-next v5 4/4] net: add per-netns sysctl for devmem
 autorelease

On Tue, Oct 28, 2025 at 07:09:58PM -0700, Mina Almasry wrote:
> On Tue, Oct 28, 2025 at 2:14 PM Bobby Eshleman <bobbyeshleman@...il.com> wrote:
> >
> > On Mon, Oct 27, 2025 at 06:22:16PM -0700, Mina Almasry wrote:
> > > On Thu, Oct 23, 2025 at 2:00 PM Bobby Eshleman <bobbyeshleman@...il.com> wrote:
> >
> > [...]
> >
> > > > diff --git a/net/core/devmem.c b/net/core/devmem.c
> > > > index 8f3199fe0f7b..9cd6d93676f9 100644
> > > > --- a/net/core/devmem.c
> > > > +++ b/net/core/devmem.c
> > > > @@ -331,7 +331,7 @@ net_devmem_bind_dmabuf(struct net_device *dev,
> > > >                 goto err_free_chunks;
> > > >
> > > >         list_add(&binding->list, &priv->bindings);
> > > > -       binding->autorelease = true;
> > > > +       binding->autorelease = dev_net(dev)->core.sysctl_devmem_autorelease;
> > > >
> > >
> > > Do you need to READ_ONCE this and WRITE_ONCE the write site? Or is
> > > that silly for a u8? Maybe better be safe.
> >
> > Probably worth it to be safe.
> > >
> > > Could we not make this an optional netlink argument? I thought that
> > > was a bit nicer than a sysctl.
> > >
> > > Needs a doc update.
> > >
> > >
> > > -- Thanks, Mina
> >
> > Sounds good, I'll change to nl for the next rev. Thanks for the review!
> >
> 
> Sorry to pile the requests, but any chance we can have the kselftest
> improved to cover the default case and the autorelease=on case?
> 
No problem, I had the same thought.

> I'm thinking out loud here: if we make autorelease a property of the
> socket like I say in the other thread, does changing the value at
> runtime blow everything up. My thinking is that no, what's important
> is that the sk->devmem_info.autorelease **never** gets toggled for any
> active sockets, but as long as the value is constant, everything
> should work fine, yes?

I agree, autorelease can be toggled so long as the xarray is empty
and there are no outstanding urefs (to avoid sock_devmem_dontneed from
doing the wrong thing with the tokens).

Best,
Bobby

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ