diff options
author | Jakub Kicinski <kuba@kernel.org> | 2024-03-20 05:44:02 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-03-20 05:44:03 +0300 |
commit | 94e3ca2fef449e14a64a02e0a9864ed314f50e06 (patch) | |
tree | 26239bbdef4ae7c1699c07fed953c59d515ef909 /include/linux/skbuff.h | |
parent | 78a2f5e6c15d8dcbd6495bb9635c7cb89235dfc5 (diff) | |
parent | 773bb766ca4a05bf363203030b72b10088869224 (diff) | |
download | linux-94e3ca2fef449e14a64a02e0a9864ed314f50e06.tar.xz |
Merge tag 'ipsec-2024-03-19' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec
Steffen Klassert says:
====================
pull request (net): ipsec 2024-03-19
1) Fix possible page_pool leak triggered by esp_output.
From Dragos Tatulea.
2) Fix UDP encapsulation in software GSO path.
From Leon Romanovsky.
* tag 'ipsec-2024-03-19' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec:
xfrm: Allow UDP encapsulation only in offload modes
net: esp: fix bad handling of pages from page_pool
====================
Link: https://lore.kernel.org/r/20240319110151.409825-1-steffen.klassert@secunet.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 7d56ce195120..0c7c67b3a87b 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -3524,6 +3524,16 @@ int skb_cow_data_for_xdp(struct page_pool *pool, struct sk_buff **pskb, bool napi_pp_put_page(struct page *page, bool napi_safe); static inline void +skb_page_unref(const struct sk_buff *skb, struct page *page, bool napi_safe) +{ +#ifdef CONFIG_PAGE_POOL + if (skb->pp_recycle && napi_pp_put_page(page, napi_safe)) + return; +#endif + put_page(page); +} + +static inline void napi_frag_unref(skb_frag_t *frag, bool recycle, bool napi_safe) { struct page *page = skb_frag_page(frag); |