smack: fix key permission verification
authorDmitry Kasatkin <d.kasatkin@samsung.com>
Fri, 14 Mar 2014 17:44:49 +0000 (17:44 +0000)
committerDamian Hobson-Garcia <dhobsong@igel.co.jp>
Thu, 11 Dec 2014 07:53:24 +0000 (16:53 +0900)
commitbd6515226a237a57458c315726d0ca7b28e1e5da
tree5b26fef8447f383b828a3ce7678c3c022b9c575f
parent4f0a43942c027940c4bc7080e4250ed6cdbc2b95
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>
(cherry picked from commit 424538354be6c42da48b302ef1ac939931599797)

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
security/smack/smack_lsm.c