linux/fs/sysfs
Christian Brauner e3b2cf6e5d kernfs: pass struct ns_common instead of const void * for namespace tags
kernfs has historically used const void * to pass around namespace tags
used for directory-level namespace filtering. The only current user of
this is sysfs network namespace tagging where struct net pointers are
cast to void *.

Replace all const void * namespace parameters with const struct
ns_common * throughout the kernfs, sysfs, and kobject namespace layers.
This includes the kobj_ns_type_operations callbacks, kobject_namespace(),
and all sysfs/kernfs APIs that accept or return namespace tags.

Passing struct ns_common is needed because various codepaths require
access to the underlying namespace. A struct ns_common can always be
converted back to the concrete namespace type (e.g., struct net) via
container_of() or to_ns_common() in the reverse direction.

This is a preparatory change for switching to ns_id-based directory
iteration to prevent a KASLR pointer leak through the current use of
raw namespace pointers as hash seeds and comparison keys.

Signed-off-by: Christian Brauner <brauner@kernel.org>
2026-04-09 14:36:52 +02:00
..
dir.c kernfs: pass struct ns_common instead of const void * for namespace tags 2026-04-09 14:36:52 +02:00
file.c kernfs: pass struct ns_common instead of const void * for namespace tags 2026-04-09 14:36:52 +02:00
group.c sysfs: attribute_group: enable const variants of is_visible() 2025-11-26 15:16:35 +01:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mount.c kernfs: pass struct ns_common instead of const void * for namespace tags 2026-04-09 14:36:52 +02:00
symlink.c kernfs: pass struct ns_common instead of const void * for namespace tags 2026-04-09 14:36:52 +02:00
sysfs.h kernfs: pass struct ns_common instead of const void * for namespace tags 2026-04-09 14:36:52 +02:00