================================================================== BUG: KASAN: use-after-free in rtnl_fill_ifinfo+0x420e/0x4670 net/core/rtnetlink.c:1630 Read of size 8 at addr ffff8801c1864498 by task syz-executor4/23613 CPU: 0 PID: 23613 Comm: syz-executor4 Not tainted 4.19.0-rc5-next-20180928+ #84 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+0x1d3/0x2c4 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 rtnl_fill_ifinfo+0x420e/0x4670 net/core/rtnetlink.c:1630 rtmsg_ifinfo_build_skb+0xc9/0x190 net/core/rtnetlink.c:3333 rtmsg_ifinfo_event.part.31+0x45/0xe0 net/core/rtnetlink.c:3365 rtmsg_ifinfo_event net/core/rtnetlink.c:3376 [inline] rtmsg_ifinfo+0x8c/0xa0 net/core/rtnetlink.c:3374 netdev_state_change+0x152/0x1a0 net/core/dev.c:1340 do_setlink+0x2680/0x3f20 net/core/rtnetlink.c:2653 rtnl_group_changelink net/core/rtnetlink.c:2902 [inline] rtnl_newlink+0x1573/0x1d40 net/core/rtnetlink.c:3060 rtnetlink_rcv_msg+0x46a/0xc20 net/core/rtnetlink.c:4730 netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2447 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4748 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0x5a5/0x760 net/netlink/af_netlink.c:1336 netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:632 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2117 __sys_sendmsg+0x11d/0x280 net/socket.c:2155 __do_sys_sendmsg net/socket.c:2164 [inline] __se_sys_sendmsg net/socket.c:2162 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2162 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457579 Code: 1d 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 eb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ff8c513fc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457579 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000004 RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff8c51406d4 R13: 00000000004c38b9 R14: 00000000004d5700 R15: 00000000ffffffff Allocated by task 7121: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 __do_kmalloc_node mm/slab.c:3682 [inline] __kmalloc_node+0x47/0x70 mm/slab.c:3689 kmalloc_node include/linux/slab.h:589 [inline] kzalloc_node include/linux/slab.h:752 [inline] qdisc_alloc+0x10f/0xb50 net/sched/sch_generic.c:820 qdisc_create_dflt+0x7a/0x1e0 net/sched/sch_generic.c:894 attach_one_default_qdisc net/sched/sch_generic.c:1041 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2117 [inline] attach_default_qdiscs net/sched/sch_generic.c:1060 [inline] dev_activate+0x82f/0xcb0 net/sched/sch_generic.c:1103 __dev_open+0x2cb/0x410 net/core/dev.c:1400 __dev_change_flags+0x730/0x9b0 net/core/dev.c:7448 dev_change_flags+0x89/0x150 net/core/dev.c:7517 do_setlink+0xb5f/0x3f20 net/core/rtnetlink.c:2441 rtnl_newlink+0x136f/0x1d40 net/core/rtnetlink.c:3054 rtnetlink_rcv_msg+0x46a/0xc20 net/core/rtnetlink.c:4730 netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2447 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4748 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0x5a5/0x760 net/netlink/af_netlink.c:1336 netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:632 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2117 __sys_sendmsg+0x11d/0x280 net/socket.c:2155 __do_sys_sendmsg net/socket.c:2164 [inline] __se_sys_sendmsg net/socket.c:2162 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2162 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 19454: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3813 qdisc_free+0x89/0x100 net/sched/sch_generic.c:941 qdisc_free_cb+0x19/0x20 net/sched/sch_generic.c:948 __rcu_reclaim kernel/rcu/rcu.h:240 [inline] rcu_do_batch kernel/rcu/tree.c:2437 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2716 [inline] rcu_process_callbacks+0xff9/0x1ad0 kernel/rcu/tree.c:2697 __do_softirq+0x30b/0xb03 kernel/softirq.c:292 The buggy address belongs to the object at ffff8801c1864480 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 24 bytes inside of 2048-byte region [ffff8801c1864480, ffff8801c1864c80) The buggy address belongs to the page: page:ffffea0007061900 count:1 mapcount:0 mapping:ffff8801da800c40 index:0xffff8801c1864480 compound_mapcount: 0 flags: 0x2fffc0000010200(slab|head) raw: 02fffc0000010200 ffffea000701ab88 ffffea000645cb88 ffff8801da800c40 raw: ffff8801c1864480 ffff8801c1864480 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c1864380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c1864400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801c1864480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c1864500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c1864580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== kernel tried to execute NX-protected page - exploit attempt? (uid: 0) BUG: unable to handle kernel paging request at ffff8801c3002a80 PGD bc01067 P4D bc01067 PUD 1d9461063 PMD 1b978a063 PTE 80000001c3002163 Oops: 0011 [#1] PREEMPT SMP KASAN CPU: 0 PID: 23613 Comm: syz-executor4 Tainted: G B 4.19.0-rc5-next-20180928+ #84 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:0xffff8801c3002a80 Code: ff ff 3e 44 a2 86 ff ff ff ff bc 42 a2 86 ff ff ff ff f5 43 a2 86 ff ff ff ff 3e 44 a2 86 ff ff ff ff bc 42 a2 86 ff ff ff ff 43 a2 86 ff ff ff ff 3e 44 a2 86 ff ff ff ff bc 42 a2 86 ff ff RSP: 0018:ffff8801dae06b78 EFLAGS: 00010292 RAX: ffff8801c3002a80 RBX: ffff8801c0d3a140 RCX: ffffffff860c7d0f RDX: ffff8801dae06d20 RSI: ffff8801c1864480 RDI: ffff8801c0d3a140 RBP: ffff8801dae070d0 R08: ffff88018aab8000 R09: 0000000000000000 R10: ffff8801dae070e8 R11: 0000000000000000 R12: 0000000000000000 R13: ffff8801c1864480 R14: 0000000000000100 R15: 0000000000000000 FS: 00007ff8c5140700(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff8801c3002a80 CR3: 00000001cd722000 CR4: 00000000001426f0 Call Trace: dev_queue_xmit+0x17/0x20 net/core/dev.c:3838 neigh_resolve_output+0x67e/0xae0 net/core/neighbour.c:1364 neigh_output include/net/neighbour.h:483 [inline] ip6_finish_output2+0xc91/0x27a0 net/ipv6/ip6_output.c:120 ip6_finish_output+0x4de/0xbc0 net/ipv6/ip6_output.c:154 NF_HOOK_COND include/linux/netfilter.h:276 [inline] ip6_output+0x23e/0x9f0 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:444 [inline] NF_HOOK include/linux/netfilter.h:287 [inline] mld_sendpack+0xae7/0xfb0 net/ipv6/mcast.c:1683 mld_send_cr net/ipv6/mcast.c:1979 [inline] mld_ifc_timer_expire+0x447/0x8a0 net/ipv6/mcast.c:2478 call_timer_fn+0x26d/0x920 kernel/time/timer.c:1326 expire_timers kernel/time/timer.c:1363 [inline] __run_timers+0x7e0/0xc60 kernel/time/timer.c:1682 run_timer_softirq+0x52/0xb0 kernel/time/timer.c:1695 __do_softirq+0x30b/0xb03 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x17f/0x1c0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1cb/0x750 arch/x86/kernel/apic/apic.c:1061 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:804 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:761 [inline] RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0xaf/0xd0 kernel/locking/spinlock.c:184 Code: 70 f4 31 89 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 75 28 48 83 3d 58 3b 7e 01 00 74 15 48 89 df 57 9d <0f> 1f 44 00 00 eb ad e8 fc c5 4c f9 eb bb 0f 0b 0f 0b e8 aa 63 0d RSP: 0018:ffff880185405e28 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: dffffc0000000000 RBX: 0000000000000286 RCX: ffffc90009ed2000 RDX: 1ffffffff1263e8e RSI: ffffffff818377a4 RDI: 0000000000000286 RBP: ffff880185405e38 R08: ffff88018aab8000 R09: fffffbfff1286ea4 R10: fffffbfff1286ea4 R11: ffffffff89437523 R12: ffffffff89437520 R13: 0000000000000000 R14: ffff8801c1864498 R15: 0000000000000000 spin_unlock_irqrestore include/linux/spinlock.h:384 [inline] kasan_end_report+0x32/0x4f mm/kasan/report.c:178 kasan_report_error mm/kasan/report.c:359 [inline] kasan_report.cold.9+0x76/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 rtnl_fill_ifinfo+0x420e/0x4670 net/core/rtnetlink.c:1630 rtmsg_ifinfo_build_skb+0xc9/0x190 net/core/rtnetlink.c:3333 rtmsg_ifinfo_event.part.31+0x45/0xe0 net/core/rtnetlink.c:3365 rtmsg_ifinfo_event net/core/rtnetlink.c:3376 [inline] rtmsg_ifinfo+0x8c/0xa0 net/core/rtnetlink.c:3374 netdev_state_change+0x152/0x1a0 net/core/dev.c:1340 do_setlink+0x2680/0x3f20 net/core/rtnetlink.c:2653 rtnl_group_changelink net/core/rtnetlink.c:2902 [inline] rtnl_newlink+0x1573/0x1d40 net/core/rtnetlink.c:3060 rtnetlink_rcv_msg+0x46a/0xc20 net/core/rtnetlink.c:4730 netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2447 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4748 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0x5a5/0x760 net/netlink/af_netlink.c:1336 netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:632 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2117 __sys_sendmsg+0x11d/0x280 net/socket.c:2155 __do_sys_sendmsg net/socket.c:2164 [inline] __se_sys_sendmsg net/socket.c:2162 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2162 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457579 Code: 1d 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 eb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ff8c513fc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457579 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000004 RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff8c51406d4 R13: 00000000004c38b9 R14: 00000000004d5700 R15: 00000000ffffffff Modules linked in: CR2: ffff8801c3002a80 ---[ end trace d9510dfccc42b163 ]--- RIP: 0010:0xffff8801c3002a80 Code: ff ff 3e 44 a2 86 ff ff ff ff bc 42 a2 86 ff ff ff ff f5 43 a2 86 ff ff ff ff 3e 44 a2 86 ff ff ff ff bc 42 a2 86 ff ff ff ff 43 a2 86 ff ff ff ff 3e 44 a2 86 ff ff ff ff bc 42 a2 86 ff ff RSP: 0018:ffff8801dae06b78 EFLAGS: 00010292 RAX: ffff8801c3002a80 RBX: ffff8801c0d3a140 RCX: ffffffff860c7d0f RDX: ffff8801dae06d20 RSI: ffff8801c1864480 RDI: ffff8801c0d3a140 RBP: ffff8801dae070d0 R08: ffff88018aab8000 R09: 0000000000000000 R10: ffff8801dae070e8 R11: 0000000000000000 R12: 0000000000000000 R13: ffff8801c1864480 R14: 0000000000000100 R15: 0000000000000000 FS: 00007ff8c5140700(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff8801c3002a80 CR3: 00000001cd722000 CR4: 00000000001426f0