syzbot


KASAN: use-after-free Write in skb_release_data

Status: auto-closed as invalid on 2020/11/26 21:03
Reported-by: syzbot+5ec5469fcf21c46a6400@syzkaller.appspotmail.com
First crash: 1618d, last: 1587d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Write in skb_release_data net C 1903 2383d 2436d 8/28 fixed on 2018/08/07 13:43
android-414 KASAN: use-after-free Write in skb_release_data 3 1874d 1953d 0/1 auto-closed as invalid on 2020/02/13 13:09
linux-4.19 KASAN: use-after-free Write in skb_release_data 1 1696d 1696d 0/1 auto-closed as invalid on 2020/08/10 01:37
upstream KASAN: use-after-free Write in skb_release_data (2) net C done unreliable 875 1181d 2241d 0/28 auto-obsoleted due to no activity on 2023/04/16 03:59
linux-4.19 KASAN: use-after-free Write in skb_release_data (2) 3 1310d 1387d 0/1 auto-closed as invalid on 2021/08/30 12:28

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in atomic_sub_return include/asm-generic/atomic-instrumented.h:159 [inline]
BUG: KASAN: use-after-free in skb_release_data+0xe5/0x6f0 net/core/skbuff.c:600
Write of size 4 at addr ffff88819cf454e0 by task syz-executor.2/29068

CPU: 0 PID: 29068 Comm: syz-executor.2 Not tainted 5.4.54-syzkaller-00667-gf311d00f3041 #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+0x14a/0x1ce lib/dump_stack.c:118
 print_address_description+0x93/0x620 mm/kasan/report.c:374
 __kasan_report+0x16d/0x1e0 mm/kasan/report.c:506
 kasan_report+0x36/0x60 mm/kasan/common.c:634
 check_memory_region_inline mm/kasan/generic.c:181 [inline]
 check_memory_region+0x2b5/0x2f0 mm/kasan/generic.c:191
 atomic_sub_return include/asm-generic/atomic-instrumented.h:159 [inline]
 skb_release_data+0xe5/0x6f0 net/core/skbuff.c:600
 skb_release_all net/core/skbuff.c:665 [inline]
 __kfree_skb+0x55/0x180 net/core/skbuff.c:679
 sit_tunnel_xmit+0x443/0x24d0 net/ipv6/sit.c:1054
 __netdev_start_xmit include/linux/netdevice.h:4467 [inline]
 netdev_start_xmit include/linux/netdevice.h:4481 [inline]
 xmit_one+0x219/0x460 net/core/dev.c:3196
 dev_hard_start_xmit net/core/dev.c:3212 [inline]
 __dev_queue_xmit+0x18d9/0x2680 net/core/dev.c:3771
 packet_sendmsg_spkt+0x10a8/0x1730 net/packet/af_packet.c:1991
 sock_sendmsg_nosec net/socket.c:638 [inline]
 sock_sendmsg net/socket.c:658 [inline]
 ____sys_sendmsg+0x58a/0x8d0 net/socket.c:2298
 ___sys_sendmsg net/socket.c:2352 [inline]
 __sys_sendmmsg+0x3b0/0x730 net/socket.c:2455
 __do_sys_sendmmsg net/socket.c:2484 [inline]
 __se_sys_sendmmsg net/socket.c:2481 [inline]
 __x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2481
 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45c429
Code: 8d b6 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 5b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f4d68a4dc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 0000000000026d80 RCX: 000000000045c429
RDX: 0000000000000001 RSI: 0000000020004000 RDI: 0000000000000003
RBP: 000000000078bf48 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c
R13: 00007fff70b4b8bf R14: 00007f4d68a4e9c0 R15: 000000000078bf0c

Allocated by task 29068:
 save_stack mm/kasan/common.c:69 [inline]
 set_track mm/kasan/common.c:77 [inline]
 __kasan_kmalloc+0x12c/0x1c0 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]
 __kmalloc_track_caller+0x201/0x2c0 mm/slub.c:4380
 __kmalloc_reserve net/core/skbuff.c:141 [inline]
 __alloc_skb+0xd1/0x4d0 net/core/skbuff.c:209
 alloc_skb include/linux/skbuff.h:1055 [inline]
 sock_wmalloc+0xaa/0x3d0 net/core/sock.c:2100
 packet_sendmsg_spkt+0x3f8/0x1730 net/packet/af_packet.c:1938
 sock_sendmsg_nosec net/socket.c:638 [inline]
 sock_sendmsg net/socket.c:658 [inline]
 ____sys_sendmsg+0x58a/0x8d0 net/socket.c:2298
 ___sys_sendmsg net/socket.c:2352 [inline]
 __sys_sendmmsg+0x3b0/0x730 net/socket.c:2455
 __do_sys_sendmmsg net/socket.c:2484 [inline]
 __se_sys_sendmmsg net/socket.c:2481 [inline]
 __x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2481
 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 29068:
 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+0x181/0x230 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]
 kfree+0x12b/0x600 mm/slub.c:4002
 skb_release_all net/core/skbuff.c:665 [inline]
 __kfree_skb+0x55/0x180 net/core/skbuff.c:679
 packet_rcv+0x151/0x1410 net/packet/af_packet.c:2153
 dev_queue_xmit_nit+0x946/0x9e0 net/core/dev.c:1991
 xmit_one+0x7b/0x460 net/core/dev.c:3192
 dev_hard_start_xmit net/core/dev.c:3212 [inline]
 __dev_queue_xmit+0x18d9/0x2680 net/core/dev.c:3771
 packet_sendmsg_spkt+0x10a8/0x1730 net/packet/af_packet.c:1991
 sock_sendmsg_nosec net/socket.c:638 [inline]
 sock_sendmsg net/socket.c:658 [inline]
 ____sys_sendmsg+0x58a/0x8d0 net/socket.c:2298
 ___sys_sendmsg net/socket.c:2352 [inline]
 __sys_sendmmsg+0x3b0/0x730 net/socket.c:2455
 __do_sys_sendmmsg net/socket.c:2484 [inline]
 __se_sys_sendmmsg net/socket.c:2481 [inline]
 __x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2481
 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 ffff88819cf45400
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 224 bytes inside of
 512-byte region [ffff88819cf45400, ffff88819cf45600)
The buggy address belongs to the page:
page:ffffea000673d100 refcount:1 mapcount:0 mapping:ffff8881da802500 index:0x0 compound_mapcount: 0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 ffffea000673d000 0000000200000002 ffff8881da802500
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88819cf45380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88819cf45400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88819cf45480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                       ^
 ffff88819cf45500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88819cf45580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/07/29 21:02 https://android.googlesource.com/kernel/common android-5.4 f311d00f3041 233283a1 .config console log report ci2-android-5-4-kasan
2020/06/29 00:59 https://android.googlesource.com/kernel/common android-5.4 54ec87ec7a59 a2cdad9d .config console log report ci2-android-5-4-kasan
* Struck through repros no longer work on HEAD.