From: Harry Wentland <harry.wentland@amd.com>
To: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Alex Hung <alex.hung@amd.com>,
Alex Deucher <alexander.deucher@amd.com>,
Qingqing Zhuo <qingqing.zhuo@amd.com>,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/display: Fix a potential buffer overflow in 'dp_dsc_clock_en_read()'
Date: Tue, 23 Jan 2024 11:05:10 -0500 [thread overview]
Message-ID: <bf82e605-a513-4ed9-aa35-e7b743d0a6da@amd.com> (raw)
In-Reply-To: <20240123150129.496102-1-srinivasan.shanmugam@amd.com>
On 2024-01-23 10:01, Srinivasan Shanmugam wrote:
> Tell snprintf() to store at most 10 bytes in the output buffer
> instead of 30.
>
> Fixes the below:
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1508 dp_dsc_clock_en_read() error: snprintf() is printing too much 30 vs 10
>
> Fixes: c06e09b76639 ("drm/amd/display: Add DSC parameters logging to debugfs")
> Cc: Alex Hung <alex.hung@amd.com>
> Cc: Qingqing Zhuo <qingqing.zhuo@amd.com>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
> Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> index 68a846323912..85fc6181303b 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> @@ -1483,7 +1483,7 @@ static ssize_t dp_dsc_clock_en_read(struct file *f, char __user *buf,
> const uint32_t rd_buf_size = 10;
> struct pipe_ctx *pipe_ctx;
> ssize_t result = 0;
> - int i, r, str_len = 30;
> + int i, r, str_len = 10;
>
> rd_buf = kcalloc(rd_buf_size, sizeof(char), GFP_KERNEL);
>
prev parent reply other threads:[~2024-01-23 16:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 15:01 [PATCH] drm/amd/display: Fix a potential buffer overflow in 'dp_dsc_clock_en_read()' Srinivasan Shanmugam
2024-01-23 16:05 ` Harry Wentland [this message]
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=bf82e605-a513-4ed9-aa35-e7b743d0a6da@amd.com \
--to=harry.wentland@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=alex.hung@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aurabindo.pillai@amd.com \
--cc=qingqing.zhuo@amd.com \
--cc=srinivasan.shanmugam@amd.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