mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] nvmet: avoid configfs recursion when enabling backends
@ 2026-08-17 14:37 Runyu Xiao
  2026-08-17 14:37 ` [PATCH 1/2] nvmet: avoid recursive configfs open for file-backed namespaces Runyu Xiao
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Runyu Xiao @ 2026-08-17 14:37 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Sagi Grimberg, Chaitanya Kulkarni, Keith Busch, Logan Gunthorpe,
	linux-nvme, linux-kernel, stable, Runyu Xiao, Jianhao Xu

The nvmet configfs store callbacks run while configfs holds the item's
frag_sem. Two enable paths then call filp_open() on user-controlled
paths:

- file-backed namespace enable via device_path
- passthru controller enable via passthru_ctrl_path

If either path points back into configfs, the open path re-enters
__configfs_open_file() and tries to take the same frag_sem again.

Resolve the configured path before opening it, reject configfs-backed
paths, and use dentry_open() on the resolved path. This prevents the
configfs recursion without changing valid backend users.

Runyu Xiao (2):
  nvmet: avoid recursive configfs open for file-backed namespaces
  nvmet: avoid recursive configfs open for passthru

 drivers/nvme/target/io-cmd-file.c | 19 ++++++++++++++++++-
 drivers/nvme/target/passthru.c    | 17 ++++++++++++++++-
 2 files changed, 34 insertions(+), 2 deletions(-)

-- 
2.34.1

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

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

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-17 14:37 [PATCH 0/2] nvmet: avoid configfs recursion when enabling backends Runyu Xiao
2026-08-17 14:37 ` [PATCH 1/2] nvmet: avoid recursive configfs open for file-backed namespaces Runyu Xiao
2026-08-19  5:46   ` Christoph Hellwig
2026-08-17 14:37 ` [PATCH 2/2] nvmet: avoid recursive configfs open for passthru Runyu Xiao
2026-08-19 15:52 ` [PATCH v2 0/3] nvmet: avoid recursive configfs open Runyu Xiao
2026-08-19 15:52   ` [PATCH v2 1/3] fs: configfs: add helper to identify configfs paths Runyu Xiao
2026-08-23  0:24     ` Sagi Grimberg
2026-09-02 10:31     ` Christoph Hellwig
2026-08-19 15:52   ` [PATCH v2 2/3] nvmet: avoid recursive configfs open for file-backed namespaces Runyu Xiao
2026-08-23  0:24     ` Sagi Grimberg
2026-09-02 10:32     ` Christoph Hellwig
2026-08-19 15:52   ` [PATCH v2 3/3] nvmet: avoid recursive configfs open for passthru Runyu Xiao
2026-08-23  0:24     ` Sagi Grimberg

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®