================================================================== BUG: KASAN: slab-out-of-bounds in nfsd+0xb77/0xc20 fs/nfsd/nfssvc.c:926 Read of size 8 at addr ffff888023fabad8 by task nfsd/7940 CPU: 2 UID: 0 PID: 7940 Comm: nfsd Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 nfsd+0xb77/0xc20 fs/nfsd/nfssvc.c:926 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 7906: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x40 mm/kasan/common.c:79 poison_kmalloc_redzone mm/kasan/common.c:412 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:429 kasan_kmalloc include/linux/kasan.h:267 [inline] __kmalloc_cache_noprof+0x2f8/0x6d0 mm/slub.c:5680 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] __svc_create+0x5c/0xad0 net/sunrpc/svc.c:402 svc_create_pooled+0x2bb/0x3a0 net/sunrpc/svc.c:503 nfsd_create_serv+0x2c1/0x4e0 fs/nfsd/nfssvc.c:632 __write_ports_addxprt fs/nfsd/nfsctl.c:790 [inline] __write_ports fs/nfsd/nfsctl.c:829 [inline] write_ports+0x2f1/0xd60 fs/nfsd/nfsctl.c:882 nfsctl_transaction_write+0x106/0x1a0 fs/nfsd/nfsctl.c:117 vfs_write+0x2aa/0x1040 fs/read_write.c:665 ksys_write+0x12a/0x250 fs/read_write.c:719 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x14d/0x8e0 arch/x86/entry/syscall_32.c:286 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:311 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888023fab800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 384 bytes to the right of allocated 344-byte region [ffff888023fab800, ffff888023fab958) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x23fa8 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801d442c80 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801d442c80 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffffffffffff01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5786, tgid 5786 (syz-executor), ts 37319781136 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1873 prep_new_page mm/page_alloc.c:1881 [inline] get_page_from_freelist+0xdae/0x2c80 mm/page_alloc.c:3963 __alloc_frozen_pages_noprof+0x2ad/0x31e0 mm/page_alloc.c:5505 alloc_slab_page mm/slub.c:3384 [inline] allocate_slab mm/slub.c:3499 [inline] new_slab+0xb1/0x6d0 mm/slub.c:3550 refill_objects+0xe3/0x410 mm/slub.c:7546 refill_sheaf mm/slub.c:2917 [inline] __pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4811 alloc_from_pcs mm/slub.c:4887 [inline] slab_alloc_node mm/slub.c:5021 [inline] __kmalloc_cache_noprof+0x4ef/0x6d0 mm/slub.c:5676 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] device_private_init drivers/base/core.c:3608 [inline] device_add+0xd3f/0x1970 drivers/base/core.c:3659 netdev_register_kobject+0x1df/0x410 net/core/net-sysfs.c:2381 register_netdevice+0x1313/0x26b0 net/core/dev.c:11744 veth_newlink+0x2b7/0xd00 drivers/net/veth.c:1885 rtnl_newlink_create net/core/rtnetlink.c:4006 [inline] __rtnl_newlink net/core/rtnetlink.c:4135 [inline] rtnl_newlink+0x1697/0x2620 net/core/rtnetlink.c:4252 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:7169 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2585 netlink_unicast_kernel net/netlink/af_netlink.c:1336 [inline] netlink_unicast+0x668/0x950 net/netlink/af_netlink.c:1362 netlink_sendmsg+0x9ac/0x10c0 net/netlink/af_netlink.c:1921 page last free pid 5802 tgid 5802 ts 36843785821 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1415 [inline] __free_frozen_pages+0x7b1/0x10f0 mm/page_alloc.c:2971 stack_depot_save_flags+0x456/0xa10 lib/stackdepot.c:735 kasan_save_stack+0x3f/0x50 mm/kasan/common.c:58 kasan_save_track+0x14/0x40 mm/kasan/common.c:79 poison_kmalloc_redzone mm/kasan/common.c:412 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:429 kasan_kmalloc include/linux/kasan.h:267 [inline] __kmalloc_cache_noprof+0x2f8/0x6d0 mm/slub.c:5680 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] tomoyo_dump_page+0x410/0x540 security/tomoyo/domain.c:916 tomoyo_environ security/tomoyo/domain.c:638 [inline] tomoyo_find_next_domain+0xcd4/0x2010 security/tomoyo/domain.c:889 tomoyo_bprm_check_security security/tomoyo/tomoyo.c:102 [inline] tomoyo_bprm_check_security+0x12d/0x1d0 security/tomoyo/tomoyo.c:92 security_bprm_check+0x87/0x1e0 security/security.c:834 search_binary_handler fs/exec.c:1767 [inline] exec_binprm fs/exec.c:1809 [inline] bprm_execve fs/exec.c:1865 [inline] bprm_execve+0x80b/0x1940 fs/exec.c:1841 kernel_execve+0x31e/0x3a0 fs/exec.c:2009 call_usermodehelper_exec_async+0x239/0x4b0 kernel/umh.c:107 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888023fab980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888023faba00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888023faba80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888023fabb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888023fabb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================