linux-audit.redhat.com archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3 RESEND] sched: Remove __rcu annotation from cred pointer
@ 2020-04-02  5:56 Amol Grover
  2020-04-02  5:56 ` [PATCH 2/3 RESEND] cred: Do not use RCU primitives to access " Amol Grover
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Amol Grover @ 2020-04-02  5:56 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, Amol Grover, 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-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit


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

end of thread, other threads:[~2020-05-26 12:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02  5:56 [PATCH 1/3 RESEND] sched: Remove __rcu annotation from cred pointer Amol Grover
2020-04-02  5:56 ` [PATCH 2/3 RESEND] cred: Do not use RCU primitives to access " Amol Grover
2020-04-02  5:56 ` [PATCH 3/3 RESEND] auditsc: Do not use RCU primitive to read from " Amol Grover
2020-04-02 12:56   ` Paul Moore
2020-04-03  7:56     ` Amol Grover
2020-04-03 19:25       ` Paul Moore
2020-04-03 21:21       ` Richard Guy Briggs
2020-04-03 21:43         ` Paul Moore
2020-04-04  2:53           ` Richard Guy Briggs
2020-05-24  8:11 ` [PATCH 1/3 RESEND] sched: Remove __rcu annotation " Amol Grover
2020-05-25 13:17   ` Richard Guy Briggs
2020-05-25 18:04     ` Amol Grover
2020-05-26 12:34       ` Paul Moore

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).