smack: fix key permission verification
authorDmitry Kasatkin <d.kasatkin@samsung.com>
Fri, 14 Mar 2014 17:44:49 +0000 (17:44 +0000)
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>
Tue, 7 Oct 2014 14:51:50 +0000 (16:51 +0200)
commit0bf8e9c3da8800052f8cbab03c12ad016d4f90dd
tree667d2a01341ffe728046e22829eb1cb3d5f311e5
parente07097697c04ed8cc8c68e89a7719cd9b51c0227
smack: fix key permission verification

For any keyring access type SMACK always used MAY_READWRITE access check.
It prevents reading the key with label "_", which should be allowed for anyone.

This patch changes default access check to MAY_READ and use MAY_READWRITE in only
appropriate cases.

Change-Id: Ie357956730df93058198e2df13ef307ce4e8f675
Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
security/smack/smack_lsm.c