syzbot


KASAN: stack-out-of-bounds Read in do_page_fault

Status: auto-obsoleted due to no activity on 2023/04/15 09:50
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+40eeb08125a156f7b51d@syzkaller.appspotmail.com
First crash: 490d, last: 490d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 KASAN: use-after-free Read in do_page_fault C 10 1d19h 24d 0/2 upstream: reported C repro on 2024/04/25 07:38
upstream KASAN: global-out-of-bounds Read in do_page_fault riscv 1 628d 624d 0/26 auto-obsoleted due to no activity on 2022/11/28 23:54

Sample crash report:
BUG: MAX_LOCK_DEPTH too low!
turning off the locking correctness validator.
depth: 162675826  max: 48!
162675826 locks held by syz-executor.0/2053:
 #0: ffffffff855cf108
 (rtnl_mutex
){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:72 [inline]
){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x2fe/0x9a0 net/core/rtnetlink.c:5589
 #1: ffffffff8568feb0
 (
(inetaddr_chain).rwsem){++++}-{3:3}, at: blocking_notifier_call_chain kernel/notifier.c:318 [inline]
(inetaddr_chain).rwsem){++++}-{3:3}, at: blocking_notifier_call_chain+0x42/0x78 kernel/notifier.c:307
 #2: ffffffff84c3a9c8
 (remove_cache_srcu){....}-{0:0}
, at: kasan_quarantine_reduce+0x46/0x1c8 mm/kasan/quarantine.c:285
 #3: ffffffff84b73e00 (rcu_read_lock){....}-{1:2}, at: INIT_LIST_HEAD include/linux/list.h:38 [inline]
 #3: ffffffff84b73e00 (rcu_read_lock){....}-{1:2}, at: list_splice_init include/linux/list.h:492 [inline]
 #3: ffffffff84b73e00 (rcu_read_lock){....}-{1:2}, at: netif_receive_skb_list_internal+0x244/0x816 net/core/dev.c:5568
==================================================================
BUG: KASAN: stack-out-of-bounds in do_page_fault+0x46/0xa3c arch/riscv/mm/fault.c:221
Read of size 8 at addr ffffaf8009b23aa8 by task syz-executor.0/2053

CPU: 0 PID: 2053 Comm: syz-executor.0 Tainted: G      D           5.17.0-rc1-syzkaller-00002-g0966d385830d #0
Hardware name: riscv-virtio,qemu (DT)
Call Trace:
[<ffffffff8000a228>] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:113
[<ffffffff831668cc>] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:119
[<ffffffff831756ba>] __dump_stack lib/dump_stack.c:88 [inline]
[<ffffffff831756ba>] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:106
[<ffffffff8047479e>] print_address_description.constprop.0+0x2a/0x330 mm/kasan/report.c:255
[<ffffffff80474d4c>] __kasan_report mm/kasan/report.c:442 [inline]
[<ffffffff80474d4c>] kasan_report+0x184/0x1e0 mm/kasan/report.c:459
[<ffffffff80475b20>] check_region_inline mm/kasan/generic.c:183 [inline]
[<ffffffff80475b20>] __asan_load8+0x6e/0x96 mm/kasan/generic.c:256
[<ffffffff800115cc>] do_page_fault+0x46/0xa3c arch/riscv/mm/fault.c:221
[<ffffffff80005724>] ret_from_exception+0x0/0x10

The buggy address belongs to the page:
page:ffffaf807a9031d8 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x89d23
flags: 0x8800000000(section=17|node=0|zone=0)
raw: 0000008800000000 0000000000000000 ffffaf807a9031e0 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
raw: 00000000000007ff
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x400dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO), pid 2018, ts 1296101997600, free_ts 1137902632600
 __set_page_owner+0x48/0x136 mm/page_owner.c:183
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0xd0/0x10a mm/page_alloc.c:2427
 prep_new_page mm/page_alloc.c:2434 [inline]
 get_page_from_freelist+0x8da/0x12d8 mm/page_alloc.c:4165
 __alloc_pages+0x150/0x3b6 mm/page_alloc.c:5389
 __alloc_pages_node include/linux/gfp.h:572 [inline]
 alloc_pages_node include/linux/gfp.h:595 [inline]
 alloc_thread_stack_node kernel/fork.c:262 [inline]
 dup_task_struct kernel/fork.c:887 [inline]
 copy_process+0x482/0x3c34 kernel/fork.c:1998
 kernel_clone+0xee/0x920 kernel/fork.c:2555
 __do_sys_clone+0xf2/0x12e kernel/fork.c:2672
 sys_clone+0x32/0x44 kernel/fork.c:2640
 ret_from_syscall+0x0/0x2
page last free stack trace:
 __reset_page_owner+0x4a/0xea mm/page_owner.c:142
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1352 [inline]
 free_pcp_prepare+0x29c/0x45e mm/page_alloc.c:1404
 free_unref_page_prepare mm/page_alloc.c:3325 [inline]
 free_unref_page+0x6a/0x31e mm/page_alloc.c:3404
 free_the_page mm/page_alloc.c:706 [inline]
 free_compound_page+0x70/0x8a mm/page_alloc.c:729
 destroy_compound_page include/linux/mm.h:889 [inline]
 __put_compound_page+0x7c/0xb0 mm/swap.c:112
 __put_page+0x48/0x100 mm/swap.c:128
 folio_put include/linux/mm.h:1199 [inline]
 put_page include/linux/mm.h:1237 [inline]
 __skb_frag_unref include/linux/skbuff.h:3178 [inline]
 skb_release_data+0x2f8/0x3c4 net/core/skbuff.c:672
 skb_release_all net/core/skbuff.c:742 [inline]
 __kfree_skb+0x38/0x50 net/core/skbuff.c:756
 tcp_eat_recv_skb+0x138/0x140 net/ipv4/tcp.c:1610
 tcp_recvmsg_locked+0xb4a/0x13f6 net/ipv4/tcp.c:2517
 tcp_recvmsg+0x190/0x414 net/ipv4/tcp.c:2563
 inet_recvmsg+0x10a/0x4ba net/ipv4/af_inet.c:850
 sock_recvmsg_nosec net/socket.c:948 [inline]
 sock_recvmsg net/socket.c:966 [inline]
 sock_recvmsg net/socket.c:962 [inline]
 sock_read_iter+0x26c/0x2ba net/socket.c:1039
 call_read_iter include/linux/fs.h:2068 [inline]
 new_sync_read+0x3ae/0x3d8 fs/read_write.c:400
 vfs_read+0x2ce/0x324 fs/read_write.c:481
 ksys_read+0x1c4/0x224 fs/read_write.c:619

Memory state around the buggy address:
 ffffaf8009b23980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffaf8009b23a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffaf8009b23a80: 00 00 00 00 f1 f1 00 00 00 00 00 00 00 00 00 00
                                  ^
 ffffaf8009b23b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffaf8009b23b80: f1 f1 f1 f1 00 f3 f3 f3 00 00 00 00 00 00 00 00
==================================================================
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
Oops [#3]
Modules linked in:
CPU: 0 PID: 2053 Comm: syz-executor.0 Tainted: G    B D           5.17.0-rc1-syzkaller-00002-g0966d385830d #0
Hardware name: riscv-virtio,qemu (DT)
epc : 0x0
 ra : 0x0
epc : 0000000000000000 ra : 0000000000000000 sp : ffffaf8009b23ac0
 gp : ffffffff85863ac0 tp : ffffaf800ed7b080 t0 : ffffffff86bdac79
 t1 : fffff5ef01364708 t2 : 0000000000000000 s0 : ffffaf8009b23b10
 s1 : 0000000000000000 a0 : 0000000000000031 a1 : 00000000000f0000
 a2 : 0000000000010506 a3 : ffffffff8012125c a4 : cc25d5719706a100
 a5 : cc25d5719706a100 a6 : 0000000000f00000 a7 : ffffaf8009b23847
 s2 : ffffffffffffffff s3 : 0000000000000000 s4 : ffffaf8009b23c28
 s5 : ffffffff83629ce0 s6 : ffffffff80121ba4 s7 : 0000000000000000
 s8 : 0000000000000000 s9 : 0000000000000001 s10: 000000000000001f
 s11: ffffaf800ed7b080 t3 : 0000000000000036 t4 : fffff5ef01364708
 t5 : fffff5ef01364709 t6 : ffffffff86bdacad
status: 0000000000000100 badaddr: 0000000000000000 cause: 000000000000000c

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/15 09:50 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d a63719e7 .config console log report info ci-qemu2-riscv64 KASAN: stack-out-of-bounds Read in do_page_fault
* Struck through repros no longer work on HEAD.