================================================================== BUG: KASAN: slab-out-of-bounds in test_and_clear_bit include/asm-generic/bitops-instrumented.h:185 [inline] BUG: KASAN: slab-out-of-bounds in napi_hash_del net/core/dev.c:6228 [inline] BUG: KASAN: slab-out-of-bounds in netif_napi_del+0x2c/0x7a0 net/core/dev.c:6323 Write of size 8 at addr ffff8881dd703f10 by task syz-executor293/305 CPU: 0 PID: 305 Comm: syz-executor293 Not tainted 5.4.190-syzkaller-00044-g77dc925ddffb #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+0x18e/0x1d5 lib/dump_stack.c:118 print_address_description+0x8c/0x630 mm/kasan/report.c:384 __kasan_report+0xf6/0x130 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 check_memory_region_inline mm/kasan/generic.c:141 [inline] check_memory_region+0x298/0x2d0 mm/kasan/generic.c:191 test_and_clear_bit include/asm-generic/bitops-instrumented.h:185 [inline] napi_hash_del net/core/dev.c:6228 [inline] netif_napi_del+0x2c/0x7a0 net/core/dev.c:6323 free_netdev+0x188/0x310 net/core/dev.c:9697 netdev_run_todo+0xa79/0xc80 net/core/dev.c:9447 rtnl_unlock net/core/rtnetlink.c:112 [inline] rtnetlink_rcv_msg+0xa49/0xb90 net/core/rtnetlink.c:5263 netlink_rcv_skb+0x190/0x3a0 net/netlink/af_netlink.c:2500 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x771/0x8d0 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x913/0xb90 net/netlink/af_netlink.c:1933 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] ____sys_sendmsg+0x4ee/0x7c0 net/socket.c:2287 ___sys_sendmsg net/socket.c:2341 [inline] __sys_sendmsg+0x235/0x2f0 net/socket.c:2387 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f73c8d54a69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f73c8d06308 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f73c8ddc428 RCX: 00007f73c8d54a69 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 00007f73c8ddc420 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f73c8ddc42c R13: 00007f73c8daa064 R14: 74656e2f7665642f R15: 0000000000022000 Allocated by task 155: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x131/0x1e0 mm/kasan/common.c:529 kmalloc include/linux/slab.h:556 [inline] inode_doinit_use_xattr+0x58/0x3d0 security/selinux/hooks.c:1389 inode_doinit_with_dentry+0x9c6/0xf30 security/selinux/hooks.c:1580 security_d_instantiate+0xa5/0x100 security/security.c:1895 d_splice_alias+0x6c/0x3b0 fs/dcache.c:3010 kernfs_iop_lookup+0x17a/0x1f0 fs/kernfs/dir.c:1104 lookup_open fs/namei.c:3288 [inline] do_last fs/namei.c:3401 [inline] path_openat+0x1fc2/0x3710 fs/namei.c:3612 do_filp_open+0x19a/0x3a0 fs/namei.c:3642 do_sys_open+0x2e3/0x700 fs/open.c:1113 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 155: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x178/0x240 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook+0x80/0x150 mm/slub.c:1494 slab_free mm/slub.c:3080 [inline] kfree+0xc6/0x260 mm/slub.c:4071 inode_doinit_use_xattr+0x251/0x3d0 security/selinux/hooks.c:1415 inode_doinit_with_dentry+0x9c6/0xf30 security/selinux/hooks.c:1580 security_d_instantiate+0xa5/0x100 security/security.c:1895 d_splice_alias+0x6c/0x3b0 fs/dcache.c:3010 kernfs_iop_lookup+0x17a/0x1f0 fs/kernfs/dir.c:1104 lookup_open fs/namei.c:3288 [inline] do_last fs/namei.c:3401 [inline] path_openat+0x1fc2/0x3710 fs/namei.c:3612 do_filp_open+0x19a/0x3a0 fs/namei.c:3642 do_sys_open+0x2e3/0x700 fs/open.c:1113 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8881dd703e00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 16 bytes to the right of 256-byte region [ffff8881dd703e00, ffff8881dd703f00) The buggy address belongs to the page: page:ffffea000775c080 refcount:1 mapcount:0 mapping:ffff8881f5c02780 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c02780 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x194/0x380 mm/page_alloc.c:2171 get_page_from_freelist+0x524/0x560 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x2ab/0x6f0 mm/page_alloc.c:4857 alloc_slab_page+0x39/0x3e0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x450 mm/slub.c:1749 new_slab_objects mm/slub.c:2506 [inline] ___slab_alloc+0x320/0x4b0 mm/slub.c:2667 __slab_alloc+0x5a/0x90 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc_trace+0x129/0x240 mm/slub.c:2854 kmalloc include/linux/slab.h:556 [inline] inode_doinit_use_xattr+0x58/0x3d0 security/selinux/hooks.c:1389 inode_doinit_with_dentry+0x9c6/0xf30 security/selinux/hooks.c:1580 security_d_instantiate+0xa5/0x100 security/security.c:1895 d_splice_alias+0x6c/0x3b0 fs/dcache.c:3010 kernfs_iop_lookup+0x17a/0x1f0 fs/kernfs/dir.c:1104 lookup_open fs/namei.c:3288 [inline] do_last fs/namei.c:3401 [inline] path_openat+0x1fc2/0x3710 fs/namei.c:3612 do_filp_open+0x19a/0x3a0 fs/namei.c:3642 do_sys_open+0x2e3/0x700 fs/open.c:1113 page_owner free stack trace missing Memory state around the buggy address: ffff8881dd703e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881dd703e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881dd703f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881dd703f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881dd704000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 305 Comm: syz-executor293 Tainted: G B 5.4.190-syzkaller-00044-g77dc925ddffb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:flush_gro_hash net/core/dev.c:6313 [inline] RIP: 0010:netif_napi_del+0x28f/0x7a0 net/core/dev.c:6328 Code: 00 74 08 4c 89 ff e8 d0 39 32 fe 49 8b 2f 49 39 ef 75 10 e8 03 cd 05 fe eb 35 90 e8 fb cc 05 fe 48 89 dd 48 89 e8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 ef e8 a2 39 32 fe 48 8b 5d 00 48 89 ef RSP: 0018:ffff8881e049f790 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 1ffff1103bae07ff RCX: ffffffff835a6db0 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8881dd703f38 RBP: 0000000000000000 R08: ffffffff835a6b83 R09: fffffbfff0d3170d R10: fffffbfff0d3170d R11: 1ffffffff0d3170c R12: ffff8881dd703f00 R13: dffffc0000000000 R14: ffff8881dd703f00 R15: ffff8881dd703f38 FS: 00007f73c8d06700(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f73c8da9c88 CR3: 00000001dd4c5000 CR4: 00000000003406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: free_netdev+0x188/0x310 net/core/dev.c:9697 netdev_run_todo+0xa79/0xc80 net/core/dev.c:9447 rtnl_unlock net/core/rtnetlink.c:112 [inline] rtnetlink_rcv_msg+0xa49/0xb90 net/core/rtnetlink.c:5263 netlink_rcv_skb+0x190/0x3a0 net/netlink/af_netlink.c:2500 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x771/0x8d0 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x913/0xb90 net/netlink/af_netlink.c:1933 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] ____sys_sendmsg+0x4ee/0x7c0 net/socket.c:2287 ___sys_sendmsg net/socket.c:2341 [inline] __sys_sendmsg+0x235/0x2f0 net/socket.c:2387 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f73c8d54a69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f73c8d06308 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f73c8ddc428 RCX: 00007f73c8d54a69 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 00007f73c8ddc420 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f73c8ddc42c R13: 00007f73c8daa064 R14: 74656e2f7665642f R15: 0000000000022000 Modules linked in: ---[ end trace 3e72d5c41413a563 ]--- RIP: 0010:flush_gro_hash net/core/dev.c:6313 [inline] RIP: 0010:netif_napi_del+0x28f/0x7a0 net/core/dev.c:6328 Code: 00 74 08 4c 89 ff e8 d0 39 32 fe 49 8b 2f 49 39 ef 75 10 e8 03 cd 05 fe eb 35 90 e8 fb cc 05 fe 48 89 dd 48 89 e8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 ef e8 a2 39 32 fe 48 8b 5d 00 48 89 ef RSP: 0018:ffff8881e049f790 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 1ffff1103bae07ff RCX: ffffffff835a6db0 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8881dd703f38 RBP: 0000000000000000 R08: ffffffff835a6b83 R09: fffffbfff0d3170d R10: fffffbfff0d3170d R11: 1ffffffff0d3170c R12: ffff8881dd703f00 R13: dffffc0000000000 R14: ffff8881dd703f00 R15: ffff8881dd703f38 FS: 00007f73c8d06700(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f73c8da9c88 CR3: 00000001dd4c5000 CR4: 00000000003406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 00 74 08 4c add %dh,0x4c(%rax,%rcx,1) 4: 89 ff mov %edi,%edi 6: e8 d0 39 32 fe callq 0xfe3239db b: 49 8b 2f mov (%r15),%rbp e: 49 39 ef cmp %rbp,%r15 11: 75 10 jne 0x23 13: e8 03 cd 05 fe callq 0xfe05cd1b 18: eb 35 jmp 0x4f 1a: 90 nop 1b: e8 fb cc 05 fe callq 0xfe05cd1b 20: 48 89 dd mov %rbx,%rbp 23: 48 89 e8 mov %rbp,%rax 26: 48 c1 e8 03 shr $0x3,%rax * 2a: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) <-- trapping instruction 2f: 74 08 je 0x39 31: 48 89 ef mov %rbp,%rdi 34: e8 a2 39 32 fe callq 0xfe3239db 39: 48 8b 5d 00 mov 0x0(%rbp),%rbx 3d: 48 89 ef mov %rbp,%rdi