Skip to content

Commit

Permalink
apparmor: Add a wildcard secid
Browse files Browse the repository at this point in the history
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 <mjg59@google.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
  • Loading branch information
Matthew Garrett authored and John Johansen committed Oct 3, 2018
1 parent 1f8266f commit 617a629
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions security/apparmor/include/secid.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ struct aa_label;
/* secid value that will not be allocated */
#define AA_SECID_INVALID 0

/* secid value that matches any other secid */
#define AA_SECID_WILDCARD 1

struct aa_label *aa_secid_to_label(u32 secid);
int apparmor_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);
int apparmor_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid);
Expand Down
3 changes: 1 addition & 2 deletions security/apparmor/secid.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
* secids - do not pin labels with a refcount. They rely on the label
* properly updating/freeing them
*/

#define AA_FIRST_SECID 1
#define AA_FIRST_SECID 2

static DEFINE_IDR(aa_secids);
static DEFINE_SPINLOCK(secid_lock);
Expand Down

0 comments on commit 617a629

Please sign in to comment.