syzbot


KASAN: use-after-free Read in bit_putcs

Status: auto-closed as invalid on 2021/01/15 05:05
Reported-by: syzbot+1c95398cbebffb00dba3@syzkaller.appspotmail.com
First crash: 1603d, last: 1317d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: global-out-of-bounds Read in bit_putcs C error 241 591d 1602d 0/1 upstream: reported C repro on 2019/12/07 16:26
upstream KASAN: use-after-free Read in bit_putcs fbdev C 12 1304d 1524d 15/26 fixed on 2020/11/16 12:12
linux-4.19 KASAN: global-out-of-bounds Read in bit_putcs C done 214 1067d 1604d 1/1 fixed on 2021/06/24 08:01
linux-4.19 KASAN: use-after-free Read in bit_putcs 18 1367d 1601d 0/1 auto-closed as invalid on 2020/11/26 07:35

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __fb_pad_aligned_buffer include/linux/fb.h:663 [inline]
BUG: KASAN: use-after-free in bit_putcs_aligned drivers/video/fbdev/core/bitblit.c:96 [inline]
BUG: KASAN: use-after-free in bit_putcs+0xab7/0xc30 drivers/video/fbdev/core/bitblit.c:185
Read of size 1 at addr ffff88805ff256be by task syz-executor.4/8958

CPU: 1 PID: 8958 Comm: syz-executor.4 Not tainted 4.14.198-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x283 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load1_noabort+0x68/0x70 mm/kasan/report.c:427
 __fb_pad_aligned_buffer include/linux/fb.h:663 [inline]
 bit_putcs_aligned drivers/video/fbdev/core/bitblit.c:96 [inline]
 bit_putcs+0xab7/0xc30 drivers/video/fbdev/core/bitblit.c:185
 fbcon_putcs+0x2fe/0x480 drivers/video/fbdev/core/fbcon.c:1301
 con_flush drivers/tty/vt/vt.c:2206 [inline]
 do_con_write+0x9dd/0x19b0 drivers/tty/vt/vt.c:2453
 con_write+0x21/0xa0 drivers/tty/vt/vt.c:2805
 process_output_block drivers/tty/n_tty.c:595 [inline]
 n_tty_write+0x352/0xda0 drivers/tty/n_tty.c:2333
 do_tty_write drivers/tty/tty_io.c:959 [inline]
 tty_write+0x410/0x740 drivers/tty/tty_io.c:1043
 __vfs_write+0xe4/0x630 fs/read_write.c:480
 vfs_write+0x17f/0x4d0 fs/read_write.c:544
 SYSC_write fs/read_write.c:590 [inline]
 SyS_write+0xf2/0x210 fs/read_write.c:582
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45d5f9
RSP: 002b:00007ff660951c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000038980 RCX: 000000000045d5f9
RDX: 0000000000001006 RSI: 0000000020001440 RDI: 0000000000000005
RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c
R13: 00007ffe32b2d6ff R14: 00007ff6609529c0 R15: 000000000118cf4c

Allocated by task 8298:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 __do_kmalloc_node mm/slab.c:3682 [inline]
 __kmalloc_node_track_caller+0x4c/0x70 mm/slab.c:3696
 __kmalloc_reserve net/core/skbuff.c:137 [inline]
 __alloc_skb+0x96/0x510 net/core/skbuff.c:205
 alloc_skb_fclone include/linux/skbuff.h:1022 [inline]
 sk_stream_alloc_skb+0xb1/0x760 net/ipv4/tcp.c:855
 tcp_sendmsg_locked+0xed8/0x2ef0 net/ipv4/tcp.c:1301
 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1457
 inet_sendmsg+0x11a/0x4e0 net/ipv4/af_inet.c:762
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 sock_write_iter+0x22c/0x370 net/socket.c:925
 call_write_iter include/linux/fs.h:1778 [inline]
 new_sync_write fs/read_write.c:469 [inline]
 __vfs_write+0x44c/0x630 fs/read_write.c:482
 vfs_write+0x17f/0x4d0 fs/read_write.c:544
 SYSC_write fs/read_write.c:590 [inline]
 SyS_write+0xf2/0x210 fs/read_write.c:582
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 8298:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 skb_free_head net/core/skbuff.c:554 [inline]
 skb_release_data+0x5f6/0x820 net/core/skbuff.c:574
 skb_release_all net/core/skbuff.c:631 [inline]
 __kfree_skb+0x46/0x60 net/core/skbuff.c:645
 sk_wmem_free_skb include/net/sock.h:1425 [inline]
 tcp_clean_rtx_queue net/ipv4/tcp_input.c:3186 [inline]
 tcp_ack+0x1872/0x43c0 net/ipv4/tcp_input.c:3686
 tcp_rcv_established+0xebb/0x17a0 net/ipv4/tcp_input.c:5499
 tcp_v4_do_rcv+0x541/0x7d0 net/ipv4/tcp_ipv4.c:1476
 sk_backlog_rcv include/net/sock.h:921 [inline]
 __release_sock+0x12a/0x350 net/core/sock.c:2269
 release_sock+0x54/0x1b0 net/core/sock.c:2805
 tcp_sendmsg+0x36/0x40 net/ipv4/tcp.c:1458
 inet_sendmsg+0x11a/0x4e0 net/ipv4/af_inet.c:762
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 sock_write_iter+0x22c/0x370 net/socket.c:925
 call_write_iter include/linux/fs.h:1778 [inline]
 new_sync_write fs/read_write.c:469 [inline]
 __vfs_write+0x44c/0x630 fs/read_write.c:482
 vfs_write+0x17f/0x4d0 fs/read_write.c:544
 SYSC_write fs/read_write.c:590 [inline]
 SyS_write+0xf2/0x210 fs/read_write.c:582
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff88805ff25640
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 126 bytes inside of
 2048-byte region [ffff88805ff25640, ffff88805ff25e40)
The buggy address belongs to the page:
page:ffffea00017fc900 count:1 mapcount:0 mapping:ffff88805ff24540 index:0xffff88805ff25640 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff88805ff24540 ffff88805ff25640 0000000100000001
raw: ffffea000257c1a0 ffffea00023c16a0 ffff88812fe50c40 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88805ff25580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88805ff25600: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff88805ff25680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                        ^
 ffff88805ff25700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88805ff25780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/09/17 05:04 linux-4.14.y cbfa1702aaf6 8247808b .config console log report info ci2-linux-4-14
2020/08/30 02:22 linux-4.14.y d7e78d08fa77 d5a3ae1f .config console log report ci2-linux-4-14
2020/08/25 14:57 linux-4.14.y 6a24ca2506d6 344da168 .config console log report ci2-linux-4-14
2020/08/24 03:24 linux-4.14.y 6a24ca2506d6 cef5ae68 .config console log report ci2-linux-4-14
2020/08/15 19:13 linux-4.14.y 14b58326976d 5ce13532 .config console log report ci2-linux-4-14
2020/07/04 12:59 linux-4.14.y b850307b279c 4f739670 .config console log report ci2-linux-4-14
2020/06/24 15:58 linux-4.14.y b850307b279c 41694dbf .config console log report ci2-linux-4-14
2020/06/19 14:32 linux-4.14.y b850307b279c 123cf502 .config console log report ci2-linux-4-14
2020/06/12 17:35 linux-4.14.y b850307b279c 3036d6fd .config console log report ci2-linux-4-14
2020/05/24 13:57 linux-4.14.y a41ba30d9df2 ce7ca010 .config console log report ci2-linux-4-14
2020/05/23 22:31 linux-4.14.y a41ba30d9df2 96c92ad3 .config console log report ci2-linux-4-14
2020/05/20 12:24 linux-4.14.y a41ba30d9df2 1255f02a .config console log report ci2-linux-4-14
2020/04/30 11:24 linux-4.14.y 050272a0423e 3698959a .config console log report ci2-linux-4-14
2020/04/12 08:12 linux-4.14.y 4520f06b03ae a8c6a3f8 .config console log report ci2-linux-4-14
2020/03/17 22:05 linux-4.14.y 12cd844a39ed 97bc55ce .config console log report ci2-linux-4-14
2019/12/28 17:37 linux-4.14.y e1f7d50ae3a3 af6b8ef8 .config console log report ci2-linux-4-14
2019/12/06 08:48 linux-4.14.y a844dc4c5442 98b4ef2d .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.