================================================================== BUG: KCSAN: data-race in kernfs_iop_permission / kernfs_link_sibling read-write to 0xffff8881002b9040 of 8 bytes by task 18925 on cpu 1: kernfs_link_sibling+0x1e7/0x230 fs/kernfs/dir.c:387 kernfs_add_one+0x260/0x390 fs/kernfs/dir.c:770 kernfs_create_dir_ns+0x100/0x150 fs/kernfs/dir.c:1046 sysfs_create_dir_ns+0xd7/0x1d0 fs/sysfs/dir.c:59 create_dir lib/kobject.c:65 [inline] kobject_add_internal+0x47b/0x780 lib/kobject.c:233 kobject_add_varg lib/kobject.c:367 [inline] kobject_add+0xdc/0x150 lib/kobject.c:419 device_add+0x2ff/0xab0 drivers/base/core.c:3563 device_register+0x1d/0x20 drivers/base/core.c:3707 nsim_bus_dev_new drivers/net/netdevsim/bus.c:290 [inline] new_device_store+0x279/0x400 drivers/net/netdevsim/bus.c:167 bus_attr_store+0x50/0x70 drivers/base/bus.c:170 sysfs_kf_write+0xaa/0xc0 fs/sysfs/file.c:136 kernfs_fop_write_iter+0x1ca/0x2b0 fs/kernfs/file.c:334 call_write_iter include/linux/fs.h:1871 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x4ab/0x7d0 fs/read_write.c:584 ksys_write+0xeb/0x1a0 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __x64_sys_write+0x42/0x50 fs/read_write.c:646 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd read to 0xffff8881002b9040 of 8 bytes by task 2766 on cpu 0: kernfs_refresh_inode fs/kernfs/inode.c:181 [inline] kernfs_iop_permission+0x165/0x1b0 fs/kernfs/inode.c:289 do_inode_permission fs/namei.c:461 [inline] inode_permission+0x184/0x300 fs/namei.c:528 may_lookup fs/namei.c:1720 [inline] link_path_walk+0x19e/0x7e0 fs/namei.c:2267 path_openat+0x1a1/0x1d10 fs/namei.c:3789 do_filp_open+0xf6/0x200 fs/namei.c:3820 do_sys_openat2+0xab/0x110 fs/open.c:1407 do_sys_open fs/open.c:1422 [inline] __do_sys_openat fs/open.c:1438 [inline] __se_sys_openat fs/open.c:1433 [inline] __x64_sys_openat+0xf3/0x120 fs/open.c:1433 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0x0000000000000011 -> 0x0000000000000012 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 2766 Comm: udevd Not tainted 6.5.0-rc3-syzkaller-00297-gd31e3792919e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023 ==================================================================