From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:39230 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752305AbdC0QTo (ORCPT ); Mon, 27 Mar 2017 12:19:44 -0400 Subject: Patch "ipv6: make sure to initialize sockc.tsflags before first use" has been added to the 4.10-stable tree To: glider@google.com, davem@davemloft.net, gregkh@linuxfoundation.org, soheil@google.com Cc: , From: Date: Mon, 27 Mar 2017 18:19:22 +0200 Message-ID: <1490631562135139@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled ipv6: make sure to initialize sockc.tsflags before first use to the 4.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ipv6-make-sure-to-initialize-sockc.tsflags-before-first-use.patch and it can be found in the queue-4.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Mon Mar 27 18:18:08 CEST 2017 From: Alexander Potapenko Date: Tue, 21 Mar 2017 17:14:27 +0100 Subject: ipv6: make sure to initialize sockc.tsflags before first use From: Alexander Potapenko [ 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 Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -1022,6 +1022,7 @@ int udpv6_sendmsg(struct sock *sk, struc ipc6.hlimit = -1; ipc6.tclass = -1; ipc6.dontfrag = -1; + sockc.tsflags = sk->sk_tsflags; /* destination address check */ if (sin6) { @@ -1146,7 +1147,6 @@ do_udp_sendmsg: fl6.flowi6_mark = sk->sk_mark; fl6.flowi6_uid = sk->sk_uid; - sockc.tsflags = sk->sk_tsflags; if (msg->msg_controllen) { opt = &opt_space; Patches currently in stable-queue which might be from glider@google.com are queue-4.10/ipv4-provide-stronger-user-input-validation-in-nl_fib_input.patch queue-4.10/ipv6-make-sure-to-initialize-sockc.tsflags-before-first-use.patch