mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-17 17:31:27 +00:00
65 lines
1.9 KiB
Diff
65 lines
1.9 KiB
Diff
From 9f2362ee17aef209a42aa7a9f6f41ca2aa82d2eb Mon Sep 17 00:00:00 2001
|
|
From: Pavithra R <quic_pavir@quicinc.com>
|
|
Date: Wed, 22 Nov 2023 20:57:45 +0530
|
|
Subject: [PATCH] net: Fix the crash due to missing skb debug deactivation
|
|
|
|
Napi allocation and consume involves activation and deactivation of
|
|
skb. In napi_skb_finish function the deactivation was not happening.
|
|
The patch fixes the same. Also deactivation was missing in napi_consume_skb.
|
|
|
|
Change-Id: I7ea2240c138ec2a4e2796e33f37b1ce923ca7a4d
|
|
Signed-off-by: Pavithra R <quic_pavir@quicinc.com>
|
|
---
|
|
net/core/gro.c | 6 ++++--
|
|
net/core/skbuff.c | 2 ++
|
|
2 files changed, 6 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/net/core/gro.c b/net/core/gro.c
|
|
index 4f520e6751c2..4e087f0a9bb4 100644
|
|
--- a/net/core/gro.c
|
|
+++ b/net/core/gro.c
|
|
@@ -3,6 +3,7 @@
|
|
#include <net/dst_metadata.h>
|
|
#include <net/busy_poll.h>
|
|
#include <trace/events/net.h>
|
|
+#include "skbuff_debug.h"
|
|
|
|
#define MAX_GRO_SKBS 8
|
|
|
|
@@ -631,9 +632,10 @@ static gro_result_t napi_skb_finish(struct napi_struct *napi,
|
|
break;
|
|
|
|
case GRO_MERGED_FREE:
|
|
- if (NAPI_GRO_CB(skb)->free == NAPI_GRO_FREE_STOLEN_HEAD)
|
|
+ if (NAPI_GRO_CB(skb)->free == NAPI_GRO_FREE_STOLEN_HEAD) {
|
|
+ skbuff_debugobj_deactivate(skb);
|
|
napi_skb_free_stolen_head(skb);
|
|
- else if (skb->fclone != SKB_FCLONE_UNAVAILABLE)
|
|
+ } else if (skb->fclone != SKB_FCLONE_UNAVAILABLE)
|
|
__kfree_skb(skb);
|
|
else
|
|
__kfree_skb_defer(skb);
|
|
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
|
|
index 6277bbf0a46c..bfa481622b34 100644
|
|
--- a/net/core/skbuff.c
|
|
+++ b/net/core/skbuff.c
|
|
@@ -1315,6 +1315,7 @@ static void napi_skb_cache_put(struct sk_buff *skb)
|
|
|
|
void __kfree_skb_defer(struct sk_buff *skb)
|
|
{
|
|
+ skbuff_debugobj_deactivate(skb);
|
|
skb_release_all(skb);
|
|
napi_skb_cache_put(skb);
|
|
}
|
|
@@ -1353,6 +1354,7 @@ void napi_consume_skb(struct sk_buff *skb, int budget)
|
|
return;
|
|
}
|
|
|
|
+ skbuff_debugobj_deactivate(skb);
|
|
skb_release_all(skb);
|
|
napi_skb_cache_put(skb);
|
|
}
|
|
--
|
|
2.34.1
|
|
|