linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/9] Fix various __task_cred related invalid RCU assumptions
@ 2009-12-10  0:52 Thomas Gleixner
  2009-12-10  0:52 ` [patch 1/9] sys: Fix missing rcu protection for __task_cred() access Thomas Gleixner
                   ` (18 more replies)
  0 siblings, 19 replies; 72+ messages in thread
From: Thomas Gleixner @ 2009-12-10  0:52 UTC (permalink / raw)
  To: LKML
  Cc: Paul E. McKenney, Dipankar Sarma, Ingo Molnar, Peter Zijlstra,
	Oleg Nesterov, Al Viro, James Morris, David Howells,
	Andrew Morton, Linus Torvalds

While auditing the read_lock(&tasklist_lock) sites for a possible
conversion to rcu-read_lock() I stumbled over an unprotected user of
__task_cred in kernel/sys.c

That caused me to audit all the __task_cred usage sites except in
kernel/exit.c.

Most of the usage sites are correct, but some of them trip over
invalid assumptions about the protection which is given by RCU.

- spinlocked/preempt_disabled regions are equivalent to rcu_read_lock():

   That's wrong. RCU does not guarantee that. 

   It has been that way due to implementation details and it still is
   valid for CONFIG_TREE_PREEMPT_RCU=n, but there is no guarantee that
   this will be the case forever.

- interrupt disabled regions are equivalent to rcu_read_lock():

  Wrong again. RCU does not guarantee that.

  It's true for current mainline, but again this is an implementation
  detail and there is no guarantee by the RCU semantics.

  Indeed we want to get rid of that to avoid scalability issues on
  large systems and preempt-rt got already rid of it to a certain
  extent.

I'm sure we are lucky that CONFIG_TREE_PREEMPT_RCU=y is not yet wide
spread and the code pathes are esoteric enough not to trigger that
subtle races (some of them might just error out silently).

Nevertheless we need to fix all invalid assumptions about RCU
protection.

The following patch series fixes all yet known affected __task_cred()
sites, but there is more auditing of all other rcu users necessary.

Thanks,

	tglx


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

end of thread, other threads:[~2010-02-12 14:22 UTC | newest]

Thread overview: 72+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-10  0:52 [patch 0/9] Fix various __task_cred related invalid RCU assumptions Thomas Gleixner
2009-12-10  0:52 ` [patch 1/9] sys: Fix missing rcu protection for __task_cred() access Thomas Gleixner
2009-12-10  1:25   ` Paul E. McKenney
2009-12-10  2:29     ` Tetsuo Handa
2009-12-10  2:43   ` Paul E. McKenney
2009-12-10 14:29     ` Oleg Nesterov
2009-12-10 14:44       ` Thomas Gleixner
2009-12-11 13:45       ` David Howells
2009-12-11 13:52         ` Thomas Gleixner
2009-12-10 14:20   ` Oleg Nesterov
2009-12-10 14:38     ` Thomas Gleixner
2009-12-10 15:08     ` [patch 1/9] sys: Fix missing rcu protection for __task_cred()access Tetsuo Handa
2009-12-10 21:17       ` Thomas Gleixner
2009-12-11  3:25         ` Tetsuo Handa
2010-02-08 12:30         ` [PATCH] Update comment on find_task_by_pid_ns Tetsuo Handa
2010-02-08 13:21           ` Oleg Nesterov
2010-02-08 17:07             ` Thomas Gleixner
2010-02-08 17:16               ` Oleg Nesterov
2010-02-08 21:42                 ` Tetsuo Handa
2010-02-09 22:08                   ` Andrew Morton
2010-02-10 16:30                     ` Serge E. Hallyn
2010-02-10 17:57                       ` Andrew Morton
2010-02-10 18:39                         ` Thomas Gleixner
2010-02-10 20:18                           ` Serge E. Hallyn
2010-02-10 20:30                             ` Paul E. McKenney
2010-02-11  1:21                     ` Tetsuo Handa
2010-02-11 12:04     ` [PATCH] sys: Fix missing rcu protection for sys_getpriority Tetsuo Handa
2010-02-12 14:22       ` Serge E. Hallyn
2009-12-10 22:09   ` [tip:core/urgent] sys: Fix missing rcu protection for __task_cred() access tip-bot for Thomas Gleixner
2009-12-10  0:52 ` [patch 2/9] fs: Add missing rcu protection for __task_cred() in sys_ioprio_get Thomas Gleixner
2009-12-10  0:53 ` [patch 3/9] proc: Add missing rcu protection for __task_cred() in task_sig() Thomas Gleixner
2009-12-10  0:53 ` [patch 4/9] oom: Add missing rcu protection of __task_cred() in dump_tasks Thomas Gleixner
2009-12-10  1:57   ` KOSAKI Motohiro
2009-12-10  0:53 ` [patch 5/9] security: Use get_task_cred() in keyctl_session_to_parent() Thomas Gleixner
2009-12-10  2:45   ` Paul E. McKenney
2009-12-10  0:53 ` [patch 6/9] signal: Fix racy access to __task_cred in kill_pid_info_as_uid() Thomas Gleixner
2009-12-10 15:11   ` Oleg Nesterov
2009-12-10 22:09   ` [tip:core/urgent] " tip-bot for Thomas Gleixner
2009-12-10  0:53 ` [patch 7/9] signals: Fix more rcu assumptions Thomas Gleixner
2009-12-10 14:34   ` Oleg Nesterov
2009-12-10 14:45     ` Thomas Gleixner
2009-12-11 13:59     ` David Howells
2009-12-10 22:09   ` [tip:core/urgent] " tip-bot for Thomas Gleixner
2009-12-10  0:53 ` [patch 8/9] Documentation: Fix invalid " Thomas Gleixner
2009-12-10 23:55   ` Vegard Nossum
2009-12-11 21:28   ` Arnd Bergmann
2009-12-11 22:01     ` Paul E. McKenney
2009-12-10  0:53 ` [patch 9/9] security: Fix invalid rcu assumptions in comments Thomas Gleixner
2009-12-10  2:28 ` [patch 0/9] Fix various __task_cred related invalid RCU assumptions Paul E. McKenney
2009-12-10  3:15   ` Linus Torvalds
2009-12-10  5:13     ` Peter Zijlstra
2009-12-10  5:34       ` Paul E. McKenney
2009-12-13 18:56         ` Peter Zijlstra
2009-12-14  1:53           ` Paul E. McKenney
2009-12-14 10:17             ` Peter Zijlstra
2009-12-14 14:16               ` Paul E. McKenney
2009-12-14 14:30                 ` Peter Zijlstra
2009-12-15  1:23                   ` Paul E. McKenney
2009-12-11 13:39 ` David Howells
2009-12-11 16:35   ` Paul E. McKenney
2009-12-11 13:41 ` [patch 1/9] sys: Fix missing rcu protection for __task_cred() access David Howells
2009-12-11 13:46 ` [patch 2/9] fs: Add missing rcu protection for __task_cred() in sys_ioprio_get David Howells
2009-12-11 13:46 ` [patch 3/9] proc: Add missing rcu protection for __task_cred() in task_sig() David Howells
2009-12-11 13:49 ` [patch 4/9] oom: Add missing rcu protection of __task_cred() in dump_tasks David Howells
2009-12-11 13:52   ` Thomas Gleixner
2009-12-11 13:52 ` [patch 5/9] security: Use get_task_cred() in keyctl_session_to_parent() David Howells
2009-12-11 13:53 ` [patch 6/9] signal: Fix racy access to __task_cred in kill_pid_info_as_uid() David Howells
2009-12-11 14:00 ` [patch 8/9] Documentation: Fix invalid rcu assumptions David Howells
2009-12-11 16:07   ` Linus Torvalds
2009-12-11 16:37     ` Paul E. McKenney
2009-12-11 18:08       ` Thomas Gleixner
2009-12-11 14:01 ` [patch 9/9] security: Fix invalid rcu assumptions in comments David Howells

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