[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b5959b38-c81b-41f4-888c-b6cfb85585da@amd.com>
Date: Mon, 16 Dec 2024 09:57:33 -0500
From: Harry Wentland <harry.wentland@....com>
To: Thomas Weißschuh <linux@...ssschuh.net>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Qiang Yu <yuq825@...il.com>, Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>, Tvrtko Ursulin
<tursulin@...ulin.net>, Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
Xinhui Pan <Xinhui.Pan@....com>, Leo Li <sunpeng.li@....com>,
Rodrigo Siqueira <Rodrigo.Siqueira@....com>
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
lima@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
amd-gfx@...ts.freedesktop.org
Subject: Re: [PATCH 5/5] drm/amd/display: Constify 'struct bin_attribute'
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@...ssschuh.net>
Reviewed-by: Harry Wentland <harry.wentland@....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,
>
Powered by blists - more mailing lists