================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_fetch_add_relaxed include/asm-generic/atomic-instrumented.h:142 [inline] BUG: KASAN: use-after-free in __refcount_add include/linux/refcount.h:193 [inline] BUG: KASAN: use-after-free in __refcount_inc include/linux/refcount.h:250 [inline] BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:267 [inline] BUG: KASAN: use-after-free in sctp_auth_shkey_hold+0x16/0x50 net/sctp/auth.c:112 Write of size 4 at addr ffff88800f475f18 by task syz-executor.5/6090 CPU: 1 PID: 6090 Comm: syz-executor.5 Not tainted 5.11.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x9a/0xcc lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413 check_memory_region_inline mm/kasan/generic.c:179 [inline] check_memory_region+0x13d/0x180 mm/kasan/generic.c:185 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_fetch_add_relaxed include/asm-generic/atomic-instrumented.h:142 [inline] __refcount_add include/linux/refcount.h:193 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] sctp_auth_shkey_hold+0x16/0x50 net/sctp/auth.c:112 sctp_set_owner_w net/sctp/socket.c:131 [inline] sctp_sendmsg_to_asoc+0x10d6/0x1f10 net/sctp/socket.c:1851 sctp_sendmsg+0x71e/0x17d0 net/sctp/socket.c:2013 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:672 __sys_sendto+0x1a4/0x270 net/socket.c:1975 __do_sys_sendto net/socket.c:1987 [inline] __se_sys_sendto net/socket.c:1983 [inline] __x64_sys_sendto+0xd8/0x1b0 net/socket.c:1983 do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fdefd50c199 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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:00007fdefcc60168 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007fdefd61f030 RCX: 00007fdefd50c199 RDX: 0000000000000001 RSI: 0000000020000400 RDI: 0000000000000003 RBP: 00007fdefd56613b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcfec40eaf R14: 00007fdefcc60300 R15: 0000000000022000 Allocated by task 6084: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:401 [inline] ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:682 [inline] sctp_auth_shkey_create+0x69/0x190 net/sctp/auth.c:84 sctp_auth_asoc_copy_shkeys+0x182/0x2c0 net/sctp/auth.c:363 sctp_association_init net/sctp/associola.c:256 [inline] sctp_association_new+0x1723/0x2100 net/sctp/associola.c:297 sctp_connect_new_asoc+0x151/0x680 net/sctp/socket.c:1074 sctp_sendmsg_new_asoc net/sctp/socket.c:1676 [inline] sctp_sendmsg+0xee5/0x17d0 net/sctp/socket.c:1986 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:672 __sys_sendto+0x1a4/0x270 net/socket.c:1975 __do_sys_sendto net/socket.c:1987 [inline] __se_sys_sendto net/socket.c:1983 [inline] __x64_sys_sendto+0xd8/0x1b0 net/socket.c:1983 do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 6100: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:356 ____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:362 kasan_slab_free include/linux/kasan.h:192 [inline] slab_free_hook mm/slub.c:1547 [inline] slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1580 slab_free mm/slub.c:3143 [inline] kfree+0xdb/0x3b0 mm/slub.c:4139 sctp_auth_set_key+0x475/0x650 net/sctp/auth.c:862 sctp_setsockopt_auth_key net/sctp/socket.c:3628 [inline] sctp_setsockopt+0x3b7b/0x89a0 net/sctp/socket.c:4611 __sys_setsockopt+0x198/0x480 net/socket.c:2115 __do_sys_setsockopt net/socket.c:2126 [inline] __se_sys_setsockopt net/socket.c:2123 [inline] __x64_sys_setsockopt+0xb5/0x150 net/socket.c:2123 do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88800f475f00 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 24 bytes inside of 32-byte region [ffff88800f475f00, ffff88800f475f20) The buggy address belongs to the page: page:00000000858222ae refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xf475 flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea0000600540 0000000500000005 ffff88800f441a00 raw: 0000000000000000 0000000000400040 00000001ffffffff 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 0x0(), pid 1, ts 2416928932 create_dummy_stack mm/page_owner.c:64 [inline] register_early_stack+0x61/0xa0 mm/page_owner.c:80 init_page_owner mm/page_owner.c:90 [inline] init_page_owner+0x27/0x700 mm/page_owner.c:83 kernel_init_freeable+0x376/0x5ca init/main.c:1531 kernel_init+0x8/0x108 init/main.c:1421 page_owner free stack trace missing Memory state around the buggy address: ffff88800f475e00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc ffff88800f475e80: 00 00 00 fc fc fc fc fc 00 00 00 00 fc fc fc fc >ffff88800f475f00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff88800f475f80: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ffff88800f476000: 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 ==================================================================