Patch "io_uring/io-wq: avoid garbage value of 'match' in io_wq_enqueue()" has been added to the 6.9-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/io-wq: avoid garbage value of 'match' in io_wq_enqueue()

to the 6.9-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-io-wq-avoid-garbage-value-of-match-in-io_wq.patch
and it can be found in the queue-6.9 subdirectory.

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



commit 6db762446e024e0ea2815d08cc7cb78b78dbfc9c
Author: Su Hui <suhui@xxxxxxxxxxxx>
Date:   Tue Jun 4 20:12:43 2024 +0800

    io_uring/io-wq: avoid garbage value of 'match' in io_wq_enqueue()
    
    [ Upstream commit 91215f70ea8541e9011c0b48f8b59b9e0ce6953b ]
    
    Clang static checker (scan-build) warning:
    o_uring/io-wq.c:line 1051, column 3
    The expression is an uninitialized value. The computed value will
    also be garbage.
    
    'match.nr_pending' is used in io_acct_cancel_pending_work(), but it is
    not fully initialized. Change the order of assignment for 'match' to fix
    this problem.
    
    Fixes: 42abc95f05bf ("io-wq: decouple work_list protection from the big wqe->lock")
    Signed-off-by: Su Hui <suhui@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240604121242.2661244-1-suhui@xxxxxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c
index 4a07742349048..8a99aabcac2c3 100644
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -929,7 +929,11 @@ void io_wq_enqueue(struct io_wq *wq, struct io_wq_work *work)
 {
 	struct io_wq_acct *acct = io_work_get_acct(wq, work);
 	unsigned long work_flags = work->flags;
-	struct io_cb_cancel_data match;
+	struct io_cb_cancel_data match = {
+		.fn		= io_wq_work_match_item,
+		.data		= work,
+		.cancel_all	= false,
+	};
 	bool do_create;
 
 	/*
@@ -967,10 +971,6 @@ void io_wq_enqueue(struct io_wq *wq, struct io_wq_work *work)
 		raw_spin_unlock(&wq->lock);
 
 		/* fatal condition, failed to create the first worker */
-		match.fn		= io_wq_work_match_item,
-		match.data		= work,
-		match.cancel_all	= false,
-
 		io_acct_cancel_pending_work(wq, acct, &match);
 	}
 }




[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