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, 25 Nov 2014 09:08:29 +0000 (10:08 +0100)
commit959c5046ea4ee48436d62d41f60c0ae70872deeb
treea0f97f7d7889b13f18b58889064829bcbc5fcdc6
parent5bcfdca5ba3685dff3b0b0de0cf4d0a0fd4e6567
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