summaryrefslogtreecommitdiff
path: root/net/core/gro.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-02-03 01:49:55 +0300
committerJakub Kicinski <kuba@kernel.org>2023-02-03 01:49:55 +0300
commit82b4a9412b4de2f68679f1403f1d229390ace27e (patch)
tree920454da3f6d509be95ae3c5c72921bfddc39c20 /net/core/gro.c
parentb18ea3d9d214dfb23b0b6bd2acc121cb0d0fa2c5 (diff)
parentedb9b8f380c3413bf783475279b1a941c7e5cec1 (diff)
downloadlinux-82b4a9412b4de2f68679f1403f1d229390ace27e.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
net/core/gro.c 7d2c89b32587 ("skb: Do mix page pool and page referenced frags in GRO") b1a78b9b9886 ("net: add support for ipv4 big tcp") https://lore.kernel.org/all/20230203094454.5766f160@canb.auug.org.au/ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/gro.c')
-rw-r--r--net/core/gro.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/core/gro.c b/net/core/gro.c
index b15f85546bdd..a606705a0859 100644
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -162,10 +162,19 @@ int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb)
struct sk_buff *lp;
int segs;
+ /* Do not splice page pool based packets w/ non-page pool
+ * packets. This can result in reference count issues as page
+ * pool pages will not decrement the reference count and will
+ * instead be immediately returned to the pool or have frag
+ * count decremented.
+ */
+ if (p->pp_recycle != skb->pp_recycle)
+ return -ETOOMANYREFS;
+
/* pairs with WRITE_ONCE() in netif_set_gro(_ipv4)_max_size() */
gro_max_size = p->protocol == htons(ETH_P_IPV6) ?
READ_ONCE(p->dev->gro_max_size) :
- READ_ONCE(p->dev->gro_ipv4_max_size);
+ READ_ONCE(p->dev->gro_ipv4_max_size);
if (unlikely(p->len + len >= gro_max_size || NAPI_GRO_CB(skb)->flush))
return -E2BIG;