函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\condition.c Create Date:2022-07-27 21:08:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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().

函数原型:bool tomoyo_condition(struct tomoyo_request_info *r, const struct tomoyo_condition *cond)

返回类型:bool

参数:

类型参数名称
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  如果非cond则返回:true
784  condc等于Number of conditions in this struct.
785  argc等于Number of "struct tomoyo_argv".
786  envc等于Number of "struct tomoyo_envp".
787  obj等于For holding parameters specific to operations which deal files.* NULL if not dealing files.
788  如果For holding parameters specific to execve() request.* NULL if not dealing do_execve().bprm等于bprm
790  如果非bprmargcenvc的值则返回:false
792  condp等于cond加1
793  numbers_p等于condpcondc
794  names_p等于numbers_pNumber of "struct tomoyo_number_union values".
796  argvmoyo_argv - Check argv[] in "struct linux_binbrm".*@index: Index number of @arg_ptr.*@arg_ptr: Contents of argv[@index].*@argc: Length of @argv.*@argv: Pointer to "struct tomoyo_argv".*@checked: Set to true if @argv[@index] was found.等于names_pNumber of "struct tomoyo_name_union names".
797  envpmoyo_envp - Check envp[] in "struct linux_binbrm".*@env_name: The name of environment variable.*@env_value: The value of environment variable.*@envc: Length of @envp.*@envp: Pointer to "struct tomoyo_envp".等于argvargc
798 i小于condc循环
799  match等于Equation operator. True if equals or overlaps, false otherwise.
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.
802  bool is_bitop[2] = {TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0.}
805  condp自加
807  如果left恒等于TOMOYO_ARGV_ENTRYleft恒等于TOMOYO_ENVP_ENTRY则继续下一循环
810  如果right恒等于TOMOYO_NAME_UNION
811  ptr等于names_p自加
824  :left恒等于TOMOYO_EXEC_REALPATH
832  继续下一循环
835 j小于2循环
836  index等于如果jright否则left
837  value等于0
840  :index恒等于current_uid()
843  :index恒等于current_euid()
846  :index恒等于current_suid()
849  :index恒等于current_fsuid()
852  :index恒等于current_gid()
855  :index恒等于current_egid()
858  :index恒等于current_sgid()
861  :index恒等于current_fsgid()
864  :index恒等于sys_getpid()
867  :index恒等于sys_getppid()
870  :index恒等于S_IFSOCK
871  value等于S_IFSOCK
872  退出
873  :index恒等于S_IFLNK
874  value等于S_IFLNK
875  退出
876  :index恒等于S_IFREG
877  value等于S_IFREG
878  退出
879  :index恒等于S_IFBLK
880  value等于S_IFBLK
881  退出
882  :index恒等于S_IFDIR
883  value等于S_IFDIR
884  退出
885  :index恒等于S_IFCHR
886  value等于S_IFCHR
887  退出
888  :index恒等于S_IFIFO
889  value等于S_IFIFO
890  退出
891  :index恒等于S_ISUID
892  value等于S_ISUID
893  退出
894  :index恒等于S_ISGID
895  value等于S_ISGID
896  退出
897  :index恒等于S_ISVTX
898  value等于S_ISVTX
899  退出
900  :index恒等于S_IRUSR
901  value等于0400
902  退出
903  :index恒等于S_IWUSR
904  value等于0200
905  退出
906  :index恒等于S_IXUSR
907  value等于0100
908  退出
909  :index恒等于S_IRGRP
910  value等于0040
911  退出
912  :index恒等于S_IWGRP
913  value等于0020
914  退出
915  :index恒等于S_IXGRP
916  value等于0010
917  退出
918  :index恒等于S_IROTH
919  value等于0004
920  退出
921  :index恒等于S_IWOTH
922  value等于0002
923  退出
924  :index恒等于S_IXOTH
925  value等于0001
926  退出
928  如果非bprm则转到:out
930  value等于argc
931  退出
933  如果非bprm则转到:out
935  value等于envc
936  退出
937  :index恒等于TOMOYO_NUMBER_UNION
939  退出
940  默认
941  如果非obj则转到:out
952  :index恒等于TOMOYO_PATH1_UID
953  :index恒等于TOMOYO_PATH1_GID
954  :index恒等于TOMOYO_PATH1_INO
955  :index恒等于TOMOYO_PATH1_MAJOR
956  :index恒等于TOMOYO_PATH1_MINOR
957  :index恒等于TOMOYO_PATH1_TYPE
960  :index恒等于TOMOYO_PATH1_PERM
962  退出
963  :index恒等于TOMOYO_PATH2_UID
964  :index恒等于TOMOYO_PATH2_GID
965  :index恒等于TOMOYO_PATH2_INO
966  :index恒等于TOMOYO_PATH2_MAJOR
967  :index恒等于TOMOYO_PATH2_MINOR
968  :index恒等于TOMOYO_PATH2_TYPE
971  :index恒等于TOMOYO_PATH2_PERM
973  退出
988  默认
989  转到:out
991  如果非 True if @stat[] is valid. [stat_index]则转到:out
995  :index恒等于TOMOYO_PATH1_UID
996  :index恒等于TOMOYO_PATH2_UID
1001  :index恒等于TOMOYO_PATH1_GID
1002  :index恒等于TOMOYO_PATH2_GID
1007  :index恒等于TOMOYO_PATH1_INO
1008  :index恒等于TOMOYO_PATH2_INO
1011  value等于ino
1012  退出
1013  :index恒等于TOMOYO_PATH1_MAJOR
1014  :index恒等于TOMOYO_PATH2_MAJOR
1015  value等于MAJOR(dev)
1016  退出
1017  :index恒等于TOMOYO_PATH1_MINOR
1018  :index恒等于TOMOYO_PATH2_MINOR
1019  value等于MINOR(dev)
1020  退出
1021  :index恒等于TOMOYO_PATH1_TYPE
1022  :index恒等于TOMOYO_PATH2_TYPE
1023  value等于mode按位与S_IFMT
1024  退出
1027  value等于MAJOR(rdev)
1028  退出
1031  value等于MINOR(rdev)
1032  退出
1033  :index恒等于TOMOYO_PATH1_PERM
1034  :index恒等于TOMOYO_PATH2_PERM
1037  value等于mode按位与S_IALLUGO
1038  退出
1041  退出
1043  max_v[j]等于value
1044  min_v[j]等于value
1046  :index恒等于S_ISUID
1047  :index恒等于S_ISGID
1048  :index恒等于S_ISVTX
1049  :index恒等于S_IRUSR
1050  :index恒等于S_IWUSR
1051  :index恒等于S_IXUSR
1052  :index恒等于S_IRGRP
1053  :index恒等于S_IWGRP
1054  :index恒等于S_IXGRP
1055  :index恒等于S_IROTH
1056  :index恒等于S_IWOTH
1057  :index恒等于S_IXOTH
1058  is_bitop[j] = true
1061  如果left恒等于TOMOYO_NUMBER_UNION
1063  ptr等于numbers_p自加
1065  min_v[0]等于values[0]
1066  max_v[0]等于values[1]
1068  如果right恒等于TOMOYO_NUMBER_UNION
1070  ptr等于numbers_p自加
1072  如果Maybe NULL.
1073  如果tomoyo_number_matches_group(min_v[0], max_v[0], Maybe NULL. )恒等于match则继续下一循环
1078  否则
1079  如果min_v[0]小于等于values[1]且max_v[0]大于等于values[0]的值恒等于match则继续下一循环
1083  转到:out
1089  如果is_bitop[0]且is_bitop[1]则
1090  转到:out
1091  否则如果is_bitop[0]则
1093  :right恒等于TOMOYO_PATH1_PERM
1095  :right恒等于TOMOYO_PATH2_PERM
1097  如果非max_v[0]按位与max_v[1]的值恒等于非match则继续下一循环
1100  转到:out
1101  否则如果is_bitop[1]则
1103  :left恒等于TOMOYO_PATH1_PERM
1105  :left恒等于TOMOYO_PATH2_PERM
1107  如果非max_v[0]按位与max_v[1]的值恒等于非match则继续下一循环
1110  转到:out
1113  如果min_v[0]小于等于max_v[1]且max_v[0]大于等于min_v[1]的值恒等于match则继续下一循环
1115  out :
1116  返回:false
1119  如果For holding parameters specific to execve() request.* NULL if not dealing do_execve().argcenvc的值则返回:moyo_scan_bprm - Scan "struct linux_binprm".*@ee: Pointer to "struct tomoyo_execve".*@argc: Length of @argc.*@argv: Pointer to "struct tomoyo_argv".*@envc: Length of @envp.*@envp: Poiner to "struct tomoyo_envp".* Returns true on success, false otherwise.
1121  返回:true
调用者
名称描述
tomoyo_check_aclmoyo_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().