]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.18.103/netlink-avoid-a-double-skb-free-in-genlmsg_mcast.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 3.18.103 / netlink-avoid-a-double-skb-free-in-genlmsg_mcast.patch
CommitLineData
66d1cac4
GKH
1From foo@baz Thu Mar 29 08:53:48 CEST 2018
2From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
3Date: Wed, 14 Mar 2018 21:10:23 +0100
4Subject: netlink: avoid a double skb free in genlmsg_mcast()
5
6From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
7
8
9[ Upstream commit 02a2385f37a7c6594c9d89b64c4a1451276f08eb ]
10
11nlmsg_multicast() consumes always the skb, thus the original skb must be
12freed only when this function is called with a clone.
13
14Fixes: cb9f7a9a5c96 ("netlink: ensure to loop over all netns in genlmsg_multicast_allns()")
15Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
16Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
17Signed-off-by: David S. Miller <davem@davemloft.net>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19---
20 net/netlink/genetlink.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23--- a/net/netlink/genetlink.c
24+++ b/net/netlink/genetlink.c
25@@ -1083,7 +1083,7 @@ static int genlmsg_mcast(struct sk_buff
26 if (!err)
27 delivered = true;
28 else if (err != -ESRCH)
29- goto error;
30+ return err;
31 return delivered ? 0 : -ESRCH;
32 error:
33 kfree_skb(skb);