Florian Westphal
160c4eb47d
netfilter: ebtables: reject blobs that don't provide all entry points
...
[ Upstream commit 7997eff828 ]
Harshit Mogalapalli says:
In ebt_do_table() function dereferencing 'private->hook_entry[hook]'
can lead to NULL pointer dereference. [..] Kernel panic:
general protection fault, probably for non-canonical address 0xdffffc0000000005: 0000 [#1 ] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f]
[..]
RIP: 0010:ebt_do_table+0x1dc/0x1ce0
Code: 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 5c 16 00 00 48 b8 00 00 00 00 00 fc ff df 49 8b 6c df 08 48 8d 7d 2c 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 88
[..]
Call Trace:
nf_hook_slow+0xb1/0x170
__br_forward+0x289/0x730
maybe_deliver+0x24b/0x380
br_flood+0xc6/0x390
br_dev_xmit+0xa2e/0x12c0
For some reason ebtables rejects blobs that provide entry points that are
not supported by the table, but what it should instead reject is the
opposite: blobs that DO NOT provide an entry point supported by the table.
t->valid_hooks is the bitmask of hooks (input, forward ...) that will see
packets. Providing an entry point that is not support is harmless
(never called/used), but the inverse isn't: it results in a crash
because the ebtables traverser doesn't expect a NULL blob for a location
its receiving packets for.
Instead of fixing all the individual checks, do what iptables is doing and
reject all blobs that differ from the expected hooks.
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Reported-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com >
Reported-by: syzkaller <syzkaller@googlegroups.com >
Signed-off-by: Florian Westphal <fw@strlen.de >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2022-09-05 10:27:41 +02:00
..
2021-04-07 14:47:41 +02:00
2022-06-14 18:11:59 +02:00
2020-07-22 09:33:13 +02:00
2022-08-25 11:18:04 +02:00
2021-06-16 11:59:44 +02:00
2022-03-16 13:21:46 +01:00
2021-05-11 14:04:03 +02:00
2022-06-14 18:12:03 +02:00
2021-03-30 14:35:28 +02:00
2021-04-21 12:56:16 +02:00
2022-09-05 10:27:41 +02:00
2021-04-28 13:19:14 +02:00
2021-09-15 09:47:27 +02:00
2020-10-01 13:18:18 +02:00
2022-05-09 09:03:28 +02:00
2021-05-14 09:44:20 +02:00
2022-05-25 09:14:34 +02:00
2022-08-25 11:17:26 +02:00
2021-05-07 10:51:36 +02:00
2022-03-19 13:40:15 +01:00
2020-10-01 13:17:47 +02:00
2021-07-14 16:53:48 +02:00
2022-07-29 17:14:18 +02:00
2022-04-15 14:18:01 +02:00
2022-05-25 09:14:38 +02:00
2021-09-15 09:47:39 +02:00
2022-06-14 18:11:34 +02:00
2022-08-25 11:17:18 +02:00
2020-12-16 10:56:58 +01:00
2020-09-09 19:12:34 +02:00
2021-09-26 14:07:10 +02:00
2022-07-21 20:59:17 +02:00
2020-07-22 09:32:49 +02:00
2021-02-17 10:35:16 +01:00
2020-12-16 10:56:59 +01:00
2021-01-23 15:57:55 +01:00
2021-09-30 10:09:25 +02:00
2021-05-26 12:05:20 +02:00
2021-11-17 09:48:25 +01:00
2022-06-16 13:23:32 +02:00
2022-06-22 14:11:12 +02:00
2021-03-09 11:09:38 +01:00
2020-09-23 12:40:47 +02:00
2020-10-01 13:17:21 +02:00
2022-06-25 12:44:35 +02:00
2021-08-18 08:57:03 +02:00
2022-07-07 17:36:49 +02:00
2021-01-19 18:26:13 +01:00
2020-07-29 10:18:29 +02:00
2022-05-25 09:14:38 +02:00
2021-03-11 14:06:50 +01:00
2022-06-14 18:11:33 +02:00
2021-05-19 10:08:30 +02:00
2021-10-27 09:54:27 +02:00
2021-09-15 09:47:33 +02:00
2022-04-27 13:50:45 +02:00
2021-04-07 14:47:43 +02:00
2020-09-03 11:27:09 +02:00
2022-07-12 16:30:47 +02:00
2021-11-17 09:48:20 +01:00
2020-10-14 10:32:56 +02:00
2022-01-20 09:19:17 +01:00
2021-01-30 13:54:11 +01:00
2021-09-12 08:56:38 +02:00
2022-02-01 17:24:39 +01:00
2022-02-23 11:59:56 +01:00
2020-10-07 08:01:29 +02:00
2022-01-27 09:19:43 +01:00
2020-11-05 11:43:36 +01:00
2021-09-15 09:47:26 +02:00
2021-06-30 08:47:52 -04:00
2021-09-22 12:26:37 +02:00
2022-06-22 14:11:12 +02:00
2020-08-11 15:33:38 +02:00
2020-09-23 12:40:38 +02:00
2021-05-19 10:08:22 +02:00
2021-03-04 10:26:53 +01:00
2022-03-23 09:12:07 +01:00
2021-03-30 14:35:25 +02:00
2020-07-22 09:32:49 +02:00
2021-08-18 08:57:01 +02:00
2021-02-03 23:26:01 +01:00
2020-07-29 10:18:44 +02:00
2021-05-19 10:08:30 +02:00
2021-12-01 09:23:35 +01:00
2022-04-15 14:18:32 +02:00
2021-08-18 08:57:02 +02:00
2020-12-11 13:23:30 +01:00
2020-06-24 17:50:48 +02:00
2020-07-16 08:16:44 +02:00
2021-01-09 13:44:54 +01:00
2022-05-09 09:03:22 +02:00
2022-07-02 16:28:50 +02:00
2021-03-04 10:26:29 +01:00
2022-08-25 11:18:04 +02:00
2020-10-14 10:33:05 +02:00
2021-12-08 09:01:10 +01:00
2021-02-07 15:35:49 +01:00
2022-08-25 11:18:16 +02:00
2021-11-17 09:48:17 +01:00
2020-11-10 12:37:24 +01:00
2021-09-22 12:26:20 +02:00
2020-09-09 19:12:29 +02:00
2021-11-17 09:48:16 +01:00
2022-06-14 18:11:42 +02:00
2021-04-21 12:56:18 +02:00
2022-05-25 09:14:32 +02:00
2021-10-09 14:39:49 +02:00
2022-01-05 12:37:44 +01:00
2021-08-26 08:36:22 -04:00
2021-09-22 12:26:43 +02:00
2020-10-07 08:01:25 +02:00
2021-05-19 10:08:31 +02:00
2022-07-29 17:14:18 +02:00
2022-07-29 17:14:18 +02:00
2021-06-30 08:47:51 -04:00
2022-05-15 19:54:46 +02:00
2020-07-29 10:18:36 +02:00
2021-05-11 14:04:04 +02:00
2021-08-18 08:57:03 +02:00
2021-03-30 14:35:29 +02:00
2020-10-14 10:33:00 +02:00
2022-05-18 09:47:24 +02:00
2022-04-15 14:17:56 +02:00
2020-11-18 19:20:17 +01:00
2020-11-18 19:20:17 +01:00
2020-12-02 08:49:44 +01:00
2022-04-15 14:18:35 +02:00
2020-10-01 13:17:52 +02:00
2022-08-25 11:18:37 +02:00
2020-10-07 08:01:30 +02:00
2022-06-14 18:12:02 +02:00
2021-12-08 09:01:08 +01:00
2021-01-06 14:48:37 +01:00
2021-09-03 10:08:12 +02:00
2021-09-03 10:08:12 +02:00
2020-10-29 09:57:51 +01:00
2020-10-29 09:57:52 +01:00
2021-06-30 08:47:55 -04:00
2022-08-25 11:17:25 +02:00
2021-09-26 14:07:05 +02:00
2022-04-15 14:18:15 +02:00
2022-01-20 09:19:18 +01:00
2020-12-30 11:50:53 +01:00
2021-05-19 10:08:20 +02:00
2022-06-22 14:11:16 +02:00
2020-12-30 11:50:55 +01:00
2021-01-12 20:16:10 +01:00
2022-02-05 12:35:36 +01:00
2022-02-05 12:35:36 +01:00
2021-06-23 14:41:26 +02:00
2022-06-14 18:11:24 +02:00
2020-11-01 12:01:06 +01:00
2022-06-22 14:11:19 +02:00
2022-06-29 08:58:45 +02:00
2021-03-04 10:26:47 +01:00
2022-07-29 17:14:17 +02:00
2020-08-05 09:59:47 +02:00
2021-06-30 08:47:52 -04:00
2021-11-17 09:48:44 +01:00
2022-07-12 16:30:49 +02:00
2021-01-09 13:44:55 +01:00
2022-09-05 10:27:39 +02:00
2022-06-06 08:33:48 +02:00
2020-12-30 11:51:21 +01:00
2020-10-01 13:17:25 +02:00
2022-06-22 14:11:16 +02:00
2021-09-22 12:26:41 +02:00
2021-04-14 08:24:12 +02:00
2021-05-14 09:44:33 +02:00
2021-06-23 14:41:25 +02:00
2022-05-25 09:14:38 +02:00
2021-03-17 17:03:56 +01:00
2022-02-16 12:52:50 +01:00
2021-03-07 12:20:49 +01:00
2020-11-24 13:29:04 +01:00
2021-03-07 12:20:48 +01:00
2020-07-31 18:39:31 +02:00
2022-03-02 11:41:04 +01:00
2021-09-26 14:07:10 +02:00
2021-03-24 11:26:44 +01:00
2021-09-16 12:56:13 +02:00
2022-06-22 14:11:15 +02:00
2022-03-08 19:07:48 +01:00
2022-08-25 11:18:11 +02:00
2020-08-19 08:16:27 +02:00
2020-12-30 11:51:21 +01:00
2021-07-14 16:53:08 +02:00
2021-05-14 09:44:22 +02:00
2022-07-29 17:14:20 +02:00
2020-12-11 13:23:28 +01:00
2021-03-30 14:35:22 +02:00
2021-02-17 10:35:19 +01:00
2021-03-24 11:26:40 +01:00
2022-03-16 13:21:48 +01:00
2021-12-29 12:23:34 +01:00
2020-10-07 08:01:24 +02:00
2022-03-16 13:21:48 +01:00
2022-08-25 11:17:29 +02:00
2021-06-10 13:37:14 +02:00
2020-08-11 15:33:39 +02:00
2021-03-07 12:20:49 +01:00