syzbot


KASAN: slab-out-of-bounds Write in decode_data

Status: upstream: reported C repro on 2020/02/22 08:09
Reported-by: syzbot+fa2b40c50b2740e679f6@syzkaller.appspotmail.com
First crash: 1734d, last: 1644d
Fix bisection the fix commit could be any of (bisect log):
  98db2bf27b9e Linux 4.14.171
  4139fb08c05f Linux 4.14.187
  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Write in decode_data hams C done error 7 1658d 1813d 20/28 fixed on 2021/11/10 00:50
linux-4.19 KASAN: slab-out-of-bounds Write in decode_data C done 1 1187d 1733d 1/1 fixed on 2021/09/22 10:07
Last patch testing requests (2)
Created Duration User Patch Repo Result
2022/12/12 23:31 13m retest repro linux-4.14.y report log
2022/08/28 21:27 10m retest repro linux-4.14.y report log
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2020/06/21 10:39 30m (5) bisect fix linux-4.14.y OK (2) job log
2020/05/22 09:40 23m bisect fix linux-4.14.y OK (0) job log log
2020/04/22 09:03 24m bisect fix linux-4.14.y OK (0) job log log
2020/03/23 08:37 25m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
audit: type=1400 audit(1582360479.823:36): avc:  denied  { map } for  pid=7145 comm="syz-executor813" path="/root/syz-executor813650321" dev="sda1" ino=16483 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
sp0: Synchronizing with TNC
==================================================================
BUG: KASAN: slab-out-of-bounds in decode_data.part.0+0x23b/0x270 drivers/net/hamradio/6pack.c:874
Write of size 1 at addr ffff8880a0d8994e by task kworker/u4:1/22

CPU: 1 PID: 22 Comm: kworker/u4:1 Not tainted 4.14.171-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events_unbound flush_to_ldisc
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x142/0x197 lib/dump_stack.c:58
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
 __asan_report_store1_noabort+0x17/0x20 mm/kasan/report.c:432
 decode_data.part.0+0x23b/0x270 drivers/net/hamradio/6pack.c:874
 decode_data drivers/net/hamradio/6pack.c:1004 [inline]
 sixpack_decode drivers/net/hamradio/6pack.c:1007 [inline]
 sixpack_receive_buf drivers/net/hamradio/6pack.c:458 [inline]
 sixpack_receive_buf+0xaf7/0x1170 drivers/net/hamradio/6pack.c:435
 tty_ldisc_receive_buf+0x14d/0x1a0 drivers/tty/tty_buffer.c:459
 tty_port_default_receive_buf+0x73/0xa0 drivers/tty/tty_port.c:37
 receive_buf drivers/tty/tty_buffer.c:475 [inline]
 flush_to_ldisc+0x1ec/0x400 drivers/tty/tty_buffer.c:527
 process_one_work+0x863/0x1600 kernel/workqueue.c:2114
 worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248
 kthread+0x319/0x430 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 7145:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
 __do_kmalloc_node mm/slab.c:3682 [inline]
 __kmalloc_node+0x51/0x80 mm/slab.c:3689
 kmalloc_node include/linux/slab.h:530 [inline]
 kvmalloc_node+0x4e/0xe0 mm/util.c:397
 kvmalloc include/linux/mm.h:531 [inline]
 kvzalloc include/linux/mm.h:539 [inline]
 alloc_netdev_mqs+0x7b/0xbc0 net/core/dev.c:8097
 sixpack_open+0xdf/0xc85 drivers/net/hamradio/6pack.c:572
 tty_ldisc_open.isra.0+0x73/0xb0 drivers/tty/tty_ldisc.c:481
 tty_set_ldisc+0x28e/0x600 drivers/tty/tty_ldisc.c:606
 tiocsetd drivers/tty/tty_io.c:2351 [inline]
 tty_ioctl+0x95b/0x1320 drivers/tty/tty_io.c:2595
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 5599:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcc/0x270 mm/slab.c:3815
 kfree_link+0x16/0x20 fs/libfs.c:1070
 do_delayed_call include/linux/delayed_call.h:28 [inline]
 put_link fs/namei.c:900 [inline]
 step_into fs/namei.c:1787 [inline]
 walk_component+0x3db/0x1d00 fs/namei.c:1844
 link_path_walk+0x4d0/0x10a0 fs/namei.c:2151
 path_openat+0x194/0x3e50 fs/namei.c:3568
 do_filp_open+0x18e/0x250 fs/namei.c:3603
 do_sys_open+0x2c5/0x430 fs/open.c:1084
 SYSC_open fs/open.c:1102 [inline]
 SyS_open+0x2d/0x40 fs/open.c:1097
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8880a0d885c0
 which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 910 bytes to the right of
 4096-byte region [ffff8880a0d885c0, ffff8880a0d895c0)
The buggy address belongs to the page:
page:ffffea0002836200 count:1 mapcount:0 mapping:ffff8880a0d885c0 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff8880a0d885c0 0000000000000000 0000000100000001
raw: ffffea000284c620 ffffea0002820320 ffff8880aa800dc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a0d89800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880a0d89880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880a0d89900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                              ^
 ffff8880a0d89980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880a0d89a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/02/22 08:37 linux-4.14.y 98db2bf27b9e 2ffa6679 .config console log report syz C ci2-linux-4-14
2020/02/22 08:08 linux-4.14.y 98db2bf27b9e 2ffa6679 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.