diff options
author | John Johansen <john.johansen@canonical.com> | 2022-05-24 11:38:12 +0200 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2022-07-14 01:37:21 +0200 |
commit | 95c0581f9bfdfbe97126ba1c7f5650a9dd064dda (patch) | |
tree | ed4981a6a37076e2258d868a677ddcd8a976d63a /security/apparmor/net.c | |
parent | apparmor: test: Remove some casts which are no-longer required (diff) | |
download | linux-95c0581f9bfdfbe97126ba1c7f5650a9dd064dda.tar.xz linux-95c0581f9bfdfbe97126ba1c7f5650a9dd064dda.zip |
apparmor: add a kernel label to use on kernel objects
Separate kernel objects from unconfined. This is done so we can
distinguish between the two in debugging, auditing and in preparation
for being able to replace unconfined, which is not appropriate for the
kernel.
The kernel label will continue to behave similar to unconfined.
Acked-by: Jon Tourville <jon.tourville@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/net.c')
-rw-r--r-- | security/apparmor/net.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/security/apparmor/net.c b/security/apparmor/net.c index e0c1b50d6edd..7efe4d17273d 100644 --- a/security/apparmor/net.c +++ b/security/apparmor/net.c @@ -145,12 +145,13 @@ int aa_af_perm(struct aa_label *label, const char *op, u32 request, u16 family, static int aa_label_sk_perm(struct aa_label *label, const char *op, u32 request, struct sock *sk) { + struct aa_sk_ctx *ctx = SK_CTX(sk); int error = 0; AA_BUG(!label); AA_BUG(!sk); - if (!unconfined(label)) { + if (ctx->label != kernel_t && !unconfined(label)) { struct aa_profile *profile; DEFINE_AUDIT_SK(sa, op, sk); |