public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland@amd.com>
To: "Thomas Weißschuh" <linux@weissschuh.net>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>, "Qiang Yu" <yuq825@gmail.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Tvrtko Ursulin" <tursulin@ursulin.net>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Xinhui Pan" <Xinhui.Pan@amd.com>, "Leo Li" <sunpeng.li@amd.com>,
	"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	lima@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/5] drm/amd/display: Constify 'struct bin_attribute'
Date: Mon, 16 Dec 2024 09:57:33 -0500	[thread overview]
Message-ID: <b5959b38-c81b-41f4-888c-b6cfb85585da@amd.com> (raw)
In-Reply-To: <20241216-sysfs-const-bin_attr-drm-v1-5-210f2b36b9bf@weissschuh.net>

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,
> 


  reply	other threads:[~2024-12-16 14:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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:47   ` Jani Nikula
2025-02-10 17:11   ` Andi Shyti
2024-12-16 11:34 ` [PATCH 2/5] drm/lima: " Thomas Weißschuh
2025-02-10 17:13   ` Andi Shyti
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
2024-12-16 11:34 ` [PATCH 4/5] drm/amdgpu: " Thomas Weißschuh
2024-12-16 19:53   ` Alex Deucher
2024-12-16 11:34 ` [PATCH 5/5] drm/amd/display: " Thomas Weißschuh
2024-12-16 14:57   ` Harry Wentland [this message]
2025-02-10 16:50 ` [PATCH 0/5] drm: " Thomas Weißschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b5959b38-c81b-41f4-888c-b6cfb85585da@amd.com \
    --to=harry.wentland@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=lima@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    --cc=sunpeng.li@amd.com \
    --cc=tursulin@ursulin.net \
    --cc=tzimmermann@suse.de \
    --cc=yuq825@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox