* [PATCH] Input: goodix-berlin - constify 'struct bin_attribute'
@ 2024-12-22 20:00 Thomas Weißschuh
2025-02-25 6:32 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Weißschuh @ 2024-12-22 20:00 UTC (permalink / raw)
To: Bastien Nocera, Hans de Goede, Dmitry Torokhov
Cc: linux-input, linux-kernel, 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 <linux@weissschuh.net>
---
drivers/input/touchscreen/goodix_berlin_core.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/input/touchscreen/goodix_berlin_core.c b/drivers/input/touchscreen/goodix_berlin_core.c
index 3fc03cf0ca23fdbe36028a6228030d3ffb8d3a09..9b53d98055e93b122603073d2920f74731848b05 100644
--- a/drivers/input/touchscreen/goodix_berlin_core.c
+++ b/drivers/input/touchscreen/goodix_berlin_core.c
@@ -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,
--
Thomas Weißschuh <linux@weissschuh.net>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: goodix-berlin - constify 'struct bin_attribute'
2024-12-22 20:00 [PATCH] Input: goodix-berlin - constify 'struct bin_attribute' Thomas Weißschuh
@ 2025-02-25 6:32 ` Dmitry Torokhov
2025-02-25 6:38 ` Thomas Weißschuh
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2025-02-25 6:32 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Bastien Nocera, Hans de Goede, linux-input, linux-kernel
On Sun, Dec 22, 2024 at 09:00:43PM +0100, Thomas Weißschuh 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.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Applied, thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: goodix-berlin - constify 'struct bin_attribute'
2025-02-25 6:32 ` Dmitry Torokhov
@ 2025-02-25 6:38 ` Thomas Weißschuh
2025-02-25 17:34 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Weißschuh @ 2025-02-25 6:38 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Bastien Nocera, Hans de Goede, linux-input, linux-kernel
Hi Dmitry,
On 2025-02-24 22:32:15-0800, Dmitry Torokhov wrote:
> On Sun, Dec 22, 2024 at 09:00:43PM +0100, Thomas Weißschuh 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.
> >
> > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
>
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: goodix-berlin - constify 'struct bin_attribute'
2025-02-25 6:38 ` Thomas Weißschuh
@ 2025-02-25 17:34 ` Dmitry Torokhov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2025-02-25 17:34 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Bastien Nocera, Hans de Goede, linux-input, linux-kernel
On Tue, Feb 25, 2025 at 07:38:28AM +0100, Thomas Weißschuh wrote:
> Hi Dmitry,
>
> On 2025-02-24 22:32:15-0800, Dmitry Torokhov wrote:
> > On Sun, Dec 22, 2024 at 09:00:43PM +0100, Thomas Weißschuh 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.
> > >
> > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> >
> > 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.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-25 17:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-22 20:00 [PATCH] Input: goodix-berlin - constify 'struct bin_attribute' Thomas Weißschuh
2025-02-25 6:32 ` Dmitry Torokhov
2025-02-25 6:38 ` Thomas Weißschuh
2025-02-25 17:34 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).