================================================================== BUG: KASAN: slab-out-of-bounds in do_jit.isra.0+0x4c35/0x5630 arch/x86/net/bpf_jit_comp.c:966 Read of size 4 at addr ffff88808d6a26fc by task syz-executor.1/9137 CPU: 1 PID: 9137 Comm: syz-executor.1 Not tainted 5.3.0-rc3+ #0 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+0xd4/0x306 mm/kasan/report.c:351 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:612 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 do_jit.isra.0+0x4c35/0x5630 arch/x86/net/bpf_jit_comp.c:966 bpf_int_jit_compile+0x374/0xda0 arch/x86/net/bpf_jit_comp.c:1132 bpf_prog_select_runtime+0x4cd/0x7d0 kernel/bpf/core.c:1725 bpf_prog_load+0xe9b/0x1670 kernel/bpf/syscall.c:1713 __do_sys_bpf+0xa44/0x3350 kernel/bpf/syscall.c:2860 __se_sys_bpf kernel/bpf/syscall.c:2819 [inline] __x64_sys_bpf+0x73/0xb0 kernel/bpf/syscall.c:2819 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459879 Code: fd b7 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 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fa189ef3c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459879 RDX: 0000000000000048 RSI: 0000000020000200 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fa189ef46d4 R13: 00000000004bfcdc R14: 00000000004d19d8 R15: 00000000ffffffff Allocated by task 8601: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:487 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:460 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:501 kmem_cache_alloc_trace+0x158/0x790 mm/slab.c:3550 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:748 [inline] kobject_create+0x3c/0x80 lib/kobject.c:770 kobject_create_and_add+0x1a/0x70 lib/kobject.c:796 batadv_sysfs_add_hardif+0x33/0x130 net/batman-adv/sysfs.c:1232 batadv_hardif_add_interface net/batman-adv/hard-interface.c:919 [inline] batadv_hard_if_event+0x898/0xf80 net/batman-adv/hard-interface.c:1032 notifier_call_chain+0xc2/0x230 kernel/notifier.c:95 __raw_notifier_call_chain kernel/notifier.c:396 [inline] raw_notifier_call_chain+0x2e/0x40 kernel/notifier.c:403 call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1749 call_netdevice_notifiers_extack net/core/dev.c:1761 [inline] call_netdevice_notifiers net/core/dev.c:1775 [inline] register_netdevice+0xa5c/0xf10 net/core/dev.c:8806 veth_newlink+0x540/0x990 drivers/net/veth.c:1329 __rtnl_newlink+0x1086/0x16c0 net/core/rtnetlink.c:3196 rtnl_newlink+0x69/0xa0 net/core/rtnetlink.c:3254 rtnetlink_rcv_msg+0x463/0xb00 net/core/rtnetlink.c:5223 netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2477 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5241 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x531/0x710 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x8a5/0xd60 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:657 __sys_sendto+0x262/0x380 net/socket.c:1952 __do_sys_sendto net/socket.c:1964 [inline] __se_sys_sendto net/socket.c:1960 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1960 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8137: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:449 kasan_slab_free+0xe/0x10 mm/kasan/common.c:457 __cache_free mm/slab.c:3425 [inline] kfree+0x10a/0x2c0 mm/slab.c:3756 tomoyo_check_open_permission+0x19e/0x3f0 security/tomoyo/file.c:786 tomoyo_file_open security/tomoyo/tomoyo.c:319 [inline] tomoyo_file_open+0xa9/0xd0 security/tomoyo/tomoyo.c:314 security_file_open+0x71/0x300 security/security.c:1457 do_dentry_open+0x373/0x1250 fs/open.c:784 vfs_open+0xa0/0xd0 fs/open.c:906 do_last fs/namei.c:3416 [inline] path_openat+0x10e9/0x4630 fs/namei.c:3533 do_filp_open+0x1a1/0x280 fs/namei.c:3563 do_sys_open+0x3fe/0x5d0 fs/open.c:1089 __do_sys_open fs/open.c:1107 [inline] __se_sys_open fs/open.c:1102 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1102 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808d6a2680 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 60 bytes to the right of 64-byte region [ffff88808d6a2680, ffff88808d6a26c0) The buggy address belongs to the page: page:ffffea000235a880 refcount:1 mapcount:0 mapping:ffff8880aa400380 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002413948 ffffea0002451a88 ffff8880aa400380 raw: 0000000000000000 ffff88808d6a2000 0000000100000020 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808d6a2580: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88808d6a2600: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc >ffff88808d6a2680: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff88808d6a2700: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff88808d6a2780: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ==================================================================