Function report |
Source Code:security\tomoyo\condition.c |
Create Date:2022-07-28 19:39:09 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:moyo_condition - Check condition part.*@r: Pointer to "struct tomoyo_request_info".*@cond: Pointer to "struct tomoyo_condition". Maybe NULL.* Returns true on success, false otherwise.* Caller holds tomoyo_read_lock().
Proto:bool tomoyo_condition(struct tomoyo_request_info *r, const struct tomoyo_condition *cond)
Type:bool
Parameter:
Type | Parameter | Name |
---|---|---|
struct tomoyo_request_info * | r | |
const struct tomoyo_condition * | cond |
769 | unsigned long min_v[2] = {0, 0} |
770 | unsigned long max_v[2] = {0, 0} |
780 | struct linux_binprm * bprm = NULL |
782 | If Not cond Then Return true |
787 | obj = For holding parameters specific to operations which deal files.* NULL if not dealing files. |
788 | If For holding parameters specific to execve() request.* NULL if not dealing do_execve(). Then bprm = bprm |
800 | left = Left hand operand. A "struct tomoyo_argv" for TOMOYO_ARGV_ENTRY, a* "struct tomoyo_envp" for TOMOYO_ENVP_ENTRY is attached to the tail* of the array of this struct. |
801 | right = Right hand operand. A "struct tomoyo_number_union" for* TOMOYO_NUMBER_UNION, a "struct tomoyo_name_union" for* TOMOYO_NAME_UNION is attached to the tail of the array of this* struct. |
805 | condp++ |
807 | If left == TOMOYO_ARGV_ENTRY || left == TOMOYO_ENVP_ENTRY Then Continue |
810 | If right == TOMOYO_NAME_UNION Then |
817 | Case left == TOMOYO_SYMLINK_TARGET |
818 | symlink = obj ? * Content of symbolic link to be created. NULL for operations other * than symlink(). : NULL |
823 | Break |
824 | Case left == TOMOYO_EXEC_REALPATH |
830 | Break |
832 | Continue |
837 | value = 0 |
840 | Case index == current_uid() |
842 | Break |
843 | Case index == current_euid() |
845 | Break |
846 | Case index == current_suid() |
848 | Break |
849 | Case index == current_fsuid() |
851 | Break |
852 | Case index == current_gid() |
854 | Break |
855 | Case index == current_egid() |
857 | Break |
858 | Case index == current_sgid() |
860 | Break |
861 | Case index == current_fsgid() |
863 | Break |
864 | Case index == sys_getpid() |
866 | Break |
867 | Case index == sys_getppid() |
869 | Break |
901 | value = 0400 |
902 | Break |
904 | value = 0200 |
905 | Break |
907 | value = 0100 |
908 | Break |
910 | value = 0040 |
911 | Break |
913 | value = 0020 |
914 | Break |
916 | value = 0010 |
917 | Break |
919 | value = 0004 |
920 | Break |
922 | value = 0002 |
923 | Break |
925 | value = 0001 |
926 | Break |
927 | Case index == "struct linux_binprm *"->argc |
932 | Case index == "struct linux_binprm *"->envc |
937 | Case index == TOMOYO_NUMBER_UNION |
939 | Break |
940 | Default |
952 | Case index == TOMOYO_PATH1_UID |
953 | Case index == TOMOYO_PATH1_GID |
954 | Case index == TOMOYO_PATH1_INO |
955 | Case index == TOMOYO_PATH1_MAJOR |
956 | Case index == TOMOYO_PATH1_MINOR |
957 | Case index == TOMOYO_PATH1_TYPE |
958 | Case index == TOMOYO_PATH1_DEV_MAJOR |
959 | Case index == TOMOYO_PATH1_DEV_MINOR |
960 | Case index == TOMOYO_PATH1_PERM |
961 | stat_index = TOMOYO_PATH1 |
962 | Break |
963 | Case index == TOMOYO_PATH2_UID |
964 | Case index == TOMOYO_PATH2_GID |
965 | Case index == TOMOYO_PATH2_INO |
966 | Case index == TOMOYO_PATH2_MAJOR |
967 | Case index == TOMOYO_PATH2_MINOR |
968 | Case index == TOMOYO_PATH2_TYPE |
969 | Case index == TOMOYO_PATH2_DEV_MAJOR |
970 | Case index == TOMOYO_PATH2_DEV_MINOR |
971 | Case index == TOMOYO_PATH2_PERM |
972 | stat_index = TOMOYO_PATH2 |
973 | Break |
974 | Case index == TOMOYO_PATH1_PARENT_UID |
975 | Case index == TOMOYO_PATH1_PARENT_GID |
976 | Case index == TOMOYO_PATH1_PARENT_INO |
977 | Case index == TOMOYO_PATH1_PARENT_PERM |
980 | Break |
981 | Case index == TOMOYO_PATH2_PARENT_UID |
982 | Case index == TOMOYO_PATH2_PARENT_GID |
983 | Case index == TOMOYO_PATH2_PARENT_INO |
984 | Case index == TOMOYO_PATH2_PARENT_PERM |
987 | Break |
988 | Default |
989 | Go to out |
991 | If Not True if @stat[] is valid. [stat_index] Then Go to out |
993 | stat = * Information on @path1, @path1's parent directory, @path2, @path2's * parent directory.[stat_index] |
995 | Case index == TOMOYO_PATH1_UID |
996 | Case index == TOMOYO_PATH2_UID |
997 | Case index == TOMOYO_PATH1_PARENT_UID |
998 | Case index == TOMOYO_PATH2_PARENT_UID |
1000 | Break |
1001 | Case index == TOMOYO_PATH1_GID |
1002 | Case index == TOMOYO_PATH2_GID |
1003 | Case index == TOMOYO_PATH1_PARENT_GID |
1004 | Case index == TOMOYO_PATH2_PARENT_GID |
1006 | Break |
1007 | Case index == TOMOYO_PATH1_INO |
1008 | Case index == TOMOYO_PATH2_INO |
1009 | Case index == TOMOYO_PATH1_PARENT_INO |
1010 | Case index == TOMOYO_PATH2_PARENT_INO |
1013 | Case index == TOMOYO_PATH1_MAJOR |
1014 | Case index == TOMOYO_PATH2_MAJOR |
1017 | Case index == TOMOYO_PATH1_MINOR |
1018 | Case index == TOMOYO_PATH2_MINOR |
1021 | Case index == TOMOYO_PATH1_TYPE |
1022 | Case index == TOMOYO_PATH2_TYPE |
1025 | Case index == TOMOYO_PATH1_DEV_MAJOR |
1026 | Case index == TOMOYO_PATH2_DEV_MAJOR |
1029 | Case index == TOMOYO_PATH1_DEV_MINOR |
1030 | Case index == TOMOYO_PATH2_DEV_MINOR |
1033 | Case index == TOMOYO_PATH1_PERM |
1034 | Case index == TOMOYO_PATH2_PERM |
1035 | Case index == TOMOYO_PATH1_PARENT_PERM |
1036 | Case index == TOMOYO_PATH2_PARENT_PERM |
1041 | Break |
1061 | If left == TOMOYO_NUMBER_UNION Then |
1068 | If right == TOMOYO_NUMBER_UNION Then |
1072 | If Maybe NULL. Then |
1073 | If tomoyo_number_matches_group(min_v[0], max_v[0], Maybe NULL. ) == match Then Continue |
1078 | Else |
1083 | Go to out |
1090 | Go to out |
1091 | Else if is_bitop[0] Then |
1093 | Case right == TOMOYO_PATH1_PERM |
1094 | Case right == TOMOYO_PATH1_PARENT_PERM |
1095 | Case right == TOMOYO_PATH2_PERM |
1096 | Case right == TOMOYO_PATH2_PARENT_PERM |
1100 | Go to out |
1101 | Else if is_bitop[1] Then |
1103 | Case left == TOMOYO_PATH1_PERM |
1104 | Case left == TOMOYO_PATH1_PARENT_PERM |
1105 | Case left == TOMOYO_PATH2_PERM |
1106 | Case left == TOMOYO_PATH2_PARENT_PERM |
1110 | Go to out |
1115 | out : |
1116 | Return false |
1121 | Return true |
Name | Describe |
---|---|
tomoyo_check_acl | moyo_check_acl - Do permission check.*@r: Pointer to "struct tomoyo_request_info".*@check_entry: Callback function to check type specific parameters.* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock(). |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |