================================================================== BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:193 [inline] BUG: KASAN: use-after-free in list_empty include/linux/list.h:237 [inline] BUG: KASAN: use-after-free in bpf_prog_ksym_node_add kernel/bpf/core.c:623 [inline] BUG: KASAN: use-after-free in bpf_prog_kallsyms_add+0x7c5/0x840 kernel/bpf/core.c:655 Read of size 8 at addr ffff8880947b7568 by task syz-executor.2/9585 CPU: 1 PID: 9585 Comm: syz-executor.2 Not tainted 5.1.0-rc4+ #35 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 __read_once_size include/linux/compiler.h:193 [inline] list_empty include/linux/list.h:237 [inline] bpf_prog_ksym_node_add kernel/bpf/core.c:623 [inline] bpf_prog_kallsyms_add+0x7c5/0x840 kernel/bpf/core.c:655 bpf_prog_load+0xf23/0x14a0 kernel/bpf/syscall.c:1642 __do_sys_bpf+0xba2/0x3f60 kernel/bpf/syscall.c:2710 __se_sys_bpf kernel/bpf/syscall.c:2672 [inline] __x64_sys_bpf+0x73/0xb0 kernel/bpf/syscall.c:2672 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x458da9 Code: ad b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fb080d3dc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000458da9 RDX: 0000000000000048 RSI: 0000000020000100 RDI: 0000000000000005 RBP: 000000000073bfa0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb080d3e6d4 R13: 00000000004bf0fc R14: 00000000004d0080 R15: 00000000ffffffff Allocated by task 9585: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_kmalloc mm/kasan/common.c:497 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:511 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3623 kmalloc include/linux/slab.h:547 [inline] kzalloc include/linux/slab.h:742 [inline] bpf_prog_alloc_no_stats+0xe6/0x2b0 kernel/bpf/core.c:92 bpf_prog_alloc+0x31/0x230 kernel/bpf/core.c:114 bpf_prog_load+0x4fc/0x14a0 kernel/bpf/syscall.c:1572 __do_sys_bpf+0xba2/0x3f60 kernel/bpf/syscall.c:2710 __se_sys_bpf kernel/bpf/syscall.c:2672 [inline] __x64_sys_bpf+0x73/0xb0 kernel/bpf/syscall.c:2672 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7826: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 __cache_free mm/slab.c:3500 [inline] kfree+0xcf/0x230 mm/slab.c:3823 __bpf_prog_free+0x87/0xc0 kernel/bpf/core.c:262 bpf_jit_free+0x7f/0x2c0 bpf_prog_free_deferred+0x2b1/0x3e0 kernel/bpf/core.c:1987 process_one_work+0x98e/0x1790 kernel/workqueue.c:2269 worker_thread+0x98/0xe40 kernel/workqueue.c:2415 kthread+0x357/0x430 kernel/kthread.c:253 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff8880947b7500 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 104 bytes inside of 512-byte region [ffff8880947b7500, ffff8880947b7700) The buggy address belongs to the page: page:ffffea000251edc0 count:1 mapcount:0 mapping:ffff88812c3f0940 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea000283e108 ffffea00024f9148 ffff88812c3f0940 raw: 0000000000000000 ffff8880947b7000 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880947b7400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880947b7480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880947b7500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880947b7580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880947b7600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================