syzbot


KASAN: use-after-free Write in gfs2_qd_shrink_scan

Status: upstream: reported syz repro on 2024/05/05 21:02
Reported-by: syzbot+00ceb73a2aae5696f09d@syzkaller.appspotmail.com
First crash: 163d, last: 10h22m
Bug presence (1)
Date Name Commit Repro Result
2024/08/04 upstream (ToT) defaf1a2113a C Didn't crash
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: use-after-free Write in gfs2_qd_shrink_scan 24 111d 179d 0/3 auto-obsoleted due to no activity on 2024/09/04 11:09

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
BUG: KASAN: use-after-free in atomic_dec include/linux/atomic/atomic-instrumented.h:244 [inline]
BUG: KASAN: use-after-free in gfs2_qd_dispose fs/gfs2/quota.c:137 [inline]
BUG: KASAN: use-after-free in gfs2_qd_shrink_scan+0x584/0x7e4 fs/gfs2/quota.c:175
Write of size 4 at addr ffff0000d28e4a70 by task syz.4.51/4301

CPU: 1 PID: 4301 Comm: syz.4.51 Not tainted 5.15.164-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x174/0x1e4 mm/kasan/report.c:451
 kasan_check_range+0x274/0x2b4 mm/kasan/generic.c:189
 __kasan_check_write+0x44/0x54 mm/kasan/shadow.c:37
 instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
 atomic_dec include/linux/atomic/atomic-instrumented.h:244 [inline]
 gfs2_qd_dispose fs/gfs2/quota.c:137 [inline]
 gfs2_qd_shrink_scan+0x584/0x7e4 fs/gfs2/quota.c:175
 do_shrink_slab+0x4b4/0x10b0 mm/vmscan.c:758
 shrink_slab+0x1f8/0x894 mm/vmscan.c:918
 drop_slab_node+0xcc/0x170 mm/vmscan.c:953
 drop_slab+0x98/0x140 mm/vmscan.c:963
 drop_caches_sysctl_handler+0x178/0x394 fs/drop_caches.c:66
 proc_sys_call_handler+0x4cc/0x7cc fs/proc/proc_sysctl.c:587
 proc_sys_write+0x2c/0x3c fs/proc/proc_sysctl.c:613
 do_iter_readv_writev+0x420/0x5f8
 do_iter_write+0x1b8/0x66c fs/read_write.c:855
 vfs_iter_write+0x88/0xac fs/read_write.c:896
 iter_file_splice_write+0x618/0xc48 fs/splice.c:689
 do_splice_from fs/splice.c:767 [inline]
 direct_splice_actor+0xe4/0x1c0 fs/splice.c:936
 splice_direct_to_actor+0x408/0x9a0 fs/splice.c:891
 do_splice_direct+0x1f4/0x334 fs/splice.c:979
 do_sendfile+0x4c0/0xcb0 fs/read_write.c:1249
 __do_sys_sendfile64 fs/read_write.c:1311 [inline]
 __se_sys_sendfile64 fs/read_write.c:1303 [inline]
 __arm64_sys_sendfile64+0x264/0x408 fs/read_write.c:1303
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Allocated by task 4297:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc+0xbc/0xfc mm/kasan/common.c:513
 __kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 kmem_cache_alloc_trace+0x27c/0x47c mm/slub.c:3247
 kmalloc include/linux/slab.h:591 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 init_sbd fs/gfs2/ops_fstype.c:77 [inline]
 gfs2_fill_super+0x140/0x2010 fs/gfs2/ops_fstype.c:1151
 get_tree_bdev+0x360/0x54c fs/super.c:1312
 gfs2_get_tree+0x54/0x1b4 fs/gfs2/ops_fstype.c:1332
 vfs_get_tree+0x90/0x274 fs/super.c:1517
 do_new_mount+0x278/0x8fc fs/namespace.c:3005
 path_mount+0x594/0x101c fs/namespace.c:3335
 do_mount fs/namespace.c:3348 [inline]
 __do_sys_mount fs/namespace.c:3556 [inline]
 __se_sys_mount fs/namespace.c:3533 [inline]
 __arm64_sys_mount+0x510/0x5e0 fs/namespace.c:3533
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Freed by task 4113:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4c/0x84 mm/kasan/common.c:46
 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360
 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366
 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kfree+0x178/0x410 mm/slub.c:4559
 free_sbd+0x5c/0x6c fs/gfs2/ops_fstype.c:69
 gfs2_put_super+0x60c/0x684 fs/gfs2/super.c:632
 generic_shutdown_super+0x130/0x29c fs/super.c:475
 kill_block_super+0x70/0xdc fs/super.c:1414
 gfs2_kill_sb+0xc0/0xd4
 deactivate_locked_super+0xb8/0x13c fs/super.c:335
 deactivate_super+0x108/0x128 fs/super.c:366
 cleanup_mnt+0x3c0/0x474 fs/namespace.c:1143
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1150
 task_work_run+0x130/0x1e4 kernel/task_work.c:164
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 do_notify_resume+0x262c/0x32b8 arch/arm64/kernel/signal.c:946
 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline]
 el0_svc+0xfc/0x1f0 arch/arm64/kernel/entry-common.c:609
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

The buggy address belongs to the object at ffff0000d28e4000
 which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 2672 bytes inside of
 8192-byte region [ffff0000d28e4000, ffff0000d28e6000)
The buggy address belongs to the page:
page:000000002260d8eb refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1128e0
head:000000002260d8eb order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 fffffc0003458a00 0000000300000003 ffff0000c0002c00
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000d28e4900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff0000d28e4980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff0000d28e4a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                             ^
 ffff0000d28e4a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff0000d28e4b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
syz.4.51 (4301): drop_caches: 2
syz.4.51 (4301): drop_caches: 2

Crashes (87):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/04 09:58 linux-5.15.y 7e89efd3ae1c 1786a2a8 .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/10/15 12:10 linux-5.15.y 3a5928702e71 7eb57b4a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/10/12 03:43 linux-5.15.y 3a5928702e71 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/10/11 05:40 linux-5.15.y 3a5928702e71 cd942402 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/10/10 21:43 linux-5.15.y 3a5928702e71 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/30 13:58 linux-5.15.y 3a5928702e71 bbd4e0a4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/25 13:35 linux-5.15.y 3a5928702e71 349a68c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/13 01:35 linux-5.15.y 3a5928702e71 73e8a465 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/12 10:31 linux-5.15.y 3a5928702e71 60e1a995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/10 14:39 linux-5.15.y 14e468424d3e 86aa7bd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/09 12:25 linux-5.15.y 14e468424d3e 073f8be2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/09 08:52 linux-5.15.y 14e468424d3e 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/03 06:15 linux-5.15.y fa93fa65db6e 8045124c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/03 00:46 linux-5.15.y fa93fa65db6e 8045124c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/02 04:47 linux-5.15.y fa93fa65db6e 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/02 04:38 linux-5.15.y fa93fa65db6e 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/08/30 20:35 linux-5.15.y fa93fa65db6e 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/08/26 14:30 linux-5.15.y fa93fa65db6e 9aee4e0b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/08/23 01:59 linux-5.15.y fa93fa65db6e ce8a9099 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/08/10 05:11 linux-5.15.y 7e89efd3ae1c 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/08/06 18:23 linux-5.15.y 7e89efd3ae1c 1ef9fe42 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/08/06 05:27 linux-5.15.y 7e89efd3ae1c e1bdb00a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/07/20 20:32 linux-5.15.y 7c6d66f0266f b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/18 13:03 linux-5.15.y 4878aadf2d15 639d6cdf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/16 10:10 linux-5.15.y c61bd26ae81a f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/16 10:09 linux-5.15.y c61bd26ae81a f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/16 10:09 linux-5.15.y c61bd26ae81a f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/15 23:04 linux-5.15.y c61bd26ae81a f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/15 23:04 linux-5.15.y c61bd26ae81a f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/13 03:07 linux-5.15.y c61bd26ae81a 2aa5052f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/02 05:17 linux-5.15.y c61bd26ae81a 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/02 05:16 linux-5.15.y c61bd26ae81a 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/05/31 00:21 linux-5.15.y c61bd26ae81a 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/05/05 21:01 linux-5.15.y 284087d4f7d5 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/10/09 13:03 linux-5.15.y 3a5928702e71 56fb2cb7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/10/08 03:54 linux-5.15.y 3a5928702e71 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/10/03 02:39 linux-5.15.y 3a5928702e71 a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/10/01 11:25 linux-5.15.y 3a5928702e71 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/26 15:55 linux-5.15.y 3a5928702e71 9314348a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/09/18 19:24 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/08/13 17:06 linux-5.15.y 7e89efd3ae1c f21a18ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/08/04 07:33 linux-5.15.y 7e89efd3ae1c 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/07/27 00:54 linux-5.15.y 7c6d66f0266f 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/07/20 16:12 linux-5.15.y 7c6d66f0266f b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/07/11 03:51 linux-5.15.y f45bea23c39c 6f7fa383 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/07/06 15:09 linux-5.15.y f45bea23c39c 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/07/02 15:29 linux-5.15.y 4878aadf2d15 07f0a0a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/07/02 15:26 linux-5.15.y 4878aadf2d15 07f0a0a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/12 08:59 linux-5.15.y c61bd26ae81a 4d75f4f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/07 07:55 linux-5.15.y c61bd26ae81a 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/07 07:46 linux-5.15.y c61bd26ae81a 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/06/07 05:47 linux-5.15.y c61bd26ae81a 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/05/24 04:48 linux-5.15.y 83655231580b 8f98448e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
2024/05/11 04:37 linux-5.15.y 284087d4f7d5 f7c35481 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in gfs2_qd_shrink_scan
* Struck through repros no longer work on HEAD.