audit: type=1804 audit(1547147988.362:129): pid=12021 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor2" name="/root/syzkaller-testdir334110542/syzkaller.42NCWE/8170/memory.events" dev="sda1" ino=17239 res=1 ================================================================== BUG: KASAN: use-after-free in __xfrm_policy_eval_candidates net/xfrm/xfrm_policy.c:2019 [inline] BUG: KASAN: use-after-free in xfrm_policy_eval_candidates net/xfrm/xfrm_policy.c:2053 [inline] BUG: KASAN: use-after-free in xfrm_policy_lookup_bytype+0xd27/0xdb0 net/xfrm/xfrm_policy.c:2113 Read of size 4 at addr ffff8880a3d35bb4 by task ksoftirqd/1/16 CPU: 1 PID: 16 Comm: ksoftirqd/1 Not tainted 4.20.0+ #15 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+0x1db/0x2d0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:134 __xfrm_policy_eval_candidates net/xfrm/xfrm_policy.c:2019 [inline] xfrm_policy_eval_candidates net/xfrm/xfrm_policy.c:2053 [inline] xfrm_policy_lookup_bytype+0xd27/0xdb0 net/xfrm/xfrm_policy.c:2113 xfrm_policy_lookup+0x7e/0x90 net/xfrm/xfrm_policy.c:2145 __xfrm_policy_check+0x1426/0x2b00 net/xfrm/xfrm_policy.c:3354 __xfrm_policy_check2 include/net/xfrm.h:1166 [inline] xfrm_policy_check include/net/xfrm.h:1175 [inline] xfrm6_policy_check include/net/xfrm.h:1185 [inline] rawv6_rcv+0x650/0x1330 net/ipv6/raw.c:423 ipv6_raw_deliver net/ipv6/raw.c:223 [inline] raw6_local_deliver+0x4fb/0xc70 net/ipv6/raw.c:239 ip6_protocol_deliver_rcu+0x414/0x1940 net/ipv6/ip6_input.c:344 ip6_input_finish+0x84/0x170 net/ipv6/ip6_input.c:434 NF_HOOK include/linux/netfilter.h:289 [inline] NF_HOOK include/linux/netfilter.h:283 [inline] ip6_input+0xf9/0x600 net/ipv6/ip6_input.c:443 dst_input include/net/dst.h:450 [inline] ip6_rcv_finish+0x177/0x330 net/ipv6/ip6_input.c:76 NF_HOOK include/linux/netfilter.h:289 [inline] NF_HOOK include/linux/netfilter.h:283 [inline] ipv6_rcv+0x113/0x650 net/ipv6/ip6_input.c:272 __netif_receive_skb_one_core+0x160/0x210 net/core/dev.c:4973 __netif_receive_skb+0x2c/0x1c0 net/core/dev.c:5083 process_backlog+0x206/0x750 net/core/dev.c:5923 napi_poll net/core/dev.c:6346 [inline] net_rx_action+0x76d/0x1930 net/core/dev.c:6412 __do_softirq+0x30b/0xb11 kernel/softirq.c:292 run_ksoftirqd kernel/softirq.c:654 [inline] run_ksoftirqd+0x8e/0x110 kernel/softirq.c:646 smpboot_thread_fn+0x6ab/0xa10 kernel/smpboot.c:164 kthread+0x357/0x430 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Allocated by task 7967: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] kasan_kmalloc mm/kasan/common.c:482 [inline] kasan_kmalloc+0xcf/0xe0 mm/kasan/common.c:455 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3607 kmalloc include/linux/slab.h:545 [inline] syslog_print kernel/printk/printk.c:1302 [inline] do_syslog kernel/printk/printk.c:1475 [inline] do_syslog+0x5aa/0x17c0 kernel/printk/printk.c:1449 kmsg_read+0x8f/0xc0 fs/proc/kmsg.c:40 proc_reg_read+0x29a/0x3c0 fs/proc/inode.c:231 __vfs_read+0x116/0xb20 fs/read_write.c:416 vfs_read+0x194/0x3e0 fs/read_write.c:452 ksys_read+0x105/0x260 fs/read_write.c:578 __do_sys_read fs/read_write.c:588 [inline] __se_sys_read fs/read_write.c:586 [inline] __x64_sys_read+0x73/0xb0 fs/read_write.c:586 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7967: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:444 kasan_slab_free+0xe/0x10 mm/kasan/common.c:452 __cache_free mm/slab.c:3485 [inline] kfree+0xcf/0x230 mm/slab.c:3804 syslog_print kernel/printk/printk.c:1361 [inline] do_syslog kernel/printk/printk.c:1475 [inline] do_syslog+0x8c8/0x17c0 kernel/printk/printk.c:1449 kmsg_read+0x8f/0xc0 fs/proc/kmsg.c:40 proc_reg_read+0x29a/0x3c0 fs/proc/inode.c:231 __vfs_read+0x116/0xb20 fs/read_write.c:416 vfs_read+0x194/0x3e0 fs/read_write.c:452 ksys_read+0x105/0x260 fs/read_write.c:578 __do_sys_read fs/read_write.c:588 [inline] __se_sys_read fs/read_write.c:586 [inline] __x64_sys_read+0x73/0xb0 fs/read_write.c:586 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a3d35b00 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 180 bytes inside of 1024-byte region [ffff8880a3d35b00, ffff8880a3d35f00) The buggy address belongs to the page: page:ffffea00028f4d00 count:1 mapcount:0 mapping:ffff88812c3f0ac0 index:0xffff8880a3d35200 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea000218f388 ffffea000231ab88 ffff88812c3f0ac0 raw: ffff8880a3d35200 ffff8880a3d34000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a3d35a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880a3d35b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a3d35b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a3d35c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a3d35c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================