summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc
diff options
context:
space:
mode:
authorFernando Fernandez Mancera <fmancera@suse.de>2026-10-26 13:07:10 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2026-11-05 13:31:11 +0100
commit364b200285bb2cc518e3c5efe6591951c05b8e01 (patch)
treeff230cb43229a25987feee3bd81dea294f6991db /rust/kernel/alloc
parent683ff28ab18accb25268741a724645eee839d41a (diff)
netfilter: x_tables: check target name before accessing verdict
Non-standard targets may contain only struct xt_entry_target. mark_source_chains() nevertheless reads the target as an xt_standard_target before checking its name, potentially reading four bytes beyond a header-only target. Check that the target is standard before reading its verdict. Non-standard targets remain handled as fallthrough rules. See the following KASAN trace: BUG: KASAN: slab-out-of-bounds in translate_table+0x1660/0x1a40 [ip6_tables] Read of size 4 at addr ffff88800ed56ff8 by task rep/432 Call Trace: kasan_report+0xfa/0x120 translate_table+0x1660/0x1a40 [ip6_tables] do_ip6t_set_ctl+0x667/0xa76 [ip6_tables] nf_setsockopt+0x77/0xd0 do_sock_setsockopt+0x118/0x490 __sys_setsockopt+0xe4/0x160 __x64_sys_setsockopt+0xbd/0x190 do_syscall_64+0xde/0x4f0 entry_SYSCALL_64_after_hwframe+0x77/0x7f Allocated by task 432: kasan_save_stack+0x2f/0x50 __kasan_kmalloc+0x7f/0x90 __kvmalloc_node_noprof+0x1b1/0x5c0 xt_alloc_table_info+0x3c/0xa0 do_ip6t_set_ctl+0x5ee/0xa76 [ip6_tables] nf_setsockopt+0x77/0xd0 do_sock_setsockopt+0x118/0x490 __sys_setsockopt+0xe4/0x160 __x64_sys_setsockopt+0xbd/0x190 do_syscall_64+0xde/0x4f0 entry_SYSCALL_64_after_hwframe+0x77/0x7f Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: VEGA <vega@nebusec.ai> Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'rust/kernel/alloc')
0 files changed, 0 insertions, 0 deletions