Patch "drm/nouveau/fence:: fix warning directly dereferencing a rcu pointer" has been added to the 5.15-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

    drm/nouveau/fence:: fix warning directly dereferencing a rcu pointer

to the 5.15-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:
     drm-nouveau-fence-fix-warning-directly-dereferencing.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 1d39e52ab0a62a0205bbbb60aeda7b1fbe119ecc
Author: Abhinav Singh <singhabhinav9051571833@xxxxxxxxx>
Date:   Tue Nov 14 00:43:03 2023 +0530

    drm/nouveau/fence:: fix warning directly dereferencing a rcu pointer
    
    [ Upstream commit 5f35a624c1e30b5bae5023b3c256e94e0ad4f806 ]
    
    Fix a sparse warning with this message
    "warning:dereference of noderef expression". In this context it means we
    are dereferencing a __rcu tagged pointer directly.
    
    We should not be directly dereferencing a rcu pointer. To get a normal
    (non __rcu tagged pointer) from a __rcu tagged pointer we are using the
    function unrcu_pointer(...). The non __rcu tagged pointer then can be
    dereferenced just like a normal pointer.
    
    I tested with qemu with this command
    qemu-system-x86_64 \
            -m 2G \
            -smp 2 \
            -kernel bzImage \
            -append "console=ttyS0 root=/dev/sda earlyprintk=serial net.ifnames=0" \
            -drive file=bullseye.img,format=raw \
            -net user,host=10.0.2.10,hostfwd=tcp:127.0.0.1:10021-:22 \
            -net nic,model=e1000 \
            -enable-kvm \
            -nographic \
            -pidfile vm.pid \
            2>&1 | tee vm.log
    with lockdep enabled.
    
    Fixes: 0ec5f02f0e2c ("drm/nouveau: prevent stale fence->channel pointers, and protect with rcu")
    Signed-off-by: Abhinav Singh <singhabhinav9051571833@xxxxxxxxx>
    Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20231113191303.3277733-1-singhabhinav9051571833@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/nouveau/nv04_fence.c b/drivers/gpu/drm/nouveau/nv04_fence.c
index 5b71a5a5cd85..cdbc75e3d1f6 100644
--- a/drivers/gpu/drm/nouveau/nv04_fence.c
+++ b/drivers/gpu/drm/nouveau/nv04_fence.c
@@ -39,7 +39,7 @@ struct nv04_fence_priv {
 static int
 nv04_fence_emit(struct nouveau_fence *fence)
 {
-	struct nvif_push *push = fence->channel->chan.push;
+	struct nvif_push *push = unrcu_pointer(fence->channel)->chan.push;
 	int ret = PUSH_WAIT(push, 2);
 	if (ret == 0) {
 		PUSH_NVSQ(push, NV_SW, 0x0150, fence->base.seqno);




[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