Patch "io_uring/register: use atomic_read/write for sq_flags migration" has been added to the 6.13-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

    io_uring/register: use atomic_read/write for sq_flags migration

to the 6.13-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:
     io_uring-register-use-atomic_read-write-for-sq_flags.patch
and it can be found in the queue-6.13 subdirectory.

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



commit c804aa62be4cd0ae49ddc29bcb6a3e94b6d53c75
Author: Jens Axboe <axboe@xxxxxxxxx>
Date:   Fri Jan 24 14:32:25 2025 -0700

    io_uring/register: use atomic_read/write for sq_flags migration
    
    [ Upstream commit a23ad06bfee5e51cd9e51aebf11401e7b4b5d00a ]
    
    A previous commit changed all of the migration from the old to the new
    ring for resizing to use READ/WRITE_ONCE. However, ->sq_flags is an
    atomic_t, and while most archs won't complain on this, some will indeed
    flag this:
    
    io_uring/register.c:554:9: sparse: sparse: cast to non-scalar
    io_uring/register.c:554:9: sparse: sparse: cast from non-scalar
    
    Just use atomic_set/atomic_read for handling this case.
    
    Reported-by: kernel test robot <lkp@xxxxxxxxx>
    Closes: https://lore.kernel.org/oe-kbuild-all/202501242000.A2sKqaCL-lkp@xxxxxxxxx/
    Fixes: 2c5aae129f42 ("io_uring/register: document io_register_resize_rings() shared mem usage")
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/io_uring/register.c b/io_uring/register.c
index 371aec87e078c..14ece7754e4ca 100644
--- a/io_uring/register.c
+++ b/io_uring/register.c
@@ -553,7 +553,7 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg)
 	ctx->cqe_cached = ctx->cqe_sentinel = NULL;
 
 	WRITE_ONCE(n.rings->sq_dropped, READ_ONCE(o.rings->sq_dropped));
-	WRITE_ONCE(n.rings->sq_flags, READ_ONCE(o.rings->sq_flags));
+	atomic_set(&n.rings->sq_flags, atomic_read(&o.rings->sq_flags));
 	WRITE_ONCE(n.rings->cq_flags, READ_ONCE(o.rings->cq_flags));
 	WRITE_ONCE(n.rings->cq_overflow, READ_ONCE(o.rings->cq_overflow));
 




[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