Re: [PATCH 1/2] module: expose imported namespaces via sysfs

From
Sami Tolvanen <samitolvanen@google.com>
Date
2026-02-13 17:45:34
Also in
lkml
Reply to
Nicholas Sielicki, 2026-01-08
Hi Nicholas,

On Wed, Jan 7, 2026 at 8:47 PM Nicholas Sielicki
[off-list ref] wrote:
Currently, the only way for userspace to determine which symbol
namespaces a module imports is to locate the .ko file on disk (which may
not match the loaded module), then either parsing the binary manually
and handling any potential compression, or shelling-out to modinfo.

This is painful in cases where userspace wants to distinguish between
module variants that share the same name but import different
namespaces. For example, the nvidia-uvm module exists in both open and
closed source variants; the open source version imports the DMA_BUF
namespace while the closed source version does not, and networking
middleware may want to initialize itself differently depending on that.

Add /sys/module/*/import_ns to expose imported namespaces for loaded
modules. The file contains one namespace per line and only exists for
modules that import at least one namespace.
The patches look reasonable to me, but I do wonder if examining
imported namespaces is the best way to distinguish between module
variants. Is looking at /sys/module/*/taint not sufficient for your
use case?

Sami
Thread (5 messages) 5 messages, 2 authors, last reply 2026-03-05
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help