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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 15 Jul 2016 11:31:08 -0400
From:	Willem de Bruijn <willemdebruijn.kernel@...il.com>
To:	Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
Cc:	David Miller <davem@...emloft.net>, 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

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.

> 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;

(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