================================================================== BUG: KASAN: stack-out-of-bounds in walk_stackframe+0x128/0x2fe arch/riscv/kernel/stacktrace.c:58 Read of size 8 at addr ff20000001e279b0 by task syz-executor.1/4349 CPU: 1 PID: 4349 Comm: syz-executor.1 Tainted: G W 6.2.0-rc1-syzkaller #0 Hardware name: riscv-virtio,qemu (DT) Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:121 [] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:127 [] __dump_stack lib/dump_stack.c:88 [inline] [] dump_stack_lvl+0xe0/0x14c lib/dump_stack.c:106 [] print_address_description mm/kasan/report.c:306 [inline] [] print_report+0x1e4/0x4c0 mm/kasan/report.c:417 [] kasan_report+0xb8/0xe6 mm/kasan/report.c:517 [] check_region_inline mm/kasan/generic.c:183 [inline] [] __asan_load8+0x7e/0xa6 mm/kasan/generic.c:256 [] walk_stackframe+0x128/0x2fe arch/riscv/kernel/stacktrace.c:58 [] arch_stack_walk+0x2c/0x3c arch/riscv/kernel/stacktrace.c:154 [] stack_trace_save_tsk+0x14a/0x1bc kernel/stacktrace.c:150 [] proc_pid_stack+0x146/0x1ee fs/proc/base.c:456 [] proc_single_show+0x9c/0x148 fs/proc/base.c:777 [] traverse.part.0+0x74/0x2ca fs/seq_file.c:111 [] traverse fs/seq_file.c:101 [inline] [] seq_read_iter+0x72c/0x934 fs/seq_file.c:195 [] seq_read+0x11a/0x16e fs/seq_file.c:162 [] do_loop_readv_writev fs/read_write.c:756 [inline] [] do_loop_readv_writev fs/read_write.c:743 [inline] [] do_iter_read+0x324/0x3c2 fs/read_write.c:798 [] vfs_readv+0xfe/0x166 fs/read_write.c:916 [] do_preadv fs/read_write.c:1008 [inline] [] __do_sys_preadv fs/read_write.c:1058 [inline] [] sys_preadv+0x182/0x1fa fs/read_write.c:1053 [] ret_from_syscall+0x0/0x2 The buggy address belongs to the virtual mapping at [ff20000001e20000, ff20000001e29000) created by: kernel_clone+0xee/0x914 kernel/fork.c:2681 The buggy address belongs to the physical page: page:ff1c0000023c0100 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8f004 memcg:ff6000001571d702 flags: 0xffe000000000000(node=0|zone=0|lastcpupid=0x7ff) raw: 0ffe000000000000 0000000000000000 0000000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ff6000001571d702 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 4305, tgid 4305 (syz-executor.1), ts 1435408275900, free_ts 1433054683400 __set_page_owner+0x32/0x182 mm/page_owner.c:190 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0xf8/0x11a mm/page_alloc.c:2524 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0xc0e/0x1118 mm/page_alloc.c:4283 __alloc_pages+0x1b0/0x165a mm/page_alloc.c:5549 alloc_pages+0x132/0x25e mm/mempolicy.c:2286 vm_area_alloc_pages mm/vmalloc.c:2989 [inline] __vmalloc_area_node mm/vmalloc.c:3057 [inline] __vmalloc_node_range+0x81c/0xdb4 mm/vmalloc.c:3227 alloc_thread_stack_node kernel/fork.c:311 [inline] dup_task_struct kernel/fork.c:987 [inline] copy_process+0x210e/0x4068 kernel/fork.c:2097 kernel_clone+0xee/0x914 kernel/fork.c:2681 __do_sys_clone+0xec/0x120 kernel/fork.c:2822 sys_clone+0x32/0x44 kernel/fork.c:2790 ret_from_syscall+0x0/0x2 page last free stack trace: __reset_page_owner+0x4a/0xf8 mm/page_owner.c:148 reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1446 [inline] free_pcp_prepare+0x254/0x48e mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page+0x60/0x2ae mm/page_alloc.c:3464 free_the_page mm/page_alloc.c:750 [inline] __free_pages+0xd6/0x106 mm/page_alloc.c:5635 __vunmap+0x85a/0xa34 mm/vmalloc.c:2727 __vfree+0x70/0x104 mm/vmalloc.c:2775 vfree+0x9a/0xdc mm/vmalloc.c:2806 __do_replace+0x15c/0x59a net/ipv4/netfilter/ip_tables.c:1100 do_replace.constprop.0+0x29c/0x342 net/ipv4/netfilter/ip_tables.c:1140 do_ip6t_set_ctl+0x2ec/0x562 net/ipv6/netfilter/ip6_tables.c:1639 nf_setsockopt+0x6c/0xac net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x14a/0x154 net/ipv6/ipv6_sockglue.c:1028 tcp_setsockopt+0x76/0xb4 net/ipv4/tcp.c:3801 sock_common_setsockopt+0x6a/0x7c net/core/sock.c:3664 __sys_setsockopt+0x25e/0x418 net/socket.c:2246 __do_sys_setsockopt net/socket.c:2257 [inline] sys_setsockopt+0x3a/0x4c net/socket.c:2254 Memory state around the buggy address: ff20000001e27880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff20000001e27900: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 f2 f2 >ff20000001e27980: 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00 ^ ff20000001e27a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff20000001e27a80: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 ==================================================================