linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
* [Linux-kernel-mentees] [PATCH 1/3] sched: Remove __rcu annotation from cred pointer
@ 2020-02-07 18:05 Amol Grover
  2020-02-07 18:05 ` [Linux-kernel-mentees] [PATCH 2/3] cred: Do not use RCU primitives to access " Amol Grover
  2020-02-07 18:05 ` [Linux-kernel-mentees] [PATCH 3/3] auditsc: Do not use RCU primitive to read from " Amol Grover
  0 siblings, 2 replies; 5+ messages in thread
From: Amol Grover @ 2020-02-07 18:05 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	James Morris, Thomas Gleixner, Peter Zijlstra, Jann Horn,
	David Howells, Shakeel Butt, Eric W . Biederman, Andrew Morton,
	Paul Moore, Eric Paris
  Cc: Paul E . McKenney, linux-kernel, Madhuparna Bhowmik, linux-audit,
	Joel Fernandes, linux-kernel-mentees

task_struct::cred (subjective credentials) is *always* used
task-synchronously, hence, does not require RCU semantics.

task_struct::real_cred (objective credentials) can be used in
RCU context and its __rcu annotation is retained.

However, task_struct::cred and task_struct::real_cred *may*
point to the same object, hence, the object pointed to by
task_struct::cred *may* have RCU delayed freeing.

Suggested-by: Jann Horn <jannh@google.com>
Co-developed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Amol Grover <frextrite@gmail.com>
---
 include/linux/sched.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 716ad1d8d95e..39924e6e0cf2 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -879,8 +879,11 @@ struct task_struct {
 	/* Objective and real subjective task credentials (COW): */
 	const struct cred __rcu		*real_cred;
 
-	/* Effective (overridable) subjective task credentials (COW): */
-	const struct cred __rcu		*cred;
+	/*
+	 * Effective (overridable) subjective task credentials (COW)
+	 * which is used task-synchronously
+	 */
+	const struct cred		*cred;
 
 #ifdef CONFIG_KEYS
 	/* Cached requested key. */
-- 
2.24.1

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-13  8:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-07 18:05 [Linux-kernel-mentees] [PATCH 1/3] sched: Remove __rcu annotation from cred pointer Amol Grover
2020-02-07 18:05 ` [Linux-kernel-mentees] [PATCH 2/3] cred: Do not use RCU primitives to access " Amol Grover
2020-02-07 18:05 ` [Linux-kernel-mentees] [PATCH 3/3] auditsc: Do not use RCU primitive to read from " Amol Grover
2020-02-11 15:19   ` Paul Moore
2020-02-13  8:11     ` Amol Grover

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).