lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b7b3c444-9ece-dd08-cb4c-c7ac4009373b@amd.com>
Date:   Wed, 6 Nov 2019 09:59:14 +0000
From:   "Koenig, Christian" <Christian.Koenig@....com>
To:     Pan Bian <bianpan2016@....com>,
        "Deucher, Alexander" <Alexander.Deucher@....com>,
        "Zhou, David(ChunMing)" <David1.Zhou@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Sam Ravnborg <sam@...nborg.org>
CC:     "amd-gfx@...ts.freedesktop.org" <amd-gfx@...ts.freedesktop.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/amdgpu: fix double reference dropping

Am 06.11.19 um 10:53 schrieb Pan Bian:
> After dropping the reference of object fence in the loop, it should be
> set to NULL to protecting dropping its reference again outside the loop.

NAK, the actual bug is that we shouldn't drop the fence outside the loop 
in the first place.

Just move the dma_fence_put(fence); two lines up and drop initializing 
fence to NULL.

Regards,
Christian.

>
> Signed-off-by: Pan Bian <bianpan2016@....com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> index 649e68c4479b..3174093f35f3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> @@ -47,6 +47,7 @@ static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size,
>   		if (r)
>   			goto exit_do_move;
>   		dma_fence_put(fence);
> +		fence = NULL;
>   	}
>   	end_jiffies = jiffies;
>   	r = jiffies_to_msecs(end_jiffies - start_jiffies);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ