mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-29 20:46:41 +07:00
skbuff: re-add check for NULL skb->head in kfree_skb path
A null check is needed after all. netlink skbs can have skb->head be
backed by vmalloc. The netlink destructor vfree()s head, then sets it to
NULL. We then panic in skb_release_data with a NULL dereference.
Re-add such a test.
Alternative would be to switch to kvfree to free skb->head memory
and remove the special handling in netlink destructor.
Reported-by: kernel test robot <fengguang.wu@intel.com>
Fixes: 06dc75ab06
("net: Revert "net: add function to allocate sk_buff head without data area")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ba3fb10221
commit
a28b1b90de
@ -638,7 +638,8 @@ void skb_release_head_state(struct sk_buff *skb)
|
||||
static void skb_release_all(struct sk_buff *skb)
|
||||
{
|
||||
skb_release_head_state(skb);
|
||||
skb_release_data(skb);
|
||||
if (likely(skb->head))
|
||||
skb_release_data(skb);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user