================================================================== BUG: KCSAN: data-race in kernfs_iop_permission / kernfs_link_sibling read-write to 0xffff888100ce77c0 of 8 bytes by task 3066 on cpu 1: kernfs_link_sibling+0x1e7/0x230 fs/kernfs/dir.c:387 kernfs_add_one+0x260/0x390 fs/kernfs/dir.c:768 kernfs_create_dir_ns+0x100/0x150 fs/kernfs/dir.c:1044 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:368 [inline] kobject_add+0xdc/0x150 lib/kobject.c:420 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:1868 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x47b/0x780 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 0xffff888100ce77c0 of 8 bytes by task 3159 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+0x19b/0x1d00 fs/namei.c:3787 do_filp_open+0xf6/0x200 fs/namei.c:3818 do_sys_openat2+0xb5/0x2a0 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __x64_sys_openat+0xf3/0x120 fs/open.c:1383 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: 0x000000000000000d -> 0x000000000000000e Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 3159 Comm: udevd Not tainted 6.4.0-rc2-syzkaller-00290-gd635f6cc934b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 ==================================================================