Lines Matching refs:ctx
438 struct aa_file_ctx *ctx = file_ctx(file);
441 spin_lock_init(&ctx->lock);
442 rcu_assign_pointer(ctx->label, aa_get_label(label));
449 struct aa_file_ctx *ctx = file_ctx(file);
451 if (ctx)
452 aa_put_label(rcu_access_pointer(ctx->label));
594 struct aa_task_ctx *ctx = task_ctx(current);
599 else if (strcmp(name, "prev") == 0 && ctx->previous)
600 label = aa_get_newest_label(ctx->previous);
601 else if (strcmp(name, "exec") == 0 && ctx->onexec)
602 label = aa_get_newest_label(ctx->onexec);
774 struct aa_sk_ctx *ctx;
776 ctx = kzalloc(sizeof(*ctx), flags);
777 if (!ctx)
780 SK_CTX(sk) = ctx;
790 struct aa_sk_ctx *ctx = SK_CTX(sk);
793 aa_put_label(ctx->label);
794 aa_put_label(ctx->peer);
795 kfree(ctx);
804 struct aa_sk_ctx *ctx = SK_CTX(sk);
809 new->label = aa_get_label(ctx->label);
813 new->peer = aa_get_label(ctx->peer);
861 struct aa_sk_ctx *ctx = SK_CTX(sock->sk);
863 aa_put_label(ctx->label);
864 ctx->label = aa_get_label(label);
1046 struct aa_sk_ctx *ctx = SK_CTX(sk);
1055 if (!ctx->label)
1058 return apparmor_secmark_check(ctx->label, OP_RECVMSG, AA_MAY_RECEIVE,
1066 struct aa_sk_ctx *ctx = SK_CTX(sk);
1068 if (ctx->peer)
1069 return ctx->peer;
1150 struct aa_sk_ctx *ctx = SK_CTX(sk);
1152 if (!ctx->label)
1153 ctx->label = aa_get_current_label();
1160 struct aa_sk_ctx *ctx = SK_CTX(sk);
1165 return apparmor_secmark_check(ctx->label, OP_CONNECT, AA_MAY_CONNECT,
1754 struct aa_sk_ctx *ctx;
1764 ctx = SK_CTX(sk);
1765 if (!apparmor_secmark_check(ctx->label, OP_SENDMSG, AA_MAY_SEND,