mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
xfrm: free skb if nlsk pointer is NULL
nlmsg_multicast() always frees the skb, so in case we cannot call
it we must do that ourselves.
Fixes: 21ee543edc ("xfrm: fix race between netns cleanup and state expire notification")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
parent
8cc8877385
commit
86126b77dc
1 changed files with 6 additions and 4 deletions
|
|
@ -1025,10 +1025,12 @@ static inline int xfrm_nlmsg_multicast(struct net *net, struct sk_buff *skb,
|
|||
{
|
||||
struct sock *nlsk = rcu_dereference(net->xfrm.nlsk);
|
||||
|
||||
if (nlsk)
|
||||
return nlmsg_multicast(nlsk, skb, pid, group, GFP_ATOMIC);
|
||||
else
|
||||
return -1;
|
||||
if (!nlsk) {
|
||||
kfree_skb(skb);
|
||||
return -EPIPE;
|
||||
}
|
||||
|
||||
return nlmsg_multicast(nlsk, skb, pid, group, GFP_ATOMIC);
|
||||
}
|
||||
|
||||
static inline unsigned int xfrm_spdinfo_msgsize(void)
|
||||
|
|
|
|||
Loading…
Reference in a new issue