==================================================================
BUG: KASAN: double-free in inet_sock_destruct+0x597/0x830 net/ipv4/af_inet.c:159
Free of addr ffff88802acbfb00 by task syz-executor/6117
CPU: 1 UID: 0 PID: 6117 Comm: syz-executor 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~bpo12+1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xcd/0x630 mm/kasan/report.c:482
kasan_report_invalid_free+0xb8/0xe0 mm/kasan/report.c:557
check_slab_allocation+0xc3/0xf0 mm/kasan/common.c:234
kasan_slab_pre_free include/linux/kasan.h:198 [inline]
slab_free_hook mm/slub.c:2485 [inline]
slab_free mm/slub.c:6668 [inline]
kfree+0x21d/0x6e0 mm/slub.c:6876
inet_sock_destruct+0x597/0x830 net/ipv4/af_inet.c:159
__sk_destruct+0x85/0xbc0 net/core/sock.c:2350
sk_destruct+0xc2/0xf0 net/core/sock.c:2412
__sk_free+0xf4/0x3e0 net/core/sock.c:2423
sk_free+0x6a/0x90 net/core/sock.c:2434
sock_put include/net/sock.h:1998 [inline]
sctp_endpoint_destroy_rcu+0xd3/0x100 net/sctp/endpointola.c:197
rcu_do_batch kernel/rcu/tree.c:2605 [inline]
rcu_core+0x79c/0x15f0 kernel/rcu/tree.c:2857
handle_softirqs+0x219/0x950 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0x109/0x170 kernel/softirq.c:723
irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1056
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:debug_smp_processor_id+0x0/0x20 lib/smp_processor_id.c:57
Code: e8 a5 0b 25 f6 e8 d0 7b f4 ff 90 65 ff 0d 08 c1 3a 08 e9 40 ff ff ff 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1e fa 48 c7 c6 00 a5 f2 8b 48 c7 c7 40 a5 f2 8b e9 f9 fe ff
RSP: 0018:ffffc900036ef5e0 EFLAGS: 00000282
RAX: 0000000000000001 RBX: ffffc900036efe80 RCX: ffffc900036f0001
RDX: ffffc900036efe88 RSI: ffffc900036efe70 RDI: ffffc900036ef680
RBP: 0000000000000001 R08: 0000000000000001 R09: 000000006bed133e
R10: 0000000000000002 R11: 0000000000083a9c R12: ffffc900036ef6c0
R13: ffffc900036ef670 R14: ffffc900036efe80 R15: ffffc900036ef6a4
rcu_is_watching_curr_cpu include/linux/context_tracking.h:128 [inline]
rcu_is_watching+0x12/0xc0 kernel/rcu/tree.c:751
rcu_read_unlock include/linux/rcupdate.h:895 [inline]
class_rcu_destructor include/linux/rcupdate.h:1195 [inline]
unwind_next_frame+0xa3b/0x20a0 arch/x86/kernel/unwind_orc.c:479
arch_stack_walk+0x94/0x100 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x8e/0xc0 kernel/stacktrace.c:122
kasan_save_stack+0x33/0x60 mm/kasan/common.c:56
kasan_save_track+0x14/0x30 mm/kasan/common.c:77
kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:252 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284
kasan_slab_free include/linux/kasan.h:234 [inline]
slab_free_hook mm/slub.c:2540 [inline]
slab_free mm/slub.c:6668 [inline]
kfree+0x2f8/0x6e0 mm/slub.c:6876
vfree+0x17c/0xb50 mm/vmalloc.c:3471
copy_entries_to_user net/ipv4/netfilter/arp_tables.c:713 [inline]
get_entries net/ipv4/netfilter/arp_tables.c:867 [inline]
do_arpt_get_ctl+0x844/0x9a0 net/ipv4/netfilter/arp_tables.c:1461
nf_getsockopt+0x7c/0xe0 net/netfilter/nf_sockopt.c:116
ip_getsockopt+0x18c/0x1e0 net/ipv4/ip_sockglue.c:1777
tcp_getsockopt+0xa1/0x100 net/ipv4/tcp.c:4834
do_sock_getsockopt+0x324/0x410 net/socket.c:2383
__sys_getsockopt+0x12f/0x260 net/socket.c:2412
__do_sys_getsockopt net/socket.c:2419 [inline]
__se_sys_getsockopt net/socket.c:2416 [inline]
__x64_sys_getsockopt+0xbd/0x160 net/socket.c:2416
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fe46139150a
Code: ff c3 66 0f 1f 44 00 00 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb b8 0f 1f 44 00 00 49 89 ca b8 37 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 06 c3 0f 1f 44 00 00 48 c7 c2 a8 ff ff ff f7
RSP: 002b:00007fff0b94cd68 EFLAGS: 00000212 ORIG_RAX: 0000000000000037
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fe46139150a
RDX: 0000000000000061 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00007fff0b94cdd0 R08: 00007fff0b94cd7c R09: 00007fff0b94d167
R10: 00007fff0b94cdd0 R11: 0000000000000212 R12: 00007fff0b94cd7c
R13: 00000000000927c0 R14: 00000000000609ae R15: 00007fff0b94d4b0
Allocated by task 18451:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:56
kasan_save_track+0x14/0x30 mm/kasan/common.c:77
poison_kmalloc_redzone mm/kasan/common.c:397 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:414
kasan_kmalloc include/linux/kasan.h:262 [inline]
__do_kmalloc_node mm/slub.c:5657 [inline]
__kmalloc_noprof+0x33d/0x910 mm/slub.c:5669
kmalloc_noprof include/linux/slab.h:961 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
cipso_v4_sock_setattr+0xbb/0x4c0 net/ipv4/cipso_ipv4.c:1890
netlbl_conn_setattr+0x4b8/0x620 net/netlabel/netlabel_kapi.c:1152
selinux_netlbl_socket_connect_helper security/selinux/netlabel.c:569 [inline]
selinux_netlbl_socket_connect_locked+0x14d/0x220 security/selinux/netlabel.c:597
selinux_netlbl_socket_connect+0x26/0x40 security/selinux/netlabel.c:615
selinux_socket_connect+0x64/0x80 security/selinux/hooks.c:5119
security_socket_connect+0xc6/0x240 security/security.c:4165
__sys_connect_file+0x8f/0x1a0 net/socket.c:2085
__sys_connect+0x13b/0x160 net/socket.c:2108
__do_sys_connect net/socket.c:2114 [inline]
__se_sys_connect net/socket.c:2111 [inline]
__x64_sys_connect+0x72/0xb0 net/socket.c:2111
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 6117:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:56
kasan_save_track+0x14/0x30 mm/kasan/common.c:77
kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:252 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284
kasan_slab_free include/linux/kasan.h:234 [inline]
slab_free_hook mm/slub.c:2540 [inline]
slab_free mm/slub.c:6668 [inline]
kfree+0x2f8/0x6e0 mm/slub.c:6876
inet_sock_destruct+0x597/0x830 net/ipv4/af_inet.c:159
__sk_destruct+0x85/0xbc0 net/core/sock.c:2350
sk_destruct+0xc2/0xf0 net/core/sock.c:2412
__sk_free+0xf4/0x3e0 net/core/sock.c:2423
sk_free+0x6a/0x90 net/core/sock.c:2434
sock_put include/net/sock.h:1998 [inline]
sctp_endpoint_destroy_rcu+0xd3/0x100 net/sctp/endpointola.c:197
rcu_do_batch kernel/rcu/tree.c:2605 [inline]
rcu_core+0x79c/0x15f0 kernel/rcu/tree.c:2857
handle_softirqs+0x219/0x950 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0x109/0x170 kernel/softirq.c:723
irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1056
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
The buggy address belongs to the object at ffff88802acbfb00
which belongs to the cache kmalloc-64 of size 64
The buggy address is located 0 bytes inside of
64-byte region [ffff88802acbfb00, ffff88802acbfb40)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2acbf
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff88801b4428c0 ffffea0000e7e5c0 dead000000000004
raw: 0000000000000000 0000000000200020 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1147, tgid 1147 (kworker/u32:7), ts 16603369511, free_ts 16603359463
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1846
prep_new_page mm/page_alloc.c:1854 [inline]
get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3915
__alloc_frozen_pages_noprof+0x25f/0x2430 mm/page_alloc.c:5210
alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486
alloc_slab_page mm/slub.c:3075 [inline]
allocate_slab mm/slub.c:3248 [inline]
new_slab+0x2c3/0x430 mm/slub.c:3302
___slab_alloc+0xe18/0x1c90 mm/slub.c:4656
__slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4779
__slab_alloc_node mm/slub.c:4855 [inline]
slab_alloc_node mm/slub.c:5251 [inline]
__do_kmalloc_node mm/slub.c:5656 [inline]
__kmalloc_node_noprof+0x4d8/0x930 mm/slub.c:5663
kmalloc_node_noprof include/linux/slab.h:987 [inline]
__vmalloc_area_node mm/vmalloc.c:3842 [inline]
__vmalloc_node_range_noprof+0x405/0x16b0 mm/vmalloc.c:4051
__vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:4111
alloc_thread_stack_node kernel/fork.c:354 [inline]
dup_task_struct kernel/fork.c:923 [inline]
copy_process+0x619/0x7430 kernel/fork.c:2052
kernel_clone+0xfc/0x910 kernel/fork.c:2651
user_mode_thread+0xc8/0x110 kernel/fork.c:2727
call_usermodehelper_exec_work kernel/umh.c:171 [inline]
call_usermodehelper_exec_work+0xcb/0x170 kernel/umh.c:157
process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257
process_scheduled_works kernel/workqueue.c:3340 [inline]
worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421
page last free pid 1147 tgid 1147 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
__free_frozen_pages+0x7df/0x1170 mm/page_alloc.c:2943
__kasan_populate_vmalloc_do mm/kasan/shadow.c:393 [inline]
__kasan_populate_vmalloc+0x149/0x220 mm/kasan/shadow.c:424
kasan_populate_vmalloc include/linux/kasan.h:579 [inline]
alloc_vmap_area+0x98d/0x2a50 mm/vmalloc.c:2124
__get_vm_area_node+0x1ca/0x330 mm/vmalloc.c:3219
__vmalloc_node_range_noprof+0x247/0x16b0 mm/vmalloc.c:4011
__vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:4111
alloc_thread_stack_node kernel/fork.c:354 [inline]
dup_task_struct kernel/fork.c:923 [inline]
copy_process+0x619/0x7430 kernel/fork.c:2052
kernel_clone+0xfc/0x910 kernel/fork.c:2651
user_mode_thread+0xc8/0x110 kernel/fork.c:2727
call_usermodehelper_exec_work kernel/umh.c:171 [inline]
call_usermodehelper_exec_work+0xcb/0x170 kernel/umh.c:157
process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257
process_scheduled_works kernel/workqueue.c:3340 [inline]
worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421
kthread+0x3c5/0x780 kernel/kthread.c:463
ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
Memory state around the buggy address:
ffff88802acbfa00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
ffff88802acbfa80: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc
>ffff88802acbfb00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff88802acbfb80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
ffff88802acbfc00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: e8 a5 0b 25 f6 call 0xf6250baa
5: e8 d0 7b f4 ff call 0xfff47bda
a: 90 nop
b: 65 ff 0d 08 c1 3a 08 decl %gs:0x83ac108(%rip) # 0x83ac11a
12: e9 40 ff ff ff jmp 0xffffff57
17: 0f 1f 00 nopl (%rax)
1a: 90 nop
1b: 90 nop
1c: 90 nop
1d: 90 nop
1e: 90 nop
1f: 90 nop
20: 90 nop
21: 90 nop
22: 90 nop
23: 90 nop
24: 90 nop
25: 90 nop
26: 90 nop
27: 90 nop
28: 90 nop
29: 90 nop
* 2a: f3 0f 1e fa endbr64 <-- trapping instruction
2e: 48 c7 c6 00 a5 f2 8b mov $0xffffffff8bf2a500,%rsi
35: 48 c7 c7 40 a5 f2 8b mov $0xffffffff8bf2a540,%rdi
3c: e9 .byte 0xe9
3d: f9 stc
3e: fe (bad)
3f: ff .byte 0xff