[moderation] [netfilter?] KASAN: slab-out-of-bounds Read in nft_fib6_eval

0 views
Skip to first unread message

syzbot

unread,
6:38 AM (6 hours ago) 6:38 AM
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 1d5dcaa3bd65 Merge tag 'probes-fixes-v7.1-rc3' of git://gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=170dae36580000
kernel config: https://syzkaller.appspot.com/x/.config?x=59da38148f3a3d24
dashboard link: https://syzkaller.appspot.com/bug?extid=84967abafb4fcdab7355
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
CC: [core...@netfilter.org da...@davemloft.net edum...@google.com f...@strlen.de ho...@kernel.org ku...@kernel.org linux-...@vger.kernel.org net...@vger.kernel.org netfilt...@vger.kernel.org pab...@redhat.com pa...@netfilter.org ph...@nwl.cc]

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-1d5dcaa3.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7c0e0b3b27ed/vmlinux-1d5dcaa3.xz
kernel image: https://storage.googleapis.com/syzbot-assets/38af7cda93bd/bzImage-1d5dcaa3.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+84967a...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-out-of-bounds in fib6_info_nh_dev include/net/nexthop.h:536 [inline]
BUG: KASAN: slab-out-of-bounds in nft_fib6_info_nh_uses_dev net/ipv6/netfilter/nft_fib_ipv6.c:174 [inline]
BUG: KASAN: slab-out-of-bounds in nft_fib6_eval+0x1673/0x17e0 net/ipv6/netfilter/nft_fib_ipv6.c:231
Read of size 8 at addr ffff88802d122cd0 by task syz.1.5562/25780

CPU: 3 UID: 0 PID: 25780 Comm: syz.1.5562 Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1d0 mm/kasan/report.c:595
fib6_info_nh_dev include/net/nexthop.h:536 [inline]
nft_fib6_info_nh_uses_dev net/ipv6/netfilter/nft_fib_ipv6.c:174 [inline]
nft_fib6_eval+0x1673/0x17e0 net/ipv6/netfilter/nft_fib_ipv6.c:231
nft_fib_inet_eval+0x200/0x250 net/netfilter/nft_fib_inet.c:34
expr_call_ops_eval net/netfilter/nf_tables_core.c:237 [inline]
nft_do_chain+0x2e5/0x1990 net/netfilter/nf_tables_core.c:285
nft_do_chain_inet+0xf3/0x400 net/netfilter/nft_chain_filter.c:162
nf_hook_entry_hookfn include/linux/netfilter.h:158 [inline]
nf_hook_slow+0xbf/0x220 net/netfilter/core.c:619
nf_hook.constprop.0+0x2a6/0x750 include/linux/netfilter.h:273
NF_HOOK include/linux/netfilter.h:316 [inline]
ipv6_rcv+0xa4/0x3d0 net/ipv6/ip6_input.c:351
__netif_receive_skb_one_core+0x12d/0x1e0 net/core/dev.c:6202
__netif_receive_skb+0x1f/0x120 net/core/dev.c:6315
netif_receive_skb_internal net/core/dev.c:6401 [inline]
netif_receive_skb+0x13b/0x7f0 net/core/dev.c:6460
tun_rx_batched.isra.0+0x3f6/0x750 drivers/net/tun.c:1511
tun_get_user+0x1e31/0x3c20 drivers/net/tun.c:1955
tun_chr_write_iter+0xdc/0x200 drivers/net/tun.c:2001
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x6ac/0x1070 fs/read_write.c:688
ksys_write+0x12a/0x250 fs/read_write.c:740
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f2fea15d68e
Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08
RSP: 002b:00007f2feafd4fb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f2feafd56c0 RCX: 00007f2fea15d68e
RDX: 000000000000004e RSI: 00002000000000c0 RDI: 00000000000000c8
RBP: 00007f2fea232d6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f2fea416038 R14: 00007f2fea415fa0 R15: 00007ffc0a9bb8d8
</TASK>

Allocated by task 24700:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415
kmalloc_noprof include/linux/slab.h:950 [inline]
kzalloc_noprof include/linux/slab.h:1188 [inline]
nexthop_alloc+0x3c/0x1f0 net/ipv4/nexthop.c:536
nexthop_create net/ipv4/nexthop.c:2918 [inline]
nexthop_add net/ipv4/nexthop.c:2985 [inline]
rtm_new_nexthop+0x1e8b/0x8760 net/ipv4/nexthop.c:3299
rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6996
netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2550
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1344
netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1894
sock_sendmsg_nosec net/socket.c:787 [inline]
__sock_sendmsg net/socket.c:802 [inline]
____sys_sendmsg+0x9e1/0xb70 net/socket.c:2698
___sys_sendmsg+0x190/0x1e0 net/socket.c:2752
__sys_sendmsg+0x170/0x220 net/socket.c:2784
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff88802d122c00
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 8 bytes to the right of
allocated 200-byte region [ffff88802d122c00, ffff88802d122cc8)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d122
head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801b842b40 dead000000000100 dead000000000122
raw: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b842b40 dead000000000100 dead000000000122
head: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000
head: 00fff00000000001 ffffffffffffff81 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 23545, tgid 23545 (syz-executor), ts 408402495972, free_ts 403609280770
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x153/0x170 mm/page_alloc.c:1858
prep_new_page mm/page_alloc.c:1866 [inline]
get_page_from_freelist+0x11a6/0x33b0 mm/page_alloc.c:3946
__alloc_frozen_pages_noprof+0x27c/0x2bc0 mm/page_alloc.c:5226
alloc_slab_page mm/slub.c:3278 [inline]
allocate_slab mm/slub.c:3467 [inline]
new_slab+0xa6/0x6c0 mm/slub.c:3525
refill_objects+0x277/0x420 mm/slub.c:7255
refill_sheaf mm/slub.c:2816 [inline]
__pcs_replace_empty_main+0x375/0x650 mm/slub.c:4651
alloc_from_pcs mm/slub.c:4749 [inline]
slab_alloc_node mm/slub.c:4883 [inline]
__do_kmalloc_node mm/slub.c:5294 [inline]
__kmalloc_noprof+0x688/0x850 mm/slub.c:5307
kmalloc_noprof include/linux/slab.h:954 [inline]
kmalloc_array_noprof include/linux/slab.h:1097 [inline]
security_inode_init_security+0x113/0x370 security/security.c:1347
shmem_symlink+0x163/0xa00 mm/shmem.c:4098
vfs_symlink fs/namei.c:5643 [inline]
vfs_symlink+0x178/0x4d0 fs/namei.c:5622
filename_symlinkat+0x2a6/0x560 fs/namei.c:5668
__do_sys_symlinkat fs/namei.c:5688 [inline]
__se_sys_symlinkat fs/namei.c:5683 [inline]
__x64_sys_symlinkat+0x9c/0xe0 fs/namei.c:5683
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 5737 tgid 5737 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1402 [inline]
__free_frozen_pages+0x747/0x1040 mm/page_alloc.c:2943
kasan_depopulate_vmalloc_pte+0x5d/0x80 mm/kasan/shadow.c:484
apply_to_pte_range mm/memory.c:3322 [inline]
apply_to_pmd_range mm/memory.c:3366 [inline]
apply_to_pud_range mm/memory.c:3402 [inline]
apply_to_p4d_range mm/memory.c:3438 [inline]
__apply_to_page_range+0xb1d/0x1520 mm/memory.c:3474
__kasan_release_vmalloc+0xd7/0xe0 mm/kasan/shadow.c:602
kasan_release_vmalloc include/linux/kasan.h:593 [inline]
kasan_release_vmalloc_node mm/vmalloc.c:2284 [inline]
purge_vmap_node+0x210/0xb40 mm/vmalloc.c:2306
__purge_vmap_area_lazy+0x91b/0xc00 mm/vmalloc.c:2396
drain_vmap_area_work+0x27/0x40 mm/vmalloc.c:2430
process_one_work+0xa0e/0x1980 kernel/workqueue.c:3302
process_scheduled_works kernel/workqueue.c:3385 [inline]
worker_thread+0x5ef/0xe50 kernel/workqueue.c:3466
kthread+0x370/0x450 kernel/kthread.c:436
ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Memory state around the buggy address:
ffff88802d122b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802d122c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88802d122c80: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
^
ffff88802d122d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802d122d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages