================================================================== 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 ffff888098b00abc by task syz-executor.4/23462 CPU: 1 PID: 23462 Comm: syz-executor.4 Not tainted 5.3.0-rc3+ #133 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:1702 __do_sys_bpf+0xc43/0x3460 kernel/bpf/syscall.c:2849 __se_sys_bpf kernel/bpf/syscall.c:2808 [inline] __x64_sys_bpf+0x73/0xb0 kernel/bpf/syscall.c:2808 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459829 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:00007fdf2614ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459829 RDX: 0000000000000048 RSI: 000000002000e000 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fdf2614b6d4 R13: 00000000004bfc7c R14: 00000000004d1938 R15: 00000000ffffffff Allocated by task 18254: 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 __do_kmalloc mm/slab.c:3655 [inline] __kmalloc_track_caller+0x15f/0x760 mm/slab.c:3670 kmemdup+0x27/0x60 mm/util.c:120 kmemdup include/linux/string.h:432 [inline] dccp_feat_clone_sp_val.part.0+0x5d/0xe0 net/dccp/feat.c:369 dccp_feat_clone_sp_val net/dccp/feat.c:368 [inline] __feat_register_sp+0x1df/0x360 net/dccp/feat.c:733 dccp_feat_init+0x29d/0x310 net/dccp/feat.c:1485 dccp_init_sock+0x320/0x3f0 net/dccp/proto.c:205 dccp_v6_init_sock+0x20/0xa0 net/dccp/ipv6.c:1004 inet6_create net/ipv6/af_inet6.c:253 [inline] inet6_create+0x9c0/0xf80 net/ipv6/af_inet6.c:107 __sock_create+0x3d8/0x730 net/socket.c:1418 sock_create_kern+0x3b/0x50 net/socket.c:1487 inet_ctl_sock_create+0x9d/0x1f0 net/ipv4/af_inet.c:1629 dccp_v6_init_net+0x57/0x80 net/dccp/ipv6.c:1102 ops_init+0xb3/0x420 net/core/net_namespace.c:137 setup_net+0x2d2/0x890 net/core/net_namespace.c:334 copy_net_ns+0x290/0x41f net/core/net_namespace.c:475 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:103 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:202 ksys_unshare+0x444/0x980 kernel/fork.c:2831 __do_sys_unshare kernel/fork.c:2899 [inline] __se_sys_unshare kernel/fork.c:2897 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2897 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 15579: 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_path_number_perm+0x459/0x520 security/tomoyo/file.c:736 tomoyo_file_ioctl+0x23/0x30 security/tomoyo/tomoyo.c:335 security_file_ioctl+0x77/0xc0 security/security.c:1369 ksys_ioctl+0x57/0xd0 fs/ioctl.c:711 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718 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 ffff888098b00a80 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 28 bytes to the right of 32-byte region [ffff888098b00a80, ffff888098b00aa0) The buggy address belongs to the page: page:ffffea000262c000 refcount:1 mapcount:0 mapping:ffff8880aa4001c0 index:0xffff888098b00fc1 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002622888 ffffea0002a31088 ffff8880aa4001c0 raw: ffff888098b00fc1 ffff888098b00000 000000010000003e 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888098b00980: 00 01 fc fc fc fc fc fc 00 00 04 fc fc fc fc fc ffff888098b00a00: 00 00 00 fc fc fc fc fc fb fb fb fb fc fc fc fc >ffff888098b00a80: 02 fc fc fc fc fc fc fc 00 00 fc fc fc fc fc fc ^ ffff888098b00b00: 00 00 fc fc fc fc fc fc fb fb fb fb fc fc fc fc ffff888098b00b80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================