==================================================================
BUG: KASAN: use-after-free in smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:670
Read of size 8 at addr ffff8880248c9028 by task syz-executor.0/21372
CPU: 2 PID: 21372 Comm: syz-executor.0 Not tainted 5.17.0-rc7-syzkaller-00020-gea4424be1688 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
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+0x8d/0x303 mm/kasan/report.c:255
__kasan_report mm/kasan/report.c:442 [inline]
kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:670
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+0x20c2/0x3320 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:638
RIP: 0010:lock_acquire+0x1ef/0x510 kernel/locking/lockdep.c:5607
Code: c5 a5 7e 83 f8 01 0f 85 b4 02 00 00 9c 58 f6 c4 02 0f 85 9f 02 00 00 48 83 7c 24 08 00 74 01 fb 48 b8 00 00 00 00 00 fc ff df <48> 01 c3 48 c7 03 00 00 00 00 48 c7 43 08 00 00 00 00 48 8b 84 24
RSP: 0018:ffffc9000d8d7058 EFLAGS: 00000206
RAX: dffffc0000000000 RBX: 1ffff92001b1ae0d RCX: 0000000000001ba8
RDX: 1ffff1100564498b RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffff8ffc89e7
R10: fffffbfff1ff913c R11: 0000000000000001 R12: 0000000000000000
R13: 0000000000000000 R14: ffff88806b4ee908 R15: 0000000000000000
__raw_write_lock include/linux/rwlock_api_smp.h:209 [inline]
_raw_write_lock+0x2a/0x40 kernel/locking/spinlock.c:300
ext4_es_insert_delayed_block+0x1ff/0x580 fs/ext4/extents_status.c:2004
ext4_insert_delayed_block fs/ext4/inode.c:1673 [inline]
ext4_da_map_blocks fs/ext4/inode.c:1765 [inline]
ext4_da_get_block_prep+0xc3f/0x11f0 fs/ext4/inode.c:1829
ext4_block_write_begin+0x539/0x1140 fs/ext4/inode.c:1080
ext4_da_write_begin+0x3eb/0xad0 fs/ext4/inode.c:2949
generic_perform_write+0x205/0x510 mm/filemap.c:3765
ext4_buffered_write_iter+0x1a2/0x390 fs/ext4/file.c:268
ext4_file_write_iter+0x423/0x14d0 fs/ext4/file.c:677
call_write_iter include/linux/fs.h:2074 [inline]
do_iter_readv_writev+0x47a/0x750 fs/read_write.c:725
do_iter_write+0x188/0x710 fs/read_write.c:851
vfs_iter_write+0x70/0xa0 fs/read_write.c:892
iter_file_splice_write+0x6fa/0xc10 fs/splice.c:689
do_splice_from fs/splice.c:767 [inline]
direct_splice_actor+0x110/0x180 fs/splice.c:936
splice_direct_to_actor+0x34b/0x8c0 fs/splice.c:891
do_splice_direct+0x1b3/0x280 fs/splice.c:979
do_sendfile+0xaf2/0x1250 fs/read_write.c:1245
__do_sys_sendfile64 fs/read_write.c:1310 [inline]
__se_sys_sendfile64 fs/read_write.c:1296 [inline]
__x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1296
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f6876217049
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:00007f6874b8c168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f6876329f60 RCX: 00007f6876217049
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000003
RBP: 00007f687627108d R08: 0000000000000000 R09: 0000000000000000
R10: 00000000108d1521 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd88fbc15f R14: 00007f6874b8c300 R15: 0000000000022000
The buggy address belongs to the page:
page:ffffea0000923240 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x248c9
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea0000923288 ffffea0000923208 0000000000000000
raw: 0000000000000000 ffff8880248c9000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2c2220(__GFP_HIGH|__GFP_ATOMIC|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 20756, ts 1618320445228, free_ts 1618969454263
prep_new_page mm/page_alloc.c:2434 [inline]
get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165
__alloc_pages_slowpath.constprop.0+0x2eb/0x20d0 mm/page_alloc.c:4934
__alloc_pages+0x412/0x500 mm/page_alloc.c:5402
__alloc_pages_node include/linux/gfp.h:572 [inline]
kmem_getpages mm/slab.c:1378 [inline]
cache_grow_begin+0x75/0x390 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]
slab_alloc_node mm/slab.c:3241 [inline]
kmem_cache_alloc_node_trace+0x49c/0x5b0 mm/slab.c:3609
__do_kmalloc_node mm/slab.c:3631 [inline]
__kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3646
kmalloc_reserve net/core/skbuff.c:354 [inline]
__alloc_skb+0xde/0x340 net/core/skbuff.c:426
alloc_skb include/linux/skbuff.h:1158 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
ctnetlink_conntrack_event+0x381/0x15c0 net/netfilter/nf_conntrack_netlink.c:738
__nf_conntrack_eventmask_report+0x1a5/0x4e0 net/netfilter/nf_conntrack_ecache.c:154
nf_conntrack_eventmask_report net/netfilter/nf_conntrack_ecache.c:194 [inline]
nf_conntrack_eventmask_report+0x1c7/0x360 net/netfilter/nf_conntrack_ecache.c:170
ctnetlink_new_conntrack+0x747/0x10d0 net/netfilter/nf_conntrack_netlink.c:2467
nfnetlink_rcv_msg+0xbc9/0x13f0 net/netfilter/nfnetlink.c:296
netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494
nfnetlink_rcv+0x1ac/0x420 net/netfilter/nfnetlink.c:654
netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline]
netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1352 [inline]
free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404
free_unref_page_prepare mm/page_alloc.c:3325 [inline]
free_unref_page+0x19/0x690 mm/page_alloc.c:3404
slab_destroy mm/slab.c:1630 [inline]
slabs_destroy+0x89/0xc0 mm/slab.c:1650
cache_flusharray mm/slab.c:3410 [inline]
___cache_free+0x303/0x600 mm/slab.c:3472
qlink_free mm/kasan/quarantine.c:157 [inline]
qlist_free_all+0x50/0x1a0 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:260 [inline]
slab_post_alloc_hook mm/slab.h:732 [inline]
slab_alloc mm/slab.c:3315 [inline]
kmem_cache_alloc+0x265/0x560 mm/slab.c:3499
kmem_cache_zalloc include/linux/slab.h:704 [inline]
jbd2_alloc_handle include/linux/jbd2.h:1600 [inline]
new_handle fs/jbd2/transaction.c:481 [inline]
jbd2__journal_start+0x186/0x6b0 fs/jbd2/transaction.c:508
__ext4_journal_start_sb+0x3a8/0x4a0 fs/ext4/ext4_jbd2.c:105
__ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline]
ext4_dirty_inode+0x9d/0x110 fs/ext4/inode.c:5899
__mark_inode_dirty+0x45b/0xfe0 fs/fs-writeback.c:2409
mark_inode_dirty include/linux/fs.h:2367 [inline]
generic_write_end+0x31b/0x500 fs/buffer.c:2203
ext4_da_write_end+0x1c2/0x990 fs/ext4/inode.c:3042
generic_perform_write+0x2c6/0x510 mm/filemap.c:3776
ext4_buffered_write_iter+0x1a2/0x390 fs/ext4/file.c:268
Memory state around the buggy address:
ffff8880248c8f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8880248c8f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8880248c9000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8880248c9080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8880248c9100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
----------------
Code disassembly (best guess), 1 bytes skipped:
0: a5 movsl %ds:(%rsi),%es:(%rdi)
1: 7e 83 jle 0xffffff86
3: f8 clc
4: 01 0f add %ecx,(%rdi)
6: 85 b4 02 00 00 9c 58 test %esi,0x589c0000(%rdx,%rax,1)
d: f6 c4 02 test $0x2,%ah
10: 0f 85 9f 02 00 00 jne 0x2b5
16: 48 83 7c 24 08 00 cmpq $0x0,0x8(%rsp)
1c: 74 01 je 0x1f
1e: fb sti
1f: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
26: fc ff df
* 29: 48 01 c3 add %rax,%rbx <-- trapping instruction
2c: 48 c7 03 00 00 00 00 movq $0x0,(%rbx)
33: 48 c7 43 08 00 00 00 movq $0x0,0x8(%rbx)
3a: 00
3b: 48 rex.W
3c: 8b .byte 0x8b
3d: 84 .byte 0x84
3e: 24 .byte 0x24