[PATCH v6 3/4] nvmet: avoid recursive configfs open for passthru
Logan Gunthorpe
logang at deltatee.com
Mon Sep 28 08:50:05 PDT 2026
On 2026-09-26 03:21, Runyu Xiao wrote:
> nvmet_passthru_enable_store() runs as a configfs store callback while
> configfs holds the item frag_sem. Passthru enable used filp_open() on the
> configured controller path, so a path into configfs could re-enter
> __configfs_open_file() and try to acquire the same semaphore again.
>
> Use configfs_file_open() so the path is resolved before opening,
> configfs-backed paths are rejected, and the resolved path is opened with
> file_open_root() while retaining the normal open-time permission and
> security checks.
>
> Fixes: cae5b01a2afc ("nvmet: introduce the passthru configfs interface")
> Cc: stable at vger.kernel.org
> Reviewed-by: Christoph Hellwig <hch at lst.de>
> Assisted-by: LLM Codex
> Signed-off-by: Runyu Xiao <runyu.xiao at seu.edu.cn>
The problem and solution make sense to me, thanks.
Reviewed-by: Logan Gunthorpe <logang at deltataee.com>
More information about the Linux-nvme
mailing list