Skip to contentSkip to conversation

ipv6: set msg_control_is_user in do_ipv6_getsockopt

PATCH Applied Christoph Hellwig 2 participants 2 messages May 13, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: set msg_control_is_user in do_ipv6_getsockopt

While do_ipv6_getsockopt does not call the high-level recvmsg helper, the msghdr eventually ends up being passed to put_cmsg anyway, and thus needs msg_control_is_user set to the proper value.

Fixes 1f466e1f15cf ("net: cleanly handle kernel vs user buffers for ->msg_control")
---
 net/ipv6/ipv6_sockglue.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv6/ipv6_sockglue.c +1 -0
index 18d05403d3b52..a0e50cc57e545 100644
@@ -1075,6 +1075,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
 		msg.msg_control = optval;
 		msg.msg_controllen = len;
 		msg.msg_flags = flags;
+		msg.msg_control_is_user = true;
 
 		lock_sock(sk);
 		skb = np->pktoptions;
Signature · 1 line
2.26.2
maintainer Applied
#1 lore raw

From: Christoph Hellwig <[email protected]>
Date: Wed, 13 May 2020 21:36:41 +0200

Quoted 7 lines

While do_ipv6_getsockopt does not call the high-level recvmsg helper, the msghdr eventually ends up being passed to put_cmsg anyway, and thus needs msg_control_is_user set to the proper value.

Fixes 1f466e1f15cf ("net: cleanly handle kernel vs user buffers for ->msg_control")

Applied, thanks.