Input: goodix-berlin - constify 'struct bin_attribute'
Subsystems (3)
PATCH 1/1 Input: goodix-berlin - constify 'struct bin_attribute'
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.
--- drivers/input/touchscreen/goodix_berlin_core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/input/touchscreen/goodix_berlin_core.c +5 -5
@@ -673,7 +673,7 @@ static void goodix_berlin_power_off_act(void *data) }static ssize_t registers_read (struct file *filp,struct kobject *kobj, -struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t count) {struct device *dev =kobj_to_dev (kobj);
@@ -686,7 +686,7 @@ static ssize_t registers_read(struct file *filp, struct kobject *kobj, }static ssize_t registers_write (struct file *filp,struct kobject *kobj, -struct bin_attribute *bin_attr, +const struct bin_attribute *bin_attr,char *buf,loff_t off,size_t count) {struct device *dev =kobj_to_dev (kobj);
@@ -698,15 +698,15 @@ static ssize_t registers_write(struct file *filp, struct kobject *kobj,return error ? error : count; } -static BIN_ATTR_ADMIN_RW(registers, 0); +static const BIN_ATTR_ADMIN_RW(registers, 0); -static struct bin_attribute *goodix_berlin_bin_attrs[] = { +static const struct bin_attribute *const goodix_berlin_bin_attrs[] = { &bin_attr_registers,NULL , };static const struct attribute_group goodix_berlin_attr_group = { - .bin_attrs = goodix_berlin_bin_attrs, + .bin_attrs_new = goodix_berlin_bin_attrs, };const struct attribute_group *goodix_berlin_groups[] = {
---
base-commit: bcde95ce32b666478d6737219caa4f8005a8f201
change-id: 20241222-sysfs-const-bin_attr-input-763cac59ce53
Best regards,
Signature · 1 line
Thomas Weißschuh <[email protected]>
Quoted 5 lines · Thomas Weißschuh
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 <[email protected]>
Applied, thank you.
Signature · 1 line
Dmitry
Hi Dmitry,
Quoted 8 lines · Dmitry Torokhov
Quoted 5 lines · Thomas Weißschuh
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 <[email protected]>Applied, thank you.
Thanks.
However Greg already took this through the driver core tree, as it was blocking the general progress.
Could you drop it again?
Thomas
Dmitry Torokhov
maintainerQuoted 10 lines · Thomas Weißschuh
Hi Dmitry,
Quoted 7 lines · Dmitry Torokhov
Quoted 5 lines · Thomas Weißschuh
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 <[email protected]>
Quoted 7 lines
Quoted 1 line
Applied, thank you.
Thanks.
However Greg already took this through the driver core tree, as it was blocking the general progress.
Could you drop it again?
Oh, sorry, dropped.
Thanks.
Signature · 1 line
Dmitry