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: <HK2PR06MB0548453237EEC531D4B0A180D8370@HK2PR06MB0548.apcprd06.prod.outlook.com>
Date:	Tue, 19 Jul 2016 05:42:57 +0000
From:	Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
To:	Willem de Bruijn <willemdebruijn.kernel@...il.com>
CC:	David Miller <davem@...emloft.net>,
	"fruggeri@...stanetworks.com" <fruggeri@...stanetworks.com>,
	Network Development <netdev@...r.kernel.org>,
	Soheil Hassas Yeganeh <soheil.kdev@...il.com>
Subject: RE: [PATCH/RFC] packet: fix sock_tx_timestamp() in packet_snd() via
 sendto syscall

Hi,

> From: Willem de Bruijn
> Sent: Saturday, July 16, 2016 12:31 AM
> 
> On Thu, Jul 14, 2016 at 10:49 PM, Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@...esas.com> wrote:
> > Since the sendto syscall doesn't have msg_control buffer,
> > the sock_tx_timestamp() in packet_snd() cannot work correctly because
> > the socks.fsflags is set to 0.
> 
> You're right. __sock_tx_timestamp used to take sk->sk_tsflags as
> input, now it relies solely on this parameter tsflags. All callsites
> must either pass sk->sk_tsflags directly or initialize sockc.tsflags
> to this value.

Thank you very much for the comment!

> > diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> > index 9f0983f..d76fd41 100644
> > --- a/net/packet/af_packet.c
> > +++ b/net/packet/af_packet.c
> > @@ -2887,6 +2887,11 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
> >                 err = sock_cmsg_send(sk, msg, &sockc);
> >                 if (unlikely(err))
> >                         goto out_unlock;
> > +       } else {
> > +               /* Set tsflags from sk because a syscall (e.g. sendto) doesn't
> > +                * have msg_control buffer.
> > +                */
> > +               sockc.tsflags = sk->sk_tsflags;
> >         }
> 
> Better to follow the example of other protocols. In all three packet
> variants, make the following initialization change:
> 
> -       sockc.tsflags = 0;
> +       sockc.tsflags = sk->sk_tsflags;

Thank you for the suggestion. I submitted a fixed patch now.

Best regards,
Yoshihiro Shimoda

> (I had to remove some recipients, because my reply was marked as spam
> and dropped otherwise..)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ