All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: set msg_control_is_user in do_ipv6_getsockopt
@ 2020-05-13 19:36 Christoph Hellwig
  2020-05-13 20:12 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2020-05-13 19:36 UTC (permalink / raw)
  To: davem; +Cc: netdev, Eric Dumazet

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")
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 net/ipv6/ipv6_sockglue.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 18d05403d3b52..a0e50cc57e545 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -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;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] ipv6: set msg_control_is_user in do_ipv6_getsockopt
  2020-05-13 19:36 [PATCH net-next] ipv6: set msg_control_is_user in do_ipv6_getsockopt Christoph Hellwig
@ 2020-05-13 20:12 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-13 20:12 UTC (permalink / raw)
  To: hch; +Cc: netdev, eric.dumazet

From: Christoph Hellwig <hch@lst.de>
Date: Wed, 13 May 2020 21:36:41 +0200

> 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")
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-13 20:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 19:36 [PATCH net-next] ipv6: set msg_control_is_user in do_ipv6_getsockopt Christoph Hellwig
2020-05-13 20:12 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.