BACKPORT: drm/virtio: fix another 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 value is 32 or more this can lead to an overflow
(value can be in range 0..MAX_CAPSET_ID (63). Fix this by shifting
the value 1ULL instead.
Addresses-Coverity: ("Uninitentional integer overflow")
Fixes: 4fb530e5 ("drm/virtio: implement context init: support init ioctl")
Signed-off-by:
Colin Ian King <colin.king@canonical.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20210930102748.16922-1-colin.king@canonical.com
Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 74c1bda2)
Conflicts:
drivers/gpu/drm/virtio/virtgpu_ioctl.c
BUG=b:176158390, b:203009046, b:230100768
TEST=gfxbench and deqp-cts in arcvm
Signed-off-by:
Rob Clark <robdclark@chromium.org>
Change-Id: Ib410e35be1dc50742839d5b1d223478102f59190
Disallow-Recycled-Builds: test-failures
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3603166
Reviewed-by:
Ryan Neph <ryanneph@google.com>
Loading
Please sign in to comment