Liping Zhang
1c759b361b
netfilter: nf_tables: fix oops when inserting an element into a verdict map
commit 58c78e104d upstream.
Dalegaard says:
The following ruleset, when loaded with 'nft -f bad.txt'
----snip----
flush ruleset
table ip inlinenat {
map sourcemap {
type ipv4_addr : verdict;
}
chain postrouting {
ip saddr vmap @sourcemap accept
}
}
add chain inlinenat test
add element inlinenat sourcemap { 100.123.10.2 : jump test }
----snip----
results in a kernel oops:
BUG: unable to handle kernel paging request at 0000000000001344
IP: [<ffffffffa07bf704>] nf_tables_check_loops+0x114/0x1f0 [nf_tables]
[...]
Call Trace:
[<ffffffffa07c2aae>] ? nft_data_init+0x13e/0x1a0 [nf_tables]
[<ffffffffa07c1950>] nft_validate_register_store+0x60/0xb0 [nf_tables]
[<ffffffffa07c74b5>] nft_add_set_elem+0x545/0x5e0 [nf_tables]
[<ffffffffa07bfdd0>] ? nft_table_lookup+0x30/0x60 [nf_tables]
[<ffffffff8132c630>] ? nla_strcmp+0x40/0x50
[<ffffffffa07c766e>] nf_tables_newsetelem+0x11e/0x210 [nf_tables]
[<ffffffff8132c400>] ? nla_validate+0x60/0x80
[<ffffffffa030d9b4>] nfnetlink_rcv+0x354/0x5a7 [nfnetlink]
Because we forget to fill the net pointer in bind_ctx, so dereferencing
it may cause kernel crash.
Reported-by: Dalegaard <dalegaard@gmail.com>
Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-01 09:46:40 +01:00
..
2018-11-27 16:08:00 +01:00
2018-09-15 09:40:38 +02:00
2018-01-31 12:06:10 +01:00
2017-10-08 10:14:19 +02:00
2018-01-31 12:06:10 +01:00
2017-08-24 17:02:34 -07:00
2018-04-13 19:50:10 +02:00
2018-08-24 13:27:01 +02:00
2018-01-31 12:06:10 +01:00
2018-07-11 16:03:51 +02:00
2017-10-08 10:14:19 +02:00
2018-03-18 11:17:51 +01:00
2018-02-16 20:09:40 +01:00
2018-12-01 09:46:40 +01:00
2018-07-11 16:03:47 +02:00
2018-01-31 12:06:11 +01:00
2017-10-08 10:14:19 +02:00
2018-07-17 11:31:46 +02:00
2017-11-15 17:13:10 +01:00
2017-11-30 08:37:27 +00:00
2018-09-19 22:48:59 +02:00
2018-03-24 10:58:43 +01:00
2018-04-08 11:51:59 +02:00
2018-11-27 16:08:01 +01:00
2018-03-18 11:17:51 +01:00
2018-01-31 12:06:11 +01:00
2018-02-25 11:03:37 +01:00
2018-04-08 11:51:59 +02:00