smack: fix key permission verification
authorDmitry Kasatkin <d.kasatkin@samsung.com>
Fri, 14 Mar 2014 17:44:49 +0000 (17:44 +0000)
committerDavid Howells <dhowells@redhat.com>
Fri, 14 Mar 2014 17:44:49 +0000 (17:44 +0000)
commitfffea214abf66a8672cfd6697fae65e743e22f11
treea1e7c6d02c070bf0a92c9650aee2fd7d292f4623
parentf5895943d91b41b0368830cdb6eaffb8eda0f4c8
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.

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>
security/smack/smack_lsm.c