syzbot


KASAN: use-after-free Read in blkdev_get

Status: upstream: reported C repro on 2018/06/13 16:27
Reported-by: syzbot+eaeb616d85c9a0afec7d@syzkaller.appspotmail.com
First crash: 1479d, last: 767d

Cause bisection: introduced by (bisect log) :
commit 77ef8f5177599efd0cedeb52c1950c1bd73fa5e3
Author: Chris Metcalf <cmetcalf@ezchip.com>
Date: Mon Jan 25 20:05:34 2016 +0000

  tile kgdb: fix bug in copy to gdb regs, and optimize memset

Crash: BUG: spinlock lockup suspected in nf_conntrack_lock (log)
Repro: C syz .config

Fix bisection: failed (bisect log)
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in blkdev_get syz error 8 741d 920d 0/1 upstream: reported syz repro on 2019/12/24 19:21
linux-4.19 KASAN: use-after-free Read in blkdev_get C error 10 811d 921d 0/1 upstream: reported C repro on 2019/12/23 13:45
Patch testing requests:
Created Duration User Patch Repo Result
2021/06/30 07:00 17m kael_w@yeah.net git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 73748627df83 OK

Sample crash report:
reiserfs: using flush barriers
REISERFS warning (device loop4): sh-2022 reiserfs_fill_super: unable to initialize journal space
REISERFS (device loop3): using ordered data mode
reiserfs: using flush barriers
==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0x3888/0x5140 kernel/locking/lockdep.c:3314
Read of size 8 at addr ffff8801a78932f8 by task syz-executor927/4536

CPU: 1 PID: 4536 Comm: syz-executor927 Not tainted 4.17.0+ #100
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+0x1b9/0x294 lib/dump_stack.c:113
 print_address_description+0x6c/0x20b mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 __lock_acquire+0x3888/0x5140 kernel/locking/lockdep.c:3314
 lock_acquire+0x1dc/0x520 kernel/locking/lockdep.c:3924
 __mutex_lock_common kernel/locking/mutex.c:757 [inline]
 __mutex_lock+0x16d/0x17f0 kernel/locking/mutex.c:894
 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:909
 blkdev_get+0x5d8/0xb30 fs/block_dev.c:1620
 blkdev_get_by_dev+0x3f/0x80 fs/block_dev.c:1736
 journal_init_dev fs/reiserfs/journal.c:2628 [inline]
 journal_init+0xcad/0x6a20 fs/reiserfs/journal.c:2775
 reiserfs_fill_super+0xd59/0x3900 fs/reiserfs/super.c:2034
 mount_bdev+0x30c/0x3e0 fs/super.c:1174
 get_super_block+0x34/0x40 fs/reiserfs/super.c:2605
 mount_fs+0xae/0x328 fs/super.c:1277
 vfs_kern_mount.part.34+0xd4/0x4d0 fs/namespace.c:1037
 vfs_kern_mount fs/namespace.c:1027 [inline]
 do_new_mount fs/namespace.c:2518 [inline]
 do_mount+0x564/0x30b0 fs/namespace.c:2848
 ksys_mount+0x12d/0x140 fs/namespace.c:3064
 __do_sys_mount fs/namespace.c:3078 [inline]
 __se_sys_mount fs/namespace.c:3075 [inline]
 __x64_sys_mount+0xbe/0x150 fs/namespace.c:3075
 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x446fda
Code: b8 08 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 1d aa fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 fa a9 fb ff c3 66 0f 1f 84 00 00 00 00 00 
RSP: 002b:00007fffcf4ce188 EFLAGS: 00000297 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fffcf4ce1a0 RCX: 0000000000446fda
RDX: 00007fffcf4ce1a0 RSI: 0000000020000100 RDI: 00007fffcf4ce1c0
RBP: 0000000000000001 R08: 00007fffcf4ce200 R09: 000000000000000a
R10: 0000000000000000 R11: 0000000000000297 R12: 0000000000000003
R13: 0000000000000004 R14: 0000000000000000 R15: 0000000000000001

Allocated by task 4536:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553
 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490
 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3554
 bdev_alloc_inode+0x1b/0x40 fs/block_dev.c:727
 alloc_inode+0x63/0x190 fs/inode.c:210
 new_inode_pseudo+0x69/0x1a0 fs/inode.c:895
 new_inode+0x1c/0x40 fs/inode.c:924
 iget5_locked+0x126/0x190 fs/inode.c:1097
 bdget+0xb1/0x5c0 fs/block_dev.c:868
 blkdev_get_by_dev+0x24/0x80 fs/block_dev.c:1732
 journal_init_dev fs/reiserfs/journal.c:2628 [inline]
 journal_init+0xcad/0x6a20 fs/reiserfs/journal.c:2775
 reiserfs_fill_super+0xd59/0x3900 fs/reiserfs/super.c:2034
 mount_bdev+0x30c/0x3e0 fs/super.c:1174
 get_super_block+0x34/0x40 fs/reiserfs/super.c:2605
 mount_fs+0xae/0x328 fs/super.c:1277
 vfs_kern_mount.part.34+0xd4/0x4d0 fs/namespace.c:1037
 vfs_kern_mount fs/namespace.c:1027 [inline]
 do_new_mount fs/namespace.c:2518 [inline]
 do_mount+0x564/0x30b0 fs/namespace.c:2848
 ksys_mount+0x12d/0x140 fs/namespace.c:3064
 __do_sys_mount fs/namespace.c:3078 [inline]
 __se_sys_mount fs/namespace.c:3075 [inline]
 __x64_sys_mount+0xbe/0x150 fs/namespace.c:3075
 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 2414:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
 __cache_free mm/slab.c:3498 [inline]
 kmem_cache_free+0x86/0x2d0 mm/slab.c:3756
 bdev_i_callback+0x20/0x30 fs/block_dev.c:738
 __rcu_reclaim kernel/rcu/rcu.h:178 [inline]
 rcu_do_batch kernel/rcu/tree.c:2558 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2818 [inline]
 __rcu_process_callbacks kernel/rcu/tree.c:2785 [inline]
 rcu_process_callbacks+0xe9d/0x1760 kernel/rcu/tree.c:2802
 __do_softirq+0x2e0/0xaf5 kernel/softirq.c:284

The buggy address belongs to the object at ffff8801a7893280
 which belongs to the cache bdev_cache of size 1352
The buggy address is located 120 bytes inside of
 1352-byte region [ffff8801a7893280, ffff8801a78937c8)
The buggy address belongs to the page:
page:ffffea00069e24c0 count:1 mapcount:0 mapping:ffff8801da9874c0 index:0xffff8801a7893ffe
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffffea0006dfab08 ffffea00069e2508 ffff8801da9874c0
raw: ffff8801a7893ffe ffff8801a7893280 0000000100000002 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801a7893180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801a7893200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8801a7893280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                                ^
 ffff8801a7893300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801a7893380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (117):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2018/06/13 15:48 upstream f5b7769eb040 27c5f59f .config log report syz C
ci-upstream-kasan-gce-root 2020/03/24 16:18 upstream 979e52ca0469 68660b21 .config log report
ci-upstream-kasan-gce-smack-root 2020/02/29 02:58 upstream f8788d86ab28 59b57593 .config log report
ci-upstream-kasan-gce-smack-root 2020/02/28 17:51 upstream f8788d86ab28 59b57593 .config log report
ci-upstream-kasan-gce-root 2020/02/22 03:31 upstream b0dd1eb220c0 2ffa6679 .config log report
ci-upstream-kasan-gce-selinux-root 2019/12/18 20:06 upstream 2187f215ebaa 79b211f7 .config log report
ci-upstream-kasan-gce-selinux-root 2019/06/20 19:56 upstream abf02e2964b3 34bf9440 .config log report
ci-upstream-kasan-gce-smack-root 2018/12/23 09:17 upstream 9105b8aa50c1 e3bd7ab8 .config log report
ci-upstream-kasan-gce-root 2018/09/02 19:04 upstream 899ba79553cf a4718693 .config log report
ci-upstream-kasan-gce-root 2018/08/30 11:25 upstream ff69279a44e9 6c7e9d3d .config log report
ci-upstream-kasan-gce-root 2018/08/30 09:32 upstream ff69279a44e9 6c7e9d3d .config log report
ci-upstream-kasan-gce-root 2018/08/28 14:31 upstream 050cdc6c9501 7ef1de9e .config log report
ci-upstream-kasan-gce-root 2018/08/27 09:29 upstream 5b394b2ddf03 758cd203 .config log report
ci-upstream-kasan-gce-root 2018/08/26 20:35 upstream aba16dc5cf93 758cd203 .config log report
ci-upstream-kasan-gce-root 2018/08/25 09:37 upstream 051935978432 9be5aa1d .config log report
ci-upstream-kasan-gce-root 2018/08/23 02:08 upstream 899fbc33fd77 95b5c82b .config log report
ci-upstream-kasan-gce-root 2018/08/20 09:39 upstream 2ad0d5269970 2dc4378f .config log report
ci-upstream-kasan-gce-root 2018/08/19 07:31 upstream a18d783fedfe de20bcbb .config log report
ci-upstream-kasan-gce-root 2018/08/18 00:57 upstream edb0a2000936 738da825 .config log report
ci-upstream-kasan-gce-root 2018/08/16 23:08 upstream f91e654474d4 9ccc1d45 .config log report
ci-upstream-kasan-gce-root 2018/08/14 11:01 upstream 7796916146b8 7a88b141 .config log report
ci-upstream-kasan-gce-root 2018/08/13 21:30 upstream 94710cac0ef4 7a88b141 .config log report
ci-upstream-kasan-gce-root 2018/08/12 13:22 upstream ec0c96714e7d 7a88b141 .config log report
ci-upstream-kasan-gce-root 2018/08/11 03:01 upstream f313b43be461 7a88b141 .config log report
ci-upstream-kasan-gce-root 2018/08/09 06:17 upstream fedb8da96355 2eeda842 .config log report
ci-upstream-kasan-gce-root 2018/08/07 19:07 upstream 1236568ee3cb 1beb8136 .config log report
ci-upstream-kasan-gce-root 2018/08/06 06:50 upstream 1ffaddd029c8 1beb8136 .config log report
ci-upstream-kasan-gce-root 2018/08/05 21:24 upstream a8c199208cd6 1beb8136 .config log report
ci-upstream-kasan-gce-root 2018/08/05 00:07 upstream 0b5b1f9a78b5 3476a2df .config log report
ci-upstream-kasan-gce-root 2018/08/04 19:21 upstream 0b5b1f9a78b5 3476a2df .config log report
ci-upstream-kasan-gce-root 2018/08/04 10:47 upstream 0b5b1f9a78b5 df7f6947 .config log report
ci-upstream-kasan-gce-root 2018/08/04 06:23 upstream 0b5b1f9a78b5 df7f6947 .config log report
ci-upstream-kasan-gce-root 2018/08/04 03:45 upstream 0b5b1f9a78b5 df7f6947 .config log report
ci-upstream-kasan-gce-root 2018/08/03 20:29 upstream 0585df468e8f cc4f6d0a .config log report
ci-upstream-kasan-gce-root 2018/08/03 05:12 upstream e30cb13c5a09 5b7e23bb .config log report
ci-upstream-kasan-gce-root 2018/08/03 02:27 upstream e30cb13c5a09 5b7e23bb .config log report
ci-upstream-kasan-gce-root 2018/08/02 19:41 upstream e30cb13c5a09 5b7e23bb .config log report
ci-upstream-kasan-gce-root 2018/08/02 14:35 upstream 6b4703768268 0a7cf4ec .config log report
ci-upstream-kasan-gce-root 2018/08/02 12:22 upstream 6b4703768268 0a7cf4ec .config log report
ci-upstream-kasan-gce-root 2018/06/13 11:17 upstream f5b7769eb040 27c5f59f .config log report
ci-upstream-linux-next-kasan-gce-root 2020/02/27 23:49 linux-next bdc5461b23ca 59b57593 .config log report
ci-upstream-linux-next-kasan-gce-root 2018/08/30 22:25 linux-next 3d18c2437944 938220fd .config log report
ci-upstream-linux-next-kasan-gce-root 2018/08/23 17:49 linux-next 455fb5ec1df1 95b5c82b .config log report
ci-upstream-linux-next-kasan-gce-root 2018/08/21 20:15 linux-next b0d11efd08e3 95b5c82b .config log report
ci-upstream-linux-next-kasan-gce-root 2018/08/21 03:45 linux-next 812667578394 95b5c82b .config log report
ci-upstream-linux-next-kasan-gce-root 2018/08/20 22:29 linux-next 812667578394 95b5c82b .config log report
ci-upstream-linux-next-kasan-gce-root 2018/08/18 23:34 linux-next d7857ae43dcc de20bcbb .config log report
ci-upstream-linux-next-kasan-gce-root 2018/08/18 18:03 linux-next d7857ae43dcc db1858f6 .config log report
ci-upstream-linux-next-kasan-gce-root 2018/08/17 06:36 linux-next d7857ae43dcc 9ccc1d45 .config log report
ci-upstream-linux-next-kasan-gce-root 2018/08/14 08:55 linux-next 4e8b38549b50 7a88b141 .config log report
ci-upstream-linux-next-kasan-gce-root 2018/08/07 04:16 linux-next 8c8399e0a3fb 1beb8136 .config log report
ci-upstream-linux-next-kasan-gce-root 2018/08/05 11:06 linux-next 116b181bb646 3476a2df .config log report