From: "Mukunda,Vijendar" <vijendar.mukunda@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: Sunil-kumar.Dommati@amd.com, "David Airlie" <airlied@linux.ie>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"open list" <linux-kernel@vger.kernel.org>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
"Daniel Vetter" <daniel@ffwll.ch>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
dan.carpenter@oracle.com
Subject: Re: [PATCH] drm/amdgpu: fix i2s_pdata out of bound array access
Date: Wed, 27 Jul 2022 20:50:17 +0530 [thread overview]
Message-ID: <1031eddb-4cfa-e94a-e77e-03aa3cb8b680@amd.com> (raw)
In-Reply-To: <CADnq5_PKjmNw+bAPCyDu_G=yNQcpJSpFd+EVzNwfNWzig8apFw@mail.gmail.com>
On 7/27/22 8:25 PM, Alex Deucher wrote:
> On Wed, Jul 27, 2022 at 10:42 AM Vijendar Mukunda
> <Vijendar.Mukunda@amd.com> wrote:
>>
>> Fixed following Smatch static checker warning:
>>
>> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:393 acp_hw_init()
>> error: buffer overflow 'i2s_pdata' 3 <= 3
>> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:396 acp_hw_init()
>> error: buffer overflow 'i2s_pdata' 3 <= 3
>>
>> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 --------
>> 1 file changed, 8 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> index bcc7ee02e0fc..6d72355ac492 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> @@ -390,14 +390,6 @@ static int acp_hw_init(void *handle)
>> i2s_pdata[2].i2s_reg_comp1 = ACP_BT_COMP1_REG_OFFSET;
>> i2s_pdata[2].i2s_reg_comp2 = ACP_BT_COMP2_REG_OFFSET;
>>
>> - i2s_pdata[3].quirks = DW_I2S_QUIRK_COMP_REG_OFFSET;
>> - switch (adev->asic_type) {
>> - case CHIP_STONEY:
>> - i2s_pdata[3].quirks |= DW_I2S_QUIRK_16BIT_IDX_OVERRIDE;
>> - break;
>> - default:
>> - break;
>> - }
>
> Is this actually not used or should we just increase the allocation size?
>
> Alex
it's my bad. i2s_pdata array size is 3. when we recently included code
changes for JD platform , this piece of code was added mistakenly for
Stoney platform switch case.
--
Vijendar
>
>> adev->acp.acp_res[0].name = "acp2x_dma";
>> adev->acp.acp_res[0].flags = IORESOURCE_MEM;
>> adev->acp.acp_res[0].start = acp_base;
>> --
>> 2.25.1
>>
WARNING: multiple messages have this Message-ID (diff)
From: "Mukunda,Vijendar" <vijendar.mukunda@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: Sunil-kumar.Dommati@amd.com, "David Airlie" <airlied@linux.ie>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"open list" <linux-kernel@vger.kernel.org>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
dan.carpenter@oracle.com
Subject: Re: [PATCH] drm/amdgpu: fix i2s_pdata out of bound array access
Date: Wed, 27 Jul 2022 20:50:17 +0530 [thread overview]
Message-ID: <1031eddb-4cfa-e94a-e77e-03aa3cb8b680@amd.com> (raw)
In-Reply-To: <CADnq5_PKjmNw+bAPCyDu_G=yNQcpJSpFd+EVzNwfNWzig8apFw@mail.gmail.com>
On 7/27/22 8:25 PM, Alex Deucher wrote:
> On Wed, Jul 27, 2022 at 10:42 AM Vijendar Mukunda
> <Vijendar.Mukunda@amd.com> wrote:
>>
>> Fixed following Smatch static checker warning:
>>
>> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:393 acp_hw_init()
>> error: buffer overflow 'i2s_pdata' 3 <= 3
>> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:396 acp_hw_init()
>> error: buffer overflow 'i2s_pdata' 3 <= 3
>>
>> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 --------
>> 1 file changed, 8 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> index bcc7ee02e0fc..6d72355ac492 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> @@ -390,14 +390,6 @@ static int acp_hw_init(void *handle)
>> i2s_pdata[2].i2s_reg_comp1 = ACP_BT_COMP1_REG_OFFSET;
>> i2s_pdata[2].i2s_reg_comp2 = ACP_BT_COMP2_REG_OFFSET;
>>
>> - i2s_pdata[3].quirks = DW_I2S_QUIRK_COMP_REG_OFFSET;
>> - switch (adev->asic_type) {
>> - case CHIP_STONEY:
>> - i2s_pdata[3].quirks |= DW_I2S_QUIRK_16BIT_IDX_OVERRIDE;
>> - break;
>> - default:
>> - break;
>> - }
>
> Is this actually not used or should we just increase the allocation size?
>
> Alex
it's my bad. i2s_pdata array size is 3. when we recently included code
changes for JD platform , this piece of code was added mistakenly for
Stoney platform switch case.
--
Vijendar
>
>> adev->acp.acp_res[0].name = "acp2x_dma";
>> adev->acp.acp_res[0].flags = IORESOURCE_MEM;
>> adev->acp.acp_res[0].start = acp_base;
>> --
>> 2.25.1
>>
WARNING: multiple messages have this Message-ID (diff)
From: "Mukunda,Vijendar" <vijendar.mukunda@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
Sunil-kumar.Dommati@amd.com, "David Airlie" <airlied@linux.ie>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"open list" <linux-kernel@vger.kernel.org>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
dan.carpenter@oracle.com
Subject: Re: [PATCH] drm/amdgpu: fix i2s_pdata out of bound array access
Date: Wed, 27 Jul 2022 20:50:17 +0530 [thread overview]
Message-ID: <1031eddb-4cfa-e94a-e77e-03aa3cb8b680@amd.com> (raw)
In-Reply-To: <CADnq5_PKjmNw+bAPCyDu_G=yNQcpJSpFd+EVzNwfNWzig8apFw@mail.gmail.com>
On 7/27/22 8:25 PM, Alex Deucher wrote:
> On Wed, Jul 27, 2022 at 10:42 AM Vijendar Mukunda
> <Vijendar.Mukunda@amd.com> wrote:
>>
>> Fixed following Smatch static checker warning:
>>
>> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:393 acp_hw_init()
>> error: buffer overflow 'i2s_pdata' 3 <= 3
>> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:396 acp_hw_init()
>> error: buffer overflow 'i2s_pdata' 3 <= 3
>>
>> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 --------
>> 1 file changed, 8 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> index bcc7ee02e0fc..6d72355ac492 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> @@ -390,14 +390,6 @@ static int acp_hw_init(void *handle)
>> i2s_pdata[2].i2s_reg_comp1 = ACP_BT_COMP1_REG_OFFSET;
>> i2s_pdata[2].i2s_reg_comp2 = ACP_BT_COMP2_REG_OFFSET;
>>
>> - i2s_pdata[3].quirks = DW_I2S_QUIRK_COMP_REG_OFFSET;
>> - switch (adev->asic_type) {
>> - case CHIP_STONEY:
>> - i2s_pdata[3].quirks |= DW_I2S_QUIRK_16BIT_IDX_OVERRIDE;
>> - break;
>> - default:
>> - break;
>> - }
>
> Is this actually not used or should we just increase the allocation size?
>
> Alex
it's my bad. i2s_pdata array size is 3. when we recently included code
changes for JD platform , this piece of code was added mistakenly for
Stoney platform switch case.
--
Vijendar
>
>> adev->acp.acp_res[0].name = "acp2x_dma";
>> adev->acp.acp_res[0].flags = IORESOURCE_MEM;
>> adev->acp.acp_res[0].start = acp_base;
>> --
>> 2.25.1
>>
next prev parent reply other threads:[~2022-07-27 15:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 14:42 [PATCH] drm/amdgpu: fix i2s_pdata out of bound array access Vijendar Mukunda
2022-07-27 14:42 ` Vijendar Mukunda
2022-07-27 14:42 ` Vijendar Mukunda
2022-07-27 14:55 ` Alex Deucher
2022-07-27 14:55 ` Alex Deucher
2022-07-27 14:55 ` Alex Deucher
2022-07-27 15:20 ` Mukunda,Vijendar [this message]
2022-07-27 15:20 ` Mukunda,Vijendar
2022-07-27 15:20 ` Mukunda,Vijendar
2022-07-27 15:22 ` Alex Deucher
2022-07-27 15:22 ` Alex Deucher
2022-07-27 15:22 ` Alex Deucher
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=1031eddb-4cfa-e94a-e77e-03aa3cb8b680@amd.com \
--to=vijendar.mukunda@amd.com \
--cc=Sunil-kumar.Dommati@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dan.carpenter@oracle.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.