Skip to content

Commit 617a629

Browse files
mjg59jrjohansen
authored andcommitted
apparmor: Add a wildcard secid
Reserve a secid value that we can use as a wildcard, allowing us to define policy that's expected to match against all secids. Signed-off-by: Matthew Garrett <[email protected]> Signed-off-by: John Johansen <[email protected]>
1 parent 1f8266f commit 617a629

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

security/apparmor/include/secid.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ struct aa_label;
2222
/* secid value that will not be allocated */
2323
#define AA_SECID_INVALID 0
2424

25+
/* secid value that matches any other secid */
26+
#define AA_SECID_WILDCARD 1
27+
2528
struct aa_label *aa_secid_to_label(u32 secid);
2629
int apparmor_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);
2730
int apparmor_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid);

security/apparmor/secid.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
* secids - do not pin labels with a refcount. They rely on the label
3333
* properly updating/freeing them
3434
*/
35-
36-
#define AA_FIRST_SECID 1
35+
#define AA_FIRST_SECID 2
3736

3837
static DEFINE_IDR(aa_secids);
3938
static DEFINE_SPINLOCK(secid_lock);

0 commit comments

Comments
 (0)