syzbot


KCSAN: data-race in bdev_set_nr_sectors / guard_bio_eod

Status: moderation: reported on 2024/10/29 21:43
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+fdd52d81423152c1a318@syzkaller.appspotmail.com
First crash: 36d, last: 36d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in bdev_set_nr_sectors / guard_bio_eod

write to 0xffff8881004c1908 of 8 bytes by task 7883 on cpu 1:
 bdev_set_nr_sectors+0x45/0x60 block/bdev.c:450
 set_capacity block/genhd.c:61 [inline]
 set_capacity_and_notify+0x6e/0x160 block/genhd.c:74
 loop_set_size drivers/block/loop.c:232 [inline]
 loop_set_status+0x399/0x540 drivers/block/loop.c:1286
 lo_ioctl+0x7f1/0x11c0
 blkdev_ioctl+0x359/0x450 block/ioctl.c:693
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:907 [inline]
 __se_sys_ioctl+0xcd/0x140 fs/ioctl.c:893
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:893
 x64_sys_call+0x15cc/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:17
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff8881004c1908 of 8 bytes by task 7891 on cpu 0:
 bdev_nr_sectors include/linux/blkdev.h:784 [inline]
 guard_bio_eod+0x29/0xb0 block/bio.c:694
 submit_bh_wbc+0x25f/0x320 fs/buffer.c:2812
 submit_bh+0x1e/0x30 fs/buffer.c:2824
 __ext4_read_bh fs/ext4/super.c:175 [inline]
 ext4_read_bh_nowait fs/ext4/super.c:187 [inline]
 ext4_sb_breadahead_unmovable+0x169/0x190 fs/ext4/super.c:269
 __ext4_get_inode_loc+0x6d4/0x910 fs/ext4/inode.c:4491
 ext4_get_inode_loc+0x65/0xe0 fs/ext4/inode.c:4536
 ext4_read_inline_link+0x47/0x290 fs/ext4/inline.c:1588
 ext4_get_link+0x85/0x2b0 fs/ext4/symlink.c:87
 pick_link+0x43f/0x7e0
 step_into+0x725/0x810 fs/namei.c:1923
 open_last_lookups fs/namei.c:3721 [inline]
 path_openat+0x1234/0x1fa0 fs/namei.c:3930
 do_filp_open+0xf7/0x200 fs/namei.c:3960
 do_sys_openat2+0xab/0x120 fs/open.c:1415
 do_sys_open fs/open.c:1430 [inline]
 __do_sys_creat fs/open.c:1508 [inline]
 __se_sys_creat fs/open.c:1502 [inline]
 __x64_sys_creat+0x66/0x90 fs/open.c:1502
 x64_sys_call+0x2cbf/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:86
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0000000000000800 -> 0x00000000000007ff

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 7891 Comm: syz.3.1624 Not tainted 6.12.0-rc5-syzkaller-00005-ge42b1a9a2557 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/29 21:43 upstream e42b1a9a2557 66aeb999 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in bdev_set_nr_sectors / guard_bio_eod
* Struck through repros no longer work on HEAD.