[syzbot] [pci?] KCSAN: data-race in vga_arb_write / vga_arb_write (4)

5 views
Skip to first unread message

syzbot

unread,
Jan 10, 2025, 10:04:26 AM1/10/25
to bhel...@google.com, linux-...@vger.kernel.org, linu...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 9b2ffa6148b1 Merge tag 'mtd/fixes-for-6.13-rc5' of git://g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12aac0b0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=87d3cfca6847d1fa
dashboard link: https://syzkaller.appspot.com/bug?extid=2699c160471dfeee2644
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8f3f5cceed80/disk-9b2ffa61.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/1ba00b70d91e/vmlinux-9b2ffa61.xz
kernel image: https://storage.googleapis.com/syzbot-assets/b99c1bb4d63f/bzImage-9b2ffa61.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+2699c1...@syzkaller.appspotmail.com

==================================================================
BUG: KCSAN: data-race in vga_arb_write / vga_arb_write

read-write to 0xffff88814f612424 of 4 bytes by task 17707 on cpu 0:
vga_arb_write+0x11fa/0x1410 drivers/pci/vgaarb.c:1204
vfs_write+0x281/0x920 fs/read_write.c:677
ksys_write+0xe8/0x1b0 fs/read_write.c:731
__do_sys_write fs/read_write.c:742 [inline]
__se_sys_write fs/read_write.c:739 [inline]
__x64_sys_write+0x42/0x50 fs/read_write.c:739
x64_sys_call+0x287e/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:2
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-write to 0xffff88814f612424 of 4 bytes by task 17708 on cpu 1:
vga_arb_write+0xf45/0x1410 drivers/pci/vgaarb.c:1263
vfs_write+0x281/0x920 fs/read_write.c:677
ksys_write+0xe8/0x1b0 fs/read_write.c:731
__do_sys_write fs/read_write.c:742 [inline]
__se_sys_write fs/read_write.c:739 [inline]
__x64_sys_write+0x42/0x50 fs/read_write.c:739
x64_sys_call+0x287e/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:2
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: 0x00000001 -> 0x00000007

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 17708 Comm: syz.4.3325 Not tainted 6.13.0-rc4-syzkaller-00012-g9b2ffa6148b1 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

Dmitry Vyukov

unread,
Jan 10, 2025, 10:18:26 AM1/10/25
to syzbot, bhel...@google.com, linux-...@vger.kernel.org, linu...@vger.kernel.org, syzkall...@googlegroups.com
On Fri, 10 Jan 2025 at 16:04, syzbot
<syzbot+2699c1...@syzkaller.appspotmail.com> wrote:
>
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 9b2ffa6148b1 Merge tag 'mtd/fixes-for-6.13-rc5' of git://g..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=12aac0b0580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=87d3cfca6847d1fa
> dashboard link: https://syzkaller.appspot.com/bug?extid=2699c160471dfeee2644
> compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
>
> Unfortunately, I don't have any reproducer for this issue yet.
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/8f3f5cceed80/disk-9b2ffa61.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/1ba00b70d91e/vmlinux-9b2ffa61.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/b99c1bb4d63f/bzImage-9b2ffa61.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+2699c1...@syzkaller.appspotmail.com

This is a race between io_cnt++ and io_cnt--.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/vgaarb.c?id=9b2ffa6148b1e4468d08f7e0e7e371c43cac9ffe#n1204
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/vgaarb.c?id=9b2ffa6148b1e4468d08f7e0e7e371c43cac9ffe#n1263

Later io_cnt is used to drop references:

while (uc->io_cnt--)
vga_put(uc->pdev, VGA_RSRC_LEGACY_IO);

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/vgaarb.c?id=9b2ffa6148b1e4468d08f7e0e7e371c43cac9ffe#n1454

So this will corrupt memory.
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bug...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/syzkaller-bugs/678136f7.050a0220.216c54.0015.GAE%40google.com.

syzbot

unread,
Feb 20, 2025, 12:21:15 AM2/20/25
to syzkall...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages