Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * AppArmor security module
0004  *
0005  * This file contains AppArmor security identifier (secid) definitions
0006  *
0007  * Copyright 2009-2018 Canonical Ltd.
0008  */
0009 
0010 #ifndef __AA_SECID_H
0011 #define __AA_SECID_H
0012 
0013 #include <linux/slab.h>
0014 #include <linux/types.h>
0015 
0016 struct aa_label;
0017 
0018 /* secid value that will not be allocated */
0019 #define AA_SECID_INVALID 0
0020 
0021 /* secid value that matches any other secid */
0022 #define AA_SECID_WILDCARD 1
0023 
0024 /* sysctl to enable displaying mode when converting secid to secctx */
0025 extern int apparmor_display_secid_mode;
0026 
0027 struct aa_label *aa_secid_to_label(u32 secid);
0028 int apparmor_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);
0029 int apparmor_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid);
0030 void apparmor_release_secctx(char *secdata, u32 seclen);
0031 
0032 
0033 int aa_alloc_secid(struct aa_label *label, gfp_t gfp);
0034 void aa_free_secid(u32 secid);
0035 void aa_secid_update(u32 secid, struct aa_label *label);
0036 
0037 #endif /* __AA_SECID_H */