Patch "debugfs: Fix __rcu type comparison warning" has been added to the 6.6-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

    debugfs: Fix __rcu type comparison warning

to the 6.6-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:
     debugfs-fix-__rcu-type-comparison-warning.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 16670a6a9002cb015fcdba4ee51aa6c7c37da0e1
Author: Mike Tipton <quic_mdtipton@xxxxxxxxxxx>
Date:   Fri Sep 22 06:45:12 2023 -0700

    debugfs: Fix __rcu type comparison warning
    
    [ Upstream commit 7360a48bd0f5e62b2d00c387d5d3f2821eb290ce ]
    
    Sparse reports the following:
    
    fs/debugfs/file.c:942:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
    fs/debugfs/file.c:942:9: sparse:    char [noderef] __rcu *
    fs/debugfs/file.c:942:9: sparse:    char *
    
    rcu_assign_pointer() expects that it's assigning to pointers annotated
    with __rcu. We can't annotate the generic struct file::private_data, so
    cast it instead.
    
    Fixes: 86b5488121db ("debugfs: Add write support to debugfs_create_str()")
    Reported-by: kernel test robot <lkp@xxxxxxxxx>
    Closes: https://lore.kernel.org/oe-kbuild-all/202309091933.BRWlSnCq-lkp@xxxxxxxxx/
    Signed-off-by: Mike Tipton <quic_mdtipton@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230922134512.5126-1-quic_mdtipton@xxxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index 87b3753aa4b1e..c45e8c2d62e11 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -939,7 +939,7 @@ static ssize_t debugfs_write_file_str(struct file *file, const char __user *user
 	new[pos + count] = '\0';
 	strim(new);
 
-	rcu_assign_pointer(*(char **)file->private_data, new);
+	rcu_assign_pointer(*(char __rcu **)file->private_data, new);
 	synchronize_rcu();
 	kfree(old);
 



[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