Prashant Bhole
155fb5c5fa
netfilter: fix null-ptr-deref in nf_nat_decode_session
Add null check for nat_hook in nf_nat_decode_session()
[ 195.648098] UBSAN: Undefined behaviour in ./include/linux/netfilter.h:348:14
[ 195.651366] BUG: KASAN: null-ptr-deref in __xfrm_policy_check+0x208/0x1d70
[ 195.653888] member access within null pointer of type 'struct nf_nat_hook'
[ 195.653896] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.17.0-rc6+ #5
[ 195.656320] Read of size 8 at addr 0000000000000008 by task ping/2469
[ 195.658715] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
[ 195.658721] Call Trace:
[ 195.661087]
[ 195.669341] <IRQ>
[ 195.670574] dump_stack+0xc6/0x150
[ 195.672156] ? dump_stack_print_info.cold.0+0x1b/0x1b
[ 195.674121] ? ubsan_prologue+0x31/0x92
[ 195.676546] ubsan_epilogue+0x9/0x49
[ 195.678159] handle_null_ptr_deref+0x11a/0x130
[ 195.679800] ? sprint_OID+0x1a0/0x1a0
[ 195.681322] __ubsan_handle_type_mismatch_v1+0xd5/0x11d
[ 195.683146] ? ubsan_prologue+0x92/0x92
[ 195.684642] __xfrm_policy_check+0x18ef/0x1d70
[ 195.686294] ? rt_cache_valid+0x118/0x180
[ 195.687804] ? __xfrm_route_forward+0x410/0x410
[ 195.689463] ? fib_multipath_hash+0x700/0x700
[ 195.691109] ? kvm_sched_clock_read+0x23/0x40
[ 195.692805] ? pvclock_clocksource_read+0xf6/0x280
[ 195.694409] ? graph_lock+0xa0/0xa0
[ 195.695824] ? pvclock_clocksource_read+0xf6/0x280
[ 195.697508] ? pvclock_read_flags+0x80/0x80
[ 195.698981] ? kvm_sched_clock_read+0x23/0x40
[ 195.700347] ? sched_clock+0x5/0x10
[ 195.701525] ? sched_clock_cpu+0x18/0x1a0
[ 195.702846] tcp_v4_rcv+0x1d32/0x1de0
[ 195.704115] ? lock_repin_lock+0x70/0x270
[ 195.707072] ? pvclock_read_flags+0x80/0x80
[ 195.709302] ? tcp_v4_early_demux+0x4b0/0x4b0
[ 195.711833] ? lock_acquire+0x195/0x380
[ 195.714222] ? ip_local_deliver_finish+0xfc/0x770
[ 195.716967] ? raw_rcv+0x2b0/0x2b0
[ 195.718856] ? lock_release+0xa00/0xa00
[ 195.720938] ip_local_deliver_finish+0x1b9/0x770
[...]
Fixes: 2c205dd398 ("netfilter: add struct nf_nat_hook and use it")
Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2018-06-12 19:12:43 +02:00
..
2018-05-14 07:05:16 -07:00
2018-05-10 10:15:05 +02:00
2018-05-30 12:48:49 -07:00
2018-05-29 10:15:33 +05:30
2018-05-25 18:23:56 +02:00
2018-05-28 23:05:11 -04:00
2018-05-23 14:01:03 +02:00
2018-06-09 10:32:39 -07:00
2018-05-13 15:59:01 +02:00
2018-05-16 07:24:30 +02:00
2018-06-09 12:11:09 -07:00
2018-05-10 16:08:25 -04:00
2018-06-07 13:04:07 -07:00
2018-06-06 18:39:49 -07:00
2018-06-08 10:39:20 -07:00
2018-06-11 14:24:32 -07:00
2018-04-24 10:29:16 +02:00
2018-05-21 18:07:05 +01:00
2018-05-17 16:11:39 -04:00
2018-06-09 10:32:39 -07:00
2018-04-25 23:11:47 +02:00
2018-06-05 10:48:09 -04:00
2018-06-07 14:23:08 +01:00
2018-06-07 17:34:35 -07:00
2018-06-06 18:39:49 -07:00
2018-05-11 21:48:07 +05:30
2018-05-11 11:34:41 +09:00
2018-04-16 14:20:26 -04:00
2018-06-06 09:08:38 -07:00
2018-06-08 11:10:58 -07:00
2018-06-02 19:29:27 -05:00
2018-05-26 09:16:44 +02:00
2018-05-31 17:34:01 +01:00
2018-05-16 07:23:35 +02:00
2018-04-27 09:48:44 +02:00
2018-05-14 17:45:21 -04:00
2018-04-20 17:18:35 -07:00
2018-04-20 17:18:35 -07:00
2018-05-23 13:23:39 -04:00
2018-06-08 13:36:19 -07:00
2018-06-02 20:35:00 -06:00
2018-05-30 10:43:58 -06:00
2018-05-30 15:33:32 -06:00
2018-05-30 12:38:40 +02:00
2018-04-30 10:55:56 +02:00
2018-05-30 12:38:40 +02:00
2018-05-26 19:46:15 -04:00
2018-05-28 17:41:02 +02:00
2018-06-03 18:22:41 -07:00
2018-05-23 13:23:40 -04:00
2018-06-05 09:43:09 -04:00
2018-05-29 13:00:25 -06:00
2018-05-29 13:00:25 -06:00
2018-05-09 17:25:13 +02:00
2018-06-01 18:37:33 -07:00
2018-06-05 18:06:24 +01:00
2018-04-12 19:02:45 +02:00
2018-04-26 14:29:05 -07:00
2018-04-26 14:29:05 -07:00
2018-06-09 12:06:24 -07:00
2018-04-19 13:30:14 +02:00
2018-06-04 20:27:54 -07:00
2018-05-31 16:41:41 -07:00
2018-05-31 16:41:41 -07:00
2018-05-31 16:41:41 -07:00
2018-06-04 17:28:20 -04:00
2018-04-11 10:28:38 -07:00
2018-04-19 12:29:41 -03:00
2018-05-14 16:19:59 +02:00
2018-05-14 08:57:47 +02:00
2018-05-03 13:55:47 +02:00
2018-05-23 10:37:08 +02:00
2018-05-30 23:13:00 +02:00
2018-05-14 13:46:04 -04:00
2018-06-08 17:21:52 -07:00
2018-05-11 15:36:37 -04:00
2018-04-27 14:34:51 +02:00
2018-05-22 23:18:31 -07:00
2018-06-06 17:27:14 -07:00
2018-05-08 13:02:42 +02:00
2018-05-19 08:46:12 +02:00
2018-05-03 12:38:39 +02:00
2018-05-13 15:59:00 +02:00
2018-05-28 12:48:25 +02:00
2018-05-19 08:46:12 +02:00
2018-05-14 08:57:48 +02:00
2018-06-01 07:38:16 -06:00
2018-04-27 11:53:02 -04:00
2018-05-17 22:44:57 +09:00
2018-06-03 07:46:56 -07:00
2018-05-14 16:44:41 +02:00
2018-06-08 10:00:20 -07:00
2018-05-20 16:20:59 -04:00
2018-05-20 16:21:03 -04:00
2018-04-25 21:23:38 -07:00
2018-04-26 09:02:01 -06:00
2018-06-07 17:34:38 -07:00
2018-06-08 10:25:50 +02:00
2018-06-07 17:34:37 -07:00
2018-05-18 21:51:37 +02:00
2018-04-26 14:53:32 +02:00
2018-06-10 13:01:12 -07:00
2018-06-04 10:58:12 -07:00
2018-04-11 10:28:39 -07:00
2018-05-25 14:37:20 -04:00
2018-04-25 08:26:19 -07:00
2018-04-17 10:50:28 -04:00
2018-06-03 11:00:52 -04:00
2018-05-29 10:12:45 -04:00
2018-05-15 16:34:52 +02:00
2018-05-14 11:25:28 +02:00
2018-06-01 18:37:33 -07:00
2018-05-09 06:55:44 +02:00
2018-06-04 14:20:39 -04:00
2018-05-09 12:21:46 -05:00
2018-04-18 10:23:06 -05:00
2018-05-14 11:25:27 +02:00
2018-04-26 22:26:39 +02:00
2018-06-10 09:44:53 -07:00
2018-05-13 15:59:00 +02:00
2018-05-14 13:46:04 -04:00
2018-06-09 10:32:39 -07:00
2018-04-13 17:10:28 -07:00
2018-04-12 19:02:45 +02:00
2018-06-07 17:34:36 -07:00
2018-05-03 07:38:05 +02:00
2018-05-11 11:21:10 +02:00
2018-06-10 13:01:12 -07:00
2018-06-01 07:43:53 -06:00
2018-04-17 13:42:48 +02:00
2018-04-12 09:41:19 -07:00
2018-04-20 15:57:32 -04:00
2018-05-04 12:48:54 -07:00
2018-04-19 15:59:10 -04:00
2018-04-19 15:59:11 -04:00
2018-06-05 08:50:16 -04:00
2018-06-07 17:34:38 -07:00
2018-06-07 17:34:35 -07:00
2018-06-07 17:34:36 -07:00
2018-05-14 13:14:23 -06:00
2018-06-08 17:21:52 -07:00
2018-04-21 16:32:48 -04:00
2018-06-07 17:34:37 -07:00
2018-06-08 17:21:52 -07:00
2018-04-16 14:18:15 -06:00
2018-05-11 12:13:26 +09:00
2018-06-07 17:34:39 -07:00
2018-06-05 12:26:41 -04:00
2018-05-13 15:58:59 +02:00
2018-05-15 08:11:15 +02:00
2018-04-24 10:15:07 -04:00
2018-06-06 18:39:49 -07:00
2018-05-23 14:48:44 -04:00
2018-06-05 12:42:19 -04:00
2018-06-12 19:12:43 +02:00
2018-05-25 18:12:11 -07:00
2018-05-05 00:51:44 +02:00
2018-05-30 10:11:34 +02:00
2018-05-14 16:27:08 +02:00
2018-06-01 14:37:35 +02:00
2018-05-14 16:20:48 +02:00
2018-05-02 08:31:07 -07:00
2018-05-03 16:25:08 +02:00
2018-05-30 11:35:13 -05:00
2018-04-20 10:47:33 -04:00
2018-05-11 17:28:45 -07:00
2018-06-05 12:16:51 -07:00
2018-06-07 17:34:36 -07:00
2018-06-07 17:34:37 -07:00
2018-04-11 10:28:39 -07:00
2018-06-04 12:08:06 -05:00
2018-06-06 16:10:45 -05:00
2018-05-30 11:35:23 -05:00
2018-05-15 15:51:38 +01:00
2018-05-18 16:40:50 +01:00
2018-06-07 12:45:58 -07:00
2018-05-16 11:45:16 +02:00
2018-06-06 18:39:49 -07:00
2018-06-07 17:34:35 -07:00
2018-05-24 15:35:58 -04:00
2018-05-09 11:51:46 +10:00
2018-05-30 15:33:32 -06:00
2018-05-03 16:22:18 +02:00
2018-05-30 13:51:51 +02:00
2018-05-09 10:15:21 +05:30
2018-05-27 12:10:32 +02:00
2018-05-26 09:16:44 +02:00
2018-05-24 18:14:27 +02:00
2018-05-16 07:24:30 +02:00
2018-05-17 12:47:21 +02:00
2018-05-31 00:13:56 +08:00
2018-04-25 10:40:51 -05:00
2018-04-11 10:28:39 -07:00
2018-05-11 17:28:45 -07:00
2018-05-11 17:28:45 -07:00
2018-06-10 06:14:01 +02:00
2018-05-22 16:12:26 -07:00
2018-05-22 16:12:26 -07:00
2018-05-25 18:35:59 +01:00
2018-04-25 16:43:55 -07:00
2018-04-19 13:32:03 +02:00
2018-04-24 13:21:45 -04:00
2018-06-04 17:28:20 -04:00
2018-04-24 19:50:10 -07:00
2018-05-16 21:08:42 +02:00
2018-05-16 11:45:16 +02:00
2018-05-24 11:00:39 -06:00
2018-06-06 11:58:31 +02:00
2018-05-05 00:51:44 +02:00
2018-05-04 12:48:54 -07:00
2018-05-16 07:24:30 +02:00
2018-04-23 10:16:50 +02:00
2018-04-30 05:14:55 -07:00
2018-04-13 17:10:28 -07:00
2018-06-07 17:34:35 -07:00
2018-04-16 02:06:47 -04:00
2018-04-26 19:51:14 -05:00
2018-05-17 12:46:54 -04:00
2018-06-06 18:39:49 -07:00
2018-06-07 17:34:34 -07:00
2018-06-05 12:16:51 -07:00
2018-06-07 17:34:37 -07:00
2018-04-24 11:15:32 -04:00
2018-05-03 15:55:23 -07:00
2018-05-05 11:41:58 -04:00
2018-05-15 08:11:15 +02:00
2018-05-15 10:27:56 -07:00
2018-05-30 10:11:34 +02:00
2018-05-30 10:11:34 +02:00
2018-05-15 08:32:42 +02:00
2018-04-28 15:01:14 -07:00
2018-06-04 17:45:38 -07:00
2018-04-16 14:25:08 -06:00
2018-06-06 11:58:31 +02:00
2018-05-18 11:40:27 -04:00
2018-04-16 18:53:13 -04:00
2018-04-20 17:18:35 -07:00
2018-04-18 10:07:13 -07:00
2018-05-19 13:57:31 +02:00
2018-05-19 13:57:31 +02:00
2018-04-19 13:31:39 +02:00
2018-04-26 14:53:32 +02:00
2018-05-19 13:57:32 +02:00
2018-05-19 13:57:33 +02:00
2018-04-17 17:18:04 +02:00
2018-04-29 08:45:53 -07:00
2018-06-06 18:39:49 -07:00
2018-04-25 10:40:51 -05:00
2018-05-16 07:24:30 +02:00
2018-06-05 16:14:12 -07:00
2018-06-07 17:34:38 -07:00
2018-05-07 23:25:24 -04:00
2018-04-26 15:08:04 -04:00
2018-05-14 16:16:35 +02:00
2018-05-22 23:17:03 -07:00
2018-05-23 13:23:39 -04:00
2018-05-31 12:48:17 +02:00
2018-06-07 17:34:38 -07:00
2018-04-23 13:41:55 +02:00
2018-06-07 16:15:38 -04:00
2018-04-25 20:33:19 +03:00
2018-06-05 12:16:51 -07:00
2018-05-03 09:25:47 -06:00
2018-05-18 08:47:13 -07:00
2018-04-11 10:28:39 -07:00
2018-05-14 09:51:34 -04:00