]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
ipv6: make sure to initialize sockc.tsflags before first use
authorAlexander Potapenko <glider@google.com>
Tue, 21 Mar 2017 16:14:27 +0000 (17:14 +0100)
committerTim Gardner <tim.gardner@canonical.com>
Thu, 30 Mar 2017 12:35:45 +0000 (06:35 -0600)
commitf7f7cd33929e4c5162d96012806ba0207ac4deb2
treecb2d1669803c25e3fb128d1a679f91222a8be07c
parent7d7043ecc0cf8558b3a83d29b97b928fa0024625
ipv6: make sure to initialize sockc.tsflags before first use

BugLink: http://bugs.launchpad.net/bugs/1677589
[ Upstream commit d515684d78148884d5fc425ba904c50f03844020 ]

In the case udp_sk(sk)->pending is AF_INET6, udpv6_sendmsg() would
jump to do_append_data, skipping the initialization of sockc.tsflags.
Fix the problem by moving sockc.tsflags initialization earlier.

The bug was detected with KMSAN.

Fixes: c14ac9451c34 ("sock: enable timestamping using control messages")
Signed-off-by: Alexander Potapenko <glider@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
net/ipv6/udp.c