================================================================== BUG: KASAN: slab-out-of-bounds in smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:772 Read of size 8 at addr ffff8880780d74e8 by task udevd/2933 CPU: 0 PID: 2933 Comm: udevd Not tainted 5.17.0-syzkaller-13993-g88e6c0207623 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x467 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:772 sk_error_report+0x35/0x310 net/core/sock.c:340 tcp_write_err net/ipv4/tcp_timer.c:71 [inline] tcp_write_timeout net/ipv4/tcp_timer.c:276 [inline] tcp_retransmit_timer+0x16c5/0x3360 net/ipv4/tcp_timer.c:512 tcp_write_timer_handler+0x5e6/0xbc0 net/ipv4/tcp_timer.c:622 tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:642 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x67c/0xa30 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:prefetchw arch/x86/include/asm/processor.h:743 [inline] RIP: 0010:slab_alloc mm/slab.c:3312 [inline] RIP: 0010:__kmem_cache_alloc_lru mm/slab.c:3493 [inline] RIP: 0010:kmem_cache_alloc+0x195/0x560 mm/slab.c:3513 Code: 0f 84 a2 01 00 00 4d 85 f6 4c 89 7c 24 08 0f 85 39 02 00 00 9c 58 f6 c4 02 0f 85 b1 02 00 00 4d 85 f6 74 01 fb 48 8b 74 24 08 <0f> 0d 0e 0f 1f 44 00 00 48 83 7b 50 00 0f 84 8e 00 00 00 44 23 25 RSP: 0018:ffffc900031b7ce8 EFLAGS: 00000206 RAX: 0000000000000002 RBX: ffff8881400a3000 RCX: 1ffffffff1b6c999 RDX: 0000000000000000 RSI: ffff88801f0883c0 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff817e14b8 R11: 0000000000000001 R12: 0000000000000cc0 R13: 0000000000000cc0 R14: 0000000000000200 R15: ffff88801f0883c0 getname_flags.part.0+0x50/0x4f0 fs/namei.c:138 getname_flags+0x9a/0xe0 include/linux/audit.h:323 vfs_fstatat+0x73/0xb0 fs/stat.c:254 __do_sys_newfstatat+0x91/0x110 fs/stat.c:426 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f658b7251da Code: 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 0b 00 00 00 66 2e 0f 1f 84 00 00 00 00 00 90 41 89 ca b8 06 01 00 00 0f 05 <3d> 00 f0 ff ff 77 07 31 c0 c3 0f 1f 40 00 48 8b 15 69 fc 0c 00 f7 RSP: 002b:00007ffe6a9ce0f8 EFLAGS: 00000202 ORIG_RAX: 0000000000000106 RAX: ffffffffffffffda RBX: 000055ea80aaf0f0 RCX: 00007f658b7251da RDX: 00007ffe6a9ce100 RSI: 00007f658b7bb75a RDI: 000000000000000d RBP: 000000000000000d R08: 0000000000090800 R09: 000055ea80aa5fb0 R10: 0000000000001000 R11: 0000000000000202 R12: 00007ffe6a9ce100 R13: 00000000000000ff R14: 00007ffe6a9ce1f0 R15: 0000000000000000 Allocated by task 3899: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:524 kasan_kmalloc include/linux/kasan.h:234 [inline] __do_kmalloc mm/slab.c:3710 [inline] __kmalloc+0x209/0x4d0 mm/slab.c:3719 kmalloc include/linux/slab.h:586 [inline] tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x272/0x380 security/tomoyo/file.c:771 tomoyo_file_open security/tomoyo/tomoyo.c:311 [inline] tomoyo_file_open+0x9d/0xc0 security/tomoyo/tomoyo.c:306 security_file_open+0x45/0xb0 security/security.c:1651 do_dentry_open+0x349/0x11e0 fs/open.c:811 do_open fs/namei.c:3476 [inline] path_openat+0x1c71/0x2910 fs/namei.c:3609 do_filp_open+0x1aa/0x400 fs/namei.c:3636 do_sys_openat2+0x16d/0x4c0 fs/open.c:1213 do_sys_open fs/open.c:1229 [inline] __do_sys_openat fs/open.c:1245 [inline] __se_sys_openat fs/open.c:1240 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1240 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 3899: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x13d/0x180 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3439 [inline] kfree+0x113/0x310 mm/slab.c:3810 tomoyo_realpath_from_path+0x191/0x620 security/tomoyo/realpath.c:291 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x272/0x380 security/tomoyo/file.c:771 tomoyo_file_open security/tomoyo/tomoyo.c:311 [inline] tomoyo_file_open+0x9d/0xc0 security/tomoyo/tomoyo.c:306 security_file_open+0x45/0xb0 security/security.c:1651 do_dentry_open+0x349/0x11e0 fs/open.c:811 do_open fs/namei.c:3476 [inline] path_openat+0x1c71/0x2910 fs/namei.c:3609 do_filp_open+0x1aa/0x400 fs/namei.c:3636 do_sys_openat2+0x16d/0x4c0 fs/open.c:1213 do_sys_open fs/open.c:1229 [inline] __do_sys_openat fs/open.c:1245 [inline] __se_sys_openat fs/open.c:1240 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1240 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff8880780d6000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1256 bytes to the right of 4096-byte region [ffff8880780d6000, ffff8880780d7000) The buggy address belongs to the physical page: page:ffffea0001e03580 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x780d6 head:ffffea0001e03580 order:1 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001c6f808 ffffea0001e74e88 ffff888010c40900 raw: 0000000000000000 ffff8880780d6000 0000000100000001 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 0x342040(__GFP_IO|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 2933, tgid 2933 (udevd), ts 565856658519, free_ts 565692882315 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0xba2/0x3df0 mm/page_alloc.c:4182 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408 __alloc_pages_node include/linux/gfp.h:587 [inline] kmem_getpages mm/slab.c:1378 [inline] cache_grow_begin+0x75/0x350 mm/slab.c:2584 cache_alloc_refill+0x27f/0x380 mm/slab.c:2957 ____cache_alloc mm/slab.c:3040 [inline] ____cache_alloc mm/slab.c:3023 [inline] __do_cache_alloc mm/slab.c:3267 [inline] slab_alloc mm/slab.c:3309 [inline] __do_kmalloc mm/slab.c:3708 [inline] __kmalloc+0x3b3/0x4d0 mm/slab.c:3719 kmalloc include/linux/slab.h:586 [inline] tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x272/0x380 security/tomoyo/file.c:771 tomoyo_file_open security/tomoyo/tomoyo.c:311 [inline] tomoyo_file_open+0x9d/0xc0 security/tomoyo/tomoyo.c:306 security_file_open+0x45/0xb0 security/security.c:1651 do_dentry_open+0x349/0x11e0 fs/open.c:811 do_open fs/namei.c:3476 [inline] path_openat+0x1c71/0x2910 fs/namei.c:3609 do_filp_open+0x1aa/0x400 fs/namei.c:3636 do_sys_openat2+0x16d/0x4c0 fs/open.c:1213 do_sys_open fs/open.c:1229 [inline] __do_sys_openat fs/open.c:1245 [inline] __se_sys_openat fs/open.c:1240 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1240 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1356 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3328 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3423 slab_destroy mm/slab.c:1630 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1650 cache_flusharray mm/slab.c:3411 [inline] ___cache_free+0x34e/0x670 mm/slab.c:3474 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x4f/0x1b0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:749 [inline] slab_alloc mm/slab.c:3316 [inline] __kmem_cache_alloc_lru mm/slab.c:3493 [inline] kmem_cache_alloc+0x265/0x560 mm/slab.c:3513 getname_flags.part.0+0x50/0x4f0 fs/namei.c:138 getname_flags include/linux/audit.h:323 [inline] getname+0x8e/0xd0 fs/namei.c:217 do_sys_openat2+0xf5/0x4c0 fs/open.c:1207 do_sys_open fs/open.c:1229 [inline] __do_sys_openat fs/open.c:1245 [inline] __se_sys_openat fs/open.c:1240 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1240 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff8880780d7380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880780d7400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880780d7480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880780d7500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880780d7580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 0f 84 a2 01 00 00 je 0x1a8 6: 4d 85 f6 test %r14,%r14 9: 4c 89 7c 24 08 mov %r15,0x8(%rsp) e: 0f 85 39 02 00 00 jne 0x24d 14: 9c pushfq 15: 58 pop %rax 16: f6 c4 02 test $0x2,%ah 19: 0f 85 b1 02 00 00 jne 0x2d0 1f: 4d 85 f6 test %r14,%r14 22: 74 01 je 0x25 24: fb sti 25: 48 8b 74 24 08 mov 0x8(%rsp),%rsi * 2a: 0f 0d 0e prefetchw (%rsi) <-- trapping instruction 2d: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 32: 48 83 7b 50 00 cmpq $0x0,0x50(%rbx) 37: 0f 84 8e 00 00 00 je 0xcb 3d: 44 rex.R 3e: 23 .byte 0x23 3f: 25 .byte 0x25