Skip to contentSkip to conversation

Patch "ipv6: make sure to initialize sockc.tsflags before first use" has been added to the 4.10-stable tree

PATCH [email protected] 1 participant 1 message Mar 27, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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 <[email protected]> know about it.

Quoted 1 line

From foo@baz Mon Mar 27 18:18:08 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.

Fixes c14ac9451c34 ("sock: enable timestamping using control messages")
---
 net/ipv6/udp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/udp.c +1 -1
@@ -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 [email protected] 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