[PATCH v2 0/3] firmware: dmi: Constify 'struct bin_attribute'

Thomas Weißschuh posted 3 patches 1 year ago
drivers/firmware/dmi-sysfs.c | 28 +++++++++++-----------------
drivers/firmware/dmi_scan.c  |  4 ++--
2 files changed, 13 insertions(+), 19 deletions(-)
[PATCH v2 0/3] firmware: dmi: Constify 'struct bin_attribute'
Posted by Thomas Weißschuh 1 year ago
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@weissschuh.net>
---
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@weissschuh.net

---
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@weissschuh.net>