syzbot


KCSAN: data-race in console_flush_all / console_flush_all

Status: moderation: reported on 2024/09/24 07:21
Subsystems: isofs selinux
[Documentation on labels]
Reported-by: syzbot+e1863428fbecbb36ac13@syzkaller.appspotmail.com
First crash: 57d, last: 11d

Sample crash report:
audit: type=1326 audit(1731166918.050:60363): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=root:sysadm_r:sysadm_t pid=20191 comm="syz.0.16107" exe="/root/syz-executor" sig=0 arch=c000003e syscall=321 compat=0 ip=0x7f45af45e719 code=0x7ffc0000
audit: type=1326 audit(1731166918.050:60364): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=root:sysadm_r:sysadm_t pid=20191 comm="syz.0.16107" exe="/root/syz-executor" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f45af45e719 code=0x7ffc0000
==================================================================
BUG: KCSAN: data-race in console_flush_all / console_flush_all

write to 0xffffffff868169f8 of 8 bytes by task 20191 on cpu 0:
 console_emit_next_record kernel/printk/printk.c:3053 [inline]
 console_flush_all+0x395/0x770 kernel/printk/printk.c:3180
 __console_flush_and_unlock kernel/printk/printk.c:3239 [inline]
 console_unlock+0xab/0x330 kernel/printk/printk.c:3279
 vprintk_emit+0x3f4/0x680 kernel/printk/printk.c:2407
 vprintk_default+0x26/0x30 kernel/printk/printk.c:2422
 vprintk+0x75/0x80 kernel/printk/printk_safe.c:68
 _printk+0x7a/0xa0 kernel/printk/printk.c:2432
 caif_disconnect_client+0x13f/0x150 net/caif/cfcnfg.c:194
 caif_release+0xea/0x230 net/caif/caif_socket.c:918
 __sock_release net/socket.c:658 [inline]
 sock_close+0x68/0x150 net/socket.c:1426
 __fput+0x17a/0x6d0 fs/file_table.c:431
 ____fput+0x1c/0x30 fs/file_table.c:459
 task_work_run+0x13a/0x1a0 kernel/task_work.c:239
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0xbe/0x130 kernel/entry/common.c:218
 do_syscall_64+0xd6/0x1c0 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffffffff868169f8 of 8 bytes by task 29 on cpu 1:
 console_flush_all+0x57e/0x770 kernel/printk/printk.c:3181
 __console_flush_and_unlock kernel/printk/printk.c:3239 [inline]
 console_unlock+0xab/0x330 kernel/printk/printk.c:3279
 vprintk_emit+0x3f4/0x680 kernel/printk/printk.c:2407
 vprintk_default+0x26/0x30 kernel/printk/printk.c:2422
 vprintk+0x75/0x80 kernel/printk/printk_safe.c:68
 _printk+0x7a/0xa0 kernel/printk/printk.c:2432
 kauditd_printk_skb kernel/audit.c:546 [inline]
 kauditd_hold_skb+0x1a3/0x1b0 kernel/audit.c:581
 kauditd_send_queue+0x288/0x2e0 kernel/audit.c:766
 kauditd_thread+0x42a/0x650 kernel/audit.c:890
 kthread+0x1d1/0x210 kernel/kthread.c:389
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

value changed: 0x0000000000006dc7 -> 0x0000000000006dc8

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 29 Comm: kauditd Tainted: G        W          6.12.0-rc6-syzkaller-00272-gda4373fbcf00 #0
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================
audit: type=1326 audit(1731166918.050:60365): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=root:sysadm_r:sysadm_t pid=20191 comm="syz.0.16107" exe="/root/syz-executor" sig=0 arch=c000003e syscall=321 compat=0 ip=0x7f45af45e719 code=0x7ffc0000
audit: type=1326 audit(1731166918.050:60366): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=root:sysadm_r:sysadm_t pid=20191 comm="syz.0.16107" exe="/root/syz-executor" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f45af45e719 code=0x7ffc0000
audit: type=1326 audit(1731166918.050:60367): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=root:sysadm_r:sysadm_t pid=20191 comm="syz.0.16107" exe="/root/syz-executor" sig=0 arch=c000003e syscall=321 compat=0 ip=0x7f45af45e719 code=0x7ffc0000
audit: type=1326 audit(1731166918.050:60368): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=root:sysadm_r:sysadm_t pid=20191 comm="syz.0.16107" exe="/root/syz-executor" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f45af45e719 code=0x7ffc0000
audit: type=1326 audit(1731166918.050:60369): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=root:sysadm_r:sysadm_t pid=20191 comm="syz.0.16107" exe="/root/syz-executor" sig=0 arch=c000003e syscall=321 compat=0 ip=0x7f45af45e719 code=0x7ffc0000

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/09 15:33 upstream da4373fbcf00 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in console_flush_all / console_flush_all
2024/11/06 08:51 upstream 2e1b3cc9d7f7 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in console_flush_all / console_flush_all
2024/10/30 01:59 upstream e42b1a9a2557 66aeb999 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in console_flush_all / console_flush_all
2024/10/18 16:51 upstream 4d939780b705 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in console_flush_all / console_flush_all
2024/10/11 00:49 upstream eb952c47d154 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in console_flush_all / console_flush_all
2024/09/24 07:20 upstream 18ba6034468e 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in console_flush_all / console_flush_all
* Struck through repros no longer work on HEAD.