Clear the false positive in __alloc_skb From: Catalin Marinas This happens when fclone is 1 because the allocated size is different from the struct sk_buff one and therefore the pointer aliases are not correctly determined. Signed-off-by: Catalin Marinas --- net/core/skbuff.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 44f6a18..ee4fd9b 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -158,6 +158,9 @@ struct sk_buff *__alloc_skb(unsigned int /* Get the HEAD */ skb = kmem_cache_alloc(cache, gfp_mask & ~__GFP_DMA); + /* the skbuff_fclone_cache contains objects larger than + * "struct sk_buff" and kmemleak cannot guess the type */ + memleak_typeid(skb, struct sk_buff); if (!skb) goto out;