From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: ben.hutchings@codethink.co.uk
Cc: davem@davemloft.net, netdev@vger.kernel.org,
stable@vger.kernel.org, johannes.berg@intel.com,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
Nicolas Dichtel <nicolas.dichtel@6wind.com>
Subject: [PATCH net] netlink: avoid a double skb free in genlmsg_mcast()
Date: Wed, 14 Mar 2018 21:10:23 +0100 [thread overview]
Message-ID: <20180314201023.12407-1-nicolas.dichtel@6wind.com> (raw)
In-Reply-To: <1520899459.23626.87.camel@codethink.co.uk>
nlmsg_multicast() consumes always the skb, thus the original skb must be
freed only when this function is called with a clone.
Fixes: cb9f7a9a5c96 ("netlink: ensure to loop over all netns in genlmsg_multicast_allns()")
Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
net/netlink/genetlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 6f02499ef007..b9ce82c9440f 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -1106,7 +1106,7 @@ static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group,
if (!err)
delivered = true;
else if (err != -ESRCH)
- goto error;
+ return err;
return delivered ? 0 : -ESRCH;
error:
kfree_skb(skb);
--
2.15.1
next parent reply other threads:[~2018-03-14 20:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1520899459.23626.87.camel@codethink.co.uk>
2018-03-14 20:10 ` Nicolas Dichtel [this message]
2018-03-16 16:36 ` [PATCH net] netlink: avoid a double skb free in genlmsg_mcast() David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180314201023.12407-1-nicolas.dichtel@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=ben.hutchings@codethink.co.uk \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox