[PATCH v2 0/3] firmware: dmi: Constify 'struct bin_attribute'
From: Thomas Weißschuh
Date: Sat Jan 25 2025 - 05:12:43 EST
The sysfs core now allows instances of 'struct bin_attribute' to be
moved into read-only memory. Make use of that to protect them against
accidental or malicious modifications.
Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
---
Changes in v2:
- Rebase on current torvalds/master
- Add patches 2 and 3
- Link to v1: https://lore.kernel.org/r/20241122-sysfs-const-bin_attr-dmi-v1-1-febd12fb27d9@xxxxxxxxxxxxxx
---
Thomas Weißschuh (3):
firmware: dmi: Mark bin_attributes as __ro_after_init
firmware: dmi: Define bin_attributes through macro
firmware: dmi: Constify 'struct bin_attribute'
drivers/firmware/dmi-sysfs.c | 28 +++++++++++-----------------
drivers/firmware/dmi_scan.c | 4 ++--
2 files changed, 13 insertions(+), 19 deletions(-)
---
base-commit: 68732c0bf97cf946ad08660203e8eabfea11463e
change-id: 20241122-sysfs-const-bin_attr-dmi-40c387a93dda
Best regards,
--
Thomas Weißschuh <linux@xxxxxxxxxxxxxx>