UPSTREAM: drm/virtio: fix potential integer overflow on shift of a int
The left shift of unsigned int 32 bit integer constant 1 is evaluated
using 32 bit arithmetic and then assigned to a signed 64 bit integer.
In the case where i is 32 or more this can lead to an overflow. Fix
this by shifting the value 1ULL instead.
Addresses-Coverity: ("Uninitentional integer overflow")
Fixes: 8d6b006e ("drm/virtio: implement context init: handle VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK")
Signed-off-by:
Colin Ian King <colin.king@canonical.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20210930101941.16546-1-colin.king@canonical.com
Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 8f4502fa)
BUG=b:176158390, b:203009046, b:230100768
TEST=gfxbench and deqp-cts in arcvm
Signed-off-by:
Rob Clark <robdclark@chromium.org>
Change-Id: Iaaf39778f888e4d1072c3ddeb1b1514f515bbc65
Disallow-Recycled-Builds: test-failures
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3602857
Reviewed-by:
Sean Paul <seanpaul@chromium.org>
Reviewed-by:
Ryan Neph <ryanneph@google.com>
Loading
Please sign in to comment