Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v3 0/3] debugfs: make debugfs_create_str() read-only
@ 2026-08-07 10:00 Yichong Chen
  2026-08-07 10:00 ` [PATCH v3 1/3] interconnect: debugfs: replace writable string helper Yichong Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yichong Chen @ 2026-08-07 10:00 UTC (permalink / raw)
  To: gregkh
  Cc: rafael, dakr, djakov, quic_mdtipton, vkoul, yung-chuan.liao,
	pierre-louis.bossart, driver-core, linux-kernel, linux-pm,
	linux-sound, Yichong Chen

debugfs_create_str() has a generic write implementation that replaces the
backing string.  Concurrent writers can race and free the same old string
twice.

Instead of adding more locking to the generic helper, convert the existing
writable in-tree users to local file operations and make
debugfs_create_str() read-only.

Changes since v2:
- Use scoped mutex guards in the interconnect and SoundWire conversions.
- Clarify why GFP_KERNEL is safe in the interconnect conversion after the
  RCU read-side critical section is removed.
- Drop the unnecessary firmware_file = NULL assignment in the SoundWire
  exit path.
- Use WARN() instead of WARN_ONCE() so each writable debugfs_create_str()
  caller can be reported.

Changes since v1:
- Follow Greg's suggestion to avoid adding locking to the generic
  debugfs_create_str() write path.
- Convert the existing writable in-tree users to local file operations.
- Make debugfs_create_str() read-only and refuse writable modes.
- Split the change into a 3-patch series.

Yichong Chen (3):
  interconnect: debugfs: replace writable string helper
  soundwire: debugfs: replace writable string helper
  debugfs: make debugfs_create_str() read-only

 drivers/interconnect/debugfs-client.c | 81 +++++++++++++++++++++------
 drivers/soundwire/debugfs.c           | 63 ++++++++++++++++++---
 fs/debugfs/file.c                     | 81 ++++-----------------------
 3 files changed, 129 insertions(+), 96 deletions(-)

-- 
2.51.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-07 10:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 10:00 [PATCH v3 0/3] debugfs: make debugfs_create_str() read-only Yichong Chen
2026-08-07 10:00 ` [PATCH v3 1/3] interconnect: debugfs: replace writable string helper Yichong Chen
2026-08-07 10:00 ` [PATCH v3 2/3] soundwire: " Yichong Chen
2026-08-07 10:00 ` [PATCH v3 3/3] debugfs: make debugfs_create_str() read-only Yichong Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox