================================================================== BUG: KASAN: slab-out-of-bounds in ptep_get include/linux/pgtable.h:495 [inline] BUG: KASAN: slab-out-of-bounds in filemap_map_order0_folio mm/filemap.c:3874 [inline] BUG: KASAN: slab-out-of-bounds in filemap_map_pages+0x1cc2/0x1f80 mm/filemap.c:3950 Read of size 8 at addr ffff88804b773dd0 by task syz.2.5250/26260 CPU: 0 UID: 0 PID: 26260 Comm: syz.2.5250 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP 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 ptep_get include/linux/pgtable.h:495 [inline] filemap_map_order0_folio mm/filemap.c:3874 [inline] filemap_map_pages+0x1cc2/0x1f80 mm/filemap.c:3950 do_fault_around mm/memory.c:5818 [inline] do_read_fault mm/memory.c:5851 [inline] do_fault+0x985/0x1750 mm/memory.c:5994 do_pte_missing mm/memory.c:4566 [inline] handle_pte_fault mm/memory.c:6379 [inline] __handle_mm_fault+0x187d/0x2a00 mm/memory.c:6517 handle_mm_fault+0x37b/0xa30 mm/memory.c:6686 do_user_addr_fault+0x74c/0x12f0 arch/x86/mm/fault.c:1394 handle_page_fault arch/x86/mm/fault.c:1483 [inline] exc_page_fault+0x6f/0xd0 arch/x86/mm/fault.c:1536 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:595 RIP: 0010:copy_user_generic arch/x86/include/asm/uaccess_64.h:126 [inline] RIP: 0010:raw_copy_from_user arch/x86/include/asm/uaccess_64.h:141 [inline] RIP: 0010:_inline_copy_from_user include/linux/uaccess.h:185 [inline] RIP: 0010:_copy_from_user+0x93/0xd0 lib/usercopy.c:18 Code: 3d ee fc 89 ee 4c 89 ef 48 b8 00 f0 ff ff ff 7f 00 00 48 39 c3 48 0f 47 d8 e8 59 d8 5d fd 0f 01 cb 4c 89 ef 48 89 de 48 89 e9 a4 0f 1f 00 49 89 cc 48 89 cb 0f 01 ca 31 ff 48 89 ce e8 15 38 RSP: 0018:ffffc90008557a28 EFLAGS: 00050297 RAX: 0000000000000001 RBX: 0000000080060000 RCX: 000000000000001c RDX: 0000000000000001 RSI: 0000000080060000 RDI: ffffc90008557a78 RBP: 000000000000001c R08: 0000000000000001 R09: fffff520010aaf52 R10: 0000000000000003 R11: 0000000000000000 R12: 0000000000000000 R13: ffffc90008557a78 R14: 1ffff920010aaf4b R15: ffffc90008557b40 copy_from_user include/linux/uaccess.h:222 [inline] get_compat_msghdr+0xb3/0x480 net/compat.c:90 recvmsg_copy_msghdr net/socket.c:2868 [inline] ___sys_recvmsg+0x193/0x1a0 net/socket.c:2942 do_recvmmsg+0x54d/0x740 net/socket.c:3033 __sys_recvmmsg+0x21f/0x270 net/socket.c:3115 __do_compat_sys_recvmmsg_time32 net/compat.c:417 [inline] __se_compat_sys_recvmmsg_time32 net/compat.c:413 [inline] __ia32_compat_sys_recvmmsg_time32+0xc4/0x160 net/compat.c:413 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x970 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7f24fec Code: Unable to access opcode bytes at 0xf7f24fc2. RSP: 002b:00000000f53c550c EFLAGS: 00000292 ORIG_RAX: 0000000000000151 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00000000800000c0 RDX: 0000000000010106 RSI: 0000000000000002 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 12443: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4584 [inline] slab_alloc_node mm/slub.c:4917 [inline] kmem_cache_alloc_noprof+0x26b/0x6a0 mm/slub.c:4931 __kernfs_new_node+0xd2/0xa10 fs/kernfs/dir.c:665 kernfs_new_node+0x117/0x150 fs/kernfs/dir.c:751 __kernfs_create_file+0x53/0x350 fs/kernfs/file.c:1050 sysfs_add_file_mode_ns+0x207/0x3c0 fs/sysfs/file.c:316 create_files fs/sysfs/group.c:82 [inline] internal_create_group+0x593/0xfb0 fs/sysfs/group.c:189 br_sysfs_addbr+0x2a/0xd0 net/bridge/br_sysfs_br.c:1048 br_device_event+0x500/0xa00 net/bridge/br.c:51 notifier_call_chain+0x99/0x3f0 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2250 call_netdevice_notifiers_extack net/core/dev.c:2288 [inline] call_netdevice_notifiers net/core/dev.c:2302 [inline] register_netdevice+0x1998/0x25a0 net/core/dev.c:11488 br_dev_newlink+0x6a/0x170 net/bridge/br_netlink.c:1602 rtnl_newlink_create net/core/rtnetlink.c:3913 [inline] __rtnl_newlink net/core/rtnetlink.c:4044 [inline] rtnl_newlink+0x1499/0x2380 net/core/rtnetlink.c:4159 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:7076 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2556 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:775 [inline] __sock_sendmsg net/socket.c:790 [inline] ____sys_sendmsg+0xa4d/0xbe0 net/socket.c:2684 ___sys_sendmsg+0x190/0x1e0 net/socket.c:2738 __sys_sendmsg+0x160/0x210 net/socket.c:2770 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x970 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff88804b773d20 which belongs to the cache kernfs_node_cache of size 176 The buggy address is located 0 bytes to the right of allocated 176-byte region [ffff88804b773d20, ffff88804b773dd0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4b773 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88801da8ba40 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800110011 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 12443, tgid 12441 (syz.2.2105), ts 305849204578, free_ts 302373892319 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0xf48/0x3530 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x299/0x2dc0 mm/page_alloc.c:5304 alloc_slab_page mm/slub.c:3266 [inline] allocate_slab mm/slub.c:3380 [inline] new_slab+0xa2/0x640 mm/slub.c:3426 refill_objects+0xe3/0x410 mm/slub.c:7310 refill_sheaf mm/slub.c:2804 [inline] __pcs_replace_empty_main+0x376/0x680 mm/slub.c:4675 alloc_from_pcs mm/slub.c:4773 [inline] slab_alloc_node mm/slub.c:4905 [inline] kmem_cache_alloc_noprof+0x46e/0x6a0 mm/slub.c:4931 __kernfs_new_node+0xd2/0xa10 fs/kernfs/dir.c:665 kernfs_new_node+0x117/0x150 fs/kernfs/dir.c:751 __kernfs_create_file+0x53/0x350 fs/kernfs/file.c:1050 sysfs_add_file_mode_ns+0x207/0x3c0 fs/sysfs/file.c:316 create_files fs/sysfs/group.c:82 [inline] internal_create_group+0x593/0xfb0 fs/sysfs/group.c:189 br_sysfs_addbr+0x2a/0xd0 net/bridge/br_sysfs_br.c:1048 br_device_event+0x500/0xa00 net/bridge/br.c:51 notifier_call_chain+0x99/0x3f0 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2250 page last free pid 10498 tgid 10498 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0x79f/0x1090 mm/page_alloc.c:2950 pcpu_free_pages.isra.0+0x13c/0x1c0 mm/percpu-vm.c:65 pcpu_reclaim_populated mm/percpu.c:2158 [inline] pcpu_balance_workfn+0x25e/0xe00 mm/percpu.c:2214 process_one_work+0xa23/0x1940 kernel/workqueue.c:3322 process_scheduled_works kernel/workqueue.c:3405 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3486 kthread+0x370/0x450 kernel/kthread.c:436 ret_from_fork+0x72b/0xd50 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: ffff88804b773c80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff88804b773d00: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88804b773d80: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ^ ffff88804b773e00: fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88804b773e80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 3d ee fc 89 ee cmp $0xee89fcee,%eax 5: 4c 89 ef mov %r13,%rdi 8: 48 b8 00 f0 ff ff ff movabs $0x7ffffffff000,%rax f: 7f 00 00 12: 48 39 c3 cmp %rax,%rbx 15: 48 0f 47 d8 cmova %rax,%rbx 19: e8 59 d8 5d fd call 0xfd5dd877 1e: 0f 01 cb stac 21: 4c 89 ef mov %r13,%rdi 24: 48 89 de mov %rbx,%rsi 27: 48 89 e9 mov %rbp,%rcx * 2a: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) <-- trapping instruction 2c: 0f 1f 00 nopl (%rax) 2f: 49 89 cc mov %rcx,%r12 32: 48 89 cb mov %rcx,%rbx 35: 0f 01 ca clac 38: 31 ff xor %edi,%edi 3a: 48 89 ce mov %rcx,%rsi 3d: e8 .byte 0xe8 3e: 15 .byte 0x15 3f: 38 .byte 0x38