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: <66fa904185c3_17cd892948a@willemb.c.googlers.com.notmuch>
Date: Mon, 30 Sep 2024 07:49:21 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Jason Xing <kerneljasonxing@...il.com>, 
 Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: davem@...emloft.net, 
 edumazet@...gle.com, 
 kuba@...nel.org, 
 pabeni@...hat.com, 
 dsahern@...nel.org, 
 shuah@...nel.org, 
 willemb@...gle.com, 
 linux-kselftest@...r.kernel.org, 
 netdev@...r.kernel.org, 
 Jason Xing <kernelxing@...cent.com>
Subject: Re: [PATCH net-next 1/3] net-timestamp: add strict check when setting
 tx flags

Jason Xing wrote:
> On Mon, Sep 30, 2024 at 6:39 PM Willem de Bruijn
> <willemdebruijn.kernel@...il.com> wrote:
> >
> > Jason Xing wrote:
> > > From: Jason Xing <kernelxing@...cent.com>
> > >
> > > Even though this case is unlikely to happen, we have to avoid such
> > > a case occurring at an earlier point: the sk_rmem_alloc could get
> > > increased because of inserting more and more skbs into the errqueue
> > > when calling __skb_complete_tx_timestamp(). This bad case would stop
> > > the socket transmitting soon.
> >
> > It is up to the application to read from the error queue frequently
> > enough and/or increase SO_RCVBUF.
> 
> Sure thing. If we test it without setting SOF_TIMESTAMPING_SOFTWARE on
> the loopback, it will soon stop. That's the reason why I tried to add
> the restriction just in case.

I don't follow at all.

That bit does not affect the core issue: that the application is not
clearing its error queue quickly enough.
 
> >
> > > Signed-off-by: Jason Xing <kernelxing@...cent.com>
> > > ---
> > >  net/core/sock.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/net/core/sock.c b/net/core/sock.c
> > > index fe87f9bd8f16..4bddd6f62e4f 100644
> > > --- a/net/core/sock.c
> > > +++ b/net/core/sock.c
> > > @@ -905,6 +905,10 @@ int sock_set_timestamping(struct sock *sk, int optname,
> > >       if (val & ~SOF_TIMESTAMPING_MASK)
> > >               return -EINVAL;
> > >
> > > +     if (val & SOF_TIMESTAMPING_TX_RECORD_MASK &&
> > > +         !(val & SOF_TIMESTAMPING_SOFTWARE))
> > > +             return -EINVAL;
> > > +
> >
> > This breaks hardware timestamping
> 
> Yes, and sorry about that. I'll fix this.

As is I don't understand the purpose of this patch. Please do not
just resubmit with a change, but explain the problem and suggested
solution first.

> >
> > >       if (val & SOF_TIMESTAMPING_OPT_ID_TCP &&
> > >           !(val & SOF_TIMESTAMPING_OPT_ID))
> > >               return -EINVAL;
> > > --
> > > 2.37.3
> > >
> >
> >



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ