5–7 Oct 2026
Europe/Prague timezone

Constification of sysfs attribute structures

7 Oct 2026, 16:15
25m
"Club C+D" (Prague Congress Centre)

"Club C+D"

Prague Congress Centre

100
Driver Core MC Driver Core MC

Speaker

Thomas Weißschuh (Linutronix)

Description

Sysfs attributes are used throughout the kernel to implement UAPI.
Subsystems either use common attributes, like kobj_attribute and device_attr or define their own wrapper structures.
These structures are only descriptors defining the behavior of an attribute and normally never change.

Historically the attribute however are not marked as const and could be modified through their various callbacks. Such modifications are inherently racy and therefore bug-prone or even a vector for attackers to redirect control-flow.

For some time I have been working on making it possible to mark all the different attribute structures as const to fix these issues.

Agenda:
* Problem statement (see above)
* Current state
* Which attributes can be marked const today?
* Which attributes are already converted.
* Discussion (see below)

  • Discussion

Discussion topics:
* Which attribute types are still missing?
* How can subsystem maintainers convert their custom attribute types?
* How to actually convert all the structure instances throughout the tree?

Author

Thomas Weißschuh (Linutronix)

Presentation materials

There are no materials yet.