Patch "rcu-tasks: Mark ->trc_reader_special.b.need_qs data races" has been added to the 5.10-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

    rcu-tasks: Mark ->trc_reader_special.b.need_qs data races

to the 5.10-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:
     rcu-tasks-mark-trc_reader_special.b.need_qs-data-races.patch
and it can be found in the queue-5.10 subdirectory.

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


>From stable-owner@xxxxxxxxxxxxxxx Sat Jul 15 02:47:26 2023
From: "Joel Fernandes (Google)" <joel@xxxxxxxxxxxxxxxxx>
Date: Sat, 15 Jul 2023 00:47:10 +0000
Subject: rcu-tasks: Mark ->trc_reader_special.b.need_qs data races
To: stable@xxxxxxxxxxxxxxx
Cc: "Joel Fernandes (Google)" <joel@xxxxxxxxxxxxxxxxx>, "Paul E . McKenney" <paulmck@xxxxxxxxxx>
Message-ID: <20230715004711.2938489-3-joel@xxxxxxxxxxxxxxxxx>

From: "Paul E. McKenney" <paulmck@xxxxxxxxxx>

[ Upstream commit f8ab3fad80dddf3f2cecb53983063c4431058ca1 ]

There are several ->trc_reader_special.b.need_qs data races that are
too low-probability for KCSAN to notice, but which will happen sooner
or later.  This commit therefore marks these accesses.

Cc: <stable@xxxxxxxxxxxxxxx> # 5.10.x
Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
Signed-off-by: Joel Fernandes (Google) <joel@xxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 kernel/rcu/tasks.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -801,7 +801,7 @@ static DEFINE_IRQ_WORK(rcu_tasks_trace_i
 /* If we are the last reader, wake up the grace-period kthread. */
 void rcu_read_unlock_trace_special(struct task_struct *t, int nesting)
 {
-	int nq = t->trc_reader_special.b.need_qs;
+	int nq = READ_ONCE(t->trc_reader_special.b.need_qs);
 
 	if (IS_ENABLED(CONFIG_TASKS_TRACE_RCU_READ_MB) &&
 	    t->trc_reader_special.b.need_mb)
@@ -867,7 +867,7 @@ static void trc_read_check_handler(void
 	// Get here if the task is in a read-side critical section.  Set
 	// its state so that it will awaken the grace-period kthread upon
 	// exit from that critical section.
-	WARN_ON_ONCE(t->trc_reader_special.b.need_qs);
+	WARN_ON_ONCE(READ_ONCE(t->trc_reader_special.b.need_qs));
 	WRITE_ONCE(t->trc_reader_special.b.need_qs, true);
 
 reset_ipi:
@@ -919,7 +919,7 @@ static bool trc_inspect_reader(struct ta
 	// state so that it will awaken the grace-period kthread upon exit
 	// from that critical section.
 	atomic_inc(&trc_n_readers_need_end); // One more to wait on.
-	WARN_ON_ONCE(t->trc_reader_special.b.need_qs);
+	WARN_ON_ONCE(READ_ONCE(t->trc_reader_special.b.need_qs));
 	WRITE_ONCE(t->trc_reader_special.b.need_qs, true);
 	return true;
 }
@@ -1048,7 +1048,7 @@ static void show_stalled_task_trace(stru
 		 ".i"[is_idle_task(t)],
 		 ".N"[cpu > 0 && tick_nohz_full_cpu(cpu)],
 		 READ_ONCE(t->trc_reader_nesting),
-		 " N"[!!t->trc_reader_special.b.need_qs],
+		 " N"[!!READ_ONCE(t->trc_reader_special.b.need_qs)],
 		 cpu);
 	sched_show_task(t);
 }


Patches currently in stable-queue which might be from stable-owner@xxxxxxxxxxxxxxx are

queue-5.10/rcu-tasks-simplify-trc_read_check_handler-atomic-operations.patch
queue-5.10/netfilter-nf_tables-fix-chain-binding-transaction-logic.patch
queue-5.10/netfilter-nf_tables-drop-map-element-references-from-preparation-phase.patch
queue-5.10/netfilter-nf_tables-fix-scheduling-while-atomic-splat.patch
queue-5.10/netfilter-nf_tables-reject-unbound-anonymous-set-before-commit-phase.patch
queue-5.10/netfilter-nf_tables-use-net_generic-infra-for-transaction-data.patch
queue-5.10/netfilter-nftables-rename-set-element-data-activation-deactivation-functions.patch
queue-5.10/netfilter-nf_tables-incorrect-error-path-handling-with-nft_msg_newrule.patch
queue-5.10/rcu-tasks-mark-trc_reader_nesting-data-races.patch
queue-5.10/netfilter-nf_tables-reject-unbound-chain-set-before-commit-phase.patch
queue-5.10/rcu-tasks-mark-trc_reader_special.b.need_qs-data-races.patch
queue-5.10/netfilter-nf_tables-add-rescheduling-points-during-loop-detection-walks.patch
queue-5.10/netfilter-nf_tables-add-nft_trans_prepare_error-to-deal-with-bound-set-chain.patch
queue-5.10/netfilter-nf_tables-unbind-non-anonymous-set-if-rule-construction-fails.patch



[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