net: sched: em_text: fix possible memory leak in em_text_destroy()
Subsystems (3)
PATCH v2 1/1 net: sched: em_text: fix possible memory leak in em_text_destroy()
m->data needs to be freed when em_text_destroy is called.
Fixes d675c989ed2d ("[PKT_SCHED]: Packet classification based on textsearch (ematch)")
Acked-by Jamal Hadi Salim <[email protected]>
Signed-off-by Hangyu Hua <[email protected]>
---
v2: fix a type usage error
net/sched/em_text.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/sched/em_text.c +3 -1
@@ -97,8 +97,10 @@ static int em_text_change(struct net *net, void *data, int len,static void em_text_destroy (struct tcf_ematch *m) { -if (EM_TEXT_PRIV (m) &&EM_TEXT_PRIV (m)->config) +if (EM_TEXT_PRIV (m) &&EM_TEXT_PRIV (m)->config) {textsearch_destroy (EM_TEXT_PRIV (m)->config); +kfree (EM_TEXT_PRIV (m)); + } }static int em_text_dump (struct sk_buff *skb,struct tcf_ematch *m)
Signature · 1 line
2.34.1
Quoted 5 lines · Hangyu Hua
m->dataneeds to be freed whenem_text_destroyis called.Fixes d675c989ed2d ("[PKT_SCHED]: Packet classification based on textsearch (ematch)")Acked-by Jamal Hadi Salim <[email protected]>Signed-off-by Hangyu Hua <[email protected]>
Reviewed-by Simon Horman <[email protected]>
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:
Quoted 8 lines · On Thu, 21 Dec 2023 10:25:31 +0800 you wrote:
m->dataneeds to be freed whenem_text_destroyis called.Fixes d675c989ed2d ("[PKT_SCHED]: Packet classification based on textsearch (ematch)")Acked-by Jamal Hadi Salim <[email protected]>Signed-off-by Hangyu Hua <[email protected]>---
[...]
Here is the summary with links:
- [v2] net: sched: em_text: fix possible memory leak in em_text_destroy()
https://git.kernel.org/netdev/net/c/8fcb0382af6f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html