Patch "virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()" has been added to the 5.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()

to the 5.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     virtio-gpu-fix-shift-wrapping-bug-in-virtio_gpu_fenc.patch
and it can be found in the queue-5.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b1b2edac81abae4d87ac7b60e6e5e158e1fae2d9
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Mon Sep 19 09:36:30 2022 +0300

    virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()
    
    [ Upstream commit 37a78445763a5921bb54e9bad01937d0dfa521c1 ]
    
    The ->ring_idx_mask variable is a u64 so static checkers, Smatch in
    this case, complain if the BIT() is not also a u64.
    
    drivers/gpu/drm/virtio/virtgpu_ioctl.c:50 virtio_gpu_fence_event_create()
    warn: should '(1 << ring_idx)' be a 64 bit type?
    
    Fixes: cd7f5ca33585 ("drm/virtio: implement context init: add virtio_gpu_fence_event")
    Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Reviewed-by: Chia-I Wu <olvaffe@xxxxxxxxx>
    Link: http://patchwork.freedesktop.org/patch/msgid/YygN7jY0GdUSQSy0@kili
    Signed-off-by: Gerd Hoffmann <kraxel@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 3b1701607aae..5d05093014ac 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -47,7 +47,7 @@ static int virtio_gpu_fence_event_create(struct drm_device *dev,
 	struct virtio_gpu_fence_event *e = NULL;
 	int ret;
 
-	if (!(vfpriv->ring_idx_mask & (1 << ring_idx)))
+	if (!(vfpriv->ring_idx_mask & BIT_ULL(ring_idx)))
 		return 0;
 
 	e = kzalloc(sizeof(*e), GFP_KERNEL);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux