syzbot


KASAN: use-after-free Read in mnt_warn_timestamp_expiry

Status: closed as dup on 2019/10/17 01:47
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+76a43f2b4d34cfc53548@syzkaller.appspotmail.com
First crash: 1893d, last: 1893d
Cause bisection: introduced by (bisect log) :
commit 452c2779410a03ac0c6be0a8a91c83aa80bdd7e5
Author: Deepa Dinamani <deepa.kernel@gmail.com>
Date: Fri Mar 8 20:40:03 2019 +0000

  fs: sysv: Initialize filesystem timestamp ranges

Crash: KASAN: use-after-free Read in do_mount (log)
Repro: syz .config
  
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
KASAN: use-after-free Read in do_mount fs syz done 6 1893d 1901d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: use-after-free Read in mnt_warn_timestamp_expiry 5 (6) 2019/10/17 02:50

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in mnt_warn_timestamp_expiry+0x4a/0x250 fs/namespace.c:2471
Read of size 8 at addr ffff888099937328 by task syz-executor.1/18510

CPU: 0 PID: 18510 Comm: syz-executor.1 Not tainted 5.4.0-rc3+ #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+0x1d8/0x2f8 lib/dump_stack.c:113
 print_address_description+0x75/0x5c0 mm/kasan/report.c:374
 __kasan_report+0x14b/0x1c0 mm/kasan/report.c:506
 kasan_report+0x26/0x50 mm/kasan/common.c:634
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132
 mnt_warn_timestamp_expiry+0x4a/0x250 fs/namespace.c:2471
 do_new_mount_fc fs/namespace.c:2773 [inline]
 do_new_mount fs/namespace.c:2825 [inline]
 do_mount+0x2160/0x2510 fs/namespace.c:3143
 ksys_mount+0xcc/0x100 fs/namespace.c:3352
 __do_sys_mount fs/namespace.c:3366 [inline]
 __se_sys_mount fs/namespace.c:3363 [inline]
 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3363
 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x459a59
Code: fd b7 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 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f1f46735c78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000459a59
RDX: 0000000020000a40 RSI: 00000000200005c0 RDI: 0000000000000000
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1f467366d4
R13: 00000000004c62a4 R14: 00000000004db438 R15: 00000000ffffffff

Allocated by task 18510:
 save_stack mm/kasan/common.c:69 [inline]
 set_track mm/kasan/common.c:77 [inline]
 __kasan_kmalloc+0x11c/0x1b0 mm/kasan/common.c:510
 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:518
 slab_post_alloc_hook mm/slab.h:584 [inline]
 slab_alloc mm/slab.c:3319 [inline]
 kmem_cache_alloc+0x1f5/0x2e0 mm/slab.c:3483
 kmem_cache_zalloc include/linux/slab.h:680 [inline]
 alloc_vfsmnt+0x27/0x470 fs/namespace.c:177
 vfs_create_mount+0x87/0x440 fs/namespace.c:940
 do_new_mount_fc fs/namespace.c:2763 [inline]
 do_new_mount fs/namespace.c:2825 [inline]
 do_mount+0x1ee0/0x2510 fs/namespace.c:3143
 ksys_mount+0xcc/0x100 fs/namespace.c:3352
 __do_sys_mount fs/namespace.c:3366 [inline]
 __se_sys_mount fs/namespace.c:3363 [inline]
 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3363
 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 16:
 save_stack mm/kasan/common.c:69 [inline]
 set_track mm/kasan/common.c:77 [inline]
 kasan_set_free_info mm/kasan/common.c:332 [inline]
 __kasan_slab_free+0x12a/0x1e0 mm/kasan/common.c:471
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:480
 __cache_free mm/slab.c:3425 [inline]
 kmem_cache_free+0x81/0xf0 mm/slab.c:3693
 free_vfsmnt fs/namespace.c:554 [inline]
 delayed_free_vfsmnt+0x74/0x80 fs/namespace.c:559
 __rcu_reclaim kernel/rcu/rcu.h:222 [inline]
 rcu_do_batch kernel/rcu/tree.c:2157 [inline]
 rcu_core+0x843/0x1050 kernel/rcu/tree.c:2377
 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2386
 __do_softirq+0x333/0x7c4 arch/x86/include/asm/paravirt.h:766

The buggy address belongs to the object at ffff888099937300
 which belongs to the cache mnt_cache of size 312
The buggy address is located 40 bytes inside of
 312-byte region [ffff888099937300, ffff888099937438)
The buggy address belongs to the page:
page:ffffea0002664dc0 refcount:1 mapcount:0 mapping:ffff8880aa5a9a80 index:0xffff888099937180
flags: 0x1fffc0000000200(slab)
raw: 01fffc0000000200 ffffea000285d4c8 ffffea00026ab308 ffff8880aa5a9a80
raw: ffff888099937180 ffff888099937000 0000000100000008 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888099937200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888099937280: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc
>ffff888099937300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff888099937380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888099937400: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/10/16 13:01 upstream 3b1f00aceb7a d4ea592f .config console log report syz ci-upstream-kasan-gce-smack-root
* Struck through repros no longer work on HEAD.