* [PATCH 1/5] drm/sysfs: Constify 'struct bin_attribute'
2024-12-16 11:34 [PATCH 0/5] drm: Constify 'struct bin_attribute' Thomas Weißschuh
@ 2024-12-16 11:34 ` Thomas Weißschuh
2024-12-16 11:47 ` Jani Nikula
2025-02-10 17:11 ` Andi Shyti
2024-12-16 11:34 ` [PATCH 2/5] drm/lima: " Thomas Weißschuh
` (4 subsequent siblings)
5 siblings, 2 replies; 14+ messages in thread
From: Thomas Weißschuh @ 2024-12-16 11:34 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Qiang Yu, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, Tvrtko Ursulin, Alex Deucher, Christian König,
Xinhui Pan, Harry Wentland, Leo Li, Rodrigo Siqueira
Cc: dri-devel, linux-kernel, lima, intel-gfx, amd-gfx,
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/gpu/drm/drm_sysfs.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index fb3bbb6adcd16f3f325a2ae8e35f41851c00b272..60c1f26edb6fad23153c32a29fd3be02700fc938 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -261,7 +261,7 @@ static ssize_t enabled_show(struct device *device,
}
static ssize_t edid_show(struct file *filp, struct kobject *kobj,
- struct bin_attribute *attr, char *buf, loff_t off,
+ const struct bin_attribute *attr, char *buf, loff_t off,
size_t count)
{
struct device *connector_dev = kobj_to_dev(kobj);
@@ -315,21 +315,21 @@ static struct attribute *connector_dev_attrs[] = {
NULL
};
-static struct bin_attribute edid_attr = {
+static const struct bin_attribute edid_attr = {
.attr.name = "edid",
.attr.mode = 0444,
.size = 0,
- .read = edid_show,
+ .read_new = edid_show,
};
-static struct bin_attribute *connector_bin_attrs[] = {
+static const struct bin_attribute *const connector_bin_attrs[] = {
&edid_attr,
NULL
};
static const struct attribute_group connector_dev_group = {
.attrs = connector_dev_attrs,
- .bin_attrs = connector_bin_attrs,
+ .bin_attrs_new = connector_bin_attrs,
};
static const struct attribute_group *connector_dev_groups[] = {
--
2.47.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH 1/5] drm/sysfs: Constify 'struct bin_attribute'
2024-12-16 11:34 ` [PATCH 1/5] drm/sysfs: " Thomas Weißschuh
@ 2024-12-16 11:47 ` Jani Nikula
2025-02-10 17:11 ` Andi Shyti
1 sibling, 0 replies; 14+ messages in thread
From: Jani Nikula @ 2024-12-16 11:47 UTC (permalink / raw)
To: Thomas Weißschuh, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Qiang Yu,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Alex Deucher,
Christian König, Xinhui Pan, Harry Wentland, Leo Li,
Rodrigo Siqueira
Cc: dri-devel, linux-kernel, lima, intel-gfx, amd-gfx,
Thomas Weißschuh
On Mon, 16 Dec 2024, 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.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/drm_sysfs.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
> index fb3bbb6adcd16f3f325a2ae8e35f41851c00b272..60c1f26edb6fad23153c32a29fd3be02700fc938 100644
> --- a/drivers/gpu/drm/drm_sysfs.c
> +++ b/drivers/gpu/drm/drm_sysfs.c
> @@ -261,7 +261,7 @@ static ssize_t enabled_show(struct device *device,
> }
>
> static ssize_t edid_show(struct file *filp, struct kobject *kobj,
> - struct bin_attribute *attr, char *buf, loff_t off,
> + const struct bin_attribute *attr, char *buf, loff_t off,
> size_t count)
> {
> struct device *connector_dev = kobj_to_dev(kobj);
> @@ -315,21 +315,21 @@ static struct attribute *connector_dev_attrs[] = {
> NULL
> };
>
> -static struct bin_attribute edid_attr = {
> +static const struct bin_attribute edid_attr = {
> .attr.name = "edid",
> .attr.mode = 0444,
> .size = 0,
> - .read = edid_show,
> + .read_new = edid_show,
> };
>
> -static struct bin_attribute *connector_bin_attrs[] = {
> +static const struct bin_attribute *const connector_bin_attrs[] = {
> &edid_attr,
> NULL
> };
>
> static const struct attribute_group connector_dev_group = {
> .attrs = connector_dev_attrs,
> - .bin_attrs = connector_bin_attrs,
> + .bin_attrs_new = connector_bin_attrs,
> };
>
> static const struct attribute_group *connector_dev_groups[] = {
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 1/5] drm/sysfs: Constify 'struct bin_attribute'
2024-12-16 11:34 ` [PATCH 1/5] drm/sysfs: " Thomas Weißschuh
2024-12-16 11:47 ` Jani Nikula
@ 2025-02-10 17:11 ` Andi Shyti
1 sibling, 0 replies; 14+ messages in thread
From: Andi Shyti @ 2025-02-10 17:11 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Qiang Yu, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, Tvrtko Ursulin, Alex Deucher, Christian König,
Xinhui Pan, Harry Wentland, Leo Li, Rodrigo Siqueira, dri-devel,
linux-kernel, lima, intel-gfx, amd-gfx
Hi Thomas,
On Mon, Dec 16, 2024 at 12:34:47PM +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>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Thanks,
Andi
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 2/5] drm/lima: Constify 'struct bin_attribute'
2024-12-16 11:34 [PATCH 0/5] drm: Constify 'struct bin_attribute' Thomas Weißschuh
2024-12-16 11:34 ` [PATCH 1/5] drm/sysfs: " Thomas Weißschuh
@ 2024-12-16 11:34 ` Thomas Weißschuh
2025-02-10 17:13 ` Andi Shyti
2024-12-16 11:34 ` [PATCH 3/5] drm/i915: " Thomas Weißschuh
` (3 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Thomas Weißschuh @ 2024-12-16 11:34 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Qiang Yu, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, Tvrtko Ursulin, Alex Deucher, Christian König,
Xinhui Pan, Harry Wentland, Leo Li, Rodrigo Siqueira
Cc: dri-devel, linux-kernel, lima, intel-gfx, amd-gfx,
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/gpu/drm/lima/lima_drv.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/lima/lima_drv.c b/drivers/gpu/drm/lima/lima_drv.c
index fb3062c872b317ef27cd321b2638944f8a5dc33a..b969bd3f28968304946c0bb629460e91622d5fbc 100644
--- a/drivers/gpu/drm/lima/lima_drv.c
+++ b/drivers/gpu/drm/lima/lima_drv.c
@@ -311,7 +311,7 @@ static bool lima_read_block(struct lima_block_reader *reader,
}
static ssize_t lima_error_state_read(struct file *filp, struct kobject *kobj,
- struct bin_attribute *attr, char *buf,
+ const struct bin_attribute *attr, char *buf,
loff_t off, size_t count)
{
struct device *dev = kobj_to_dev(kobj);
@@ -337,7 +337,7 @@ static ssize_t lima_error_state_read(struct file *filp, struct kobject *kobj,
}
static ssize_t lima_error_state_write(struct file *file, struct kobject *kobj,
- struct bin_attribute *attr, char *buf,
+ const struct bin_attribute *attr, char *buf,
loff_t off, size_t count)
{
struct device *dev = kobj_to_dev(kobj);
@@ -363,8 +363,8 @@ static const struct bin_attribute lima_error_state_attr = {
.attr.name = "error",
.attr.mode = 0600,
.size = 0,
- .read = lima_error_state_read,
- .write = lima_error_state_write,
+ .read_new = lima_error_state_read,
+ .write_new = lima_error_state_write,
};
static int lima_pdev_probe(struct platform_device *pdev)
--
2.47.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH 2/5] drm/lima: Constify 'struct bin_attribute'
2024-12-16 11:34 ` [PATCH 2/5] drm/lima: " Thomas Weißschuh
@ 2025-02-10 17:13 ` Andi Shyti
0 siblings, 0 replies; 14+ messages in thread
From: Andi Shyti @ 2025-02-10 17:13 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Qiang Yu, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, Tvrtko Ursulin, Alex Deucher, Christian König,
Xinhui Pan, Harry Wentland, Leo Li, Rodrigo Siqueira, dri-devel,
linux-kernel, lima, intel-gfx, amd-gfx
Hi Thomas,
On Mon, Dec 16, 2024 at 12:34:48PM +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>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Andi
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/5] drm/i915: Constify 'struct bin_attribute'
2024-12-16 11:34 [PATCH 0/5] drm: Constify 'struct bin_attribute' Thomas Weißschuh
2024-12-16 11:34 ` [PATCH 1/5] drm/sysfs: " Thomas Weißschuh
2024-12-16 11:34 ` [PATCH 2/5] drm/lima: " Thomas Weißschuh
@ 2024-12-16 11:34 ` Thomas Weißschuh
2024-12-16 11:48 ` Jani Nikula
2025-02-10 17:14 ` Andi Shyti
2024-12-16 11:34 ` [PATCH 4/5] drm/amdgpu: " Thomas Weißschuh
` (2 subsequent siblings)
5 siblings, 2 replies; 14+ messages in thread
From: Thomas Weißschuh @ 2024-12-16 11:34 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Qiang Yu, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, Tvrtko Ursulin, Alex Deucher, Christian König,
Xinhui Pan, Harry Wentland, Leo Li, Rodrigo Siqueira
Cc: dri-devel, linux-kernel, lima, intel-gfx, amd-gfx,
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/gpu/drm/i915/i915_gpu_error.c | 8 ++++----
drivers/gpu/drm/i915/i915_sysfs.c | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 71c0daef19962660086b37fe55ca2d6b01f2bb9a..a4cb4e731bdd72201c91541fb86e827e96214a8b 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -2491,7 +2491,7 @@ void i915_gpu_error_debugfs_register(struct drm_i915_private *i915)
}
static ssize_t error_state_read(struct file *filp, struct kobject *kobj,
- struct bin_attribute *attr, char *buf,
+ const struct bin_attribute *attr, char *buf,
loff_t off, size_t count)
{
@@ -2527,7 +2527,7 @@ static ssize_t error_state_read(struct file *filp, struct kobject *kobj,
}
static ssize_t error_state_write(struct file *file, struct kobject *kobj,
- struct bin_attribute *attr, char *buf,
+ const struct bin_attribute *attr, char *buf,
loff_t off, size_t count)
{
struct device *kdev = kobj_to_dev(kobj);
@@ -2543,8 +2543,8 @@ static const struct bin_attribute error_state_attr = {
.attr.name = "error",
.attr.mode = S_IRUSR | S_IWUSR,
.size = 0,
- .read = error_state_read,
- .write = error_state_write,
+ .read_new = error_state_read,
+ .write_new = error_state_write,
};
void i915_gpu_error_sysfs_setup(struct drm_i915_private *i915)
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index 8775beab9cb8438c2e8abb0f9d8104dcba7c0df3..f936e8f1f12942287a5a7d6aa7db6ed3a4c28281 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -60,7 +60,7 @@ static int l3_access_valid(struct drm_i915_private *i915, loff_t offset)
static ssize_t
i915_l3_read(struct file *filp, struct kobject *kobj,
- struct bin_attribute *attr, char *buf,
+ const struct bin_attribute *attr, char *buf,
loff_t offset, size_t count)
{
struct device *kdev = kobj_to_dev(kobj);
@@ -88,7 +88,7 @@ i915_l3_read(struct file *filp, struct kobject *kobj,
static ssize_t
i915_l3_write(struct file *filp, struct kobject *kobj,
- struct bin_attribute *attr, char *buf,
+ const struct bin_attribute *attr, char *buf,
loff_t offset, size_t count)
{
struct device *kdev = kobj_to_dev(kobj);
@@ -140,8 +140,8 @@ i915_l3_write(struct file *filp, struct kobject *kobj,
static const struct bin_attribute dpf_attrs = {
.attr = {.name = "l3_parity", .mode = (S_IRUSR | S_IWUSR)},
.size = GEN7_L3LOG_SIZE,
- .read = i915_l3_read,
- .write = i915_l3_write,
+ .read_new = i915_l3_read,
+ .write_new = i915_l3_write,
.mmap = NULL,
.private = (void *)0
};
@@ -149,8 +149,8 @@ static const struct bin_attribute dpf_attrs = {
static const struct bin_attribute dpf_attrs_1 = {
.attr = {.name = "l3_parity_slice_1", .mode = (S_IRUSR | S_IWUSR)},
.size = GEN7_L3LOG_SIZE,
- .read = i915_l3_read,
- .write = i915_l3_write,
+ .read_new = i915_l3_read,
+ .write_new = i915_l3_write,
.mmap = NULL,
.private = (void *)1
};
--
2.47.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH 3/5] drm/i915: Constify 'struct bin_attribute'
2024-12-16 11:34 ` [PATCH 3/5] drm/i915: " Thomas Weißschuh
@ 2024-12-16 11:48 ` Jani Nikula
2025-02-10 17:14 ` Andi Shyti
1 sibling, 0 replies; 14+ messages in thread
From: Jani Nikula @ 2024-12-16 11:48 UTC (permalink / raw)
To: Thomas Weißschuh, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Qiang Yu,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Alex Deucher,
Christian König, Xinhui Pan, Harry Wentland, Leo Li,
Rodrigo Siqueira
Cc: dri-devel, linux-kernel, lima, intel-gfx, amd-gfx,
Thomas Weißschuh
On Mon, 16 Dec 2024, 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.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gpu_error.c | 8 ++++----
> drivers/gpu/drm/i915/i915_sysfs.c | 12 ++++++------
> 2 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 71c0daef19962660086b37fe55ca2d6b01f2bb9a..a4cb4e731bdd72201c91541fb86e827e96214a8b 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -2491,7 +2491,7 @@ void i915_gpu_error_debugfs_register(struct drm_i915_private *i915)
> }
>
> static ssize_t error_state_read(struct file *filp, struct kobject *kobj,
> - struct bin_attribute *attr, char *buf,
> + const struct bin_attribute *attr, char *buf,
> loff_t off, size_t count)
> {
>
> @@ -2527,7 +2527,7 @@ static ssize_t error_state_read(struct file *filp, struct kobject *kobj,
> }
>
> static ssize_t error_state_write(struct file *file, struct kobject *kobj,
> - struct bin_attribute *attr, char *buf,
> + const struct bin_attribute *attr, char *buf,
> loff_t off, size_t count)
> {
> struct device *kdev = kobj_to_dev(kobj);
> @@ -2543,8 +2543,8 @@ static const struct bin_attribute error_state_attr = {
> .attr.name = "error",
> .attr.mode = S_IRUSR | S_IWUSR,
> .size = 0,
> - .read = error_state_read,
> - .write = error_state_write,
> + .read_new = error_state_read,
> + .write_new = error_state_write,
> };
>
> void i915_gpu_error_sysfs_setup(struct drm_i915_private *i915)
> diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> index 8775beab9cb8438c2e8abb0f9d8104dcba7c0df3..f936e8f1f12942287a5a7d6aa7db6ed3a4c28281 100644
> --- a/drivers/gpu/drm/i915/i915_sysfs.c
> +++ b/drivers/gpu/drm/i915/i915_sysfs.c
> @@ -60,7 +60,7 @@ static int l3_access_valid(struct drm_i915_private *i915, loff_t offset)
>
> static ssize_t
> i915_l3_read(struct file *filp, struct kobject *kobj,
> - struct bin_attribute *attr, char *buf,
> + const struct bin_attribute *attr, char *buf,
> loff_t offset, size_t count)
> {
> struct device *kdev = kobj_to_dev(kobj);
> @@ -88,7 +88,7 @@ i915_l3_read(struct file *filp, struct kobject *kobj,
>
> static ssize_t
> i915_l3_write(struct file *filp, struct kobject *kobj,
> - struct bin_attribute *attr, char *buf,
> + const struct bin_attribute *attr, char *buf,
> loff_t offset, size_t count)
> {
> struct device *kdev = kobj_to_dev(kobj);
> @@ -140,8 +140,8 @@ i915_l3_write(struct file *filp, struct kobject *kobj,
> static const struct bin_attribute dpf_attrs = {
> .attr = {.name = "l3_parity", .mode = (S_IRUSR | S_IWUSR)},
> .size = GEN7_L3LOG_SIZE,
> - .read = i915_l3_read,
> - .write = i915_l3_write,
> + .read_new = i915_l3_read,
> + .write_new = i915_l3_write,
> .mmap = NULL,
> .private = (void *)0
> };
> @@ -149,8 +149,8 @@ static const struct bin_attribute dpf_attrs = {
> static const struct bin_attribute dpf_attrs_1 = {
> .attr = {.name = "l3_parity_slice_1", .mode = (S_IRUSR | S_IWUSR)},
> .size = GEN7_L3LOG_SIZE,
> - .read = i915_l3_read,
> - .write = i915_l3_write,
> + .read_new = i915_l3_read,
> + .write_new = i915_l3_write,
> .mmap = NULL,
> .private = (void *)1
> };
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 3/5] drm/i915: Constify 'struct bin_attribute'
2024-12-16 11:34 ` [PATCH 3/5] drm/i915: " Thomas Weißschuh
2024-12-16 11:48 ` Jani Nikula
@ 2025-02-10 17:14 ` Andi Shyti
1 sibling, 0 replies; 14+ messages in thread
From: Andi Shyti @ 2025-02-10 17:14 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Qiang Yu, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, Tvrtko Ursulin, Alex Deucher, Christian König,
Xinhui Pan, Harry Wentland, Leo Li, Rodrigo Siqueira, dri-devel,
linux-kernel, lima, intel-gfx, amd-gfx
Hi Thomas,
On Mon, Dec 16, 2024 at 12:34:49PM +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>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Thanks,
Andi
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 4/5] drm/amdgpu: Constify 'struct bin_attribute'
2024-12-16 11:34 [PATCH 0/5] drm: Constify 'struct bin_attribute' Thomas Weißschuh
` (2 preceding siblings ...)
2024-12-16 11:34 ` [PATCH 3/5] drm/i915: " Thomas Weißschuh
@ 2024-12-16 11:34 ` Thomas Weißschuh
2024-12-16 19:53 ` Alex Deucher
2024-12-16 11:34 ` [PATCH 5/5] drm/amd/display: " Thomas Weißschuh
2025-02-10 16:50 ` [PATCH 0/5] drm: " Thomas Weißschuh
5 siblings, 1 reply; 14+ messages in thread
From: Thomas Weißschuh @ 2024-12-16 11:34 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Qiang Yu, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, Tvrtko Ursulin, Alex Deucher, Christian König,
Xinhui Pan, Harry Wentland, Leo Li, Rodrigo Siqueira
Cc: dri-devel, linux-kernel, lima, intel-gfx, amd-gfx,
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/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 14 +++++++-------
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 13 ++++++-------
3 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index d272d95dd5b2f5eb83be279281d55af323f7f508..88459de2cd2e47390d33e5939875c3322b740b4d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -223,7 +223,7 @@ static DEVICE_ATTR(pcie_replay_count, 0444,
amdgpu_device_get_pcie_replay_count, NULL);
static ssize_t amdgpu_sysfs_reg_state_get(struct file *f, struct kobject *kobj,
- struct bin_attribute *attr, char *buf,
+ const struct bin_attribute *attr, char *buf,
loff_t ppos, size_t count)
{
struct device *dev = kobj_to_dev(kobj);
@@ -259,8 +259,8 @@ static ssize_t amdgpu_sysfs_reg_state_get(struct file *f, struct kobject *kobj,
return bytes_read;
}
-BIN_ATTR(reg_state, 0444, amdgpu_sysfs_reg_state_get, NULL,
- AMDGPU_SYS_REG_STATE_END);
+static const BIN_ATTR(reg_state, 0444, amdgpu_sysfs_reg_state_get, NULL,
+ AMDGPU_SYS_REG_STATE_END);
int amdgpu_reg_state_sysfs_init(struct amdgpu_device *adev)
{
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 448f9e742983f3ef0c5fccc18d85f0c2449aa08e..cda25174730a6852bcb6e01aeec858faad172b19 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -3969,7 +3969,7 @@ int is_psp_fw_valid(struct psp_bin_desc bin)
}
static ssize_t amdgpu_psp_vbflash_write(struct file *filp, struct kobject *kobj,
- struct bin_attribute *bin_attr,
+ const struct bin_attribute *bin_attr,
char *buffer, loff_t pos, size_t count)
{
struct device *dev = kobj_to_dev(kobj);
@@ -4005,7 +4005,7 @@ static ssize_t amdgpu_psp_vbflash_write(struct file *filp, struct kobject *kobj,
}
static ssize_t amdgpu_psp_vbflash_read(struct file *filp, struct kobject *kobj,
- struct bin_attribute *bin_attr, char *buffer,
+ const struct bin_attribute *bin_attr, char *buffer,
loff_t pos, size_t count)
{
struct device *dev = kobj_to_dev(kobj);
@@ -4057,11 +4057,11 @@ static ssize_t amdgpu_psp_vbflash_read(struct file *filp, struct kobject *kobj,
* Writing to this file will stage an IFWI for update. Reading from this file
* will trigger the update process.
*/
-static struct bin_attribute psp_vbflash_bin_attr = {
+static const struct bin_attribute psp_vbflash_bin_attr = {
.attr = {.name = "psp_vbflash", .mode = 0660},
.size = 0,
- .write = amdgpu_psp_vbflash_write,
- .read = amdgpu_psp_vbflash_read,
+ .write_new = amdgpu_psp_vbflash_write,
+ .read_new = amdgpu_psp_vbflash_read,
};
/**
@@ -4088,7 +4088,7 @@ static ssize_t amdgpu_psp_vbflash_status(struct device *dev,
}
static DEVICE_ATTR(psp_vbflash_status, 0440, amdgpu_psp_vbflash_status, NULL);
-static struct bin_attribute *bin_flash_attrs[] = {
+static const struct bin_attribute *const bin_flash_attrs[] = {
&psp_vbflash_bin_attr,
NULL
};
@@ -4124,7 +4124,7 @@ static umode_t amdgpu_bin_flash_attr_is_visible(struct kobject *kobj,
const struct attribute_group amdgpu_flash_attr_group = {
.attrs = flash_attrs,
- .bin_attrs = bin_flash_attrs,
+ .bin_attrs_new = bin_flash_attrs,
.is_bin_visible = amdgpu_bin_flash_attr_is_visible,
.is_visible = amdgpu_flash_attr_is_visible,
};
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 4c9fa24dd9726a405935907524ed7bf7862779d1..2991e0967b5bfc848328aaa59ddfb9a8f202bae9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -1732,7 +1732,7 @@ static char *amdgpu_ras_badpage_flags_str(unsigned int flags)
*/
static ssize_t amdgpu_ras_sysfs_badpages_read(struct file *f,
- struct kobject *kobj, struct bin_attribute *attr,
+ struct kobject *kobj, const struct bin_attribute *attr,
char *buf, loff_t ppos, size_t count)
{
struct amdgpu_ras *con =
@@ -2063,8 +2063,8 @@ void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev)
/* debugfs end */
/* ras fs */
-static BIN_ATTR(gpu_vram_bad_pages, S_IRUGO,
- amdgpu_ras_sysfs_badpages_read, NULL, 0);
+static const BIN_ATTR(gpu_vram_bad_pages, S_IRUGO,
+ amdgpu_ras_sysfs_badpages_read, NULL, 0);
static DEVICE_ATTR(features, S_IRUGO,
amdgpu_ras_sysfs_features_read, NULL);
static DEVICE_ATTR(version, 0444,
@@ -2086,7 +2086,7 @@ static int amdgpu_ras_fs_init(struct amdgpu_device *adev)
&con->event_state_attr.attr,
NULL
};
- struct bin_attribute *bin_attrs[] = {
+ const struct bin_attribute *bin_attrs[] = {
NULL,
NULL,
};
@@ -2112,11 +2112,10 @@ static int amdgpu_ras_fs_init(struct amdgpu_device *adev)
if (amdgpu_bad_page_threshold != 0) {
/* add bad_page_features entry */
- bin_attr_gpu_vram_bad_pages.private = NULL;
con->badpages_attr = bin_attr_gpu_vram_bad_pages;
+ sysfs_bin_attr_init(&con->badpages_attr);
bin_attrs[0] = &con->badpages_attr;
- group.bin_attrs = bin_attrs;
- sysfs_bin_attr_init(bin_attrs[0]);
+ group.bin_attrs_new = bin_attrs;
}
r = sysfs_create_group(&adev->dev->kobj, &group);
--
2.47.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH 4/5] drm/amdgpu: Constify 'struct bin_attribute'
2024-12-16 11:34 ` [PATCH 4/5] drm/amdgpu: " Thomas Weißschuh
@ 2024-12-16 19:53 ` Alex Deucher
0 siblings, 0 replies; 14+ messages in thread
From: Alex Deucher @ 2024-12-16 19:53 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Qiang Yu, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, Tvrtko Ursulin, Alex Deucher, Christian König,
Xinhui Pan, Harry Wentland, Leo Li, Rodrigo Siqueira, dri-devel,
linux-kernel, lima, intel-gfx, amd-gfx
On Mon, Dec 16, 2024 at 6:53 AM 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.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 14 +++++++-------
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 13 ++++++-------
> 3 files changed, 16 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index d272d95dd5b2f5eb83be279281d55af323f7f508..88459de2cd2e47390d33e5939875c3322b740b4d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -223,7 +223,7 @@ static DEVICE_ATTR(pcie_replay_count, 0444,
> amdgpu_device_get_pcie_replay_count, NULL);
>
> static ssize_t amdgpu_sysfs_reg_state_get(struct file *f, struct kobject *kobj,
> - struct bin_attribute *attr, char *buf,
> + const struct bin_attribute *attr, char *buf,
> loff_t ppos, size_t count)
> {
> struct device *dev = kobj_to_dev(kobj);
> @@ -259,8 +259,8 @@ static ssize_t amdgpu_sysfs_reg_state_get(struct file *f, struct kobject *kobj,
> return bytes_read;
> }
>
> -BIN_ATTR(reg_state, 0444, amdgpu_sysfs_reg_state_get, NULL,
> - AMDGPU_SYS_REG_STATE_END);
> +static const BIN_ATTR(reg_state, 0444, amdgpu_sysfs_reg_state_get, NULL,
> + AMDGPU_SYS_REG_STATE_END);
>
> int amdgpu_reg_state_sysfs_init(struct amdgpu_device *adev)
> {
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 448f9e742983f3ef0c5fccc18d85f0c2449aa08e..cda25174730a6852bcb6e01aeec858faad172b19 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -3969,7 +3969,7 @@ int is_psp_fw_valid(struct psp_bin_desc bin)
> }
>
> static ssize_t amdgpu_psp_vbflash_write(struct file *filp, struct kobject *kobj,
> - struct bin_attribute *bin_attr,
> + const struct bin_attribute *bin_attr,
> char *buffer, loff_t pos, size_t count)
> {
> struct device *dev = kobj_to_dev(kobj);
> @@ -4005,7 +4005,7 @@ static ssize_t amdgpu_psp_vbflash_write(struct file *filp, struct kobject *kobj,
> }
>
> static ssize_t amdgpu_psp_vbflash_read(struct file *filp, struct kobject *kobj,
> - struct bin_attribute *bin_attr, char *buffer,
> + const struct bin_attribute *bin_attr, char *buffer,
> loff_t pos, size_t count)
> {
> struct device *dev = kobj_to_dev(kobj);
> @@ -4057,11 +4057,11 @@ static ssize_t amdgpu_psp_vbflash_read(struct file *filp, struct kobject *kobj,
> * Writing to this file will stage an IFWI for update. Reading from this file
> * will trigger the update process.
> */
> -static struct bin_attribute psp_vbflash_bin_attr = {
> +static const struct bin_attribute psp_vbflash_bin_attr = {
> .attr = {.name = "psp_vbflash", .mode = 0660},
> .size = 0,
> - .write = amdgpu_psp_vbflash_write,
> - .read = amdgpu_psp_vbflash_read,
> + .write_new = amdgpu_psp_vbflash_write,
> + .read_new = amdgpu_psp_vbflash_read,
> };
>
> /**
> @@ -4088,7 +4088,7 @@ static ssize_t amdgpu_psp_vbflash_status(struct device *dev,
> }
> static DEVICE_ATTR(psp_vbflash_status, 0440, amdgpu_psp_vbflash_status, NULL);
>
> -static struct bin_attribute *bin_flash_attrs[] = {
> +static const struct bin_attribute *const bin_flash_attrs[] = {
> &psp_vbflash_bin_attr,
> NULL
> };
> @@ -4124,7 +4124,7 @@ static umode_t amdgpu_bin_flash_attr_is_visible(struct kobject *kobj,
>
> const struct attribute_group amdgpu_flash_attr_group = {
> .attrs = flash_attrs,
> - .bin_attrs = bin_flash_attrs,
> + .bin_attrs_new = bin_flash_attrs,
> .is_bin_visible = amdgpu_bin_flash_attr_is_visible,
> .is_visible = amdgpu_flash_attr_is_visible,
> };
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 4c9fa24dd9726a405935907524ed7bf7862779d1..2991e0967b5bfc848328aaa59ddfb9a8f202bae9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -1732,7 +1732,7 @@ static char *amdgpu_ras_badpage_flags_str(unsigned int flags)
> */
>
> static ssize_t amdgpu_ras_sysfs_badpages_read(struct file *f,
> - struct kobject *kobj, struct bin_attribute *attr,
> + struct kobject *kobj, const struct bin_attribute *attr,
> char *buf, loff_t ppos, size_t count)
> {
> struct amdgpu_ras *con =
> @@ -2063,8 +2063,8 @@ void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev)
> /* debugfs end */
>
> /* ras fs */
> -static BIN_ATTR(gpu_vram_bad_pages, S_IRUGO,
> - amdgpu_ras_sysfs_badpages_read, NULL, 0);
> +static const BIN_ATTR(gpu_vram_bad_pages, S_IRUGO,
> + amdgpu_ras_sysfs_badpages_read, NULL, 0);
> static DEVICE_ATTR(features, S_IRUGO,
> amdgpu_ras_sysfs_features_read, NULL);
> static DEVICE_ATTR(version, 0444,
> @@ -2086,7 +2086,7 @@ static int amdgpu_ras_fs_init(struct amdgpu_device *adev)
> &con->event_state_attr.attr,
> NULL
> };
> - struct bin_attribute *bin_attrs[] = {
> + const struct bin_attribute *bin_attrs[] = {
> NULL,
> NULL,
> };
> @@ -2112,11 +2112,10 @@ static int amdgpu_ras_fs_init(struct amdgpu_device *adev)
>
> if (amdgpu_bad_page_threshold != 0) {
> /* add bad_page_features entry */
> - bin_attr_gpu_vram_bad_pages.private = NULL;
> con->badpages_attr = bin_attr_gpu_vram_bad_pages;
> + sysfs_bin_attr_init(&con->badpages_attr);
> bin_attrs[0] = &con->badpages_attr;
> - group.bin_attrs = bin_attrs;
> - sysfs_bin_attr_init(bin_attrs[0]);
> + group.bin_attrs_new = bin_attrs;
> }
>
> r = sysfs_create_group(&adev->dev->kobj, &group);
>
> --
> 2.47.1
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 5/5] drm/amd/display: Constify 'struct bin_attribute'
2024-12-16 11:34 [PATCH 0/5] drm: Constify 'struct bin_attribute' Thomas Weißschuh
` (3 preceding siblings ...)
2024-12-16 11:34 ` [PATCH 4/5] drm/amdgpu: " Thomas Weißschuh
@ 2024-12-16 11:34 ` Thomas Weißschuh
2024-12-16 14:57 ` Harry Wentland
2025-02-10 16:50 ` [PATCH 0/5] drm: " Thomas Weißschuh
5 siblings, 1 reply; 14+ messages in thread
From: Thomas Weißschuh @ 2024-12-16 11:34 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Qiang Yu, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, Tvrtko Ursulin, Alex Deucher, Christian König,
Xinhui Pan, Harry Wentland, Leo Li, Rodrigo Siqueira
Cc: dri-devel, linux-kernel, lima, intel-gfx, amd-gfx,
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/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
index e339c7a8d541c962aa44ae25ad97b864285394b8..e27d077396327bbe25014aec5b978293b1c20dac 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
@@ -614,7 +614,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
* incorrect/corrupted and we should correct our SRM by getting it from PSP
*/
static ssize_t srm_data_write(struct file *filp, struct kobject *kobj,
- struct bin_attribute *bin_attr, char *buffer,
+ const struct bin_attribute *bin_attr, char *buffer,
loff_t pos, size_t count)
{
struct hdcp_workqueue *work;
@@ -638,7 +638,7 @@ static ssize_t srm_data_write(struct file *filp, struct kobject *kobj,
}
static ssize_t srm_data_read(struct file *filp, struct kobject *kobj,
- struct bin_attribute *bin_attr, char *buffer,
+ const struct bin_attribute *bin_attr, char *buffer,
loff_t pos, size_t count)
{
struct hdcp_workqueue *work;
@@ -698,8 +698,8 @@ static ssize_t srm_data_read(struct file *filp, struct kobject *kobj,
static const struct bin_attribute data_attr = {
.attr = {.name = "hdcp_srm", .mode = 0664},
.size = PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE, /* Limit SRM size */
- .write = srm_data_write,
- .read = srm_data_read,
+ .write_new = srm_data_write,
+ .read_new = srm_data_read,
};
struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev,
--
2.47.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH 5/5] drm/amd/display: Constify 'struct bin_attribute'
2024-12-16 11:34 ` [PATCH 5/5] drm/amd/display: " Thomas Weißschuh
@ 2024-12-16 14:57 ` Harry Wentland
0 siblings, 0 replies; 14+ messages in thread
From: Harry Wentland @ 2024-12-16 14:57 UTC (permalink / raw)
To: Thomas Weißschuh, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Qiang Yu,
Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
Alex Deucher, Christian König, Xinhui Pan, Leo Li,
Rodrigo Siqueira
Cc: dri-devel, linux-kernel, lima, intel-gfx, amd-gfx
On 2024-12-16 06:34, 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>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
> index e339c7a8d541c962aa44ae25ad97b864285394b8..e27d077396327bbe25014aec5b978293b1c20dac 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
> @@ -614,7 +614,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
> * incorrect/corrupted and we should correct our SRM by getting it from PSP
> */
> static ssize_t srm_data_write(struct file *filp, struct kobject *kobj,
> - struct bin_attribute *bin_attr, char *buffer,
> + const struct bin_attribute *bin_attr, char *buffer,
> loff_t pos, size_t count)
> {
> struct hdcp_workqueue *work;
> @@ -638,7 +638,7 @@ static ssize_t srm_data_write(struct file *filp, struct kobject *kobj,
> }
>
> static ssize_t srm_data_read(struct file *filp, struct kobject *kobj,
> - struct bin_attribute *bin_attr, char *buffer,
> + const struct bin_attribute *bin_attr, char *buffer,
> loff_t pos, size_t count)
> {
> struct hdcp_workqueue *work;
> @@ -698,8 +698,8 @@ static ssize_t srm_data_read(struct file *filp, struct kobject *kobj,
> static const struct bin_attribute data_attr = {
> .attr = {.name = "hdcp_srm", .mode = 0664},
> .size = PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE, /* Limit SRM size */
> - .write = srm_data_write,
> - .read = srm_data_read,
> + .write_new = srm_data_write,
> + .read_new = srm_data_read,
> };
>
> struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev,
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/5] drm: Constify 'struct bin_attribute'
2024-12-16 11:34 [PATCH 0/5] drm: Constify 'struct bin_attribute' Thomas Weißschuh
` (4 preceding siblings ...)
2024-12-16 11:34 ` [PATCH 5/5] drm/amd/display: " Thomas Weißschuh
@ 2025-02-10 16:50 ` Thomas Weißschuh
5 siblings, 0 replies; 14+ messages in thread
From: Thomas Weißschuh @ 2025-02-10 16:50 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Qiang Yu, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, Tvrtko Ursulin, Alex Deucher, Christian König,
Xinhui Pan, Harry Wentland, Leo Li, Rodrigo Siqueira
Cc: dri-devel, linux-kernel, lima, intel-gfx, amd-gfx
Hi,
On 2024-12-16 12:34:46+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.
Can anybody pick up these patches?
Except for lima they all have Acks.
In my opinion they should go through drm-misc.
Thanks,
Thomas
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> Thomas Weißschuh (5):
> drm/sysfs: Constify 'struct bin_attribute'
> drm/lima: Constify 'struct bin_attribute'
> drm/i915: Constify 'struct bin_attribute'
> drm/amdgpu: Constify 'struct bin_attribute'
> drm/amd/display: Constify 'struct bin_attribute'
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 14 +++++++-------
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 13 ++++++-------
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 8 ++++----
> drivers/gpu/drm/drm_sysfs.c | 10 +++++-----
> drivers/gpu/drm/i915/i915_gpu_error.c | 8 ++++----
> drivers/gpu/drm/i915/i915_sysfs.c | 12 ++++++------
> drivers/gpu/drm/lima/lima_drv.c | 8 ++++----
> 8 files changed, 39 insertions(+), 40 deletions(-)
> ---
> base-commit: 78d4f34e2115b517bcbfe7ec0d018bbbb6f9b0b8
> change-id: 20241215-sysfs-const-bin_attr-drm-9bf7700da886
>
> Best regards,
> --
> Thomas Weißschuh <linux@weissschuh.net>
>
^ permalink raw reply [flat|nested] 14+ messages in thread