8 #include <linux/slab.h>
68 tomoyo_put_group(ptr->
group);
100 tomoyo_put_group(ptr->
group);
116 return value >= ptr->
values[0] && value <= ptr->
values[1];
340 return tomoyo_same_name_union(&p1->
name, &p2->
name);
354 const bool is_delete)
378 static int tomoyo_update_path_acl(
const u16 perm,
390 tomoyo_same_path_acl,
391 tomoyo_merge_path_acl);
409 return tomoyo_same_name_union(&p1->
name, &p2->
name) &&
410 tomoyo_same_number_union(&p1->
mode, &p2->
mode) &&
411 tomoyo_same_number_union(&p1->
major, &p2->
major) &&
412 tomoyo_same_number_union(&p1->
minor, &p2->
minor);
426 const bool is_delete)
451 static int tomoyo_update_mkdev_acl(
const u8 perm,
466 tomoyo_same_mkdev_acl,
467 tomoyo_merge_mkdev_acl);
488 return tomoyo_same_name_union(&p1->
name1, &p2->
name1) &&
489 tomoyo_same_name_union(&p1->
name2, &p2->
name2);
503 const bool is_delete)
527 static int tomoyo_update_path2_acl(
const u8 perm,
540 tomoyo_same_path2_acl,
541 tomoyo_merge_path2_acl);
572 error = tomoyo_audit_path_log(r);
604 return tomoyo_audit_path_log(r);
616 static bool tomoyo_same_path_number_acl(
const struct tomoyo_acl_info *a,
623 return tomoyo_same_name_union(&p1->
name, &p2->
name) &&
638 const bool is_delete)
661 static int tomoyo_update_path_number_acl(
const u8 perm,
674 tomoyo_same_path_number_acl,
675 tomoyo_merge_path_number_acl);
704 idx = tomoyo_read_lock();
705 if (!tomoyo_get_realpath(&buf, path))
709 tomoyo_add_slash(&buf);
716 error = tomoyo_audit_path_number_log(&r);
720 tomoyo_read_unlock(idx);
736 struct path *path,
const int flag)
749 idx = tomoyo_read_lock();
753 if (!tomoyo_get_realpath(&buf, path)) {
762 error = tomoyo_path_permission(&r, (flag &
O_APPEND) ?
769 tomoyo_read_unlock(idx);
803 idx = tomoyo_read_lock();
804 if (!tomoyo_get_realpath(&buf, path))
810 tomoyo_add_slash(&buf);
814 if (!symlink_target.
name)
820 error = tomoyo_path_permission(&r, operation, &buf);
825 tomoyo_read_unlock(idx);
842 const unsigned int mode,
unsigned int dev)
855 idx = tomoyo_read_lock();
857 if (tomoyo_get_realpath(&buf, path)) {
859 dev = new_decode_dev(dev);
867 error = tomoyo_audit_mkdev_log(&r);
870 tomoyo_read_unlock(idx);
903 idx = tomoyo_read_lock();
904 if (!tomoyo_get_realpath(&buf1, path1) ||
905 !tomoyo_get_realpath(&buf2, path2))
916 tomoyo_add_slash(&buf1);
917 tomoyo_add_slash(&buf2);
927 error = tomoyo_audit_path2_log(&r);
932 tomoyo_read_unlock(idx);
954 tomoyo_same_number_union(&p1->
flags, &p2->
flags);
977 tomoyo_same_mount_acl,
NULL);
1003 return tomoyo_update_path_acl(perm, param);
1009 return tomoyo_update_path2_acl(perm, param);
1015 return tomoyo_update_path_number_acl(perm, param);
1021 return tomoyo_update_mkdev_acl(perm, param);
1024 return tomoyo_update_mount_acl(param);