------------[ cut here ]------------ kernel BUG at mm/slab.c:4421! invalid opcode: 0000 [#1] SMP KASAN ================================================================== CPU: 1 PID: 14969 Comm: syz-executor6 Not tainted 4.18.0-rc3+ #58 BUG: KASAN: use-after-free in _copy_to_user+0xe9/0x110 lib/usercopy.c:27 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Read of size 1024 at addr ffff880192bffffc by task syz-executor6/14920 RIP: 0010:__check_heap_object+0xa7/0xb5 mm/slab.c:4446 Code: CPU: 0 PID: 14920 Comm: syz-executor6 Not tainted 4.18.0-rc3+ #58 48 c7 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: c7 e0 __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 8b c0 88 e8 87 7a print_address_description+0x6c/0x20b mm/kasan/report.c:256 08 00 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412 5d check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 c3 kasan_check_read+0x11/0x20 mm/kasan/kasan.c:272 41 _copy_to_user+0xe9/0x110 lib/usercopy.c:27 8b copy_to_user include/linux/uaccess.h:155 [inline] bpf_test_finish.isra.7+0xee/0x1f0 net/bpf/test_run.c:59 91 04 01 00 bpf_prog_test_run_skb+0x7d7/0xa30 net/bpf/test_run.c:144 00 48 29 c7 48 39 bpf_prog_test_run+0x130/0x1a0 kernel/bpf/syscall.c:1686 d7 __do_sys_bpf kernel/bpf/syscall.c:2323 [inline] __se_sys_bpf kernel/bpf/syscall.c:2267 [inline] __x64_sys_bpf+0x3d8/0x510 kernel/bpf/syscall.c:2267 77 be 48 01 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 d0 48 29 c8 48 39 f0 72 b3 5d entry_SYSCALL_64_after_hwframe+0x49/0xbe c3 RIP: 0033:0x455ab9 <0f> Code: 0b 1d 48 ba c7 fb c7 ff e0 8b c3 c0 66 88 2e e8 0f 6d 81 1f 08 84 00 00 44 00 89 00 00 e1 00 4c 66 8d 90 45 48 c4 89 48 f8 RSP: 0018:ffff88019e497a10 EFLAGS: 00010246 48 89 f7 48 RAX: 0000000000000001 RBX: 1ffff10033c92f49 RCX: 000000000000000c 89 RDX: ffff8801973fe540 RSI: 0000000000000400 RDI: ffff8801973ffffc d6 48 RBP: ffff88019e497a10 R08: ffff8801b3800180 R09: ffff8801da987dc0 R10: 0000000000001796 R11: 0000000000000001 R12: ffff8801973ffffc 89 R13: 0000000000000400 R14: 0000000000000001 R15: ffffea00065cff80 FS: 00007f49bb9ec700(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000 ca CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f3ba04e0db8 CR3: 00000001c307e000 CR4: 00000000001406e0 4d DR0: 0000000020000000 DR1: 0000000000000000 DR2: 0000000000000000 89 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 c2 Call Trace: 4d check_heap_object mm/usercopy.c:236 [inline] __check_object_size+0x4db/0x5f2 mm/usercopy.c:259 89 c8 4c 8b 4c check_object_size include/linux/thread_info.h:119 [inline] check_copy_size include/linux/thread_info.h:150 [inline] copy_to_user include/linux/uaccess.h:154 [inline] bpf_test_finish.isra.7+0xd9/0x1f0 net/bpf/test_run.c:59 24 08 0f bpf_prog_test_run_skb+0x7d7/0xa30 net/bpf/test_run.c:144 05 <48> 3d 01 f0 ff ff bpf_prog_test_run+0x130/0x1a0 kernel/bpf/syscall.c:1686 0f __do_sys_bpf kernel/bpf/syscall.c:2323 [inline] __se_sys_bpf kernel/bpf/syscall.c:2267 [inline] __x64_sys_bpf+0x3d8/0x510 kernel/bpf/syscall.c:2267 83 eb b9 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 fb ff c3 66 2e 0f 1f 84 entry_SYSCALL_64_after_hwframe+0x49/0xbe 00 RIP: 0033:0x455ab9 00 00 Code: 00 1d ba RSP: 002b:00007f49bba2dc68 EFLAGS: 00000246 fb ORIG_RAX: 0000000000000141 ff RAX: ffffffffffffffda RBX: 00007f49bba2e6d4 RCX: 0000000000455ab9 c3 RDX: 0000000000000028 RSI: 0000000020000080 RDI: 000000000000000a 66 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 2e 0f R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff 1f 84 R13: 00000000004bb71f R14: 00000000004c8b00 R15: 0000000000000000 00 00 00 The buggy address belongs to the page: 00 page:ffffea00064affc0 count:0 mapcount:0 mapping:0000000000000000 index:0x0 00 66 flags: 0x2fffc0000000000() 90 raw: 02fffc0000000000 0000000000000000 ffffea00064affc8 0000000000000000 48 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 89 page dumped because: kasan: bad access detected f8 48 89 Memory state around the buggy address: f7 ffff880192bffe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 48 89 ffff880192bfff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff d6 >ffff880192bfff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 48 ^ 89 ca ffff880192c00000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4d ffff880192c00080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 89 c2 ================================================================== 4d 89