1. 05 May, 2010 2 commits
    • David Howells's avatar
      KEYS: Fix RCU handling in key_gc_keyring() · cf8304e8
      David Howells authored
      key_gc_keyring() needs to either hold the RCU read lock or hold the keyring
      semaphore if it's going to scan the keyring's list.  Given that it only needs
      to read the key list, and it's doing so under a spinlock, the RCU read lock is
      the thing to use.
      
      Furthermore, the RCU check added in e7b0a61b is
      incorrect as holding the spinlock on key_serial_lock is not grounds for
      assuming a keyring's pointer list can be read safely.  Instead, a simple
      rcu_dereference() inside of the previously mentioned RCU read lock is what we
      want.
      Reported-by: default avatarSerge E. Hallyn <serue@us.ibm.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
      Acked-by: default avatar"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      cf8304e8
    • David Howells's avatar
      KEYS: Fix an RCU warning in the reading of user keys · d9a9b4ae
      David Howells authored
      Fix an RCU warning in the reading of user keys:
      
      ===================================================
      [ INFO: suspicious rcu_dereference_check() usage. ]
      ---------------------------------------------------
      security/keys/user_defined.c:202 invoked rcu_dereference_check() without protection!
      
      other info that might help us debug this:
      
      rcu_scheduler_active = 1, debug_locks = 0
      1 lock held by keyctl/3637:
       #0:  (&key->sem){+++++.}, at: [<ffffffff811a80ae>] keyctl_read_key+0x9c/0xcf
      
      stack backtrace:
      Pid: 3637, comm: keyctl Not tainted 2.6.34-rc5-cachefs #18
      Call Trace:
       [<ffffffff81051f6c>] lockdep_rcu_dereference+0xaa/0xb2
       [<ffffffff811aa55f>] user_read+0x47/0x91
       [<ffffffff811a80be>] keyctl_read_key+0xac/0xcf
       [<ffffffff811a8a06>] sys_keyctl+0x75/0xb7
       [<ffffffff81001eeb>] system_call_fastpath+0x16/0x1b
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      d9a9b4ae
  2. 04 May, 2010 7 commits
  3. 03 May, 2010 15 commits
  4. 01 May, 2010 1 commit
  5. 30 Apr, 2010 15 commits