syzbot


KASAN: use-after-free Read in bit_putcs

Status: auto-closed as invalid on 2020/11/26 07:35
Reported-by: syzbot+fa274411c7f4086c86db@syzkaller.appspotmail.com
First crash: 1810d, last: 1577d
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 801d 1811d 0/1 upstream: reported C repro on 2019/12/07 16:26
upstream KASAN: use-after-free Read in bit_putcs fbdev C 12 1513d 1733d 15/28 fixed on 2020/11/16 12:12
linux-4.14 KASAN: use-after-free Read in bit_putcs 17 1527d 1812d 0/1 auto-closed as invalid on 2021/01/15 05:05
linux-4.19 KASAN: global-out-of-bounds Read in bit_putcs C done 214 1277d 1814d 1/1 fixed on 2021/06/24 08:01

Sample crash report:
ISOFS: Unable to identify CD-ROM format.
==================================================================
BUG: KASAN: use-after-free in __fb_pad_aligned_buffer include/linux/fb.h:674 [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+0xbaf/0xd10 drivers/video/fbdev/core/bitblit.c:185
Read of size 1 at addr ffff888058a67d8a by task syz-executor.4/19090

CPU: 1 PID: 19090 Comm: syz-executor.4 Not tainted 4.19.134-syzkaller #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+0x1fc/0x2fe lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1c7 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load1_noabort+0x88/0x90 mm/kasan/report.c:430
 __fb_pad_aligned_buffer include/linux/fb.h:674 [inline]
 bit_putcs_aligned drivers/video/fbdev/core/bitblit.c:96 [inline]
 bit_putcs+0xbaf/0xd10 drivers/video/fbdev/core/bitblit.c:185
 fbcon_putcs+0x336/0x4f0 drivers/video/fbdev/core/fbcon.c:1323
 do_update_region+0x399/0x630 drivers/tty/vt/vt.c:683
 redraw_screen+0x5e1/0x870 drivers/tty/vt/vt.c:1031
 vc_do_resize+0x1132/0x1440 drivers/tty/vt/vt.c:1317
 vt_ioctl+0x1f74/0x24d0 drivers/tty/vt/vt_ioctl.c:901
 tty_ioctl+0x5b0/0x15c0 drivers/tty/tty_io.c:2669
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:501 [inline]
 do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688
 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
 __do_sys_ioctl fs/ioctl.c:712 [inline]
 __se_sys_ioctl fs/ioctl.c:710 [inline]
 __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45c369
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:00007fa827904c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 000000000001ba00 RCX: 000000000045c369
RDX: 0000000020000040 RSI: 000000000000560a RDI: 0000000000000003
RBP: 000000000078bf40 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c
R13: 00007fff27fbcaaf R14: 00007fa8279059c0 R15: 000000000078bf0c

Allocated by task 18197:
 __do_kmalloc_node mm/slab.c:3689 [inline]
 __kmalloc_node_track_caller+0x4c/0x70 mm/slab.c:3703
 __kmalloc_reserve net/core/skbuff.c:137 [inline]
 __alloc_skb+0xae/0x560 net/core/skbuff.c:205
 alloc_skb include/linux/skbuff.h:995 [inline]
 alloc_skb_with_frags+0x92/0x570 net/core/skbuff.c:5303
 sock_alloc_send_pskb+0x6e1/0x830 net/core/sock.c:2090
 __ip6_append_data.isra.0+0x1ab2/0x2d70 net/ipv6/ip6_output.c:1422
 ip6_append_data+0x1e7/0x330 net/ipv6/ip6_output.c:1591
 icmp6_send+0x17c4/0x2230 net/ipv6/icmp.c:576
 icmpv6_send+0xde/0x210 net/ipv6/ip6_icmp.c:43
 ip6_link_failure+0x26/0x4e0 net/ipv6/route.c:2297
 dst_link_failure include/net/dst.h:438 [inline]
 vti_xmit net/ipv4/ip_vti.c:300 [inline]
 vti_tunnel_xmit+0x49f/0x18c0 net/ipv4/ip_vti.c:336
 __netdev_start_xmit include/linux/netdevice.h:4333 [inline]
 netdev_start_xmit include/linux/netdevice.h:4347 [inline]
 xmit_one net/core/dev.c:3256 [inline]
 dev_hard_start_xmit+0x1a8/0x920 net/core/dev.c:3272
 __dev_queue_xmit+0x269d/0x2e00 net/core/dev.c:3838
 neigh_output include/net/neighbour.h:501 [inline]
 ip6_finish_output2+0x113d/0x2290 net/ipv6/ip6_output.c:120
 ip6_finish_output+0x7eb/0xc10 net/ipv6/ip6_output.c:154
 NF_HOOK_COND include/linux/netfilter.h:278 [inline]
 ip6_output+0x205/0x770 net/ipv6/ip6_output.c:171
 dst_output include/net/dst.h:455 [inline]
 ip6_local_out+0xaf/0x170 net/ipv6/output_core.c:178
 ip6_send_skb+0xb3/0x300 net/ipv6/ip6_output.c:1699
 udp_v6_send_skb+0x7d7/0x1610 net/ipv6/udp.c:1111
 udpv6_sendmsg+0x236b/0x2a90 net/ipv6/udp.c:1408
 inet_sendmsg+0x132/0x5a0 net/ipv4/af_inet.c:798
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:632
 ___sys_sendmsg+0x3b3/0x8e0 net/socket.c:2115
 __sys_sendmmsg+0x195/0x470 net/socket.c:2210
 __do_sys_sendmmsg net/socket.c:2239 [inline]
 __se_sys_sendmmsg net/socket.c:2236 [inline]
 __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2236
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 18197:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 skb_free_head net/core/skbuff.c:554 [inline]
 skb_release_data+0x6de/0x920 net/core/skbuff.c:574
 skb_release_all net/core/skbuff.c:631 [inline]
 __kfree_skb net/core/skbuff.c:645 [inline]
 kfree_skb+0x11a/0x3d0 net/core/skbuff.c:663
 icmpv6_rcv+0x70c/0x17c0 net/ipv6/icmp.c:925
 ip6_input_finish+0x46a/0x17a0 net/ipv6/ip6_input.c:395
 NF_HOOK include/linux/netfilter.h:289 [inline]
 ip6_input+0xcf/0x3c0 net/ipv6/ip6_input.c:438
 dst_input include/net/dst.h:461 [inline]
 ip6_rcv_finish+0x1d9/0x2f0 net/ipv6/ip6_input.c:76
 NF_HOOK include/linux/netfilter.h:289 [inline]
 ipv6_rcv+0xf2/0x3f0 net/ipv6/ip6_input.c:283
 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:4954
 __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5066
 process_backlog+0x239/0x6f0 net/core/dev.c:5848
 napi_poll net/core/dev.c:6271 [inline]
 net_rx_action+0x4ac/0xfb0 net/core/dev.c:6337
 __do_softirq+0x26c/0x9a0 kernel/softirq.c:292

The buggy address belongs to the object at ffff888058a67d00
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 138 bytes inside of
 512-byte region [ffff888058a67d00, ffff888058a67f00)
The buggy address belongs to the page:
page:ffffea00016299c0 count:1 mapcount:0 mapping:ffff88812c39c940 index:0xffff888058a67800
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffffea00023a6c48 ffffea0002971208 ffff88812c39c940
raw: ffff888058a67800 ffff888058a67080 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888058a67c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888058a67d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888058a67d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff888058a67e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888058a67e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (18):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/07/29 07:34 linux-4.19.y 20b3a3dfdf6c 19a8de55 .config console log report ci2-linux-4-19
2020/07/26 22:21 linux-4.19.y 20b3a3dfdf6c 51265195 .config console log report ci2-linux-4-19
2020/07/16 10:14 linux-4.19.y 17a87580a885 ada108d0 .config console log report ci2-linux-4-19
2020/07/06 06:04 linux-4.19.y 399849e4654e 22f87567 .config console log report ci2-linux-4-19
2020/07/01 13:01 linux-4.19.y 399849e4654e 39acb39d .config console log report ci2-linux-4-19
2020/06/23 01:20 linux-4.19.y b3a99fd385fa 1afe1535 .config console log report ci2-linux-4-19
2020/05/08 23:24 linux-4.19.y 84920cc7fbe1 e97b06d3 .config console log report ci2-linux-4-19
2020/05/06 01:42 linux-4.19.y fdc072324f3c 35b8eb30 .config console log report ci2-linux-4-19
2020/05/01 21:23 linux-4.19.y 765675379b62 bc734e7a .config console log report ci2-linux-4-19
2020/04/24 03:58 linux-4.19.y 7edd66cf6167 03d97a1b .config console log report ci2-linux-4-19
2020/03/18 08:57 linux-4.19.y 93556fb211fa 97bc55ce .config console log report ci2-linux-4-19
2020/03/14 00:25 linux-4.19.y 569209711609 749688d2 .config console log report ci2-linux-4-19
2020/02/17 22:50 linux-4.19.y 9b15f7fae677 72bfa6f2 .config console log report ci2-linux-4-19
2020/01/15 15:40 linux-4.19.y db5b9190ff82 069a5a44 .config console log report ci2-linux-4-19
2020/01/14 20:19 linux-4.19.y db5b9190ff82 fa12bd3c .config console log report ci2-linux-4-19
2020/01/13 23:31 linux-4.19.y dcd888983542 32881205 .config console log report ci2-linux-4-19
2020/01/10 15:46 linux-4.19.y cb1f9a169a0e 532ec44e .config console log report ci2-linux-4-19
2019/12/08 10:20 linux-4.19.y fb683b5e3f53 1508f453 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.