D. Wythe
1834d62ae8
netfilter: bpf: fix bad registration on nf_defrag
...
We should pass a pointer to global_hook to the get_proto_defrag_hook()
instead of its value, since the passed value won't be updated even if
the request module was loaded successfully.
Log:
[ 54.915713] nf_defrag_ipv4 has bad registration
[ 54.915779] WARNING: CPU: 3 PID: 6323 at net/netfilter/nf_bpf_link.c:62 get_proto_defrag_hook+0x137/0x160
[ 54.915835] CPU: 3 PID: 6323 Comm: fentry Kdump: loaded Tainted: G E 6.7.0-rc2+ #35
[ 54.915839] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
[ 54.915841] RIP: 0010:get_proto_defrag_hook+0x137/0x160
[ 54.915844] Code: 4f 8c e8 2c cf 68 ff 80 3d db 83 9a 01 00 0f 85 74 ff ff ff 48 89 ee 48 c7 c7 8f 12 4f 8c c6 05 c4 83 9a 01 01 e8 09 ee 5f ff <0f> 0b e9 57 ff ff ff 49 8b 3c 24 4c 63 e5 e8 36 28 6c ff 4c 89 e0
[ 54.915849] RSP: 0018:ffffb676003fbdb0 EFLAGS: 00010286
[ 54.915852] RAX: 0000000000000023 RBX: ffff9596503d5600 RCX: ffff95996fce08c8
[ 54.915854] RDX: 00000000ffffffd8 RSI: 0000000000000027 RDI: ffff95996fce08c0
[ 54.915855] RBP: ffffffff8c4f12de R08: 0000000000000000 R09: 00000000fffeffff
[ 54.915859] R10: ffffb676003fbc70 R11: ffffffff8d363ae8 R12: 0000000000000000
[ 54.915861] R13: ffffffff8e1f75c0 R14: ffffb676003c9000 R15: 00007ffd15e78ef0
[ 54.915864] FS: 00007fb6e9cab740(0000) GS:ffff95996fcc0000(0000) knlGS:0000000000000000
[ 54.915867] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 54.915868] CR2: 00007ffd15e75c40 CR3: 0000000101e62006 CR4: 0000000000360ef0
[ 54.915870] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 54.915871] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 54.915873] Call Trace:
[ 54.915891] <TASK>
[ 54.915894] ? __warn+0x84/0x140
[ 54.915905] ? get_proto_defrag_hook+0x137/0x160
[ 54.915908] ? __report_bug+0xea/0x100
[ 54.915925] ? report_bug+0x2b/0x80
[ 54.915928] ? handle_bug+0x3c/0x70
[ 54.915939] ? exc_invalid_op+0x18/0x70
[ 54.915942] ? asm_exc_invalid_op+0x1a/0x20
[ 54.915948] ? get_proto_defrag_hook+0x137/0x160
[ 54.915950] bpf_nf_link_attach+0x1eb/0x240
[ 54.915953] link_create+0x173/0x290
[ 54.915969] __sys_bpf+0x588/0x8f0
[ 54.915974] __x64_sys_bpf+0x20/0x30
[ 54.915977] do_syscall_64+0x45/0xf0
[ 54.915989] entry_SYSCALL_64_after_hwframe+0x6e/0x76
[ 54.915998] RIP: 0033:0x7fb6e9daa51d
[ 54.916001] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 2b 89 0c 00 f7 d8 64 89 01 48
[ 54.916003] RSP: 002b:00007ffd15e78ed8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
[ 54.916006] RAX: ffffffffffffffda RBX: 00007ffd15e78fc0 RCX: 00007fb6e9daa51d
[ 54.916007] RDX: 0000000000000040 RSI: 00007ffd15e78ef0 RDI: 000000000000001c
[ 54.916009] RBP: 000000000000002d R08: 00007fb6e9e73a60 R09: 0000000000000001
[ 54.916010] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000006
[ 54.916012] R13: 0000000000000006 R14: 0000000000000000 R15: 0000000000000000
[ 54.916014] </TASK>
[ 54.916015] ---[ end trace 0000000000000000 ]---
Fixes: 91721c2d02d3 ("netfilter: bpf: Support BPF_F_NETFILTER_IP_DEFRAG in netfilter link")
Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
Acked-by: Daniel Xu <dxu@dxuuu.xyz>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2023-12-06 17:14:26 +01:00
..
2023-11-14 16:16:21 +01:00
2023-11-08 13:52:33 +01:00
2023-10-18 10:26:43 +02:00
2023-04-21 11:34:14 -07:00
2023-04-21 11:34:14 -07:00
2023-12-06 17:14:26 +01:00
2022-05-16 13:05:40 +02:00
2022-02-04 06:30:28 +01:00
2023-11-01 22:33:53 -07:00
2023-11-08 13:52:32 +01:00
2023-10-18 10:26:43 +02:00
2023-02-22 00:28:47 +01:00
2023-07-20 10:06:36 +02:00
2023-09-13 21:57:50 +02:00
2022-09-20 23:50:03 +02:00
2020-07-22 01:18:05 +02:00
2022-08-11 16:50:49 +02:00
2023-10-10 16:34:28 +02:00
2022-09-07 15:55:23 +02:00
2023-10-24 13:16:30 +02:00
2022-01-11 10:41:44 +01:00
2023-11-08 13:52:32 +01:00
2023-03-08 14:25:41 +01:00
2022-07-11 16:25:15 +02:00
2023-07-27 13:45:51 +02:00
2023-07-05 14:42:15 +02:00
2021-06-18 14:47:43 +02:00
2022-11-30 23:01:20 +01:00
2023-10-04 14:12:01 +02:00
2023-10-10 16:34:28 +02:00
2023-02-01 12:18:51 +01:00
2023-11-08 13:52:32 +01:00
2022-08-11 16:50:25 +02:00
2022-02-04 06:30:28 +01:00
2023-06-26 17:18:48 +02:00
2023-08-15 15:26:17 -07:00
2022-07-11 16:25:15 +02:00
2022-02-04 06:30:28 +01:00
2022-06-21 10:50:41 +02:00
2023-10-25 11:35:46 +02:00
2023-02-03 09:31:24 +00:00
2023-06-15 22:19:41 -07:00
2023-07-31 09:11:24 +01:00
2022-07-11 16:25:14 +02:00
2021-08-30 01:51:36 +02:00
2020-05-27 22:20:34 +02:00
2023-02-01 20:54:27 -08:00
2023-08-15 15:26:17 -07:00
2022-09-07 16:46:04 +02:00
2023-11-01 22:33:53 -07:00
2023-11-08 13:52:32 +01:00
2022-09-07 16:46:04 +02:00
2022-11-18 02:15:15 +01:00
2022-09-07 16:46:04 +02:00
2022-05-13 18:56:27 +02:00
2022-12-12 10:14:03 +00:00
2023-10-30 14:36:57 -07:00
2023-11-08 16:40:30 +01:00
2022-09-07 16:46:04 +02:00
2022-03-01 11:51:15 +01:00
2020-07-24 15:41:54 -07:00
2023-10-23 09:35:01 +01:00
2023-11-14 16:16:21 +01:00
2023-10-18 10:26:43 +02:00
2023-07-31 09:11:24 +01:00
2023-10-18 10:26:43 +02:00
2021-05-29 01:04:53 +02:00
2022-07-11 16:25:15 +02:00
2022-06-17 23:31:20 +02:00
2023-04-21 11:34:14 -07:00
2023-10-12 10:28:45 +02:00
2023-11-08 13:52:32 +01:00
2023-10-18 10:26:43 +02:00
2023-06-08 04:00:02 +02:00
2023-06-26 12:59:18 -07:00
2023-11-14 16:16:21 +01:00
2023-05-10 08:50:18 +02:00
2023-11-08 13:52:32 +01:00
2021-05-29 01:04:54 +02:00
2023-07-31 09:11:24 +01:00
2022-11-15 10:46:34 +01:00
2022-11-15 10:46:34 +01:00
2022-11-15 10:53:17 +01:00
2023-05-03 13:49:08 +02:00
2023-08-22 15:13:21 +02:00
2022-11-15 10:46:34 +01:00
2023-10-24 13:16:30 +02:00
2023-09-06 18:03:02 +02:00
2022-03-20 00:29:47 +01:00
2022-03-20 00:29:47 +01:00
2023-11-08 13:52:32 +01:00
2023-07-05 14:42:15 +02:00
2023-11-08 13:52:32 +01:00
2023-06-26 08:05:57 +02:00
2023-07-26 16:48:49 +02:00
2023-10-12 10:28:45 +02:00
2023-03-01 17:23:23 +01:00
2022-11-15 10:46:34 +01:00
2022-11-15 10:46:34 +01:00
2023-07-27 13:45:51 +02:00
2023-07-27 13:45:51 +02:00
2023-11-14 16:16:21 +01:00
2023-07-27 13:45:51 +02:00
2022-11-15 10:46:34 +01:00
2023-07-05 14:42:15 +02:00
2023-08-22 15:13:21 +02:00
2023-10-12 10:28:45 +02:00
2022-11-15 10:46:34 +01:00
2023-03-01 17:23:23 +01:00
2023-06-26 08:05:57 +02:00
2023-07-27 13:45:51 +02:00
2022-03-20 00:29:46 +01:00
2022-03-20 00:29:46 +01:00
2023-06-26 08:05:57 +02:00
2023-06-26 08:05:57 +02:00
2023-10-24 13:37:46 +02:00
2023-10-24 13:37:46 +02:00
2021-12-24 16:58:17 +01:00
2021-05-29 01:04:27 +02:00
2023-10-24 13:37:46 +02:00
2023-10-24 13:16:30 +02:00
2023-11-14 16:10:20 +01:00
2023-07-29 18:13:41 +01:00
2022-11-15 10:46:34 +01:00
2023-06-26 08:05:57 +02:00
2023-06-26 08:05:57 +02:00
2023-06-26 08:05:57 +02:00
2023-03-08 14:25:40 +01:00
2023-08-22 15:13:21 +02:00
2021-06-01 23:53:51 +02:00
2021-08-17 00:45:07 +02:00
2022-07-11 16:40:45 +02:00
2022-11-18 15:21:00 +01:00
2020-07-29 20:09:18 +02:00
2022-07-11 16:25:15 +02:00
2022-07-11 16:40:45 +02:00
2022-01-22 08:33:37 +02:00
2020-08-28 19:55:51 +02:00
2023-03-17 15:16:33 +01:00
2023-05-25 12:16:27 +01:00
2023-02-22 21:25:23 -08:00
2021-05-29 01:04:52 +02:00
2021-09-21 03:46:56 +02:00
2020-06-25 00:50:31 +02:00
2020-12-01 09:45:29 +01:00
2021-09-21 03:46:56 +02:00
2023-06-20 22:43:42 +02:00
2022-09-07 16:46:03 +02:00
2023-11-08 13:53:36 +01:00
2023-03-22 21:48:59 +01:00
2023-08-22 15:13:21 +02:00
2023-08-30 17:34:01 +02:00
2021-05-03 23:02:44 +02:00
2023-07-29 18:13:41 +01:00
2022-10-11 17:42:58 -06:00
2022-07-11 16:40:45 +02:00
2023-03-22 21:48:59 +01:00
2020-07-29 20:09:18 +02:00
2022-07-21 00:56:00 +02:00
2021-03-31 22:34:10 +02:00
2023-08-30 17:34:01 +02:00