linux-kernel-test/security/smack
Lukasz Pawelczyk e774ad683f 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>
2015-05-15 08:36:03 -07:00
..
Kconfig Smack: secmark support for netfilter 2015-01-20 16:34:25 -08:00
Makefile Smack: Repair netfilter dependency 2015-01-23 10:08:19 -08:00
smack_access.c smack: pass error code through pointers 2015-05-15 08:36:03 -07:00
smack_lsm.c smack: pass error code through pointers 2015-05-15 08:36:03 -07:00
smack_netfilter.c netfilter: Make nf_hookfn use nf_hook_state. 2015-04-04 12:31:38 -04:00
smack.h LSM: Switch to lists of hooks 2015-05-12 15:00:41 +10:00
smackfs.c smack: pass error code through pointers 2015-05-15 08:36:03 -07:00