]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.4/netfilter-x_tables-set-module-owner-for-icmp-6-matches.patch
7e70a0734b7b534e5d14d2c729ce97dbe186761e
[thirdparty/kernel/stable-queue.git] / queue-4.4 / netfilter-x_tables-set-module-owner-for-icmp-6-matches.patch
1 From foo@baz Wed Aug 22 10:28:26 CEST 2018
2 From: Florian Westphal <fw@strlen.de>
3 Date: Wed, 4 Jul 2018 20:25:32 +0200
4 Subject: netfilter: x_tables: set module owner for icmp(6) matches
5
6 From: Florian Westphal <fw@strlen.de>
7
8 [ Upstream commit d376bef9c29b3c65aeee4e785fffcd97ef0a9a81 ]
9
10 nft_compat relies on xt_request_find_match to increment
11 refcount of the module that provides the match/target.
12
13 The (builtin) icmp matches did't set the module owner so it
14 was possible to rmmod ip(6)tables while icmp extensions were still in use.
15
16 Signed-off-by: Florian Westphal <fw@strlen.de>
17 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
18 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 ---
21 net/ipv4/netfilter/ip_tables.c | 1 +
22 net/ipv6/netfilter/ip6_tables.c | 1 +
23 2 files changed, 2 insertions(+)
24
25 --- a/net/ipv4/netfilter/ip_tables.c
26 +++ b/net/ipv4/netfilter/ip_tables.c
27 @@ -2072,6 +2072,7 @@ static struct xt_match ipt_builtin_mt[]
28 .checkentry = icmp_checkentry,
29 .proto = IPPROTO_ICMP,
30 .family = NFPROTO_IPV4,
31 + .me = THIS_MODULE,
32 },
33 };
34
35 --- a/net/ipv6/netfilter/ip6_tables.c
36 +++ b/net/ipv6/netfilter/ip6_tables.c
37 @@ -2073,6 +2073,7 @@ static struct xt_match ip6t_builtin_mt[]
38 .checkentry = icmp6_checkentry,
39 .proto = IPPROTO_ICMPV6,
40 .family = NFPROTO_IPV6,
41 + .me = THIS_MODULE,
42 },
43 };
44