Liping Zhang
2fa46c1301
netfilter: nft_limit: fix divided by zero panic
After I input the following nftables rule, a panic happened on my system:
# nft add rule filter OUTPUT limit rate 0xf00000000 bytes/second
divide error: 0000 [#1] SMP
[ ... ]
RIP: 0010:[<ffffffffa059035e>] [<ffffffffa059035e>]
nft_limit_pkt_bytes_eval+0x2e/0xa0 [nft_limit]
Call Trace:
[<ffffffffa05721bb>] nft_do_chain+0xfb/0x4e0 [nf_tables]
[<ffffffffa044f236>] ? nf_nat_setup_info+0x96/0x480 [nf_nat]
[<ffffffff81753767>] ? ipt_do_table+0x327/0x610
[<ffffffffa044f677>] ? __nf_nat_alloc_null_binding+0x57/0x80 [nf_nat]
[<ffffffffa058b21f>] nft_ipv4_output+0xaf/0xd0 [nf_tables_ipv4]
[<ffffffff816f4aa2>] nf_iterate+0x62/0x80
[<ffffffff816f4b33>] nf_hook_slow+0x73/0xd0
[<ffffffff81703d0d>] __ip_local_out+0xcd/0xe0
[<ffffffff81701d90>] ? ip_forward_options+0x1b0/0x1b0
[<ffffffff81703d3c>] ip_local_out+0x1c/0x40
This is because divisor is 64-bit, but we treat it as a 32-bit integer,
then 0xf00000000 becomes zero, i.e. divisor becomes 0.
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-10-04 08:59:03 +02:00
..
2016-09-19 20:19:34 +02:00
2016-08-09 13:42:36 +03:00
2016-08-13 15:15:54 -07:00
2016-09-10 21:19:10 -07:00
2016-09-10 21:19:10 -07:00
2016-06-18 20:55:34 -07:00
2016-09-23 06:46:57 -04:00
2016-09-22 17:48:23 +02:00
2016-09-25 23:34:19 +02:00
2016-06-28 05:26:14 -04:00
2016-06-23 11:23:49 +02:00
2016-08-08 21:41:42 +02:00
2016-09-28 20:32:38 -04:00
2016-07-29 17:38:46 -07:00
2016-07-05 14:08:47 -07:00
2016-09-23 08:38:50 -04:00
2016-05-16 14:00:43 -04:00
2016-07-08 13:23:12 +02:00
2016-09-30 01:50:45 -04:00
2016-09-30 01:54:28 -04:00
2016-09-23 06:46:57 -04:00
2016-07-29 17:38:46 -07:00
2016-09-12 15:52:44 -07:00
2016-09-17 10:07:23 -04:00
2016-09-10 23:12:53 -07:00
2016-05-29 22:33:25 -07:00
2016-09-17 10:05:05 -04:00
2016-09-23 06:46:57 -04:00
2016-09-19 20:19:34 +02:00
2016-09-01 10:13:15 -07:00
2016-07-25 10:32:59 -07:00
2016-10-04 08:59:03 +02:00
2016-06-27 15:06:18 -04:00
2016-09-07 17:29:38 -07:00
2016-07-11 02:02:03 +02:00
2016-09-20 22:54:35 -04:00
2016-07-24 00:53:32 -04:00
2016-05-17 14:11:19 -04:00
2016-08-08 16:16:21 -07:00
2016-07-13 11:53:40 -07:00
2016-09-29 22:57:47 +01:00
2016-09-28 03:11:22 -04:00
2016-09-30 01:50:45 -04:00
2016-08-28 23:32:41 -04:00
2016-09-16 17:00:26 -07:00
2016-09-28 04:48:00 -04:00
2016-09-13 11:28:32 -04:00
2016-09-04 13:29:29 -07:00
2016-08-15 05:05:21 +03:00
2016-09-23 06:46:57 -04:00
2016-09-09 18:13:30 -07:00
2016-09-30 01:50:45 -04:00
2016-06-09 23:41:03 -07:00
2016-08-17 19:36:23 -04:00
2016-08-17 19:36:23 -04:00
2016-05-19 19:12:14 -07:00
2016-08-14 21:08:58 -07:00