Skip to content

Commit d376bef

Browse files
Florian Westphalummakynes
authored andcommitted
netfilter: x_tables: set module owner for icmp(6) matches
nft_compat relies on xt_request_find_match to increment refcount of the module that provides the match/target. The (builtin) icmp matches did't set the module owner so it was possible to rmmod ip(6)tables while icmp extensions were still in use. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent d461e3d commit d376bef

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

net/ipv4/netfilter/ip_tables.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,6 +1898,7 @@ static struct xt_match ipt_builtin_mt[] __read_mostly = {
18981898
.checkentry = icmp_checkentry,
18991899
.proto = IPPROTO_ICMP,
19001900
.family = NFPROTO_IPV4,
1901+
.me = THIS_MODULE,
19011902
},
19021903
};
19031904

net/ipv6/netfilter/ip6_tables.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,6 +1909,7 @@ static struct xt_match ip6t_builtin_mt[] __read_mostly = {
19091909
.checkentry = icmp6_checkentry,
19101910
.proto = IPPROTO_ICMPV6,
19111911
.family = NFPROTO_IPV6,
1912+
.me = THIS_MODULE,
19121913
},
19131914
};
19141915

0 commit comments

Comments
 (0)