diff options
| author | Thomas Weißschuh <linux@weissschuh.net> | 2024-12-15 14:18:59 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-02-21 09:20:31 +0100 |
| commit | 05a9896fa9e15466456a1b1dc9d2eacdf3551b79 (patch) | |
| tree | 05d2ed8e9ec8e61950e0871330d54ef2401c5c71 /drivers/pcmcia | |
| parent | ae7a15fb2920844e61cc71199cd1a08795716c54 (diff) | |
| download | linux-next-05a9896fa9e15466456a1b1dc9d2eacdf3551b79.tar.gz linux-next-05a9896fa9e15466456a1b1dc9d2eacdf3551b79.zip | |
pcmcia: cistpl: 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.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241215-sysfs-const-bin_attr-pcmcia-v1-1-ebb82e47d834@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pcmcia')
| -rw-r--r-- | drivers/pcmcia/cistpl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c index d018f36f3a89..0c801e4ccc6c 100644 --- a/drivers/pcmcia/cistpl.c +++ b/drivers/pcmcia/cistpl.c @@ -1540,7 +1540,7 @@ static ssize_t pccard_extract_cis(struct pcmcia_socket *s, char *buf, static ssize_t pccard_show_cis(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) { unsigned int size = 0x200; @@ -1571,7 +1571,7 @@ static ssize_t pccard_show_cis(struct file *filp, struct kobject *kobj, static ssize_t pccard_store_cis(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 pcmcia_socket *s; @@ -1605,6 +1605,6 @@ static ssize_t pccard_store_cis(struct file *filp, struct kobject *kobj, const struct bin_attribute pccard_cis_attr = { .attr = { .name = "cis", .mode = S_IRUGO | S_IWUSR }, .size = 0x200, - .read = pccard_show_cis, - .write = pccard_store_cis, + .read_new = pccard_show_cis, + .write_new = pccard_store_cis, }; |
