AW: [PATCH] drm/amdgpu: fix potential integer overflow on shift of a int

2021-02-08 Thread Walter Harms
...@vger.kernel.org; linux-ker...@vger.kernel.org Betreff: Re: [PATCH] drm/amdgpu: fix potential integer overflow on shift of a int For start and end? The hardware has 48 bit address space and that won't fit into 32bits. Only the fragment handling can't do more than 2GB at the

Re: [PATCH] drm/amdgpu: fix potential integer overflow on shift of a int

2021-02-08 Thread Christian König
rnel-janit...@vger.kernel.org; linux-ker...@vger.kernel.org Betreff: Re: [PATCH] drm/amdgpu: fix potential integer overflow on shift of a int Am 08.02.21 um 00:07 schrieb Colin King: From: Colin Ian King The left shift of int 32 bit integer constant 1 is evaluated using 32 bit arithmetic and then assi

AW: [PATCH] drm/amdgpu: fix potential integer overflow on shift of a int

2021-02-08 Thread Walter Harms
-...@lists.freedesktop.org; dri-devel@lists.freedesktop.org Cc: kernel-janit...@vger.kernel.org; linux-ker...@vger.kernel.org Betreff: Re: [PATCH] drm/amdgpu: fix potential integer overflow on shift of a int Am 08.02.21 um 00:07 schrieb Colin King: > From: Colin Ian King > > The left shift of i

Re: [PATCH] drm/amdgpu: fix potential integer overflow on shift of a int

2021-02-08 Thread Christian König
Am 08.02.21 um 00:07 schrieb Colin King: From: Colin Ian King The left shift of int 32 bit integer constant 1 is evaluated using 32 bit arithmetic and then assigned to an unsigned 64 bit integer. In the case where *frag is 32 or more this can lead to an oveflow. Avoid this by shifting 1ULL.

[PATCH] drm/amdgpu: fix potential integer overflow on shift of a int

2021-02-07 Thread Colin King
From: Colin Ian King The left shift of int 32 bit integer constant 1 is evaluated using 32 bit arithmetic and then assigned to an unsigned 64 bit integer. In the case where *frag is 32 or more this can lead to an oveflow. Avoid this by shifting 1ULL. Addresses-Coverity: ("Unintentional integer