CRED: Fix RCU warning due to previous patch fixing __task_cred()'s checks
commit5232dfac1ac008b5a4df815a5256776913dfa025
authorDavid Howells <dhowells@redhat.com>
Wed, 4 Aug 2010 15:59:14 +0000 (4 16:59 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Aug 2010 18:09:21 +0000 (10 11:09 -0700)
tree26afd8acdd9fe90d48b8ce9bf5cdf4eb43b98337
parent1a0528f57734493e588229266130c247a8e26ac2
CRED: Fix RCU warning due to previous patch fixing __task_cred()'s checks

commit 694f690d27dadccc8cb9d90532e76593b61fe098 upstream.

Commit 8f92054e7ca1 ("CRED: Fix __task_cred()'s lockdep check and banner
comment") fixed the lockdep checks on __task_cred().  This has shown up
a place in the signalling code where a lock should be held - namely that
check_kill_permission() requires its callers to hold the RCU lock.

Fix group_send_sig_info() to get the RCU read lock around its call to
check_kill_permission().

Without this patch, the following warning can occur:

  ===================================================
  [ INFO: suspicious rcu_dereference_check() usage. ]
  ---------------------------------------------------
  kernel/signal.c:660 invoked rcu_dereference_check() without protection!
  ...

Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/signal.c