]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: Add missing smp_rmb() primitives to the keyring search code
authorDavid Howells <dhowells@redhat.com>
Tue, 17 Jan 2012 20:39:40 +0000 (20:39 +0000)
committerJames Morris <jmorris@namei.org>
Tue, 17 Jan 2012 23:41:27 +0000 (10:41 +1100)
commit3d8e707645e8501be2f586afeaf1d0f527c27905
tree4fb5e80428c4f36c5da35ff3319cd71c1771451c
parentf16fa2c12309b755800cd06a1b96614ef2761b8a
KEYS: Add missing smp_rmb() primitives to the keyring search code

Add missing smp_rmb() primitives to the keyring search code.

When keyring payloads are appended to without replacement (thus using up spare
slots in the key pointer array), an smp_wmb() is issued between the pointer
assignment and the increment of the key count (nkeys).

There should be corresponding read barriers between the read of nkeys and
dereferences of keys[n] when n is dependent on the value of nkeys.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
security/keys/gc.c
security/keys/keyring.c