smack: pass error code through pointers
authorLukasz Pawelczyk <l.pawelczyk@samsung.com>
Mon, 20 Apr 2015 15:12:54 +0000 (17:12 +0200)
committerCasey Schaufler <casey@schaufler-ca.com>
Fri, 15 May 2015 15:36:03 +0000 (08:36 -0700)
commite774ad683f425a51f87711164ea166d9dcc41477
tree0dcb99f91fe29472664f1ac4cd8714f30a6a020c
parent9777582e8d604f69ce3a93805065e451487e26b4
smack: pass error code through pointers

This patch makes the following functions to use ERR_PTR() and related
macros to pass the appropriate error code through returned pointers:

smk_parse_smack()
smk_import_entry()
smk_fetch()

It also makes all the other functions that use them to handle the
error cases properly. This ways correct error codes from places
where they happened can be propagated to the user space if necessary.

Doing this it fixes a bug in onlycap and unconfined files
handling. Previously their content was cleared on any error from
smk_import_entry/smk_parse_smack, be it EINVAL (as originally intended)
or ENOMEM. Right now it only reacts on EINVAL passing other codes
properly to userspace.

Comments have been updated accordingly.

Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@samsung.com>
security/smack/smack_access.c
security/smack/smack_lsm.c
security/smack/smackfs.c
This page took 0.024993 seconds and 5 git commands to generate.