Hello, kernel test robot noticed "WARNING:at_fs/sysfs/file.c:#sysfs_emit" on: commit: ec95570844b7a6ec10105691f0c875f0688eeadd ("[PATCH] net/mac80211: replace scnprintf() with sysfs_emit() for sysfs output") url: https://github.com/intel-lab-lkp/linux/commits/Mande-Imran-Ahmed/net-mac80211-replace-scnprintf-with-sysfs_emit-for-sysfs-output/20250730-180128 base: https://git.kernel.org/cgit/linux/kernel/git/wireless/wireless-next.git main patch link: https://lore.kernel.org/all/20250730095634.3754-1-immu.ahmed1905@xxxxxxxxx/ patch subject: [PATCH] net/mac80211: replace scnprintf() with sysfs_emit() for sysfs output in testcase: hwsim version: hwsim-x86_64-4bc754d9c-1_20250727 with following parameters: test: group-32 config: x86_64-rhel-9.4-func compiler: gcc-12 test machine: 8 threads 1 sockets Intel(R) Core(TM) i7-4790 v3 @ 3.60GHz (Haswell) with 6G memory (please refer to attached dmesg/kmsg for entire log/backtrace) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <oliver.sang@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-lkp/202508080725.79ed349c-lkp@xxxxxxxxx kern :warn : [ 99.491962] ------------[ cut here ]------------ kern :warn : [ 99.497289] invalid sysfs_emit: buf:000000002422382b kern :warn : [ 99.502971] WARNING: CPU: 3 PID: 5700 at fs/sysfs/file.c:767 sysfs_emit (fs/sysfs/file.c:767) kern :warn : [ 99.511332] Modules linked in: mac80211_hwsim mac80211 libarc4 cfg80211 btrfs blake2b_generic xor zstd_compress ipmi_devintf ipmi_msghandler raid6_pq intel_rapl_msr intel_rapl_common sd_mod x86_pkg_temp_thermal snd_hda_codec_hdmi intel_powerclamp sg coretemp platform_profile kvm_intel snd_hda_codec_realtek i915 snd_hda_codec_generic snd_hda_scodec_component kvm intel_gtt dell_wmi snd_hda_intel cec irqbypass snd_intel_dspcfg dell_smbios snd_intel_sdw_acpi ghash_clmulni_intel dell_wmi_descriptor ahci drm_buddy sparse_keymap snd_hda_codec rfkill libahci rapl ttm mei_wdt intel_cstate dcdbas libata drm_display_helper snd_hda_core intel_uncore i2c_i801 mei_me snd_hwdep lpc_ich drm_client_lib i2c_smbus pcspkr mei drm_kms_helper snd_pcm snd_timer video snd wmi soundcore binfmt_misc drm fuse loop dm_mod ip_tables kern :warn : [ 99.583263] CPU: 3 UID: 0 PID: 5700 Comm: python3 Tainted: G S 6.16.0-rc7-01834-gec95570844b7 #1 PREEMPT(voluntary) kern :warn : [ 99.595968] Tainted: [S]=CPU_OUT_OF_SPEC kern :warn : [ 99.600582] Hardware name: Dell Inc. OptiPlex 9020/03CPWF, BIOS A11 04/01/2015 kern :warn : [ 99.608504] RIP: 0010:sysfs_emit (fs/sysfs/file.c:767) kern :warn : [ 99.613493] Code: 00 00 48 8b 54 24 78 65 48 2b 15 e1 45 2b 05 75 1f 48 8b 5d f8 c9 c3 cc cc cc cc 48 89 fe 48 c7 c7 20 a8 45 84 e8 5e 47 33 ff <0f> 0b 31 c0 eb b7 e8 f3 32 f5 01 0f 1f 00 90 90 90 90 90 90 90 90 All code ======== 0: 00 00 add %al,(%rax) 2: 48 8b 54 24 78 mov 0x78(%rsp),%rdx 7: 65 48 2b 15 e1 45 2b sub %gs:0x52b45e1(%rip),%rdx # 0x52b45f0 e: 05 f: 75 1f jne 0x30 11: 48 8b 5d f8 mov -0x8(%rbp),%rbx 15: c9 leave 16: c3 ret 17: cc int3 18: cc int3 19: cc int3 1a: cc int3 1b: 48 89 fe mov %rdi,%rsi 1e: 48 c7 c7 20 a8 45 84 mov $0xffffffff8445a820,%rdi 25: e8 5e 47 33 ff call 0xffffffffff334788 2a:* 0f 0b ud2 <-- trapping instruction 2c: 31 c0 xor %eax,%eax 2e: eb b7 jmp 0xffffffffffffffe7 30: e8 f3 32 f5 01 call 0x1f53328 35: 0f 1f 00 nopl (%rax) 38: 90 nop 39: 90 nop 3a: 90 nop 3b: 90 nop 3c: 90 nop 3d: 90 nop 3e: 90 nop 3f: 90 nop Code starting with the faulting instruction =========================================== 0: 0f 0b ud2 2: 31 c0 xor %eax,%eax 4: eb b7 jmp 0xffffffffffffffbd 6: e8 f3 32 f5 01 call 0x1f532fe b: 0f 1f 00 nopl (%rax) e: 90 nop f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 90 nop 15: 90 nop kern :warn : [ 99.632931] RSP: 0018:ffffc9000288f890 EFLAGS: 00010282 kern :warn : [ 99.638863] RAX: 0000000000000000 RBX: 1ffff92000511f12 RCX: ffffffff8193bda5 kern :warn : [ 99.646704] RDX: 1ffff11026776180 RSI: 0000000000000008 RDI: ffff888133bb0c00 kern :warn : [ 99.654540] RBP: ffffc9000288f948 R08: 0000000000000001 R09: fffff52000511ecd kern :warn : [ 99.662380] R10: ffffc9000288f66f R11: 0000000000000001 R12: 0000000016c83b60 kern :warn : [ 99.670215] R13: 0000000000002000 R14: ffffc9000288fbb0 R15: ffffc9000288fbb0 kern :warn : [ 99.678051] FS: 00007fbdc1fe5040(0000) GS:ffff8881ac7f1000(0000) knlGS:0000000000000000 kern :warn : [ 99.686844] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 kern :warn : [ 99.693300] CR2: 00000000004ac270 CR3: 0000000123ed2003 CR4: 00000000001726f0 kern :warn : [ 99.701143] Call Trace: kern :warn : [ 99.704281] <TASK> kern :warn : [ 99.707089] ? __pfx_sysfs_emit (fs/sysfs/file.c:763) kern :warn : [ 99.711809] ? __pfx_file_ioctl (fs/ioctl.c:324) kern :warn : [ 99.716531] key_replays_read (net/mac80211/debugfs_key.c:250) mac80211 kern :warn : [ 99.722327] ? __pfx_key_replays_read (net/mac80211/debugfs_key.c:223) mac80211 kern :warn : [ 99.728597] ? __pfx___debugfs_file_get (fs/debugfs/file.c:80) kern :warn : [ 99.734009] ? do_vfs_ioctl (fs/ioctl.c:886) kern :warn : [ 99.738639] ? __pfx_do_vfs_ioctl (fs/ioctl.c:804) kern :warn : [ 99.743531] full_proxy_read (fs/debugfs/file.c:393 (discriminator 6)) kern :warn : [ 99.748162] vfs_read (fs/read_write.c:570) kern :warn : [ 99.752185] ? __pfx___debugfs_file_get (fs/debugfs/file.c:80) kern :warn : [ 99.757594] ? __pfx_make_vfsgid (fs/mnt_idmapping.c:122) kern :warn : [ 99.762399] ? __pfx_vfs_read (fs/read_write.c:553) kern :warn : [ 99.766942] ? __pfx_map_id_range_up (kernel/user_namespace.c:382) kern :warn : [ 99.772091] ? debugfs_file_put (arch/x86/include/asm/atomic.h:93 include/linux/atomic/atomic-arch-fallback.h:949 include/linux/atomic/atomic-instrumented.h:401 include/linux/refcount.h:389 include/linux/refcount.h:432 include/linux/refcount.h:450 fs/debugfs/file.c:196) kern :warn : [ 99.776812] ? full_proxy_llseek (fs/debugfs/file.c:389) kern :warn : [ 99.781788] ? fdget_pos (arch/x86/include/asm/atomic64_64.h:15 include/linux/atomic/atomic-arch-fallback.h:2583 include/linux/atomic/atomic-long.h:38 include/linux/atomic/atomic-instrumented.h:3189 include/linux/file_ref.h:215 fs/file.c:1189 fs/file.c:1215) kern :warn : [ 99.786071] ? from_kgid_munged (kernel/user_namespace.c:535) kern :warn : [ 99.790873] ksys_read (fs/read_write.c:715) kern :warn : [ 99.794898] ? __pfx_ksys_read (fs/read_write.c:705) kern :warn : [ 99.799531] ? __pfx_cp_new_stat (fs/stat.c:471) kern :warn : [ 99.804342] ? __pfx_make_vfsgid (fs/mnt_idmapping.c:122) kern :warn : [ 99.809147] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) kern :warn : [ 99.813518] ? vfs_getattr_nosec (fs/stat.c:218) kern :warn : [ 99.818494] ? vfs_fstat (include/linux/file.h:62 include/linux/file.h:84 fs/stat.c:278) kern :warn : [ 99.822605] ? __do_sys_newfstatat (fs/stat.c:538) kern :warn : [ 99.827583] ? __pfx___do_sys_newfstatat (fs/stat.c:538) kern :warn : [ 99.833081] ? __x64_sys_openat (fs/open.c:1463) kern :warn : [ 99.837973] ? fdget_pos (arch/x86/include/asm/atomic64_64.h:15 include/linux/atomic/atomic-arch-fallback.h:2583 include/linux/atomic/atomic-long.h:38 include/linux/atomic/atomic-instrumented.h:3189 include/linux/file_ref.h:215 fs/file.c:1189 fs/file.c:1215) kern :warn : [ 99.842258] ? do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) kern :warn : [ 99.846801] ? ksys_read (fs/read_write.c:715) kern :warn : [ 99.851000] ? __pfx_ksys_read (fs/read_write.c:705) kern :warn : [ 99.855631] ? do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) kern :warn : [ 99.860174] ? __x64_sys_ioctl (fs/ioctl.c:906 fs/ioctl.c:893 fs/ioctl.c:893) kern :warn : [ 99.864893] ? do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) kern :warn : [ 99.869437] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) kern :warn : [ 99.875194] RIP: 0033:0x7fbdc20de25d kern :warn : [ 99.879479] Code: 31 c0 e9 c6 fe ff ff 50 48 8d 3d a6 53 0a 00 e8 59 ff 01 00 66 0f 1f 84 00 00 00 00 00 80 3d 81 23 0e 00 00 74 17 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 5b c3 66 2e 0f 1f 84 00 00 00 00 00 48 83 ec All code ======== 0: 31 c0 xor %eax,%eax 2: e9 c6 fe ff ff jmp 0xfffffffffffffecd 7: 50 push %rax 8: 48 8d 3d a6 53 0a 00 lea 0xa53a6(%rip),%rdi # 0xa53b5 f: e8 59 ff 01 00 call 0x1ff6d 14: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1) 1b: 00 00 1d: 80 3d 81 23 0e 00 00 cmpb $0x0,0xe2381(%rip) # 0xe23a5 24: 74 17 je 0x3d 26: 31 c0 xor %eax,%eax 28: 0f 05 syscall 2a:* 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax <-- trapping instruction 30: 77 5b ja 0x8d 32: c3 ret 33: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) 3a: 00 00 00 3d: 48 rex.W 3e: 83 .byte 0x83 3f: ec in (%dx),%al Code starting with the faulting instruction =========================================== 0: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax 6: 77 5b ja 0x63 8: c3 ret 9: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) 10: 00 00 00 13: 48 rex.W 14: 83 .byte 0x83 15: ec in (%dx),%al The kernel config and materials to reproduce are available at: https://download.01.org/0day-ci/archive/20250808/202508080725.79ed349c-lkp@xxxxxxxxx -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki