==================================================================
BUG: KASAN: use-after-free in skb_copy_bits+0x6f0/0x780 net/core/skbuff.c:2427
Read of size 4 at addr ffff888029d666b0 by task kworker/u4:8/7951
CPU: 1 PID: 7951 Comm: kworker/u4:8 Not tainted 5.17.0-rc5-syzkaller-01623-ga02192151b7d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: bat_events batadv_nc_worker
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/0x336 mm/kasan/report.c:255
__kasan_report mm/kasan/report.c:442 [inline]
kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
skb_copy_bits+0x6f0/0x780 net/core/skbuff.c:2427
__skb_header_pointer include/linux/skbuff.h:3867 [inline]
skb_header_pointer include/linux/skbuff.h:3876 [inline]
sctp_rcv_ootb net/sctp/input.c:702 [inline]
sctp_rcv+0x2041/0x3290 net/sctp/input.c:196
sctp6_rcv+0x38/0x60 net/sctp/ipv6.c:1109
ip6_protocol_deliver_rcu+0x2e9/0x1d10 net/ipv6/ip6_input.c:422
ip6_input_finish+0x62/0x170 net/ipv6/ip6_input.c:463
NF_HOOK include/linux/netfilter.h:307 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:472
dst_input include/net/dst.h:461 [inline]
ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline]
NF_HOOK include/linux/netfilter.h:307 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
ipv6_rcv+0x27f/0x3b0 net/ipv6/ip6_input.c:297
__netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5358
__netif_receive_skb+0x24/0x1b0 net/core/dev.c:5472
process_backlog+0x2a5/0x680 net/core/dev.c:5800
__napi_poll+0xaf/0x440 net/core/dev.c:6366
napi_poll net/core/dev.c:6433 [inline]
net_rx_action+0x801/0xb40 net/core/dev.c:6520
__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_release+0x3f1/0x720 kernel/locking/lockdep.c:5647
Code: 7e 83 f8 01 0f 85 8d 01 00 00 9c 58 f6 c4 02 0f 85 78 01 00 00 48 f7 04 24 00 02 00 00 74 01 fb 48 b8 00 00 00 00 00 fc ff df <48> 01 c5 48 c7 45 00 00 00 00 00 c7 45 08 00 00 00 00 48 8b 84 24
RSP: 0018:ffffc900026afbd0 EFLAGS: 00000206
RAX: dffffc0000000000 RBX: 36b2c06577f847d0 RCX: ffffc900026afc20
RDX: 1ffff1100f96788a RSI: 0000000000000000 RDI: 0000000000000000
RBP: 1ffff920004d5f7c R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000002
R13: 0000000000000003 R14: ffff88807cb3c458 R15: ffff88807cb3ba00
rcu_lock_release include/linux/rcupdate.h:273 [inline]
rcu_read_unlock include/linux/rcupdate.h:727 [inline]
batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:412 [inline]
batadv_nc_worker+0x86b/0xfa0 net/batman-adv/network-coding.c:719
process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307
worker_thread+0x657/0x1110 kernel/workqueue.c:2454
kthread+0x2e9/0x3a0 kernel/kthread.c:377
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Allocated by task 7951:
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_slab_alloc+0x90/0xc0 mm/kasan/common.c:469
kasan_slab_alloc include/linux/kasan.h:260 [inline]
slab_post_alloc_hook mm/slab.h:732 [inline]
slab_alloc_node mm/slub.c:3230 [inline]
kmem_cache_alloc_node+0x2c3/0x4f0 mm/slub.c:3266
__alloc_skb+0x215/0x340 net/core/skbuff.c:414
alloc_skb include/linux/skbuff.h:1233 [inline]
sctp_packet_pack net/sctp/output.c:471 [inline]
sctp_packet_transmit+0xcca/0x3070 net/sctp/output.c:620
sctp_outq_flush_transports+0x406/0x7b0 net/sctp/outqueue.c:1166
sctp_outq_flush net/sctp/outqueue.c:1214 [inline]
sctp_outq_uncork+0x185/0x200 net/sctp/outqueue.c:761
sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1812 [inline]
sctp_side_effects net/sctp/sm_sideeffect.c:1195 [inline]
sctp_do_sm+0x745/0x4f00 net/sctp/sm_sideeffect.c:1166
sctp_assoc_bh_rcv+0x386/0x6c0 net/sctp/associola.c:1054
sctp_inq_push+0x1d2/0x270 net/sctp/inqueue.c:80
sctp_rcv+0xfb9/0x3290 net/sctp/input.c:256
sctp6_rcv+0x38/0x60 net/sctp/ipv6.c:1109
ip6_protocol_deliver_rcu+0x2e9/0x1d10 net/ipv6/ip6_input.c:422
ip6_input_finish+0x62/0x170 net/ipv6/ip6_input.c:463
NF_HOOK include/linux/netfilter.h:307 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:472
dst_input include/net/dst.h:461 [inline]
ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline]
NF_HOOK include/linux/netfilter.h:307 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
ipv6_rcv+0x27f/0x3b0 net/ipv6/ip6_input.c:297
__netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5358
__netif_receive_skb+0x24/0x1b0 net/core/dev.c:5472
process_backlog+0x2a5/0x680 net/core/dev.c:5800
__napi_poll+0xaf/0x440 net/core/dev.c:6366
napi_poll net/core/dev.c:6433 [inline]
net_rx_action+0x801/0xb40 net/core/dev.c:6520
__do_softirq+0x29b/0x9c2 kernel/softirq.c:558
Freed by task 7951:
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+0x126/0x160 mm/kasan/common.c:328
kasan_slab_free include/linux/kasan.h:236 [inline]
slab_free_hook mm/slub.c:1728 [inline]
slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754
slab_free mm/slub.c:3509 [inline]
kmem_cache_free+0xd7/0x370 mm/slub.c:3526
kfree_skbmem+0xef/0x1b0 net/core/skbuff.c:700
__kfree_skb net/core/skbuff.c:757 [inline]
consume_skb net/core/skbuff.c:914 [inline]
consume_skb+0xcf/0x160 net/core/skbuff.c:908
sctp_chunk_destroy net/sctp/sm_make_chunk.c:1503 [inline]
sctp_chunk_put+0x1c0/0x2d0 net/sctp/sm_make_chunk.c:1530
sctp_inq_free+0x17f/0x260 net/sctp/inqueue.c:56
sctp_association_free+0x221/0x7d0 net/sctp/associola.c:348
sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:940 [inline]
sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1324 [inline]
sctp_side_effects net/sctp/sm_sideeffect.c:1195 [inline]
sctp_do_sm+0x3855/0x4f00 net/sctp/sm_sideeffect.c:1166
sctp_assoc_bh_rcv+0x386/0x6c0 net/sctp/associola.c:1054
sctp_inq_push+0x1d2/0x270 net/sctp/inqueue.c:80
sctp_rcv+0xfb9/0x3290 net/sctp/input.c:256
sctp6_rcv+0x38/0x60 net/sctp/ipv6.c:1109
ip6_protocol_deliver_rcu+0x2e9/0x1d10 net/ipv6/ip6_input.c:422
ip6_input_finish+0x62/0x170 net/ipv6/ip6_input.c:463
NF_HOOK include/linux/netfilter.h:307 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:472
dst_input include/net/dst.h:461 [inline]
ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline]
NF_HOOK include/linux/netfilter.h:307 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
ipv6_rcv+0x27f/0x3b0 net/ipv6/ip6_input.c:297
__netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5358
__netif_receive_skb+0x24/0x1b0 net/core/dev.c:5472
process_backlog+0x2a5/0x680 net/core/dev.c:5800
__napi_poll+0xaf/0x440 net/core/dev.c:6366
napi_poll net/core/dev.c:6433 [inline]
net_rx_action+0x801/0xb40 net/core/dev.c:6520
__do_softirq+0x29b/0x9c2 kernel/softirq.c:558
The buggy address belongs to the object at ffff888029d66640
which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 112 bytes inside of
232-byte region [ffff888029d66640, ffff888029d66728)
The buggy address belongs to the page:
page:ffffea0000a75980 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x29d66
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 dead000000000122 ffff8881401ab500
raw: 0000000000000000 00000000000c000c 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 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 7951, ts 995798731248, free_ts 984648100753
prep_new_page mm/page_alloc.c:2434 [inline]
get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165
__alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389
alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271
alloc_slab_page mm/slub.c:1799 [inline]
allocate_slab+0x27f/0x3c0 mm/slub.c:1944
new_slab mm/slub.c:2004 [inline]
___slab_alloc+0xbe1/0x12b0 mm/slub.c:3018
__slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105
slab_alloc_node mm/slub.c:3196 [inline]
kmem_cache_alloc_node+0x190/0x4f0 mm/slub.c:3266
__alloc_skb+0x215/0x340 net/core/skbuff.c:414
alloc_skb include/linux/skbuff.h:1233 [inline]
sctp_packet_transmit+0x1e7/0x3070 net/sctp/output.c:597
sctp_outq_flush_transports+0x406/0x7b0 net/sctp/outqueue.c:1166
sctp_outq_flush net/sctp/outqueue.c:1214 [inline]
sctp_outq_uncork+0x185/0x200 net/sctp/outqueue.c:761
sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1812 [inline]
sctp_side_effects net/sctp/sm_sideeffect.c:1195 [inline]
sctp_do_sm+0x745/0x4f00 net/sctp/sm_sideeffect.c:1166
sctp_assoc_bh_rcv+0x386/0x6c0 net/sctp/associola.c:1054
sctp_inq_push+0x1d2/0x270 net/sctp/inqueue.c:80
sctp_rcv+0xfb9/0x3290 net/sctp/input.c:256
sctp6_rcv+0x38/0x60 net/sctp/ipv6.c:1109
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_list+0x1a9/0xfa0 mm/page_alloc.c:3441
release_pages+0x317/0x1220 mm/swap.c:980
tlb_batch_pages_flush mm/mmu_gather.c:50 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:243 [inline]
tlb_flush_mmu mm/mmu_gather.c:250 [inline]
tlb_finish_mmu+0x165/0x8c0 mm/mmu_gather.c:341
exit_mmap+0x21b/0x670 mm/mmap.c:3180
__mmput+0x122/0x4b0 kernel/fork.c:1114
mmput+0x56/0x60 kernel/fork.c:1135
exit_mm kernel/exit.c:507 [inline]
do_exit+0xa3c/0x2a30 kernel/exit.c:793
do_group_exit+0xd2/0x2f0 kernel/exit.c:935
get_signal+0x45a/0x2490 kernel/signal.c:2863
arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868
handle_signal_work kernel/entry/common.c:148 [inline]
exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207
__syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300
do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x44/0xae
Memory state around the buggy address:
ffff888029d66580: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc
ffff888029d66600: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
>ffff888029d66680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888029d66700: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
ffff888029d66780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 7e 83 jle 0xffffff85
2: f8 clc
3: 01 0f add %ecx,(%rdi)
5: 85 8d 01 00 00 9c test %ecx,-0x63ffffff(%rbp)
b: 58 pop %rax
c: f6 c4 02 test $0x2,%ah
f: 0f 85 78 01 00 00 jne 0x18d
15: 48 f7 04 24 00 02 00 testq $0x200,(%rsp)
1c: 00
1d: 74 01 je 0x20
1f: fb sti
20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
27: fc ff df
* 2a: 48 01 c5 add %rax,%rbp <-- trapping instruction
2d: 48 c7 45 00 00 00 00 movq $0x0,0x0(%rbp)
34: 00
35: c7 45 08 00 00 00 00 movl $0x0,0x8(%rbp)
3c: 48 rex.W
3d: 8b .byte 0x8b
3e: 84 .byte 0x84
3f: 24 .byte 0x24