[PATCH v2] device_cgroup: Refactor devcgroup_seq_show to use seq_put* helpers

Paul Moore paul at paul-moore.com
Wed Nov 12 00:47:22 UTC 2025


On Oct 31, 2025 Thorsten Blum <thorsten.blum at linux.dev> wrote:
> 
> Replace set_access(), set_majmin(), and type_to_char() with new helpers
> seq_putaccess(), seq_puttype(), and seq_putversion() that write directly
> to 'seq_file'.
> 
> Simplify devcgroup_seq_show() by hard-coding "a *:* rwm", and use the
> new seq_put* helper functions to list the exceptions otherwise.
> 
> This allows us to remove the intermediate string buffers while
> maintaining the same functionality, including wildcard handling.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum at linux.dev>
> Acked-by: Serge Hallyn <serge at hallyn.com>
> ---
> Changes in v2:
> - Add setq_put* helpers to modify seq_file directly (David)
> - Update patch subject and description
> - Link to v1: https://lore.kernel.org/lkml/20251031110647.102728-2-thorsten.blum@linux.dev/
> ---
>  security/device_cgroup.c | 56 ++++++++++++++++++----------------------
>  1 file changed, 25 insertions(+), 31 deletions(-)

Looks good to me, merged into lsm/dev, thanks!

--
paul-moore.com



More information about the Linux-security-module-archive mailing list