udp: drop skb extensions before marking skb stateless
Once udp stack has set the UDP_SKB_IS_STATELESS flag, later skb free
assumes all skb head state has been dropped already.
This will leak the extension memory in case the skb has extensions other
than the ipsec secpath, e.g. bridge nf data.
To fix this, set the UDP_SKB_IS_STATELESS flag only if we don't have
extensions or if the extension space can be free'd.
Fixes: 895b5c9f20
("netfilter: drop bridge nf reset from nf_reset")
Cc: Paolo Abeni <pabeni@redhat.com>
Reported-by: Byron Stanoszek <gandalf@winds.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
ff08ddba3a
commit
677bf08cfd
@@ -4169,12 +4169,18 @@ static inline void skb_ext_reset(struct sk_buff *skb)
|
||||
skb->active_extensions = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool skb_has_extensions(struct sk_buff *skb)
|
||||
{
|
||||
return unlikely(skb->active_extensions);
|
||||
}
|
||||
#else
|
||||
static inline void skb_ext_put(struct sk_buff *skb) {}
|
||||
static inline void skb_ext_reset(struct sk_buff *skb) {}
|
||||
static inline void skb_ext_del(struct sk_buff *skb, int unused) {}
|
||||
static inline void __skb_ext_copy(struct sk_buff *d, const struct sk_buff *s) {}
|
||||
static inline void skb_ext_copy(struct sk_buff *dst, const struct sk_buff *s) {}
|
||||
static inline bool skb_has_extensions(struct sk_buff *skb) { return false; }
|
||||
#endif /* CONFIG_SKB_EXTENSIONS */
|
||||
|
||||
static inline void nf_reset_ct(struct sk_buff *skb)
|
||||
|
Reference in New Issue
Block a user