Lines Matching refs:ctx
494 struct aa_file_ctx *ctx = file_ctx(file);
497 spin_lock_init(&ctx->lock);
498 rcu_assign_pointer(ctx->label, aa_get_label(label));
505 struct aa_file_ctx *ctx = file_ctx(file);
507 if (ctx)
508 aa_put_label(rcu_access_pointer(ctx->label));
669 struct aa_task_ctx *ctx = task_ctx(current);
674 else if (strcmp(name, "prev") == 0 && ctx->previous)
675 label = aa_get_newest_label(ctx->previous);
676 else if (strcmp(name, "exec") == 0 && ctx->onexec)
677 label = aa_get_newest_label(ctx->onexec);
858 struct aa_sk_ctx *ctx;
860 ctx = kzalloc(sizeof(*ctx), flags);
861 if (!ctx)
864 SK_CTX(sk) = ctx;
874 struct aa_sk_ctx *ctx = SK_CTX(sk);
877 aa_put_label(ctx->label);
878 aa_put_label(ctx->peer);
879 kfree(ctx);
888 struct aa_sk_ctx *ctx = SK_CTX(sk);
893 new->label = aa_get_label(ctx->label);
897 new->peer = aa_get_label(ctx->peer);
943 struct aa_sk_ctx *ctx = SK_CTX(sock->sk);
945 aa_put_label(ctx->label);
946 ctx->label = aa_get_label(label);
1128 struct aa_sk_ctx *ctx = SK_CTX(sk);
1133 return apparmor_secmark_check(ctx->label, OP_RECVMSG, AA_MAY_RECEIVE,
1141 struct aa_sk_ctx *ctx = SK_CTX(sk);
1143 if (ctx->peer)
1144 return ctx->peer;
1222 struct aa_sk_ctx *ctx = SK_CTX(sk);
1224 if (!ctx->label)
1225 ctx->label = aa_get_current_label();
1232 struct aa_sk_ctx *ctx = SK_CTX(sk);
1237 return apparmor_secmark_check(ctx->label, OP_CONNECT, AA_MAY_CONNECT,
1836 struct aa_sk_ctx *ctx;
1846 ctx = SK_CTX(sk);
1847 if (!apparmor_secmark_check(ctx->label, OP_SENDMSG, AA_MAY_SEND,