]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Mar 2017 19:40:22 +0000 (12:40 -0700)
commitd77d2c9363586e65a1bcae1b576ca23eeb952f67
tree9b48522dd41d5e36f4af6fe13de70f1d7a48931d
parent6125848dd6e21e91b273cd70302d8724eefeb081
ipv6: make sure to initialize sockc.tsflags before first use

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: 1b4614be4286 ("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>
net/ipv6/udp.c