Lines Matching defs:label

37 #include "include/label.h"
82 * prepare new cred label for modification by prepare_cred block
155 struct aa_label *label;
160 label = aa_get_newest_cred_label(cred);
166 if (!unconfined(label)) {
170 label_for_each_confined(i, label, profile) {
183 aa_put_label(label);
191 struct aa_label *label;
194 label = aa_get_newest_cred_label(cred);
195 if (!unconfined(label))
196 error = aa_capable(cred, label, cap, opts);
197 aa_put_label(label);
214 struct aa_label *label;
217 label = __begin_current_label_crit_section();
218 if (!unconfined(label))
219 error = aa_path_perm(op, current_cred(), label, path, 0, mask,
221 __end_current_label_crit_section(label);
358 struct aa_label *label;
364 label = begin_current_label_crit_section();
365 if (!unconfined(label))
366 error = aa_path_link(current_cred(), label, old_dentry, new_dir,
368 end_current_label_crit_section(label);
377 struct aa_label *label;
385 label = begin_current_label_crit_section();
386 if (!unconfined(label)) {
407 label, &new_path, 0,
413 label, &old_path,
420 label, &old_path, 0,
426 label, &new_path,
431 end_current_label_crit_section(label);
454 struct aa_label *label;
470 label = aa_get_newest_cred_label(file->f_cred);
471 if (!unconfined(label)) {
482 label, &file->f_path, 0,
487 aa_put_label(label);
495 struct aa_label *label = begin_current_label_crit_section();
498 rcu_assign_pointer(ctx->label, aa_get_label(label));
499 end_current_label_crit_section(label);
508 aa_put_label(rcu_access_pointer(ctx->label));
514 struct aa_label *label;
521 label = __begin_current_label_crit_section();
522 error = aa_file_perm(op, current_cred(), label, file, mask, in_atomic);
523 __end_current_label_crit_section(label);
588 struct aa_label *label;
597 label = __begin_current_label_crit_section();
598 if (!unconfined(label)) {
600 error = aa_remount(current_cred(), label, path, flags,
603 error = aa_bind_mount(current_cred(), label, path,
607 error = aa_mount_change_type(current_cred(), label,
610 error = aa_move_mount_old(current_cred(), label, path,
613 error = aa_new_mount(current_cred(), label, dev_name,
616 __end_current_label_crit_section(label);
624 struct aa_label *label;
627 label = __begin_current_label_crit_section();
628 if (!unconfined(label))
629 error = aa_move_mount(current_cred(), label, from_path,
631 __end_current_label_crit_section(label);
638 struct aa_label *label;
641 label = __begin_current_label_crit_section();
642 if (!unconfined(label))
643 error = aa_umount(current_cred(), label, mnt, flags);
644 __end_current_label_crit_section(label);
652 struct aa_label *label;
655 label = aa_get_current_label();
656 if (!unconfined(label))
657 error = aa_pivotroot(current_cred(), label, old_path, new_path);
658 aa_put_label(label);
670 struct aa_label *label = NULL;
673 label = aa_get_newest_label(cred_label(cred));
675 label = aa_get_newest_label(ctx->previous);
677 label = aa_get_newest_label(ctx->onexec);
681 if (label)
682 error = aa_getprocattr(label, value);
684 aa_put_label(label);
770 struct aa_label *label = aa_current_raw_label();
774 if ((new_label->proxy == label->proxy) ||
782 /* reset soft limits and set hard limits for the new label */
783 __aa_transition_rlimits(label, new_label);
800 struct aa_label *label = aa_get_current_label();
801 *secid = label->secid;
802 aa_put_label(label);
807 struct aa_label *label = aa_get_task_label(p);
808 *secid = label->secid;
809 aa_put_label(label);
815 struct aa_label *label = __begin_current_label_crit_section();
818 if (!unconfined(label))
819 error = aa_task_setrlimit(current_cred(), label, task,
821 __end_current_label_crit_section(label);
877 aa_put_label(ctx->label);
891 if (new->label)
892 aa_put_label(new->label);
893 new->label = aa_get_label(ctx->label);
905 struct aa_label *label;
910 label = begin_current_label_crit_section();
911 if (!(kern || unconfined(label)))
913 create_perm(label, family, type, protocol),
914 aa_af_perm(current_cred(), label,
917 end_current_label_crit_section(label);
927 * move to a special kernel label
935 struct aa_label *label;
938 label = aa_get_label(kernel_t);
940 label = aa_get_current_label();
945 aa_put_label(ctx->label);
946 ctx->label = aa_get_label(label);
948 aa_put_label(label);
1133 return apparmor_secmark_check(ctx->label, OP_RECVMSG, AA_MAY_RECEIVE,
1160 struct aa_label *label;
1163 label = begin_current_label_crit_section();
1169 slen = aa_label_asxprint(&name, labels_ns(label), peer,
1188 end_current_label_crit_section(label);
1194 * apparmor_socket_getpeersec_dgram - get security label of packet
1215 * just set sk security information off of current creating process label
1224 if (!ctx->label)
1225 ctx->label = aa_get_current_label();
1237 return apparmor_secmark_check(ctx->label, OP_CONNECT, AA_MAY_CONNECT,
1847 if (!apparmor_secmark_check(ctx->label, OP_SENDMSG, AA_MAY_SEND,