[PATCH 0/3] ACPI: Constify 'struct bin_attribute'

Thomas Weißschuh posted 3 patches 1 year, 2 months ago
drivers/acpi/bgrt.c  | 6 +++---
drivers/acpi/sysfs.c | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
[PATCH 0/3] ACPI: Constify 'struct bin_attribute'
Posted by Thomas Weißschuh 1 year, 2 months 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.

The usage of read_new/write_new/bin_attrs_new is a transition mechanism
and will be reverted after the transition is complete.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Thomas Weißschuh (3):
      ACPI: BGRT: Mark bin_attribute as __ro_after_init
      ACPI: BGRT: Constify 'struct bin_attribute'
      ACPI: sysfs: Constify 'struct bin_attribute'

 drivers/acpi/bgrt.c  | 6 +++---
 drivers/acpi/sysfs.c | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
---
base-commit: e70140ba0d2b1a30467d4af6bcfe761327b9ec95
change-id: 20241201-sysfs-const-bin_attr-acpi-be28e6d66a2a

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>

Re: [PATCH 0/3] ACPI: Constify 'struct bin_attribute'
Posted by Rafael J. Wysocki 1 year, 2 months ago
On Mon, Dec 2, 2024 at 8:04 PM Thomas Weißschuh <linux@weissschuh.net> wrote:
>
> 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.
>
> The usage of read_new/write_new/bin_attrs_new is a transition mechanism
> and will be reverted after the transition is complete.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> Thomas Weißschuh (3):
>       ACPI: BGRT: Mark bin_attribute as __ro_after_init
>       ACPI: BGRT: Constify 'struct bin_attribute'
>       ACPI: sysfs: Constify 'struct bin_attribute'
>
>  drivers/acpi/bgrt.c  | 6 +++---
>  drivers/acpi/sysfs.c | 8 ++++----
>  2 files changed, 7 insertions(+), 7 deletions(-)
> ---

All applied as 6.14 material, thanks!