diff mbox series

[nf] netfilter: xt_connmark: fix list corruption on rmmod

Message ID 20180612163619.12636-1-fw@strlen.de
State Accepted
Delegated to: Pablo Neira
Headers show
Series [nf] netfilter: xt_connmark: fix list corruption on rmmod | expand

Commit Message

Florian Westphal June 12, 2018, 4:36 p.m. UTC
This needs to use xt_unregister_targets, else new revision is left
on the list which then causes list to point to a target struct that has been free'd.

Fixes: 472a73e00757 ("netfilter: xt_conntrack: Support bit-shifting for CONNMARK & MARK targets.")
Signed-off-by: Florian Westphal <fw@strlen.de>
---

Comments

Pablo Neira Ayuso June 12, 2018, 5:31 p.m. UTC | #1
On Tue, Jun 12, 2018 at 06:36:19PM +0200, Florian Westphal wrote:
> This needs to use xt_unregister_targets, else new revision is left
> on the list which then causes list to point to a target struct that has been free'd.

Aplied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/net/netfilter/xt_connmark.c b/net/netfilter/xt_connmark.c
index 94df000abb92..29c38aa7f726 100644
--- a/net/netfilter/xt_connmark.c
+++ b/net/netfilter/xt_connmark.c
@@ -211,7 +211,7 @@  static int __init connmark_mt_init(void)
 static void __exit connmark_mt_exit(void)
 {
 	xt_unregister_match(&connmark_mt_reg);
-	xt_unregister_target(connmark_tg_reg);
+	xt_unregister_targets(connmark_tg_reg, ARRAY_SIZE(connmark_tg_reg));
 }
 
 module_init(connmark_mt_init);