tipc: Failed do clone local mcast rcv buffer ================================================================== BUG: KASAN: use-after-free in __skb_unlink include/linux/skbuff.h:2031 [inline] BUG: KASAN: use-after-free in __skb_dequeue include/linux/skbuff.h:2050 [inline] BUG: KASAN: use-after-free in __skb_queue_purge include/linux/skbuff.h:2761 [inline] BUG: KASAN: use-after-free in tipc_mcast_xmit+0x101f/0x1690 net/tipc/bcast.c:421 Read of size 8 at addr ffff8881d3e5af00 by task syz-executor.2/21634 CPU: 1 PID: 21634 Comm: syz-executor.2 Not tainted 5.4.68-syzkaller-00475-g673e6740f870 #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+0x1b0/0x21e lib/dump_stack.c:118 print_address_description+0x96/0x5d0 mm/kasan/report.c:374 __kasan_report+0x14b/0x1c0 mm/kasan/report.c:506 kasan_report+0x27/0x50 mm/kasan/common.c:634 __skb_unlink include/linux/skbuff.h:2031 [inline] __skb_dequeue include/linux/skbuff.h:2050 [inline] __skb_queue_purge include/linux/skbuff.h:2761 [inline] tipc_mcast_xmit+0x101f/0x1690 net/tipc/bcast.c:421 tipc_sendmcast+0xc00/0xeb0 net/tipc/socket.c:819 __tipc_sendmsg+0x120d/0x2ce0 net/tipc/socket.c:1357 tipc_sendmsg+0x51/0x70 net/tipc/socket.c:1290 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] kernel_sendmsg+0xe2/0x120 net/socket.c:678 sock_no_sendpage+0x13f/0x1b0 net/core/sock.c:2768 kernel_sendpage net/socket.c:3764 [inline] sock_sendpage+0xd0/0x120 net/socket.c:936 pipe_to_sendpage+0x23b/0x300 fs/splice.c:449 splice_from_pipe_feed fs/splice.c:500 [inline] __splice_from_pipe+0x2d3/0x870 fs/splice.c:624 splice_from_pipe fs/splice.c:659 [inline] generic_splice_sendpage+0x172/0x200 fs/splice.c:829 splice_direct_to_actor+0x496/0xb00 fs/splice.c:976 do_splice_direct+0x279/0x3d0 fs/splice.c:1064 do_sendfile+0x89d/0x1110 fs/read_write.c:1464 __do_sys_sendfile64 fs/read_write.c:1525 [inline] __se_sys_sendfile64 fs/read_write.c:1511 [inline] __x64_sys_sendfile64+0x1ae/0x220 fs/read_write.c:1511 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45dd99 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:00007fe4e6e79c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 0000000000027ec0 RCX: 000000000045dd99 RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000005 RBP: 000000000118bf68 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000200fc0 R11: 0000000000000246 R12: 000000000118bf2c R13: 00007fff0b86e0ef R14: 00007fe4e6e7a9c0 R15: 000000000118bf2c Allocated by task 21634: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc+0x117/0x1b0 mm/kasan/common.c:510 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2793 [inline] slab_alloc mm/slub.c:2801 [inline] kmem_cache_alloc+0x1d5/0x250 mm/slub.c:2806 kmem_cache_alloc_node include/linux/slab.h:427 [inline] __alloc_skb+0x88/0x4d0 net/core/skbuff.c:198 alloc_skb_fclone include/linux/skbuff.h:1107 [inline] tipc_buf_acquire net/tipc/msg.c:66 [inline] tipc_msg_build+0x727/0x1a60 net/tipc/msg.c:368 tipc_sendmcast+0x92a/0xeb0 net/tipc/socket.c:813 __tipc_sendmsg+0x120d/0x2ce0 net/tipc/socket.c:1357 tipc_sendmsg+0x51/0x70 net/tipc/socket.c:1290 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] kernel_sendmsg+0xe2/0x120 net/socket.c:678 sock_no_sendpage+0x13f/0x1b0 net/core/sock.c:2768 kernel_sendpage net/socket.c:3764 [inline] sock_sendpage+0xd0/0x120 net/socket.c:936 pipe_to_sendpage+0x23b/0x300 fs/splice.c:449 splice_from_pipe_feed fs/splice.c:500 [inline] __splice_from_pipe+0x2d3/0x870 fs/splice.c:624 splice_from_pipe fs/splice.c:659 [inline] generic_splice_sendpage+0x172/0x200 fs/splice.c:829 splice_direct_to_actor+0x496/0xb00 fs/splice.c:976 do_splice_direct+0x279/0x3d0 fs/splice.c:1064 do_sendfile+0x89d/0x1110 fs/read_write.c:1464 __do_sys_sendfile64 fs/read_write.c:1525 [inline] __se_sys_sendfile64 fs/read_write.c:1511 [inline] __x64_sys_sendfile64+0x1ae/0x220 fs/read_write.c:1511 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 21634: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x168/0x220 mm/kasan/common.c:471 slab_free_hook mm/slub.c:1443 [inline] slab_free_freelist_hook+0xd0/0x150 mm/slub.c:1476 slab_free mm/slub.c:3041 [inline] kmem_cache_free+0xac/0x5c0 mm/slub.c:3057 tipc_buf_append+0x2d1/0xad0 net/tipc/msg.c:188 tipc_msg_reassemble+0x331/0x590 net/tipc/msg.c:726 tipc_mcast_xmit+0x223/0x1690 net/tipc/bcast.c:385 tipc_sendmcast+0xc00/0xeb0 net/tipc/socket.c:819 __tipc_sendmsg+0x120d/0x2ce0 net/tipc/socket.c:1357 tipc_sendmsg+0x51/0x70 net/tipc/socket.c:1290 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] kernel_sendmsg+0xe2/0x120 net/socket.c:678 sock_no_sendpage+0x13f/0x1b0 net/core/sock.c:2768 kernel_sendpage net/socket.c:3764 [inline] sock_sendpage+0xd0/0x120 net/socket.c:936 pipe_to_sendpage+0x23b/0x300 fs/splice.c:449 splice_from_pipe_feed fs/splice.c:500 [inline] __splice_from_pipe+0x2d3/0x870 fs/splice.c:624 splice_from_pipe fs/splice.c:659 [inline] generic_splice_sendpage+0x172/0x200 fs/splice.c:829 splice_direct_to_actor+0x496/0xb00 fs/splice.c:976 do_splice_direct+0x279/0x3d0 fs/splice.c:1064 do_sendfile+0x89d/0x1110 fs/read_write.c:1464 __do_sys_sendfile64 fs/read_write.c:1525 [inline] __se_sys_sendfile64 fs/read_write.c:1511 [inline] __x64_sys_sendfile64+0x1ae/0x220 fs/read_write.c:1511 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8881d3e5af00 which belongs to the cache skbuff_fclone_cache of size 488 The buggy address is located 0 bytes inside of 488-byte region [ffff8881d3e5af00, ffff8881d3e5b0e8) The buggy address belongs to the page: page:ffffea00074f9680 refcount:1 mapcount:0 mapping:ffff8881daa93b80 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881daa93b80 raw: 0000000000000000 00000000800c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d3e5ae00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffff8881d3e5ae80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881d3e5af00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d3e5af80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d3e5b000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: double-free or invalid-free in slab_free mm/slub.c:3041 [inline] BUG: KASAN: double-free or invalid-free in kmem_cache_free+0xac/0x5c0 mm/slub.c:3057 CPU: 1 PID: 21634 Comm: syz-executor.2 Tainted: G B 5.4.68-syzkaller-00475-g673e6740f870 #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+0x1b0/0x21e lib/dump_stack.c:118 print_address_description+0x96/0x5d0 mm/kasan/report.c:374 kasan_report_invalid_free+0x54/0xc0 mm/kasan/report.c:468 __kasan_slab_free+0x102/0x220 mm/kasan/common.c:459 slab_free_hook mm/slub.c:1443 [inline] slab_free_freelist_hook+0xd0/0x150 mm/slub.c:1476 slab_free mm/slub.c:3041 [inline] kmem_cache_free+0xac/0x5c0 mm/slub.c:3057 __skb_queue_purge include/linux/skbuff.h:2762 [inline] tipc_mcast_xmit+0x109f/0x1690 net/tipc/bcast.c:421 tipc_sendmcast+0xc00/0xeb0 net/tipc/socket.c:819 __tipc_sendmsg+0x120d/0x2ce0 net/tipc/socket.c:1357 tipc_sendmsg+0x51/0x70 net/tipc/socket.c:1290 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] kernel_sendmsg+0xe2/0x120 net/socket.c:678 sock_no_sendpage+0x13f/0x1b0 net/core/sock.c:2768 kernel_sendpage net/socket.c:3764 [inline] sock_sendpage+0xd0/0x120 net/socket.c:936 pipe_to_sendpage+0x23b/0x300 fs/splice.c:449 splice_from_pipe_feed fs/splice.c:500 [inline] __splice_from_pipe+0x2d3/0x870 fs/splice.c:624 splice_from_pipe fs/splice.c:659 [inline] generic_splice_sendpage+0x172/0x200 fs/splice.c:829 splice_direct_to_actor+0x496/0xb00 fs/splice.c:976 do_splice_direct+0x279/0x3d0 fs/splice.c:1064 do_sendfile+0x89d/0x1110 fs/read_write.c:1464 __do_sys_sendfile64 fs/read_write.c:1525 [inline] __se_sys_sendfile64 fs/read_write.c:1511 [inline] __x64_sys_sendfile64+0x1ae/0x220 fs/read_write.c:1511 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45dd99 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:00007fe4e6e79c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 0000000000027ec0 RCX: 000000000045dd99 RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000005 RBP: 000000000118bf68 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000200fc0 R11: 0000000000000246 R12: 000000000118bf2c R13: 00007fff0b86e0ef R14: 00007fe4e6e7a9c0 R15: 000000000118bf2c Allocated by task 21634: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc+0x117/0x1b0 mm/kasan/common.c:510 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2793 [inline] slab_alloc mm/slub.c:2801 [inline] kmem_cache_alloc+0x1d5/0x250 mm/slub.c:2806 __build_skb net/core/skbuff.c:311 [inline] __netdev_alloc_skb+0x1d8/0x710 net/core/skbuff.c:464 netdev_alloc_skb include/linux/skbuff.h:2789 [inline] dev_alloc_skb include/linux/skbuff.h:2802 [inline] __ieee80211_beacon_get+0x628/0x11b0 net/mac80211/tx.c:4547 ieee80211_beacon_get_tim+0xb7/0x500 net/mac80211/tx.c:4658 ieee80211_beacon_get include/net/mac80211.h:4728 [inline] mac80211_hwsim_beacon_tx+0xd4/0x570 drivers/net/wireless/mac80211_hwsim.c:1560 __iterate_interfaces+0x1fc/0x390 net/mac80211/util.c:738 ieee80211_iterate_active_interfaces_atomic+0x2e/0x40 net/mac80211/util.c:774 mac80211_hwsim_beacon+0xa1/0x180 drivers/net/wireless/mac80211_hwsim.c:1596 __run_hrtimer+0x405/0x7a0 kernel/time/hrtimer.c:1517 __hrtimer_run_queues kernel/time/hrtimer.c:1579 [inline] hrtimer_run_softirq+0x320/0x450 kernel/time/hrtimer.c:1596 __do_softirq+0x22e/0x569 kernel/softirq.c:292 Freed by task 21634: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x168/0x220 mm/kasan/common.c:471 slab_free_hook mm/slub.c:1443 [inline] slab_free_freelist_hook+0xd0/0x150 mm/slub.c:1476 slab_free mm/slub.c:3041 [inline] kmem_cache_free+0xac/0x5c0 mm/slub.c:3057 mac80211_hwsim_beacon_tx+0x35e/0x570 drivers/net/wireless/mac80211_hwsim.c:1578 __iterate_interfaces+0x1fc/0x390 net/mac80211/util.c:738 ieee80211_iterate_active_interfaces_atomic+0x2e/0x40 net/mac80211/util.c:774 mac80211_hwsim_beacon+0xa1/0x180 drivers/net/wireless/mac80211_hwsim.c:1596 __run_hrtimer+0x405/0x7a0 kernel/time/hrtimer.c:1517 __hrtimer_run_queues kernel/time/hrtimer.c:1579 [inline] hrtimer_run_softirq+0x320/0x450 kernel/time/hrtimer.c:1596 __do_softirq+0x22e/0x569 kernel/softirq.c:292 The buggy address belongs to the object at ffff888180343b40 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 0 bytes inside of 240-byte region [ffff888180343b40, ffff888180343c30) The buggy address belongs to the page: page:ffffea000600d0c0 refcount:1 mapcount:0 mapping:ffff8881daa93400 index:0xffff888180343280 flags: 0x8000000000000200(slab) raw: 8000000000000200 ffffea0006031f88 ffffea0005b3cf08 ffff8881daa93400 raw: ffff888180343280 00000000000c000b 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888180343a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888180343a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc >ffff888180343b00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff888180343b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888180343c00: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ==================================================================