Patch "ipv6: make sure to initialize sockc.tsflags before first use" has been added to the 4.9-stable tree
Subsystems (3)
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.9-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.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Mon Mar 27 18:17:54 CEST 2017
From: Alexander Potapenko <[email protected]>
Date: Tue, 21 Mar 2017 17:14:27 +0100
Subject: ipv6: make sure to initialize sockc.tsflags before first use
From: Alexander Potapenko <[email protected]>
[ 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.
--- net/ipv6/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/udp.c +1 -1
@@ -1037,6 +1037,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) {
@@ -1156,7 +1157,6 @@ do_udp_sendmsg: fl6.flowi6_oif = np->sticky_pktinfo.ipi6_ifindex; fl6.flowi6_mark = sk->sk_mark; - sockc.tsflags = sk->sk_tsflags;if (msg->msg_controllen) { opt = &opt_space;
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/ipv4-provide-stronger-user-input-validation-in-nl_fib_input.patch queue-4.9/ipv6-make-sure-to-initialize-sockc.tsflags-before-first-use.patch