All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: netlink: Fix uninit-value in netlink_recvmsg()
@ 2019-12-06 13:49 Håkon Bugge
  2019-12-06 18:20 ` Sergei Shtylyov
  2019-12-06 18:47 ` Eric Dumazet
  0 siblings, 2 replies; 6+ messages in thread
From: Håkon Bugge @ 2019-12-06 13:49 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev

If skb_recv_datagram() returns NULL, netlink_recvmsg() will return an
arbitrarily value.

Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
---
 net/netlink/af_netlink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 90b2ab9dd449..bb7276f9c9f8 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1936,6 +1936,7 @@ static int netlink_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
 		return -EOPNOTSUPP;
 
 	copied = 0;
+	err = 0;
 
 	skb = skb_recv_datagram(sk, flags, noblock, &err);
 	if (skb == NULL)
-- 
2.20.1


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

end of thread, other threads:[~2019-12-06 19:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 13:49 [PATCH net] net: netlink: Fix uninit-value in netlink_recvmsg() Håkon Bugge
2019-12-06 18:20 ` Sergei Shtylyov
2019-12-06 18:45   ` Håkon Bugge
2019-12-06 18:57     ` Sergei Shtylyov
2019-12-06 18:47 ` Eric Dumazet
2019-12-06 19:07   ` Håkon Bugge

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.