lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251202-configfs_netcon-v1-0-b4738ead8ee8@debian.org>
Date: Tue, 02 Dec 2025 07:29:00 -0800
From: Breno Leitao <leitao@...ian.org>
To: Andreas Hindborg <a.hindborg@...nel.org>, 
 Andrew Lunn <andrew+netdev@...n.ch>, 
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Cc: Breno Leitao <leitao@...ian.org>, linux-kernel@...r.kernel.org, 
 hch@...radead.org, jlbec@...lplan.org, linux-fsdevel@...r.kernel.org, 
 netdev@...r.kernel.org, gustavold@...il.com, asantostc@...il.com, 
 calvin@...nvd.org, kernel-team@...a.com
Subject: [PATCH RFC 0/2] configfs: enable kernel-space item registration

This series introduces a new kernel-space item registration API for configfs
to enable subsystems to programmatically create configfs items whose lifecycle
is controlled by the kernel rather than userspace.

Currently, configfs items can only be created via userspace mkdir operations,
which limits their utility for kernel-driven configuration scenarios such as
boot parameters or hardware auto-detection.

This discussion about this feature started 2 years ago[1], when netconsole needed to have
an configfs target that maps to what was passed by cmdline (something as
netconsole=+6666@....168.1.1....)

The suggestion was to workaround configfs limitation by asking users to create
some pre-defined configfs entries specially named (such as "cmdlineX", where X
is the entry index in the list of targets), that would match entries coming from
cmdline.

That proved to be confusing in many ways, such as:

 1) if cmdline is not properly passed or parsed, then cmdline0 becomes a new
    and unrelated target
 2) If netconsole becomes a module, then cmdline0 is not populated, so, the
    creation of cmdline0 is something unrelated to what we have in cmdline.
 3) The admin needs to create X items properly matching the iterms from cmdline,
    which is error prone.

The solution proposed in this patchset is to manage the life cycle of an item by the
kernel (if the cmdline entry exists, it will populate the cofingfs
automatically), instead of by the user (mkdir-ing special names).

The new configfs_register_item() and configfs_unregister_item() functions fill
this gap by allowing kernel modules to register items that appear in configfs
but are protected from userspace removal. These items are marked with the
CONFIGFS_USET_DEFAULT flag, making them behave similarly to default groups that
are automatically created but cannot be removed via rmdir.

The primary motivation for this work is to support dynamic netconsole target
registration from boot parameters.

Currently, netconsole can be configured either statically at boot time
(cmdline) or dynamically via userspace manipulation of configfs directories.

However, there is no way to create netconsole targets from kernel command line
parameters that persist in configfs for runtime inspection and modification.

This series addresses that limitation by providing the necessary configfs
infrastructure, making netconsole management easier, and simplifying the
code.

Link: https://lore.kernel.org/all/ZRWRal5bW93px4km@gmail.com/ [1]

---
Breno Leitao (2):
      configfs: add kernel-space item registration API
      netconsole: Plug to dynamic configfs item

 drivers/net/netconsole.c |  63 +++++++++++++++-----------------------------
 fs/configfs/dir.c        | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/configfs.h |   4 +++
 3 files changed, 159 insertions(+), 42 deletions(-)
---
base-commit: e538109ac71d801d26776af5f3c54f548296c29c
change-id: 20251128-configfs_netcon-f53ec4ca3363

Best regards,
--  
Breno Leitao <leitao@...ian.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ