diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-17 16:43:39 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-17 16:43:39 -0800 |
commit | a25a2b84098eb5e001cb8086603d692aa95bf2ec (patch) | |
tree | 02c01b36251f7b0afb1a98093e14efb17d015910 /security/keys/gc.c | |
parent | f429ee3b808118591d1f3cdf3c0d0793911a5677 (diff) | |
parent | f1be242c95257b199d8b679bc952ca33487c9af6 (diff) | |
download | linux-a25a2b84098eb5e001cb8086603d692aa95bf2ec.tar.bz2 |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
integrity: digital signature config option name change
lib: Removed MPILIB, MPILIB_EXTRA, and SIGNATURE prompts
lib: MPILIB Kconfig description update
lib: digital signature dependency fix
lib: digital signature config option name change
encrypted-keys: fix rcu and sparse messages
keys: fix trusted/encrypted keys sparse rcu_assign_pointer messages
KEYS: Add missing smp_rmb() primitives to the keyring search code
TOMOYO: Accept \000 as a valid character.
security: update MAINTAINERS file with new git repo
Diffstat (limited to 'security/keys/gc.c')
-rw-r--r-- | security/keys/gc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/security/keys/gc.c b/security/keys/gc.c index bf4d8da5a795..a42b45531aac 100644 --- a/security/keys/gc.c +++ b/security/keys/gc.c @@ -145,7 +145,9 @@ static void key_gc_keyring(struct key *keyring, time_t limit) if (!klist) goto unlock_dont_gc; - for (loop = klist->nkeys - 1; loop >= 0; loop--) { + loop = klist->nkeys; + smp_rmb(); + for (loop--; loop >= 0; loop--) { key = klist->keys[loop]; if (test_bit(KEY_FLAG_DEAD, &key->flags) || (key->expiry > 0 && key->expiry <= limit)) |