public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.29.6 - 2.6.35-rc3] CRED: Release spinlock before commit_creds().
@ 2010-06-18  3:08 Tetsuo Handa
  2010-06-18  3:40 ` Serge E. Hallyn
  2010-06-18 15:45 ` David Howells
  0 siblings, 2 replies; 3+ messages in thread
From: Tetsuo Handa @ 2010-06-18  3:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: dhowells, linux-security-module

reparent_to_kthreadd() is calling commit_creds() with tasklist_lock held. But
commit_creds() calls key_fsuid_changed()/key_fsgid_changed()/proc_id_connector()
which may sleep. Release tasklist_lock before calling commit_creds().

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
 kernel/exit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- security-testing-2.6.orig/kernel/exit.c
+++ security-testing-2.6/kernel/exit.c
@@ -348,8 +348,8 @@ static void reparent_to_kthreadd(void)
 	       sizeof(current->signal->rlim));
 
 	atomic_inc(&init_cred.usage);
-	commit_creds(&init_cred);
 	write_unlock_irq(&tasklist_lock);
+	commit_creds(&init_cred);
 }
 
 void __set_special_pids(struct pid *pid)

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

end of thread, other threads:[~2010-06-18 15:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-18  3:08 [PATCH 2.6.29.6 - 2.6.35-rc3] CRED: Release spinlock before commit_creds() Tetsuo Handa
2010-06-18  3:40 ` Serge E. Hallyn
2010-06-18 15:45 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox