Re: [PATCH v10 16/24] firmware: arm_scmi: Add Telemetry debugfs SHMTI dump support

Fayssal Benmlih <[email protected]>
Newsgroups org.kernel.vger.arm-scmi,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hi Cristian,

The two V7 debugfs issues appear to remain.

First, scmi_telemetry_dbg_shmti_open() stores a pointer to the devm-owned
telemetry_shmti descriptor and its devm mapping. An open debugfs fd can
outlive debugfs removal and protocol teardown, but the open/release path
does not pin the SCMI device or protocol.

The file_operations owner pins the module, not the protocol instance or
the devm-managed SHMTI state. A later read from an already open fd can
therefore access released state.

Please use the debugfs file-lifetime helpers or explicitly pin the owning
SCMI instance from open until release, and reject reads after teardown has
started.

Second, files are still named using the enumeration index:

        snprintf(id, 16, "%u", i);

while the ABI documentation says they are named using the firmware SHMTI
ID. Please use ti->shmti[i].info.sid, or change the ABI documentation to
define the filename as an enumeration index.

Thanks,
Fayçal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.