==================================================================
BUG: KASAN: use-after-free in decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393
Read of size 1 at addr ffff88802cf0c0af by task syz-executor.0/11755
CPU: 1 PID: 11755 Comm: syz-executor.0 Not tainted 5.10.0-rc2-next-20201104-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x107/0x163 lib/dump_stack.c:118
print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385
__kasan_report mm/kasan/report.c:545 [inline]
kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562
decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393
__xfrm_decode_session net/xfrm/xfrm_policy.c:3485 [inline]
__xfrm_policy_check+0x2fa/0x2850 net/xfrm/xfrm_policy.c:3540
__xfrm_policy_check2 include/net/xfrm.h:1097 [inline]
xfrm_policy_check include/net/xfrm.h:1106 [inline]
sctp_rcv+0x12b0/0x2e30 net/sctp/input.c:202
sctp6_rcv+0x22/0x40 net/sctp/ipv6.c:1078
ip6_protocol_deliver_rcu+0x2e8/0x1680 net/ipv6/ip6_input.c:433
ip6_input_finish+0x7f/0x160 net/ipv6/ip6_input.c:474
NF_HOOK include/linux/netfilter.h:301 [inline]
NF_HOOK include/linux/netfilter.h:295 [inline]
ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:483
dst_input include/net/dst.h:447 [inline]
ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
NF_HOOK include/linux/netfilter.h:295 [inline]
ipv6_rcv+0x28e/0x3c0 net/ipv6/ip6_input.c:307
__netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5315
__netif_receive_skb+0x27/0x1c0 net/core/dev.c:5429
process_backlog+0x232/0x6c0 net/core/dev.c:6319
napi_poll net/core/dev.c:6763 [inline]
net_rx_action+0x4dc/0x1100 net/core/dev.c:6833
__do_softirq+0x2a0/0x9f6 kernel/softirq.c:298
asm_call_irq_on_stack+0xf/0x20
__run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline]
run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline]
do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77
do_softirq kernel/softirq.c:343 [inline]
do_softirq+0xb5/0xe0 kernel/softirq.c:330
__local_bh_enable_ip+0xf0/0x110 kernel/softirq.c:195
local_bh_enable include/linux/bottom_half.h:32 [inline]
rcu_read_unlock_bh include/linux/rcupdate.h:731 [inline]
ip6_finish_output2+0x71f/0x16c0 net/ipv6/ip6_output.c:118
__ip6_finish_output net/ipv6/ip6_output.c:143 [inline]
__ip6_finish_output+0x447/0xab0 net/ipv6/ip6_output.c:128
ip6_finish_output+0x34/0x1f0 net/ipv6/ip6_output.c:153
NF_HOOK_COND include/linux/netfilter.h:290 [inline]
ip6_output+0x1db/0x520 net/ipv6/ip6_output.c:176
dst_output include/net/dst.h:441 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
NF_HOOK include/linux/netfilter.h:295 [inline]
ip6_xmit+0x1258/0x1e80 net/ipv6/ip6_output.c:280
sctp_v6_xmit+0xbf3/0xfe0 net/sctp/ipv6.c:223
sctp_packet_transmit+0x1f44/0x32f0 net/sctp/output.c:627
sctp_packet_singleton net/sctp/outqueue.c:773 [inline]
sctp_outq_flush_ctrl.constprop.0+0x6d3/0xc40 net/sctp/outqueue.c:904
sctp_outq_flush+0xf3/0x2580 net/sctp/outqueue.c:1186
sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1801 [inline]
sctp_side_effects net/sctp/sm_sideeffect.c:1185 [inline]
sctp_do_sm+0x74e/0x5120 net/sctp/sm_sideeffect.c:1156
sctp_primitive_ASSOCIATE+0x98/0xc0 net/sctp/primitive.c:73
__sctp_connect+0x9e5/0xc30 net/sctp/socket.c:1217
sctp_connect net/sctp/socket.c:4730 [inline]
sctp_inet_connect+0x15e/0x200 net/sctp/socket.c:4745
__sys_connect_file+0x155/0x1a0 net/socket.c:1852
__sys_connect+0x161/0x190 net/socket.c:1869
__do_sys_connect net/socket.c:1879 [inline]
__se_sys_connect net/socket.c:1876 [inline]
__x64_sys_connect+0x6f/0xb0 net/socket.c:1876
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45deb9
Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fdac2a02c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000002400 RCX: 000000000045deb9
RDX: 000000000000001c RSI: 0000000020000200 RDI: 0000000000000003
RBP: 000000000118bf60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c
R13: 00007ffd0c2db2af R14: 00007fdac2a039c0 R15: 000000000118bf2c
Allocated by task 11282:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
kasan_set_track mm/kasan/common.c:56 [inline]
__kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461
kmalloc include/linux/slab.h:557 [inline]
tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_number_perm+0x1d5/0x590 security/tomoyo/file.c:723
tomoyo_path_mknod+0x10d/0x190 security/tomoyo/tomoyo.c:240
security_path_mknod+0xf9/0x170 security/security.c:1078
do_mknodat.part.0+0x17a/0x480 fs/namei.c:3594
do_mknodat fs/namei.c:3626 [inline]
__do_sys_mknod fs/namei.c:3628 [inline]
__se_sys_mknod fs/namei.c:3626 [inline]
__x64_sys_mknod+0xf8/0x120 fs/namei.c:3626
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
The buggy address belongs to the object at ffff88802cf0c000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 175 bytes inside of
4096-byte region [ffff88802cf0c000, ffff88802cf0d000)
The buggy address belongs to the page:
page:00000000dfb7904a refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802cf08000 pfn:0x2cf08
head:00000000dfb7904a order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head)
raw: 00fff00000010200 ffff888010040588 ffffea00019b7a08 ffff888010042140
raw: ffff88802cf08000 0000000000040001 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88802cf0bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802cf0c000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88802cf0c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88802cf0c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88802cf0c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
WARNING: CPU: 1 PID: 11755 at drivers/gpu/drm/vkms/vkms_crtc.c:21 vkms_vblank_simulate+0x31e/0x3b0 drivers/gpu/drm/vkms/vkms_crtc.c:21
Modules linked in:
CPU: 1 PID: 11755 Comm: syz-executor.0 Tainted: G B 5.10.0-rc2-next-20201104-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:vkms_vblank_simulate+0x31e/0x3b0 drivers/gpu/drm/vkms/vkms_crtc.c:21
Code: 85 9e 00 00 00 48 8b 95 b8 01 00 00 4c 89 e1 bf 02 00 00 00 48 c7 c6 00 e6 b3 89 e8 ac 10 f0 ff e9 e5 fe ff ff e8 32 b9 34 fd <0f> 0b e9 88 fd ff ff e8 36 6c 76 fd e9 11 fe ff ff 4c 89 ef e8 29
RSP: 0018:ffffc90000d90390 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff888017505e48 RCX: ffffffff843b6523
RDX: ffff888066bb1a80 RSI: ffffffff843b679e RDI: 0000000000000007
RBP: 0000000000000036 R08: 0000000000000000 R09: ffffffff8cece0cf
R10: 0000000000000001 R11: 0000000000000001 R12: ffff888017504d40
R13: 0000000000fe4c00 R14: ffffffff843b6480 R15: dffffc0000000000
FS: 00007fdac2a03700(0000) GS:ffff8880b9f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000004e07f0 CR3: 000000001929e000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__run_hrtimer kernel/time/hrtimer.c:1519 [inline]
__hrtimer_run_queues+0x693/0xea0 kernel/time/hrtimer.c:1583
hrtimer_interrupt+0x334/0x940 kernel/time/hrtimer.c:1645
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1080 [inline]
__sysvec_apic_timer_interrupt+0x146/0x540 arch/x86/kernel/apic/apic.c:1097
run_sysvec_on_irqstack_cond arch/x86/include/asm/irq_stack.h:91 [inline]
sysvec_apic_timer_interrupt+0x48/0x100 arch/x86/kernel/apic/apic.c:1091
asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:631
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x25/0x50 kernel/locking/spinlock.c:191
Code: f8 5d c3 66 90 55 48 89 fd 48 83 c7 18 53 48 89 f3 48 8b 74 24 10 e8 5a 0d 6d f8 48 89 ef e8 c2 cd 6d f8 f6 c7 02 75 1a 53 9d 01 00 00 00 e8 41 17 62 f8 65 8b 05 1a d0 18 77 85 c0 74 0a 5b
RSP: 0018:ffffc90000d90690 EFLAGS: 00000297
RAX: 0000000000000007 RBX: 0000000000000297 RCX: 1ffffffff19da253
RDX: 0000000000000000 RSI: ffffffff8175ec21 RDI: ffffffff88e91fb2
RBP: ffffffff8b45b8e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 6e696c6261736944 R12: ffff88802cf0c0af
R13: ffffffff8798604c R14: ffffffff8798604c R15: 0000000000000000
spin_unlock_irqrestore include/linux/spinlock.h:409 [inline]
end_report+0x2e/0x5e mm/kasan/report.c:97
__kasan_report mm/kasan/report.c:552 [inline]
kasan_report.cold+0xd/0x37 mm/kasan/report.c:562
decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393
__xfrm_decode_session net/xfrm/xfrm_policy.c:3485 [inline]
__xfrm_policy_check+0x2fa/0x2850 net/xfrm/xfrm_policy.c:3540
__xfrm_policy_check2 include/net/xfrm.h:1097 [inline]
xfrm_policy_check include/net/xfrm.h:1106 [inline]
sctp_rcv+0x12b0/0x2e30 net/sctp/input.c:202
sctp6_rcv+0x22/0x40 net/sctp/ipv6.c:1078
ip6_protocol_deliver_rcu+0x2e8/0x1680 net/ipv6/ip6_input.c:433
ip6_input_finish+0x7f/0x160 net/ipv6/ip6_input.c:474
NF_HOOK include/linux/netfilter.h:301 [inline]
NF_HOOK include/linux/netfilter.h:295 [inline]
ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:483
dst_input include/net/dst.h:447 [inline]
ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
NF_HOOK include/linux/netfilter.h:295 [inline]
ipv6_rcv+0x28e/0x3c0 net/ipv6/ip6_input.c:307
__netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5315
__netif_receive_skb+0x27/0x1c0 net/core/dev.c:5429
process_backlog+0x232/0x6c0 net/core/dev.c:6319
napi_poll net/core/dev.c:6763 [inline]
net_rx_action+0x4dc/0x1100 net/core/dev.c:6833
__do_softirq+0x2a0/0x9f6 kernel/softirq.c:298
asm_call_irq_on_stack+0xf/0x20
__run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline]
run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline]
do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77
do_softirq kernel/softirq.c:343 [inline]
do_softirq+0xb5/0xe0 kernel/softirq.c:330
__local_bh_enable_ip+0xf0/0x110 kernel/softirq.c:195
local_bh_enable include/linux/bottom_half.h:32 [inline]
rcu_read_unlock_bh include/linux/rcupdate.h:731 [inline]
ip6_finish_output2+0x71f/0x16c0 net/ipv6/ip6_output.c:118
__ip6_finish_output net/ipv6/ip6_output.c:143 [inline]
__ip6_finish_output+0x447/0xab0 net/ipv6/ip6_output.c:128
ip6_finish_output+0x34/0x1f0 net/ipv6/ip6_output.c:153
NF_HOOK_COND include/linux/netfilter.h:290 [inline]
ip6_output+0x1db/0x520 net/ipv6/ip6_output.c:176
dst_output include/net/dst.h:441 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
NF_HOOK include/linux/netfilter.h:295 [inline]
ip6_xmit+0x1258/0x1e80 net/ipv6/ip6_output.c:280
sctp_v6_xmit+0xbf3/0xfe0 net/sctp/ipv6.c:223
sctp_packet_transmit+0x1f44/0x32f0 net/sctp/output.c:627
sctp_packet_singleton net/sctp/outqueue.c:773 [inline]
sctp_outq_flush_ctrl.constprop.0+0x6d3/0xc40 net/sctp/outqueue.c:904
sctp_outq_flush+0xf3/0x2580 net/sctp/outqueue.c:1186
sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1801 [inline]
sctp_side_effects net/sctp/sm_sideeffect.c:1185 [inline]
sctp_do_sm+0x74e/0x5120 net/sctp/sm_sideeffect.c:1156
sctp_primitive_ASSOCIATE+0x98/0xc0 net/sctp/primitive.c:73
__sctp_connect+0x9e5/0xc30 net/sctp/socket.c:1217
sctp_connect net/sctp/socket.c:4730 [inline]
sctp_inet_connect+0x15e/0x200 net/sctp/socket.c:4745
__sys_connect_file+0x155/0x1a0 net/socket.c:1852
__sys_connect+0x161/0x190 net/socket.c:1869
__do_sys_connect net/socket.c:1879 [inline]
__se_sys_connect net/socket.c:1876 [inline]
__x64_sys_connect+0x6f/0xb0 net/socket.c:1876
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45deb9
Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fdac2a02c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000002400 RCX: 000000000045deb9
RDX: 000000000000001c RSI: 0000000020000200 RDI: 0000000000000003
RBP: 000000000118bf60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c
R13: 00007ffd0c2db2af R14: 00007fdac2a039c0 R15: 000000000118bf2c