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>
Wed, 4 Feb 2015 10:23:18 +0000 (11:23 +0100)
commit4077bbc2c5ee873a67f808b4a0ca06213e4ed570
tree21f5ac086e733d5d118256d7d691856b1c1292c6
parent6612de0cca37ebc4dfd7a30bbec75d4bc9bf2765
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