mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/3] nvmet: avoid recursive configfs open
@ 2026-09-21  9:05 Runyu Xiao
  2026-09-21  9:05 ` [PATCH v4 1/3] fs: configfs: add helpers for opening non-configfs paths Runyu Xiao
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Runyu Xiao @ 2026-09-21  9:05 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Sagi Grimberg, Chaitanya Kulkarni, Andreas Hindborg,
	Breno Leitao, linux-nvme, linux-kernel, stable, Runyu Xiao,
	Jianhao Xu

The nvmet configfs store callbacks hold the item's frag_sem while they
enable file-backed namespaces or passthru controllers. Both paths open a
user-configured pathname. If it resolves into configfs, the open path can
re-enter __configfs_open_file() and try to acquire the same frag_sem again.

Add configfs helpers that resolve configured paths, reject configfs-backed
paths, and open the resolved path with file_open_root(). This keeps the
normal open-time permission and security checks while preventing the
recursive configfs open.

Changes since v3:
- Move path lookup, configfs rejection, and file_open_root() into the
  configfs helper, as requested by Christoph Hellwig.
- Use the helper from both nvmet backend open paths.
- Provide a root-relative helper for callers that retain a resolved root,
  including callers that create files below a pinned root.
- Drop the previous Reviewed-by tags because the helper interface changed.

Runyu Xiao (3):
  fs: configfs: add helpers for opening non-configfs paths
  nvmet: avoid recursive configfs open for file-backed namespaces
  nvmet: avoid recursive configfs open for passthru

 drivers/nvme/target/io-cmd-file.c |  3 ++-
 drivers/nvme/target/passthru.c    |  3 ++-
 fs/configfs/mount.c               | 33 +++++++++++++++++++++++++++++++
 include/linux/configfs.h          |  6 ++++++
 4 files changed, 43 insertions(+), 2 deletions(-)


base-commit: df2908090cda368b01ff43709f51890076c56157
-- 
2.34.1

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

end of thread, other threads:[~2026-09-23  2:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-21  9:05 [PATCH v4 0/3] nvmet: avoid recursive configfs open Runyu Xiao
2026-09-21  9:05 ` [PATCH v4 1/3] fs: configfs: add helpers for opening non-configfs paths Runyu Xiao
2026-09-22 13:29   ` Christoph Hellwig
2026-09-23  2:39     ` Runyu Xiao
2026-09-21  9:05 ` [PATCH v4 2/3] nvmet: avoid recursive configfs open for file-backed namespaces Runyu Xiao
2026-09-22 13:29   ` Christoph Hellwig
2026-09-21  9:05 ` [PATCH v4 3/3] nvmet: avoid recursive configfs open for passthru Runyu Xiao
2026-09-22 13:29   ` Christoph Hellwig

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

all inboxes | Powered by JetHome®