[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_MP6Fz6gm=vc74U8sc6SgZy1D+39ZQX48zdiWzf+24tTw@mail.gmail.com>
Date: Fri, 18 Nov 2022 09:25:41 -0500
From: Alex Deucher <alexdeucher@...il.com>
To: Denis Arefev <arefev@...mel.ru>
Cc: Alex Deucher <alexander.deucher@....com>,
lvc-project@...uxtesting.org, avid Airlie <airlied@...ux.ie>,
trufanov@...mel.ru, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org, vfh@...mel.ru,
amd-gfx@...ts.freedesktop.org, Daniel Vetter <daniel@...ll.ch>,
Christian König <christian.koenig@....com>
Subject: Re: [PATCH v2] amdgpu: nbio_v7_4: Add pointer check
On Fri, Nov 18, 2022 at 9:11 AM Denis Arefev <arefev@...mel.ru> wrote:
>
> Return value of a function 'amdgpu_ras_find_obj' is dereferenced
> at nbio_v7_4.c:325 without checking for null
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Denis Arefev <arefev@...mel.ru>
> ---
> drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
> index eadc9526d33f..0f2ac99de864 100644
> --- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
> +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
> @@ -304,6 +304,9 @@ static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_device
> struct ras_err_data err_data = {0, 0, 0, NULL};
> struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
>
> + if (!obj)
> + return;
>
I don't think we could ever get here with a NULL obj. This is part of
the interrupt handler for NBIO RAS, so the interrupt would never be
enabled in the first place if the obj didn't exist.
Alex
> bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL);
> if (REG_GET_FIELD(bif_doorbell_intr_cntl,
> BIF_DOORBELL_INT_CNTL, RAS_CNTLR_INTERRUPT_STATUS)) {
> --
> 2.25.1
>
Powered by blists - more mailing lists