syzbot


KASAN: use-after-free Read in seq_escape

Status: auto-closed as invalid on 2019/04/06 08:43
First crash: 1998d, last: 1998d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in seq_escape ext4 1 2006d 2005d 11/26 fixed on 2018/11/12 21:25

Sample crash report:
selinux_nlmsg_perm: 334 callbacks suppressed
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=5920 sclass=netlink_route_socket pig=7973 comm=syz-executor3
EXT4-fs (sda1): journaled quota format not specified
==================================================================
BUG: KASAN: use-after-free in strlen+0x79/0x90 lib/string.c:482
Read of size 1 at addr ffff8801c65ccdb0 by task syz-executor5/7970

CPU: 1 PID: 7970 Comm: syz-executor5 Not tainted 4.14.74+ #17
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0xb9/0x11b lib/dump_stack.c:53
 print_address_description+0x60/0x22b mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409
 strlen+0x79/0x90 lib/string.c:482
 strlen include/linux/string.h:266 [inline]
 string_escape_str include/linux/string_helpers.h:65 [inline]
 seq_escape+0xb3/0x1f0 fs/seq_file.c:390
 seq_show_option include/linux/seq_file.h:166 [inline]
 ext4_show_quota_options fs/ext4/super.c:1986 [inline]
 _ext4_show_options.isra.8+0xd01/0x14f0 fs/ext4/super.c:2082
 show_vfsmnt+0x38a/0x430 fs/proc_namespace.c:127
 seq_read+0x4e0/0x11d0 fs/seq_file.c:237
 do_loop_readv_writev fs/read_write.c:698 [inline]
 do_iter_read+0x3cc/0x580 fs/read_write.c:922
 vfs_readv+0xe6/0x150 fs/read_write.c:984
 do_preadv+0x187/0x230 fs/read_write.c:1068
 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x457579
RSP: 002b:00007f6872f1cc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000127
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000457579
RDX: 10000000000002a1 RSI: 0000000020000480 RDI: 0000000000000004
RBP: 000000000072bfa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f6872f1d6d4
R13: 00000000004c309c R14: 00000000004d4a40 R15: 00000000ffffffff

Allocated by task 7972:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc.part.1+0x4f/0xd0 mm/kasan/kasan.c:551
 __kmalloc+0x153/0x340 mm/slub.c:3760
 kmalloc include/linux/slab.h:493 [inline]
 match_strdup+0x57/0x90 lib/parser.c:331
 set_qf_name+0x11e/0x380 fs/ext4/super.c:1482
 handle_mount_opt fs/ext4/super.c:1652 [inline]
 parse_options+0xc5c/0x2000 fs/ext4/super.c:1911
 ext4_remount+0x47b/0x1c60 fs/ext4/super.c:5064
 do_remount_sb2+0x2eb/0x5f0 fs/super.c:878
 do_remount fs/namespace.c:2377 [inline]
 do_mount+0xfae/0x26e0 fs/namespace.c:2883
 SYSC_mount fs/namespace.c:3108 [inline]
 SyS_mount+0xe5/0x100 fs/namespace.c:3085
 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 7972:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:524
 slab_free_hook mm/slub.c:1389 [inline]
 slab_free_freelist_hook mm/slub.c:1410 [inline]
 slab_free mm/slub.c:2966 [inline]
 kfree+0xf5/0x310 mm/slub.c:3897
 ext4_remount+0xc70/0x1c60 fs/ext4/super.c:5273
 do_remount_sb2+0x2eb/0x5f0 fs/super.c:878
 do_remount fs/namespace.c:2377 [inline]
 do_mount+0xfae/0x26e0 fs/namespace.c:2883
 SYSC_mount fs/namespace.c:3108 [inline]
 SyS_mount+0xe5/0x100 fs/namespace.c:3085
 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8801c65ccdb0
 which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes inside of
 8-byte region [ffff8801c65ccdb0, ffff8801c65ccdb8)
The buggy address belongs to the page:
page:ffffea0007197300 count:1 mapcount:0 mapping:          (null) index:0x0
flags: 0x4000000000000100(slab)
raw: 4000000000000100 0000000000000000 0000000000000000 0000000180aa00aa
raw: ffffea00075b9d40 0000000d0000000d ffff8801da803c00 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c65ccc80: fc fc fb fc fc 00 fc fc fb fc fc fb fc fc fb fc
 ffff8801c65ccd00: fc fb fc fc 00 fc fc 00 fc fc fb fc fc 00 fc fc
>ffff8801c65ccd80: 00 fc fc fb fc fc fb fc fc fb fc fc 00 fc fc 00
                                     ^
 ffff8801c65cce00: fc fc 00 fc fc fb fc fc fb fc fc fb fc fc fb fc
 ffff8801c65cce80: fc fb fc fc fb fc fc fb fc fc fb fc fc fb fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/10/08 08:40 android-4.14 d33692e8014d 8b311eaf .config console log report ci-android-414-kasan-gce-root
* Struck through repros no longer work on HEAD.