syzbot


KASAN: slab-out-of-bounds Read in getname_kernel

Status: public: reported C repro on 2019/04/14 00:00
Reported-by: syzbot+07886784c012dc64011e@syzkaller.appspotmail.com
First crash: 2397d, last: 2282d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in getname_kernel fs C 8 2322d 2421d 8/28 fixed on 2018/07/24 12:55
upstream KASAN: slab-out-of-bounds Read in getname_kernel (2) btrfs C done 5 291d 339d 25/28 fixed on 2024/03/28 13:58

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in strlen+0x91/0xa0 lib/string.c:481
Read of size 1 at addr ffff8801b5f9a020 by task syz-executor267/3797

CPU: 1 PID: 3797 Comm: syz-executor267 Not tainted 4.9.105-gd7e64f8 #40
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 ffff8801b5d1f978 ffffffff81eb41a9 ffffea0006d7e680 ffff8801b5f9a020
 0000000000000000 ffff8801b5f9a020 ffff8801b5f9a018 ffff8801b5d1f9b0
 ffffffff81567e49 ffff8801b5f9a020 0000000000000001 0000000000000000
Call Trace:
 [<ffffffff81eb41a9>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81eb41a9>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
 [<ffffffff81567e49>] print_address_description+0x6c/0x234 mm/kasan/report.c:256
 [<ffffffff81568253>] kasan_report_error mm/kasan/report.c:355 [inline]
 [<ffffffff81568253>] kasan_report.cold.6+0x242/0x2fe mm/kasan/report.c:412
 [<ffffffff8153be44>] __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430
 [<ffffffff81ed14c1>] strlen+0x91/0xa0 lib/string.c:481
 [<ffffffff815a8aa4>] getname_kernel+0x24/0x340 fs/namei.c:215
 [<ffffffff815aa0c4>] kern_path_mountpoint+0x24/0x70 fs/namei.c:2754
 [<ffffffff8190520e>] find_autofs_mount.isra.4+0x8e/0x200 fs/autofs4/dev-ioctl.c:213
 [<ffffffff81906043>] autofs_dev_ioctl_open_mountpoint fs/autofs4/dev-ioctl.c:258 [inline]
 [<ffffffff81906043>] autofs_dev_ioctl_openmount+0x153/0x2d0 fs/autofs4/dev-ioctl.c:303
 [<ffffffff81904f8b>] _autofs_dev_ioctl+0x4fb/0x690 fs/autofs4/dev-ioctl.c:699
 [<ffffffff8190513b>] autofs_dev_ioctl+0x1b/0x30 fs/autofs4/dev-ioctl.c:714
 [<ffffffff815b2f5c>] vfs_ioctl fs/ioctl.c:43 [inline]
 [<ffffffff815b2f5c>] file_ioctl fs/ioctl.c:493 [inline]
 [<ffffffff815b2f5c>] do_vfs_ioctl+0x1ac/0x11a0 fs/ioctl.c:677
 [<ffffffff815b3fdf>] SYSC_ioctl fs/ioctl.c:694 [inline]
 [<ffffffff815b3fdf>] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685
 [<ffffffff81006316>] do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282
 [<ffffffff839f9b13>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Allocated by task 3797:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
 save_stack+0x43/0xd0 mm/kasan/kasan.c:505
 set_track mm/kasan/kasan.c:517 [inline]
 kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:609
 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:547
 slab_post_alloc_hook mm/slab.h:417 [inline]
 slab_alloc_node mm/slub.c:2715 [inline]
 slab_alloc mm/slub.c:2723 [inline]
 __kmalloc_track_caller+0xdc/0x2b0 mm/slub.c:4232
 memdup_user+0x2c/0xb0 mm/util.c:161
 copy_dev_ioctl fs/autofs4/dev-ioctl.c:110 [inline]
 _autofs_dev_ioctl+0x13a/0x690 fs/autofs4/dev-ioctl.c:645
 autofs_dev_ioctl+0x1b/0x30 fs/autofs4/dev-ioctl.c:714
 vfs_ioctl fs/ioctl.c:43 [inline]
 file_ioctl fs/ioctl.c:493 [inline]
 do_vfs_ioctl+0x1ac/0x11a0 fs/ioctl.c:677
 SYSC_ioctl fs/ioctl.c:694 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685
 do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282
 entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8801b5f9a000
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 0 bytes to the right of
 32-byte region [ffff8801b5f9a000, ffff8801b5f9a020)
The buggy address belongs to the page:
page:ffffea0006d7e680 count:1 mapcount:0 mapping:          (null) index:0x0
flags: 0x8000000000000080(slab)
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801b5f99f00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8801b5f99f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8801b5f9a000: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc
                               ^
 ffff8801b5f9a080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801b5f9a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/06/02 15:29 https://android.googlesource.com/kernel/common android-4.9 d7e64f8022e4 2f93b54f .config console log report syz C ci-android-49-kasan-gce-root
2018/04/30 12:32 https://android.googlesource.com/kernel/common android-4.9 71fce1edd26d 06db3cec .config console log report syz C ci-android-49-kasan-gce-root
2018/08/23 05:30 https://android.googlesource.com/kernel/common android-4.9 8dd3fc2ed765 95b5c82b .config console log report ci-android-49-kasan-gce-root
2018/05/01 12:55 https://android.googlesource.com/kernel/common android-4.9 2bcbbd5b3924 d5b114b4 .config console log report ci-android-49-kasan-gce-root
2018/04/30 13:32 https://android.googlesource.com/kernel/common android-4.9 71fce1edd26d 06db3cec .config console log report ci-android-49-kasan-gce-root
2018/04/30 12:08 https://android.googlesource.com/kernel/common android-4.9 71fce1edd26d 06db3cec .config console log report ci-android-49-kasan-gce-root
* Struck through repros no longer work on HEAD.