WO2019237864A1 - Security user architecture and authority control method - Google Patents

Security user architecture and authority control method Download PDF

Info

Publication number
WO2019237864A1
WO2019237864A1 PCT/CN2019/086496 CN2019086496W WO2019237864A1 WO 2019237864 A1 WO2019237864 A1 WO 2019237864A1 CN 2019086496 W CN2019086496 W CN 2019086496W WO 2019237864 A1 WO2019237864 A1 WO 2019237864A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
msu
role
administrator
maintainer
Prior art date
Application number
PCT/CN2019/086496
Other languages
French (fr)
Chinese (zh)
Inventor
杨力祥
Original Assignee
杨力祥
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杨力祥 filed Critical 杨力祥
Publication of WO2019237864A1 publication Critical patent/WO2019237864A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/45Structures or tools for the administration of authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2113Multi-level security, e.g. mandatory access control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Abstract

The invention discloses a security user architecture and an authority control method, relating to the information technology and specifically relating to the information security field. Multiple user roles are arranged; a competence collection of a user of each role is defined; and respective role cannot own full authority; and a control collection is set for a progress competence collection such that the competence collection of the role are not broken through during operating. By using the technical solution provided by the present invention, even if an intrusion program illegally obtains the authority of any user, the behaviors implemented by the intrusion program are very limited due to the authority limitation of the role subordinated to the user and are only limited to the authority range of the user itself; in consequence, the effect caused by intrusion is very limited.

Description

一种安全用户架构及权限控制方法Security user architecture and authority control method 技术领域Technical field
本发明涉及信息技术领域,特别涉及一种权限控制技术,以及一种操作系统中的用户及其用户权限的控制方法。The present invention relates to the field of information technology, and in particular, to a permission control technology and a user in an operating system and a method for controlling user permissions.
背景技术Background technique
现有操作系统在用户授权管理方面有一些特征,由这些特征会带来一些弊端,包括:The existing operating systems have some characteristics in terms of user authorization management. These characteristics will bring some disadvantages, including:
1.root用户的全权设计,即root用户拥有对计算机中所有资源的完全操控权限,攻击者一旦获得root权限就可以很容易达到攻击目标。1. The full design of the root user, that is, the root user has full control of all resources in the computer. Once the attacker obtains root permissions, he can easily reach the target of the attack.
2.内核没有自己对用户的权力数据管理。对于操作系统来说,权力的来源虽然逻辑上与用户有关,但是管理单位为进程,一旦进程创建完成,操作系统所有与权力相关的判断都根据进程的属性而来,很难根据用户本身的权力对进程进行约束。2. The kernel does not have its own authority over user data management. For the operating system, although the source of power is logically related to the user, the management unit is a process. Once the process is created, all the power-related judgments of the operating system are based on the attributes of the process. Constrain the process.
3.权力以进程为单位,一个进程可以同时有两种用户属性(uid、euid),并靠进程创建来传递,并且用户可以由于某些特殊原因创建一个高于自己权限的进程,此时该进程同时有两个用户属性,一个用于权力判断,且往往是高特权级,一个用于标明所属关系,是实际的所属用户,二者权限有差异,而且这种差异可以由父子进程创建机制传递下去,子进程也可以同时拥有两种权力。3. Power is based on process. A process can have two user attributes (uid, euid) at the same time, and is passed on by process creation, and the user can create a process with higher privileges than his own for some special reasons. A process has two user attributes at the same time. One is used to judge power and is often of high privilege level. The other is used to indicate the belonging relationship and is the actual user. The permissions of the two are different, and this difference can be created by the parent and child processes. Passed on, the child process can also have both powers.
更为致命的是,如果仅修改其中的一条,则正常的功能无法实现;如果不修改,权力的监管无法实现。因此,必须彻底更改现在的这些授权机制,使操作系统直接管理用户的权力数据,进程的权力取决于它的用户并永不超越用户的权限,在整个操作过程之中都能够依据用户的权力数据对正在进行的动作进行权力检查,判断当前操作的合法性。这样才能真正有效阻止攻击导致的越权行为。What's more fatal is that if only one of them is modified, normal functions cannot be achieved; without modification, the supervision of power cannot be achieved. Therefore, it is necessary to completely change these current authorization mechanisms so that the operating system directly manages the user's power data. The power of a process depends on its users and never exceeds the user's permissions. It can be based on the user's power data during the entire operation process. Perform power checks on ongoing actions to determine the legitimacy of the current operation. Only in this way can we effectively prevent unauthorized actions caused by attacks.
发明内容Summary of the Invention
针对现有技术中的上述问题,本发明建立了一种安全用户架构,其特征在于:In view of the above problems in the prior art, the present invention establishes a secure user architecture, which is characterized by:
设置多种用户角色,限定每种角色的用户的权能集合,每种角色都不拥有全权;设置针对进程权能集合进行控制的集合,保证角色的用户的权能集合在运行时不被突破;所述进程权能集合是指该进程所属的用户的权能集合。Set a variety of user roles, limit the set of capabilities of users of each role, each role does not have full power; set a set of control for the set of process capabilities, to ensure that the set of capabilities of users of the role is not broken at runtime; The process capability set refers to the capability set of the user to which the process belongs.
所述用户角色是指:将计算机用户分为不同种类,每个种类称为一种角色,每种角色有自己的最大权能范围。每个用户都属于且只能属于一种具体的角色,每个用户的权能范围不能超越其所属角色的权能范围。The user role refers to dividing computer users into different categories, and each category is called a role, and each role has its own maximum power range. Each user belongs to and can only belong to a specific role, and the range of capabilities of each user cannot exceed the range of capabilities of the role to which they belong.
所述用户的权能集合是指:用户的权力和能力的集合。所述能力是属于该用户的进程包含的功能及有权使内核支持其进行的行为的范围,优选的,所述能力是指:可执行的程序包含的功能、可使用的系统调用接口;所述权力是指属于该用户的进程的能力可操作的对象的范围;优选的,所述权力是指:可操作的文件范围、可访问的系统端口号等。The capability set of the user refers to a set of power and capability of the user. The capability belongs to a range of functions included in the process of the user and has a right to enable the kernel to support the actions performed by the user. Preferably, the capability refers to the functions included in the executable program and the available system call interface; The power refers to a range of objects that can be operated by the user's process capability. Preferably, the power refers to a range of operable files, accessible system port numbers, and the like.
所述全权是指一种包含了当前系统中出现的全部能力和权力的权限,例如,现有操作系统常见的root权限。The full authority refers to a kind of authority that includes all the capabilities and powers present in the current system, for example, the root authority that is common in existing operating systems.
所述针对进程权能集合进行控制的集合,包括:操作系统为不同角色各自设立其可操作的行为及可操作的对象范围;在进程执行过程中,对进程的操作进行判断,判断其行为是否在其对应用户的角色权能范围之内。The set for controlling the process capability set includes: the operating system sets up its operable behavior and operable object range for different roles respectively; during the execution of the process, the operation of the process is judged to determine whether its behavior is in Its corresponding user's role capabilities are within the scope.
一种优选的用户角色划分方式:按照用户类型划分角色。A preferred method for dividing user roles: divide roles according to user types.
所述用户类型包括:The user types include:
根据使用目的的不同,将上述用户分为两种用户类型:一种是使用者,其目的是利用计算机完成自己的应用需求,使用目标是计算机上的应用软件;一种是维护者,其目的是维护计算机的正常使用,对计算机进行维护和管理,以 支持所述使用者可以正常、方便的使用计算机;According to the purpose of use, the above users are divided into two types of users: one is the user, whose purpose is to use the computer to complete their application requirements, and the use target is the application software on the computer; the other is the maintainer, whose purpose is It is to maintain the normal use of the computer, and to maintain and manage the computer to support the user to use the computer normally and conveniently;
进一步的,计算机维护者可以分为计算机服务软件(如对普通计算机软件进行底层支持、并不直接面对使用者的应用程序)的维护者,和计算机自身的维护者;Further, computer maintainers can be divided into maintainers of computer service software (such as low-level support for common computer software and applications that do not directly face users), and maintainers of the computer itself;
进一步的,计算机自身的维护者还可分为:对计算机硬件的管理和维护,对计算机用户的管理和维护,以及当计算机出现问题时,对异常情况的处理和维护。Further, the maintainer of the computer itself can be divided into: management and maintenance of computer hardware, management and maintenance of computer users, and handling and maintenance of abnormal situations when a computer problem occurs.
根据以上用户类型,划分的用户角色为:使用者角色和维护者角色。According to the above user types, the user roles divided are: user role and maintainer role.
进一步的,维护者角色分为服务维护者和计算机自身维护者。Further, the role of the maintainer is divided into a service maintainer and a computer maintainer.
进一步的,计算机自身维护者分为硬件管理员、用户管理员、异常情况管理员。Further, the computer's own maintainers are divided into hardware administrators, user administrators, and abnormal situation administrators.
进一步的,对以上角色在权能集合中进行限定:Further, the above roles are limited in the capability set:
优选的,为每种角色设立该角色对应的文件管理结构的根节点。Preferably, a root node of a file management structure corresponding to the role is established for each role.
图1给出了一种本发明的具体实现方式中,其中,在文件管理结构根节点下分别为使用者、服务维护者、硬件管理者、用户管理者、异常情况管理者分别建立文件管理结构根节点,并在此基础上,分别为各个具体的用户设置其可访问的文件范围。FIG. 1 shows a specific implementation manner of the present invention, in which a file management structure is respectively established for a user, a service maintainer, a hardware manager, a user manager, and an exception manager under a root node of the file management structure. The root node, and on this basis, set the range of files that can be accessed by each specific user.
具体的,使用者仅可访问使用者文件管理结构的根节点以下的文件,内核不支持使用者调用仅可被维护者使用的系统调用。Specifically, the user can only access files below the root node of the user's file management structure, and the kernel does not support user calls to system calls that can only be used by the maintainer.
服务维护者仅可访问服务维护者文件管理结构的根节点以下的文件,内核不支持服务维护者使用仅供用户管理员、硬件管理员、异常情况管理员使用的系统调用。The service maintainer can only access files below the root node of the service maintainer's file management structure. The kernel does not support service maintainers to use system calls that are only used by user administrators, hardware administrators, and exception administrators.
用户管理员仅可访问用户管理员文件管理结构的根节点以下的文件,包括:用户登录程序、用户管理程序等用于对用户权力进行管理的应用程序和与其配 合的文件等;内核中用于进行与用户管理相关的系统调用,仅供用户管理员角色的用户使用。用户管理员仅可执行系统为其预设的应用程序,不可以自己添加、修改、删除这些应用程序。进一步的,其应用程序的参数最好仅设选择性输入。The user administrator can only access the files below the root node of the user administrator's file management structure, including: user login programs, user management programs, and other applications used to manage user rights and files that cooperate with them; used in the kernel to Makes system calls related to user management and is only available to users in the user administrator role. The user administrator can only execute the applications preset by the system, and cannot add, modify, or delete these applications. Further, the parameters of the application program are preferably set only for selective input.
硬件管理员仅可访问硬件管理员文件管理结构的根节点以下的文件,包括:添加删除驱动的管理程序、磁盘管理程序等对系统硬件进行管理的应用程序和与其配合的文件等;内核中用于进行与硬件管理相关的系统调用,仅供硬件管理员角色的用户使用。硬件管理员仅可执行系统为其预设的应用程序,不可以自己添加、修改、删除这些应用程序。进一步的,其应用程序的参数最好仅设选择性输入。The hardware administrator can only access the files below the root node of the hardware administrator's file management structure, including: adding and removing driver management programs, disk management programs, and other applications that manage system hardware and the files that cooperate with them; used in the kernel Used to make system calls related to hardware management, and is only available to users in the hardware administrator role. The hardware administrator can only execute the applications preset by the system, and cannot add, modify, or delete these applications. Further, the parameters of the application program are preferably set only for selective input.
异常情况管理员仅可访问异常情况管理员文件管理结构的根节点以下的文件,包括:删除指定文件、关闭指定进程等在异常情况下对系统进行管理的应用程序和与其配合的文件等;内核中用于进行与异常管理相关的系统调用,仅供异常管理员角色的用户使用。异常管理员在对文件进行操作时,需用户管理员临时对其进行文件授权。异常管理员仅可执行系统为其预设的应用程序,不可以自己添加、修改、删除这些应用程序。The exception administrator can only access the files below the root node of the exception administrator's file management structure, including: deleting specified files, closing specified processes, and other applications that manage the system under abnormal conditions and the files that cooperate with them; etc. Is used to make system calls related to exception management and is only available to users in the exception administrator role. When an abnormal administrator operates a file, the user administrator needs to temporarily authorize the file. The exception administrator can only execute the applications preset by the system, and cannot add, modify, or delete these applications by himself.
优选的,在文件的管理结构中标明该文件的可访问用户角色、可访问用户、用户组。Preferably, the accessible user roles, accessible users, and user groups of the file are indicated in the management structure of the file.
进一步的,设置一种由不同角色的进程接续完成一个用户操作的方式:当使用者的权力无法满足使用者的请求,需由服务维护者角色的用户及其程序协助完成时,由使用者的应用程序向服务维护者的维护程序提出特定格式的申请,维护程序处理完毕后将处理结果返回给使用者的应用程序。Further, a method for successively completing a user operation by processes of different roles is set: when the user's power cannot meet the user's request, and the user and its program of the service maintainer role need to assist in completing the operation, the user's The application program applies a specific format to the maintenance program of the service maintainer. After the maintenance program finishes processing, the processing result is returned to the user's application program.
进一步的,设置一种将两个用户的程序体现在一个进程中并进行权能范围判断的方式,包括:Further, a method for embodying the programs of two users in one process and judging the scope of capabilities is provided, including:
在支持MSU的系统中,如需将二个属于不同角色用户的含有可执行代码的文件加载为同一线性地址空间(如服务程序以动态链接库的方式为进程提供支 持),则将两部分的指令、代码划分为不同的MSU,为各自MSU的属性信息填写实际的用户ID和用户角色类型。当进行权能范围判断时,判断依据为当前MSU所属的用户角色类型。In a system that supports MSU, if two files containing executable code belonging to users with different roles need to be loaded into the same linear address space (such as a service program providing support for processes in the form of dynamic link libraries), the two parts of the The instructions and codes are divided into different MSUs, and the actual user ID and user role type are filled in for the attribute information of the respective MSUs. When judging the power range, the judgment is based on the user role type to which the current MSU belongs.
所述MSU是指内存系统单元,所述内存系统单元是内存系统装置中的某个具体单元;所述内存系统装置是指特定访问控制的集合及其控制的访问区域。The MSU refers to a memory system unit, and the memory system unit is a specific unit in a memory system device; the memory system device refers to a set of specific access controls and an access area controlled by the specific access control.
除非特别指明,本发明中MSU这一缩写对应的就是内存系统单元(Memory System Unit)。Unless otherwise specified, the abbreviation MSU in the present invention corresponds to a memory system unit.
所述区域,包括:由一组边界包围而成的CPU可寻址存储空间,区域必须由访问控制集合认定,所述认定是指将区域的信息记录在MSU信息中。所述访问控制集合,包括:MSU信息,对区域进行访问的允许机制,和/或对区域进行访问的禁止机制。所述可寻址存储空间可以存放数据和/或指令。优选的,全部软件的数据、代码都按设计要求分别放入指定的MSU之中,即没有代码、数据放在MSU之外。The area includes a CPU-addressable storage space surrounded by a set of boundaries. The area must be identified by an access control set. The identification refers to recording the information of the area in the MSU information. The access control set includes: MSU information, a permission mechanism for accessing the area, and / or a mechanism for prohibiting access to the area. The addressable storage space may store data and / or instructions. Preferably, the data and codes of all software are put into designated MSUs separately according to design requirements, that is, no codes and data are placed outside the MSU.
所述CPU是指中央处理器。The CPU refers to a central processing unit.
进一步,区域由同一个线性地址空间中的一个或多个连续存储区组成,每个连续存储区由两端的地址标识界定,所有前述的地址标识的集合构成区域的边界。对于由多个连续存储区组成的区域的优选方案是区域中的连续存储区之间互不相交。其中存储数据、代码的存储区分别被称作数据区、指令区。不同MSU的区域互不相交。Further, the area is composed of one or more continuous storage areas in the same linear address space, and each continuous storage area is defined by the address identifiers at both ends, and the set of all the foregoing address identifiers constitutes the boundary of the area. A preferred solution for an area composed of multiple consecutive storage areas is that the consecutive storage areas in the area are disjoint from each other. The storage areas where data and code are stored are called data area and instruction area, respectively. Regions of different MSUs do not intersect each other.
进一步的,所述MSU信息包括:MSU边界信息、MSU端口信息、MSU属性信息。作为一种可选的实现方式,可以设置空端口MSU,所述空端口MSU其MSU端口信息为空,仍具有MSU边界信息、MSU属性信息。Further, the MSU information includes: MSU boundary information, MSU port information, and MSU attribute information. As an optional implementation manner, an empty port MSU may be set. The MSU port information of the empty port MSU is empty and still has MSU boundary information and MSU attribute information.
优选的,所述MSU信息进一步包括:MSU用户信息。Preferably, the MSU information further includes: MSU user information.
进一步的,所述允许机制包括:允许区域内的非转移指令、中断指令及目标地址在当前区域内(不超越当前区域)的转移指令执行,允许区域内的指令 访问当前区域内的数据。进一步的,允许机制包括:允许区域间,不论是区域内到区域外或区域外到区域内,通过传参的方式传递数据;允许区域间通过共享物理内存的方式传递数据,优选的,传递大量的数据时采用共享物理内存的方式;对区域间,即超出或进入本区域,进行访问的允许机制,进一步包括:MSU间必须经过端口执行转移指令,并且属性信息、端口信息必须匹配。Further, the permission mechanism includes: allowing non-branch instructions, interrupt instructions, and branch instructions in the current area (without exceeding the current area) to execute in the area, and allowing instructions in the area to access data in the current area. Further, the permission mechanism includes: allowing data to be passed between regions, whether within the region to outside the region or outside the region to the region, by passing parameters; allowing the regions to pass data by sharing physical memory, preferably, passing a large amount The data is shared by physical memory; the permission mechanism for access between regions, that is, beyond or entering the region, further includes: MSUs must execute port transfer instructions through ports, and attribute information and port information must match.
所述禁止机制包括,禁止在区域中的数据区执行指令。除允许机制之外,对一切由区域内向区域外或由区域外向区域内的跨区域执行指令(包括非转移指令、转移指令及不匹配情形),跨区域操作访问数据都产生异常。The prohibition mechanism includes prohibiting execution of instructions in a data area in the area. Except for the permission mechanism, for all cross-region execution instructions (including non-transfer instructions, branch instructions, and mismatches) from within the region to outside the region or from outside the region to the region, cross-region operations to access data will generate exceptions.
一个特例是共享数据MSU,其特征是只包含被其他MSU共享的数据,没有指令;允许其他MSU通过约定的指令操作数据。A special case is shared data MSU, which is characterized by containing only data shared by other MSUs and no instructions; allowing other MSUs to manipulate data through agreed instructions.
在本发明的一种具体实现方式中,将内核栈和/或用户栈置于共享数据MSU中,栈所属的MSU必须为共享数据MSU,其他MSU通过约定的指令操作栈中的数据。In a specific implementation manner of the present invention, the kernel stack and / or the user stack are placed in the shared data MSU, and the MSU to which the stack belongs must be the shared data MSU, and other MSUs operate the data in the stack by a predetermined instruction.
所述MSU边界信息包括:由访问控制集合认定的区域中,所有连续存储区的边界信息构成的集合。存储上述信息的数据结构简称边界数据,所述边界数据的地址被关联到内存系统装置中并为其可识别。当需要查找区域的边界时,所述装置可以根据边界数据的地址找到数据结构,即可获得所有的边界信息。The MSU boundary information includes: a set of boundary information of all continuous storage areas in an area identified by an access control set. The data structure storing the above information is referred to as boundary data, and the address of the boundary data is associated with and identifiable in the memory system device. When it is necessary to find the boundary of the area, the device can find the data structure according to the address of the boundary data, and then all the boundary information can be obtained.
所述MSU端口信息包括入口和/或出口。在访问控制集合认定的区域范围内的指令地址区域中指定有限个指令地址为入口或出口,其中每一个指令地址为一个入口或出口。可选的入口为:区域中MSU间转移指令的目标地址;可选的出口为:MSU间转移指令的所在地址。The MSU port information includes an entrance and / or an exit. Specify a limited number of instruction addresses as entrances or exits in the instruction address area within the area identified by the access control set, where each instruction address is an entrance or exit. The optional entry is: the destination address of the inter-MSU branch instruction in the area; the optional exit is: the address of the inter-MSU branch instruction.
所述MSU属性信息包括:MSU标识信息,MSU类型信息。所述MSU标识信息是指区别于其它MSU的唯一标识。所述MSU的类型信息可以是普通MSU、共享数据MSU中的一种。The MSU attribute information includes: MSU identification information and MSU type information. The MSU identification information refers to a unique identification that is different from other MSUs. The type information of the MSU may be one of an ordinary MSU and a shared data MSU.
优选的,所述MSU属性信息还可包括:MSU所属用户类型信息,MSU所属用户标识信息。所述MSU所属用户类型信息是指这个MSU所属用户的类型,在一些应用场景中,用户类型即为用户角色,所述MSU所属用户标识信息是指 MSU所属用户的唯一标识。Preferably, the MSU attribute information may further include: user type information to which the MSU belongs, and user identification information to which the MSU belongs. The user type information to which the MSU belongs refers to the type of the user to which the MSU belongs. In some application scenarios, the user type is a user role, and the user identifier information to which the MSU belongs refers to the unique identifier of the user to which the MSU belongs.
优选的,可以将前述的边界信息和/或属性信息和/或MSU端口信息合成为一个更方便使用的、完整的数据结构。Preferably, the aforementioned boundary information and / or attribute information and / or MSU port information can be synthesized into a more convenient and complete data structure.
所述MSU端口信息匹配、所述MSU属性信息匹配是指:在程序初始化阶段,将转移指令执行所需MSU的出口、入口、边界、标识信息、类型信息记录在MSU描述符表中,在程序运行时,将转移指令包含的信息,分别与MSU描述符表中的端口信息、属性信息做对比,如果结果匹配,视为合法,允许转移指令执行,反之,视为非法,报异常。The matching of the MSU port information and the matching of the MSU attribute information means that in the program initialization phase, the exit, entrance, boundary, identification information, and type information of the MSU required for execution of the transfer instruction are recorded in the MSU descriptor table. At run time, the information contained in the transfer instruction is compared with the port information and attribute information in the MSU descriptor table. If the results match, it is regarded as legitimate and the transfer instruction is allowed to execute. Otherwise, it is considered illegal and an exception is reported.
进一步的,在MSU类型信息中增加一种检查MSU。类型信息被标记为“检查MSU”的MSU被视为检查MSU。当所述装置包含检查MSU时,不允许非检查MSU直接调用另外一个非检查MSU,必须由源MSU先调用检查MSU,再由检查MSU调用目标MSU;目标MSU返回时,先返回到检查MSU,再由检查MSU返回到源MSU。所述非检查MSU指除了检查MSU外的任何其它类型的MSU。Further, a check MSU is added to the MSU type information. An MSU whose type information is marked "Check MSU" is considered to check MSU. When the device includes a check MSU, a non-check MSU is not allowed to directly call another non-check MSU. The source MSU must first call the check MSU, and then the check MSU calls the target MSU. When the target MSU returns, it returns to the check MSU first. The check MSU returns to the source MSU. The non-inspection MSU refers to any other type of MSU other than the inspection MSU.
进一步的,在MSU类型信息中增加一种终端MSU。类型信息标记为“终端MSU”的MSU只可被其它MSU调用,不可调用其它MSU。Further, a terminal MSU is added to the MSU type information. An MSU whose type information is marked as "terminal MSU" can only be called by other MSUs, and cannot call other MSUs.
进一步的,在MSU类型信息中增加一种空端口MSU。类型信息被标记为“空端口MSU”的MSU没有端口,其它MSU可以通过端口调用任意空端口MSU的函数,但不可直接访问空端口MSU的数据。空端口MSU调用其它MSU必须通过其端口进入该MSU。不同的空端口MSU之间可以任意进行函数调用,但不可访问数据。当终端MSU存在时,空端口MSU不可调用终端MSU。Further, an empty port MSU is added to the MSU type information. The MSU whose type information is marked as "empty port MSU" has no port. Other MSUs can call any function of the empty port MSU through the port, but cannot directly access the data of the empty port MSU. An empty port MSU calling another MSU must enter the MSU through its port. Function calls can be made between different empty port MSUs, but data cannot be accessed. When the terminal MSU exists, the empty port MSU cannot call the terminal MSU.
进一步的,在MSU类型信息中增加一种保险箱MSU。此类MSU不允许包含指令区。只有某些需要保存状态信息的操作,才可访问该MSU。优选的,所述状态信息可以是返回地址、中断现场等。Further, a safe MSU is added to the MSU type information. This type of MSU is not allowed to contain instruction areas. Only certain operations that need to save status information can access the MSU. Preferably, the status information may be a return address, an interruption scene, and the like.
进一步的,在MSU类型信息中增加一种IO指令MSU。当所述装置包含IO指令MSU时,仅允许这类MSU内执行IO操作相关的特殊指令。此类MSU的属性匹配检查规则与终端MSU相同。Further, an IO instruction MSU is added to the MSU type information. When the device contains an IO instruction MSU, only special instructions related to IO operations are allowed to be executed within this type of MSU. The attribute matching check rules of this type of MSU are the same as those of the terminal MSU.
在装置中,可不支持检查MSU、终端MSU、空端口MSU、保险箱MSU、IO指令MSU的实现,也可支持其中的一种或几种。In the device, it may not support checking the implementation of MSU, terminal MSU, empty port MSU, safe MSU, IO instruction MSU, or one or more of them.
优选的,所述安全用户架构是指应用于操作系统的安全用户架构。Preferably, the secure user architecture refers to a secure user architecture applied to an operating system.
一种计算装置,其特征在于:增设寄存器,用户保存当前用户ID。A computing device is characterized in that a register is added and a user saves a current user ID.
一种计算装置,其特征在于:增设寄存器,用于保存当前用户角色类型。A computing device is characterized in that a register is added to save the current user role type.
优选的,增设用户ID专用寄存器,用于保存当前用户ID;增设用户角色类型专用寄存器,用于保存当前用户角色类型。Preferably, a special register for user ID is added to store the current user ID; a special register for user role type is added to save the current user role type.
本发明的技术方案具有如下技术效果:The technical scheme of the present invention has the following technical effects:
在现有系统中,root权限具有绝对的权力,可以进行任何操作。攻击者获得root权限意味着系统中所有的授权检查机制都不能再限制其行为。实际上,大部分攻击代码最核心的目标也正是获得root权限,一旦获得之后,所有的获得攻击结果的操作就可以“正常的、合法的、利用系统的功能”去实现。In existing systems, root authority has absolute power and can perform any operation. An attacker gaining root authority means that all authorization checking mechanisms in the system can no longer restrict its behavior. In fact, the core goal of most attack code is to obtain root privileges. Once obtained, all operations to obtain attack results can be "normal, legal, and use system functions."
现有系统中,支持用户可以由于某些特殊原因创建一个高于自己权限的进程,此时该进程同时有两个用户属性,一个用于权力判断,且往往是高特权级;一个用于标明所属关系,是实际的所属用户,二者权限有差异,而且这种差异可以由父子进程创建机制传递下去,子进程也可以同时拥有两种权力。于是攻击程序可以以低权限的身份拥有高执行权限,在此时启动攻击,就可以以高权限执行攻击执行序;如果此时创建子进程,还可以获得高权限的子进程,并使子进程驻留内存,不断的获得攻击想要的结果。In the existing system, users can create a process with higher privileges than their own due to some special reasons. At this time, the process has two user attributes at the same time, one for power judgment and often high privilege level; one for marking The ownership relationship is the actual user. The permissions of the two are different, and this difference can be passed on by the parent-child process creation mechanism, and the child process can also have both types of power. Therefore, the attacker can have high execution permissions as a low-privilege. At this time, when the attack is launched, the attack execution order can be executed with high permissions. If a child process is created at this time, a child process with high permissions can also be obtained and the child process Residing in memory, constantly getting the desired results of the attack.
一旦攻击启动之后,在系统看来,这个高权限是合理合法的,没有任何手段和措施可以制止。Once the attack is launched, from the system's point of view, this high authority is reasonable and legal, and there are no means or measures to stop it.
在本方案中,不再存在全权的机制,而是将全部的权力分散为几种角色,并且保证了每种角色之间的权力隔离,保证任何一个用户都不拥有全权,用户 的每一个行为都在角色的权力范围控制之内,任何超越角色授权的行为都会被识别出来并阻止。这就可以实现限制各类管理员的权限范围,使其真正成为一个维护者。一方面,可以防止由于管理员具有全权而可以访问计算机中全部对象,例如管理员的权责范围本应是维护计算机,但由于他有root权限,则可以访问计算机中任意用户的文件,其中包括部分敏感数据,如财务数据等;另一方面,也可以防止攻击者超越授权。In this solution, there is no longer a full power mechanism. Instead, the entire power is divided into several roles, and the power separation between each role is guaranteed, ensuring that no user has full power and every action of the user. All are within the control of the role's power, and any behavior that exceeds the role's authorization will be identified and prevented. This can be achieved to limit the scope of various types of administrators, making it a true maintainer. On the one hand, it can prevent the administrator from having full power to access all objects on the computer. For example, the administrator's scope of responsibility should be maintaining the computer, but because he has root permissions, he can access any user's files on the computer, including Some sensitive data, such as financial data; on the other hand, it can also prevent attackers from exceeding authorization.
本方案中,任一时刻,进程不再同时具备两种权力,进程的权力仅来自于其所属用户。当使用者的权力不足以满足自己进程的需求时,通过维护者的进程辅助完成功能,二者以进程间通信的方式各自完成自己权力范围内的工作。这样就可以严格审查每个进程的操作是否超越了其用户的授权,使进程永远在权力控制范围之内。这样也能保证进程的权力永远来自于其所属用户,而不是一个权力范围被临时提高的父进程。In this solution, at any time, a process no longer has two types of power at the same time, and the power of the process only comes from the user to which it belongs. When the user's power is insufficient to meet the needs of his own process, the process is assisted by the maintainer to complete the function, and the two each complete the work within their own power through inter-process communication. In this way, you can strictly check whether the operation of each process exceeds the authorization of its user, so that the process is always under the control of power. This can also ensure that the power of a process always comes from its own user, rather than a parent process whose power scope is temporarily increased.
以上机制保证了:The above mechanism guarantees:
1.不再有“root”"这种一旦得到就等于获得所有系统操作权限的攻击目标,攻击程序再也无法通过获取root权限来实现自己的目的。1. There is no longer a "root" attack target that, once obtained, is equivalent to obtaining all system operation permissions. The attacker can no longer achieve its own purpose by obtaining root permissions.
2.攻击程序即使非法获得了任何一个用户的权限,由于该用户所属角色的权力限制,其可实现的行为都是非常有限的,仅限于这个用户自身的权力范围之内,使攻击可达到的效果也非常有限。2. Even if the attacker gains the rights of any user illegally, due to the power limitation of the role to which the user belongs, its achievable behaviors are very limited, which is limited to the scope of the user's own power, making the attack reachable. The effect is also very limited.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without paying creative labor.
图1:为每种角色设立该角色对应的文件管理结构的根节点的实例示意图Figure 1: Example of setting up a root node for a file management structure corresponding to that role for each role
图2:操作系统提供系统服务实例示意图Figure 2: Schematic diagram of an example of system service provided by the operating system
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In the following, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
以下通过具体实施方式来说明本发明的技术方案。The technical solutions of the present invention are described below through specific embodiments.
实施例1:Example 1:
为每个用户建立一套数据管理结构,在结构中标明该用户所属的角色类型。Establish a data management structure for each user, and indicate the type of role to which the user belongs in the structure.
Figure PCTCN2019086496-appb-000001
Figure PCTCN2019086496-appb-000001
Figure PCTCN2019086496-appb-000002
Figure PCTCN2019086496-appb-000002
实施例2:Example 2:
本实施例是一种记录当前用户、当前用户角色标识的具体实施方式,这两个信息主要供对进程权能集合进行控制的集合使用。This embodiment is a specific implementation manner of recording the current user and the current user role identifier. These two pieces of information are mainly used for a set that controls a set of process capabilities.
一种方式为:在当前进程信息中记录当前用户ID及用户角色类型。One way is to record the current user ID and user role type in the current process information.
一种优选的方式为:增设寄存器,保存当前用户ID;增设寄存器,保存当前用户角色类型。A preferred method is: adding a register to save the current user ID; adding a register to save the current user role type.
进程创建时,为上述寄存器赋值,进程切换时,随进程切换保护现场一起保存。When the process is created, the above registers are assigned values. When the process is switched, it is saved with the process switching protection site.
实施例3:Example 3:
一种通过仅可执行系统为其预设的应用程序来限制维护者角色操作权能的实施方式是:One implementation that restricts the maintainer role's operational capabilities by only executing applications that the system presets for it:
为每种维护者角色的用户提供专用的人机交互界面,用户只能通过界面中提供的选项,执行特定的可执行程序,完成特定的任务,而无法行使可执行程序逻辑之外的权能。要求:可执行程序除了完成特定任务外,不具有其它功能,包括对可执行程序自身进行添加、删除、修改、替换的功能;不提供对可执行程序进行添加、删除、修改、替换的选项。以此将用户的权能,限制在选项的范围内,无法超越,特别的:无法添加、删除、修改、替换选项对应的可执行程序。Provide a dedicated human-machine interaction interface for users of each maintainer role. Users can only execute specific executable programs and complete specific tasks through the options provided in the interface, and they cannot exercise the power beyond the logic of executable programs. Requirements: Except for completing specific tasks, the executable program does not have other functions, including the ability to add, delete, modify, and replace the executable program itself; it does not provide the option to add, delete, modify, or replace the executable program. In this way, the power of the user is limited to the scope of the option and cannot be surpassed. In particular: the executable program corresponding to the option cannot be added, deleted, modified, or replaced.
优选的,所属维护者包括:硬件管理员、用户管理员、异常情况管理员。Preferably, the maintainers include: a hardware administrator, a user administrator, and an abnormality administrator.
实施例4:Example 4:
一种在实施例3基础上,进一步的,通过控制用户仅可执行系统为其预设的应用程序来限定用户可操作对象范围的确立方式是:On the basis of Embodiment 3, further, by establishing that the user can only execute an application preset by the system to limit the range of user operable objects, the establishment method is:
对于硬件管理员角色的用户,由系统开发者提供专用的程序来完成硬件管理员需要完成的功能。所述专用的程序在使用过程中不允许用户自定义输入内容。For the user of the hardware administrator role, the system developer provides a special program to complete the functions that the hardware administrator needs to complete. The dedicated program does not allow the user to customize input content during use.
例如,以常用的磁盘碎片整理功能为例,需要系统开发者提供专门的程序用来进行磁盘碎片整理。为此开发者需要增设专门的系统调用端口,此端口的参数只包括需要进行碎片整理的盘符;同时,此程序中只包括调用此系统调用端口的程序,及其它与此相关的逻辑;另外,此程序提供给用户的人机交互界面中,只允许此用户选择需要碎片整理的盘符,不允许用户自定义输入内容。这样的一套程序在投入使用前,要进行形式化验证及穷举测试,只要验证通过,就可以确保此程序没有漏洞。投入使用后,硬件管理员角色面对的人机交互界面中,不存在除选择需要碎片整理的盘符之外的选项,特别的,不包括添加、删除、修改、替换可执行程序的选项,以此保证硬件管理员角色既能完成碎片整理的工作,又无法访问其它角色的文件。For example, taking the commonly used disk defragmentation function as an example, a system developer is required to provide a special program to perform disk defragmentation. To this end, the developer needs to add a special system call port. The parameters of this port only include the drive letter that needs to be defragmented. At the same time, this program only includes the program that calls this system call port and other related logic. In the human-computer interaction interface provided by the program, only the user is allowed to select the drive letter that needs to be defragmented, and the user is not allowed to customize the input content. Before such a program is put into use, formal verification and exhaustive testing are required. As long as the verification is passed, it can be ensured that the program is free of vulnerabilities. After being put into use, in the human-computer interaction interface that the hardware administrator role faces, there are no options other than selecting drive letters that need to be defragmented. In particular, it does not include options for adding, deleting, modifying, and replacing executable programs. This ensures that the hardware administrator role can not only complete the defragmentation work, but also cannot access the files of other roles.
实施例5:Example 5:
一种在实施例3基础上,进一步的,通过控制用户仅可执行系统为其预设的应用程序来限定用户可操作对象范围的确立方式是:On the basis of Embodiment 3, further, by establishing that the user can only execute an application preset by the system to limit the range of user operable objects, the establishment method is:
对于从属于硬件管理员角色的用户,由系统开发者提供专用的程序来完成硬件管理员需要完成的功能。所述专用的程序在使用过程中不允许用户自定义输入内容。For users subordinate to the role of hardware administrator, the system developer provides a special program to complete the functions that the hardware administrator needs to complete. The dedicated program does not allow the user to customize input content during use.
例如,以常用的驱动处理功能为例,需要系统开发者提供专门的驱动处理程序来处理驱动,为此程序的开发者与驱动程序的开发者之间要约定一套驱动程序编写识别格式,即,在驱动程序所属文件的文件头中设置特定字段以标记此程序为驱动程序以及驱动的种类,驱动处理程序通过文件头中的字段,就可以认定驱动程序,并将其载入。同时,要求驱动程序中不能有I/O指令,所有I/O 指令都必须由操作系统特别控制的指令部分完成,驱动程序利用操作系统中的程序来完成I/O处理,驱动处理程序在加载驱动程序前,会通过专用的扫描工具扫描驱动程序中是否存在I/O指令,如果存在,不予加载,并进入异常处理流程,如果不存在,予以加载。驱动程序所在文件需要特定的文件类型,即驱动文件类型,驱动处理程序只能在特定目录下查找驱动文件类型的文件,另外,确保提供给用户的人机交互界面中,只显示特定目录下驱动类型的文件,并只给用户提供选择具体文件并安装/卸载驱动的选项,以此保证除了驱动处理,不能进行其他的操作。For example, taking the commonly used driver processing functions as an example, a system driver is required to provide a special driver processing program to process the driver. A set of driver writing recognition formats must be agreed between the developer of the program and the driver developer, that is, , Set specific fields in the file header of the file to which the driver belongs to mark this program as the driver and the type of driver. The driver handler can identify the driver and load it by using the fields in the file header. At the same time, it is required that there must be no I / O instructions in the driver. All I / O instructions must be completed by the instructions specially controlled by the operating system. The driver uses the programs in the operating system to complete the I / O processing. The driver processing program is loading. Before the driver, it will scan the driver for the existence of I / O instructions through a special scanning tool. If it exists, it will not be loaded, and it will enter the exception processing flow. If it does not exist, it will be loaded. The file where the driver is located requires a specific file type, that is, the driver file type. The driver handler can only find files of the driver file type in a specific directory. In addition, ensure that only the drivers in a specific directory are displayed in the human-computer interaction interface provided to the user. Type of files, and only provide users with the option to select specific files and install / uninstall the driver to ensure that no other operations can be performed except the driver process.
实施例6:Example 6:
一种在实施例3基础上,进一步的,通过控制用户仅可执行系统为其预设的应用程序来限定用户可操作对象范围的确立方式是:On the basis of Embodiment 3, further, by establishing that the user can only execute an application preset by the system to limit the range of user operable objects, the establishment method is:
对于从属于异常情况管理员角色的用户,由系统开发者提供专用的程序来完成异常情况管理员需要完成的功能。所述专用的程序在使用过程中不允许用户自定义输入内容。For users subordinate to the abnormal situation administrator role, the system developer provides a special program to complete the functions that the abnormal situation administrator needs to complete. The dedicated program does not allow the user to customize input content during use.
例如,以常用的kill其它进程的功能为例,需要系统开发者提供专门的kill其它进程的处理程序,并确保此程序中只存在与kill进程相关的逻辑,只能调用与kill进程相关的系统调用端口,另外,在人机交互界面中,只允许异常情况管理员角色的用户选择要kill的进程名、进程号,以此确保用户不能做除了kill进程之外的其它工作。For example, taking the functions of commonly used kill processes as an example, the system developer needs to provide a special kill process for other processes, and ensure that only logic related to the kill process exists in this program, and only the system related to the kill process can be called. Invoking port. In addition, in the human-computer interaction interface, only the user with the administrator role in abnormal situations is allowed to select the process name and process number to be killed, so as to ensure that the user cannot do other work except the kill process.
再如,以常用的删除指定用户文件这一功能为例,需要系统开发者提供专门的用户文件删除程序。此程序通过进程间通信的方式,通过用户管理员的特定进程,获取一套用户ID,此程序只能删除此指定用户的文件,程序中只存在与删除此文件相关的逻辑以及只能调用与删除文件相关的系统调用端口,在此程序的人机交互界面中,只允许异常情况管理员角色用户在指定用户的文件目录下,选择要删除的文件,以此确保用户不能做除此之外的其它工作。As another example, taking the commonly used function of deleting specified user files as an example, a system developer is required to provide a special user file deleting program. This program obtains a set of user IDs through the inter-process communication and a specific process of the user administrator. This program can only delete the file of the specified user. The program only has logic related to deleting this file and can only call and Delete the system call port related to the file. In the human-computer interaction interface of this program, only the administrator in the abnormal situation is allowed to select the file to be deleted in the specified user's file directory to ensure that the user cannot do anything else. Other work.
实施例7:Example 7:
在本发明的一种具体实施方式中,判断系统调用是否符合角色要求的方法,包括:In a specific embodiment of the present invention, a method for determining whether a system call meets a role requirement includes:
在对用户角色有特殊要求的系统调用函数的最开始,判断当前用户角色是否符合该系统调用对角色的要求,如符合可继续执行,如不符合,返回系统调用并返回错误信息。At the beginning of the system call function that has special requirements for the user role, determine whether the current user role meets the requirements of the system call for the role. If it does, it can continue to execute. If not, it returns the system call and returns an error message.
在本发明的一种具体实施方式中,判断对某文件的访问是否符合角色要求的方法,包括:In a specific embodiment of the present invention, a method for determining whether access to a file meets a role requirement includes:
在文件管理结构节点里添上可操作的角色类型,访问文件时,判断文件管理结构节点中的角色类型是否与当前角色类型一致,如一致,可访问,如不一致,返回错误信息。Add an operable role type to the file management structure node. When accessing the file, determine whether the role type in the file management structure node is consistent with the current role type. If the role type is consistent, it can be accessed. If it is inconsistent, an error message is returned.
实施例8:Example 8:
一种通过特定进程间通信的方式完成使用者的进程、服务维护者的进程及管理员的进程交互的实施方式,其中管理员可为硬件管理员或用户管理员,具体方式为:An implementation manner in which a user's process, a service maintainer's process, and an administrator's process interaction are completed through a specific inter-process communication method, wherein the administrator can be a hardware administrator or a user administrator, and the specific methods are:
操作系统提供一个应用程序“系统服务界面输入进程”,供使用者执行,程序的功能是接收用户提出的服务请求,这个程序被使用者角色的用户创建,进程所属用户为创建它的用户,所有使用者都可以执行这个程序,两个用户同时执行这个程序,创建两个进程,其所属用户分别是创建进程的用户。如图2中步骤1。The operating system provides an application program "system service interface input process" for users to execute. The function of the program is to receive service requests from users. This program is created by users in the user role. The user of the process is the user who created it. Users can execute this program. Two users execute this program at the same time to create two processes, and their users are the users who created the processes. See step 1 in Figure 2.
操作系统提供一个“系统服务驻留进程”,在开机时由内核创建,其所属用户为服务维护者角色用户,常驻内存。这个进程与“系统服务界面输入进程”进行进程间通讯,负责收集用户的请求,并与完成该请求对应的服务程序进行通讯,当“系统功能处理进程”没有被创建时,由驻留进程负责创建,其所属的用户的角色为管理员。如图2中步骤2、3。The operating system provides a "system service resident process", which is created by the kernel at boot time, and its user is a service maintainer role user and is resident in memory. This process communicates with the "system service interface input process" and is responsible for collecting user requests and communicating with the service program that completes the request. When the "system function processing process" has not been created, the resident process is responsible for Created, the role of the user belongs to administrator. See steps 2 and 3 in Figure 2.
“系统功能处理进程”从“系统服务驻留进程”中获得用户提交的请求和参数,进行判断和处理,向内核发起系统调用完成该功能。这些功能需用到的系统调用通常被设置为只有管理员角色所属的进程才能使用。如图2中步骤4、5。The "system function processing process" obtains the request and parameters submitted by the user from the "system service resident process", performs judgment and processing, and initiates a system call to the kernel to complete the function. The system calls required for these functions are usually set to be used only by the process to which the administrator role belongs. See steps 4 and 5 in Figure 2.
系统服务完成工作之后,通过进程间通讯向驻留程序返回处理结果信息,再由驻留程序通过进程间通讯向使用者的应用程序返回处理结果信息。如图2中步骤6、7、8、9。After the system service completes the work, it returns the processing result information to the resident program through inter-process communication, and then the resident program returns the processing result information to the user's application program through inter-process communication. As shown in steps 2, 7, 8, 9 in FIG.
实施例9:Example 9:
一种用户管理员角色用户和使用者角色用户、服务维护者角色用户、硬件管理员角色进行交互的实施方式是:An implementation manner in which a user administrator role user interacts with a user role user, a service maintainer role user, and a hardware administrator role is:
用户的权力是通过进程来行使的。当用户创建第一个进程时,由于此时用户还未登录完成,因此该用户第一个进程的创建不是由这个用户的进程创建的,而是登录程序创建的。登录程序对应的进程属于用户管理员角色的用户,如登录的实际用户是使用者角色用户,当他通过登录程序登录时,登录程序为这个用户创建一个shell进程:具体方式为,增加一个特殊的创建进程的系统调用接口,由登录程序调用该接口,该接口在创建进程时,可同时指定该进程所属的用户、用户角色,这个接口仅供用户管理员角色使用。在创建shell程序的过程中,将当前用户切换到登录的用户,一旦shell程序创建完毕,返回到shell程序的用户态,此时的用户已经是刚才登录的用户,该用户继续通过shell创建其他进程时,当前用户不发生变化,所述其他进程自然属于当前用户。如果进程切换,同时切换当前用户为该进程所对应的用户。User power is exercised through processes. When the user creates the first process, because the user is not yet logged in at this time, the creation of the user's first process is not created by the user's process, but by the login program. The process corresponding to the login program belongs to the user in the user administrator role. For example, if the actual user logged in is the user role user, when he logs in through the login program, the login program creates a shell process for the user: the specific method is to add a special The system call interface for creating a process is called by the login program. When creating a process, the interface can specify the user and user role to which the process belongs. This interface is only used by the user administrator role. In the process of creating a shell program, switch the current user to the logged-in user. Once the shell program is created, return to the user mode of the shell program. At this time, the user is already the user who just logged in. The user continues to create other processes through the shell. At this time, the current user does not change, and the other processes naturally belong to the current user. If the process is switched, the current user is also the user corresponding to the process.
进一步的,为了更方便用户创建进程以及和现有体系兼容。一旦用户的第一个进程创建完毕,该用户的进程的权力传递就开始了。此后的进程都由该用户的进程创建,权力全都由这个用户而来。子进程可与父进程共享资源,子进程的权力来源由其所属用户而定。Further, in order to make it easier for users to create processes and to be compatible with existing systems. Once the user's first process is created, power transfer for that user's process begins. Subsequent processes are created by the user's processes, and all power comes from this user. The child process can share resources with the parent process, and the power source of the child process is determined by the user to which it belongs.
如果登录的用户是硬件管理员角色或服务维护者角色的用户或其他角色的 用户,具体方式和为使用者角色用户创建shell进程的方式一致。If the logged-in user is a user in the hardware administrator role or service maintainer role or a user in another role, the specific method is the same as the method for creating a shell process for the user role user.
实施例10:使用者设定程序和管理员程序的配合Embodiment 10: Cooperation between a user setting program and an administrator program
有一些用户自身的私人设定,实际操作与权力维护或者硬件管理相关,例如,用户想要修改自己的密码,或者是修改自己的桌面、电源选项、鼠标设定等等。这一类操作,发起方在使用者,而最终数据的维护者是用户管理员或硬件管理员。如果由用户自行修改相当于给了用户管理员的权力,如果全部由管理员操作进行又使得用户的使用感很僵硬。Some users have their own personal settings. The actual operation is related to power maintenance or hardware management. For example, users want to change their passwords, or modify their desktops, power options, mouse settings, and so on. In this type of operation, the initiator is the user, and the maintainer of the final data is the user administrator or hardware administrator. If the modification is performed by the user, it is equivalent to giving the administrator the power, and if all operations are performed by the administrator, the user's sense of use is very rigid.
针对这种情况,我们对每类修改需求提供两套应用程序,一套是开放给使用者的,使用者利用它来提交自己的请求,通过应用程序限定用户的操作在一个合理的范围内;一套是管理员的程序,可以驻留内存,或者需要的时候被系统启动,它接收用户程序的请求数据,并审核数据是否和合法,如果合法,在后台自动完成用户的请求,否则,产生异常。In response to this situation, we provide two sets of applications for each type of modification requirements, one set is open to users, users use it to submit their own requests, and limit the user's operation within a reasonable range through the application; One is an administrator program, which can reside in memory or be started by the system when needed. It receives the user program's request data and checks whether the data is valid. If it is valid, the user's request is automatically completed in the background. Otherwise, it generates abnormal.
这样,就把这类的维护工作分别交由两种管理员角色的用户来执行,其中管理员的执行是后台服务程序自动执行的。既没有把权力下放给使用者,也不需要一个生物的人来替使用者操作修改说明。In this way, this kind of maintenance work is handed over to the users of the two administrator roles, and the administrator's execution is automatically performed by the background service program. It neither delegates authority to the user, nor does it need a biological person to modify the instructions for the user.
如果是一些必须由一个实际的“管理员”来决定是否可行的事情,就必须有一个管理员角色的用户打开属于管理员的程序,独立完成操作。比如添加一个用户,这样的操作需要人来识别是否可行,就不能由一个使用者提出申请,管理员默认允许执行并替其操作,必须由管理员亲自完整的执行整个过程。If it is something that must be determined by an actual "administrator", a user with the administrator role must open the program that belongs to the administrator and complete the operation independently. For example, adding a user, such an operation requires humans to identify whether it is feasible, an application cannot be submitted by a user, the administrator is allowed to perform the operation by default, and the administrator must perform the entire process in person.
实施例11:在MSU机制下加载动态链接库,在动态链接库的MSU信息中保存动态链接库文件所属用户ID及用户类型Embodiment 11: Load a dynamic link library under the MSU mechanism, and store the user ID and user type of the dynamic link library file in the MSU information of the dynamic link library
在有MSU机制支持的情况下,当加载动态链接库时,动态链接库中的指令和数据存入与原有进程不同的MSU,这些MSU的属性信息中记录的用户ID和用户角色类型,为该动态链接库文件所属的用户和用户类型。当CPU执行原有 进程时,当前用户ID和用户角色为进程所属用户的ID和角色,当调用动态链接库的MSU时,切换MSU会导致当前用户ID和用户角色变为目标MSU信息中的用户ID和用户角色。With the support of the MSU mechanism, when loading the dynamic link library, the instructions and data in the dynamic link library are stored in an MSU different from the original process. The user ID and user role type recorded in the attribute information of these MSUs are The user and user type to which the dynamic link library file belongs. When the CPU executes the original process, the current user ID and user role are the ID and role of the user to which the process belongs. When the MSU of the dynamic link library is called, switching the MSU will cause the current user ID and user role to become the user in the target MSU information ID and user role.
对用户角色的权能范围进行判断时,依据当前用户ID和用户角色进行。When judging the functional scope of a user role, it is performed based on the current user ID and user role.
实施例12:Example 12:
一种现有体系下通过软件指令进行访问控制的MSU制作方法及针对该方法的访问控制应用方式:An MSU manufacturing method for access control through software instructions under the existing system and an access control application method for the method:
A1内存系统装置的制作,具体包括:The production of A1 memory system device includes:
A1-1制作MSU信息记录单元:A1-1 Production of MSU information recording unit:
建立以下数据:Create the following data:
当前MSU的ID;MSU控制对照表;端口匹配表;指向MSU控制对照表的指针变量;指向端口匹配表的指针变量;用以记录MSU栈底地址值的变量。Current MSU ID; MSU control comparison table; port matching table; pointer variable pointing to MSU control comparison table; pointer variable pointing to port matching table; variable used to record the address value of the bottom of the MSU stack.
所述MSU控制对照表的信息包括:所有MSU的信息,具体包括:MSU的ID号、MSU的边界信息、属性信息、端口信息、生效/失效信息。优选的,还包括MSU所属用户类型信息,MSU所属用户标识信息。The information of the MSU control comparison table includes all MSU information, and specifically includes: MSU ID number, MSU boundary information, attribute information, port information, and validity / invalidation information. Preferably, it also includes information about the type of user to which the MSU belongs, and user identification information to which the MSU belongs.
所述MSU边界信息,包括:指令区边界信息、全局数据区边界信息、堆区边界信息。The MSU boundary information includes: instruction area boundary information, global data area boundary information, and heap area boundary information.
所述MSU端口信息包括:MSU的出口信息和MSU的入口信;The MSU port information includes: MSU exit information and MSU entry letter;
所述MSU的出口信息,包括:其所属的MSU的ID、出口号、出口地址值;所述MSU的入口信息,包括:其所属的MSU的ID、入口号、入口地址值;The exit information of the MSU includes the ID, exit number, and exit address value of the MSU to which it belongs; the entrance information of the MSU includes the ID, entry number, and entry address value of the MSU to which it belongs;
所述端口匹配表,包括:一对有MSU间调用关系的出口和入口。The port matching table includes a pair of exits and entries having a calling relationship between MSUs.
在每个MSU的数据区,设置:指向MSU控制对照表的指针变量;指向端口匹配表的指针变量;记录MSU栈底地址值的变量。In the data area of each MSU, set: a pointer variable pointing to the MSU control comparison table; a pointer variable pointing to the port matching table; a variable that records the address value of the bottom of the MSU stack.
在每个MSU数据区的线性地址空间中,以页对齐的方式预留一段空间,空间大小为页大小的整数倍,将控制对照表设置于其中,其它数据不存入其中。In the linear address space of each MSU data area, a space is reserved in a page-aligned manner, and the space size is an integer multiple of the page size. The control lookup table is set therein, and other data is not stored therein.
A1-2制作访问控制单元A1-2 Making an access control unit
在本制作方法中:MSU访问控制逻辑靠软件指令进行控制,具体包括:In this production method: MSU access control logic is controlled by software instructions, which specifically include:
●获取当前MSU栈底地址值:● Get the current MSU stack address value:
添加指令的逻辑是:在MSU间调用的参数传递指令前,获取栈顶地址值,并将此地址值压入栈中,此地址值作为目标MSU的栈底地址值;调用进目标MSU后,在其指令的起始位置,获取栈中传递的上述地址值,保存到用于记录当前MSU栈底地址值的变量中。The logic of adding instructions is: before the parameter transfer instruction called between MSUs, obtain the top address of the stack, and push this address value into the stack, this address value is used as the bottom MSU address value; At the beginning of its instruction, the above address value passed in the stack is obtained and saved to a variable used to record the current address value of the bottom of the MSU stack.
●添加检查指令用以判定数据访问是否超出MSU边界:● Added check instructions to determine whether data access exceeds MSU boundaries:
由于对于非指针变量,可以在编译阶段明确访问地址,所以一种优选的方案是,运行时不再对它们进行边界判断,只需对数据指针进行边界检查,具体方式:在访问数据指针对应的指令之前,添加判断逻辑,来进行访问的边界检查,具体包括:Because non-pointer variables can be explicitly accessed at the compilation stage, a preferred solution is that they no longer perform boundary judgment on the runtime, and only need to perform a boundary check on the data pointer. The specific method is to access the corresponding data pointer. Before the instruction, add judgment logic to check the boundary of the access, including:
步骤1:如果访问的最终目标地址处于当前MSU的全局数据区,或堆区,或处于栈区中当前MSU对应的区域内,跳转到步骤2,否则跳转到步骤3;Step 1: If the final destination address of the access is in the global data area of the current MSU, or in the heap area, or in the area corresponding to the current MSU in the stack area, skip to step 2, otherwise skip to step 3;
步骤2:执行数据访问指令,跳转到步骤4;Step 2: execute the data access instruction, skip to step 4;
步骤3:进入异常处理流程;Step 3: Enter the exception processing flow;
步骤4:执行下一条指令Step 4: Execute the next instruction
●添加检查指令用以判断MSU内间接转移指令的目标地址是否超出MSU边界:● Added a check instruction to determine whether the target address of an indirect transfer instruction in the MSU exceeds the MSU boundary:
由于对于MSU内的直接转移指令,可以在编译阶段明确转移目标地址,所以一种优选的方案是,运行时不再对它们进行边界判断,只需对MSU内间接转移指令的目标地址进行边界检查,具体方式:在MSU内间接转移指令之前,添加判断逻辑,来进行访问的边界检查,具体包括:Since direct transfer instructions in the MSU can explicitly transfer target addresses during the compilation phase, a preferred solution is to no longer perform boundary judgment on them at runtime, and only need to perform boundary checks on the target addresses of the indirect transfer instructions in the MSU. Specific method: Before the indirect transfer instruction in the MSU, add judgment logic to check the boundary of the access, including:
步骤1:如果访问的最终目标地址处于当前MSU的指令区内,跳转到步骤2,否则跳转到步骤3;Step 1: If the accessed final destination address is in the instruction area of the current MSU, skip to step 2; otherwise, skip to step 3;
步骤2:执行MSU内间接转移指令,跳转到步骤4;Step 2: execute the indirect transfer instruction in the MSU, and go to step 4;
步骤3:进入异常处理流程;Step 3: Enter the exception processing flow;
步骤4:执行下一条指令Step 4: Execute the next instruction
●MSU属性匹配检查:● MSU attribute matching check:
根据编译器和链接器,将MSU间调用指令所在地址信息和目标地址信息予 以记载,并体现到检查指令中。According to the compiler and linker, the address information and target address information of the call instructions between MSUs are recorded and reflected in the check instructions.
根据MSU间调用指令的目标地址值和所有MSU的边界信息,确定目标MSU,并进一步用当前MSU的属性和目标MSU的属性做比对,如果属性匹配符合发明内容中记载的MSU属性匹配规则,再进行端口匹配检查,否则,进入异常处理流程。Determine the target MSU according to the target address value of the call instruction between MSUs and the boundary information of all MSUs, and further compare the attributes of the current MSU with the attributes of the target MSU. If the attribute matches the MSU attribute matching rules recorded in the content of the invention, Then perform port matching check, otherwise, enter exception processing flow.
●MSU端口匹配检查:● MSU port matching check:
端口检查的目的是:检查当前MSU调用、返回是否与预期的MSU间调用、返回一致,防止改变MSU间执行序。具体方式是:1,在MSU间调用前,检查当前调用指令的地址值与目标地址是否记录在端口匹配表中。2,在MSU间返回时,一个返回指令,可能对应多个合法的返回地址,如果进行出入口的匹配检查,可能导致执行效率降低,一种优选的方案是:在返回时,仅检查返回指令是否为合法的出口。The purpose of the port check is to check whether the current MSU call and return are consistent with the expected inter-MSU call and return to prevent changing the execution order between MSUs. The specific method is: 1. Before calling between MSUs, check whether the address value of the current calling instruction and the target address are recorded in the port matching table. 2. When returning between MSUs, one return instruction may correspond to multiple legal return addresses. If the entry and exit match check is performed, execution efficiency may be reduced. A preferred solution is to check only the return instruction when returning. For legal export.
在MSU间调用指令前添加逻辑如下:Add logic before calling instructions between MSUs as follows:
通过MSU间调用指令所在地址值,在端口匹配表中找到相应的出口,通过此出口,确定其匹配的入口;再判断MSU间调用指令目标地址值,是否与该入口地址值一致,如果一致,允许MSU间调用指令执行,否则,进入异常处理流程。According to the address value of the call instruction between MSUs, find the corresponding exit in the port matching table, and determine the matching entry through this exit; then determine whether the target address value of the call instruction between MSUs is consistent with the entry address value, if they are the same, Allow MSU to call instructions for execution, otherwise, enter exception processing flow.
在MSU间返回指令前添加逻辑如下:通过MSU间返回指令所在地址值,在当MSU控制对照表中找相应的出口,如果能够找到,说明这是一个合法的出口,允许MSU间返回指令执行,否则,进入异常处理流程。Add the logic before the return instruction between MSUs as follows: According to the address value of the return instruction between MSUs, find the corresponding exit in the MSU control comparison table. If it can be found, it means that this is a legal exit, allowing the return instruction between MSUs to execute Otherwise, enter the exception processing flow.
●对MSU中非转移指令和内部直接转移指令的检查:● Inspection of non-transfer instructions and internal direct transfer instructions in MSU:
对于非转移指令,可通过编译确定其在所属MSU的区域范围内;对于内部直接转移指令,也可在编译阶段确保其目标地址在MSU的区域范围内。通过将指令区所在页面设置为只读,可保证指令在运行时不会被更改,为了提高执行效率,一种优选的方案是:依靠编译阶段保证其正确性,在运行时阶段不再对其进行检查。For non-branch instructions, they can be determined to be within the MSU area by compiling. For internal direct branch instructions, the target address can also be ensured to be within the MSU area during the compilation phase. By setting the page where the instruction area is set to read-only, it can be guaranteed that the instruction will not be changed at runtime. In order to improve the execution efficiency, a preferred solution is to rely on the compilation stage to ensure its correctness, and no longer modify it at runtime. Check.
●对IO指令的检查:● Inspection of IO instructions:
从语法树生成汇编指令时,在所有指定的IO指令前增加判断逻辑:判断当前MSU的类型是否为IO指令类型的MSU,如是,可继续执行,如不是,则报 出异常。When generating assembly instructions from the syntax tree, add judgment logic before all specified IO instructions: determine whether the current MSU type is an IO instruction type MSU. If so, continue execution, and if not, report an exception.
不论IO指令是高级代码生成还是直接嵌入的汇编,都需进行此操作,确保可执行程序中所有的IO指令前都包含此检查逻辑。This operation is required whether the IO instructions are advanced code generation or directly embedded assembly, to ensure that all IO instructions in the executable program include this check logic before.
所述IO指令为直接对外设进行读写的特殊指令,不同体系的CPU的IO指令各不相同,以实际为准,如INTEL体系下in、out指令。The IO instruction is a special instruction that directly reads and writes to peripheral devices. The IO instructions of CPUs in different systems are different, and the actual conditions prevail, such as the in and out instructions under the INTEL system.
针对该种内存系统装置制作方式的访问控制应用方式,包括:Access control application methods for manufacturing methods of such memory system devices include:
B1编译包含MSU的源程序,具体包括:B1 compiles the source program containing MSU, including:
B1-1、提取MSU信息,具体包括:B1-1. Extract MSU information, including:
B1-1-1:编写、编译包含MSU信息的源程序:B1-1-1: Write and compile source programs containing MSU information:
●一种增设语法规则的方式表达MSU信息● A way to add grammar rules to express MSU information
增设语法规则,使编程阶段完成准确保留程序设计中MSU信息,为了兼容性,本规则在C语言的基础上,增设如下语法规则:Add grammar rules to ensure that the MSU information in the program design is accurately retained during the programming phase. For compatibility, this rule adds the following grammar rules based on the C language:
Figure PCTCN2019086496-appb-000003
Figure PCTCN2019086496-appb-000003
Figure PCTCN2019086496-appb-000004
Figure PCTCN2019086496-appb-000004
其中MSU类型代表MSU的属性:common_msu代表普通MSU、check_msu代表检查MSU、terminal_msu代表终端MSU、nothing_msu代表空端口MSU、share_msu代表共享数据MSU。当MSU类型为空端口MSU时,不需要定义函数的访问标识符。The MSU type represents the attributes of MSU: common_msu represents ordinary MSU, check_msu represents check MSU, terminal_msu represents terminal MSU, nothing_msu represents empty port MSU, and share_msu represents shared data MSU. When the MSU type is an empty port MSU, you do not need to define the access identifier of the function.
MSU名代表MSU的标识信息;一对{}里面的数据和函数,从属于同一个 MSU。The MSU name represents the identification information of the MSU; the data and functions in a pair of {} belong to the same MSU.
由inner这个访问标识符标识的函数为MSU空端口函数;The function identified by the inner access identifier is the MSU empty port function;
由port这个访问标识符标识的函数为MSU端口函数;The function identified by the port access identifier is an MSU port function;
生效/失效位,记录着MSU是否可用,1代表生效,0代表失效。Validation / deactivation bit, which records whether the MSU is available. 1 means valid, 0 means invalid.
共享数据MSU中只允许定义数据。Only data can be defined in shared data MSU.
指针区域类型:data标识的指针为全局数据区指针;stack标识的指针为栈区指针;heap标识的指针为堆区指针;如果指针定义前不添加指针区域类型标识符,则默认指针为全局数据区指针。Pointer area type: The pointer identified by data is the global data area pointer; the pointer identified by stack is the pointer of the stack area; the pointer identified by heap is the pointer of the heap area; if the pointer area type identifier is not added before the pointer definition, the default pointer is global data Area pointer.
编译器通过增设语法规则,识别出程序中保留的MSU信息,把信息保存在语法树上。供后续步骤使用。The compiler recognizes the MSU information retained in the program by adding syntax rules and saves the information in the syntax tree. For subsequent steps.
编译器进行语法分析时,可通过上述规则分别认定程序中与MSU相关的信息,最终生成语法树、保存MSU信息,其余语法的编译技术与现有技术相同。When the compiler performs syntax analysis, the above rules can be used to identify the information related to the MSU in the program, and finally generate a syntax tree and save the MSU information. The remaining syntax compiling technology is the same as the existing technology.
B1-1-2:内存布局及编址方式B1-1-2: Memory layout and addressing
把属于同一MSU的指令和数据,以页对齐的形式,分别密排链接,指令保存在指令区、数据保存在数据区。所有MSU在同一线性地址空间内,以同一个基址进行统一编址。Instructions and data belonging to the same MSU are page-aligned and closely linked separately. Instructions are stored in the instruction area and data are stored in the data area. All MSUs are uniformly addressed with the same base address in the same linear address space.
B1-1-3:提取并保存MSU信息:B1-1-3: Extract and save MSU information:
在编译链接阶段,为每个MSU建立以下数据,存储在MSU的数据区:During the compilation and linking phase, the following data is established for each MSU and stored in the data area of the MSU:
当前MSU的ID;MSU控制对照表;端口匹配表;指向MSU控制对照表的指针变量;指向端口匹配表的指针变量;用以记录MSU栈底地址值的变量。Current MSU ID; MSU control comparison table; port matching table; pointer variable pointing to MSU control comparison table; pointer variable pointing to port matching table; variable used to record the address value of the bottom of the MSU stack.
所述当前MSU的ID,保存当前MSU正在运行的MSU的ID值,用以在MSU控制对照表中找到当前正在运行的MSU的信息。The ID of the current MSU stores the ID value of the currently running MSU, and is used to find information of the currently running MSU in the MSU control comparison table.
所述MSU控制对照表的信息包括:所有MSU的信息,具体包括:MSU的ID号、MSU的边界信息、属性信息、端口信息、生效/失效信息。优选的,还包括MSU所属用户类型信息,MSU所属用户标识信息。表中:The information of the MSU control comparison table includes all MSU information, and specifically includes: MSU ID number, MSU boundary information, attribute information, port information, and validity / invalidation information. Preferably, it also includes information about the type of user to which the MSU belongs, and user identification information to which the MSU belongs. In the table:
所述MSU的ID号,通过语法树中保存的不同MSU名生成;The MSU ID number is generated by different MSU names stored in the syntax tree;
所述MSU边界信息,包括:指令区边界信息、全局数据区边界信息、堆区 边界信息。对于指令区边界信息、全局数据区边界信息,可以通过统计编译生成的指令和全局数据占用空间大小来确定。对于堆区边界信息,由于编译时无法确定需要建立的堆区大小,可以在对照表中先预留表项,等到运行时需要堆区的时候再临时添加信息;The MSU boundary information includes: instruction area boundary information, global data area boundary information, and heap area boundary information. The instruction area boundary information and global data area boundary information can be determined by statistically compiling the generated instructions and the global data footprint. For heap area boundary information, because the size of the heap area that needs to be established cannot be determined at compile time, you can reserve an entry in the comparison table and temporarily add information when the heap area is needed at runtime;
所述MSU属性信息,可以根据语法树中记录的MSU类型信息来设定;The MSU attribute information may be set according to the MSU type information recorded in the syntax tree;
所述MSU端口信息包括:MSU的出口信息和MSU的入口信;The MSU port information includes: MSU exit information and MSU entry letter;
所述MSU的出口信息,包括:其所属的MSU的ID、出口号、出口地址值;其中出口号为每一个出口的唯一编号,出口地址值为MSU间调用/返回指令所在地址值;The exit information of the MSU includes the ID, exit number, and exit address value of the MSU to which it belongs; where the exit number is a unique number for each exit, and the exit address value is the address value of the call / return instruction between MSUs;
所述MSU的入口信息,包括:其所属的MSU的ID、入口号、入口地址值;其中入口号为每一个入口的唯一编号,入口地址值为MSU间调用指令的下一条指令地址值,以及端口函数的第一条指令的地址值;The MSU entry information includes the ID, entry number, and entry address value of the MSU to which it belongs; where the entry number is a unique number for each entry, and the entry address value is the next instruction address value of the call instruction between MSUs, and The address value of the first instruction of the port function;
所述生效/失效信息,通过语法树节点中记录的生效/失效标记设置。The validity / invalidation information is set by the validity / invalidation flag recorded in the syntax tree node.
所述端口匹配表,为本MSU调用其它MSU的调用关系集合。其中一个表项,包括:一对有MSU间调用关系的出口和入口。The port matching table is a set of call relationships for the MSU to call other MSUs. One of the entries includes a pair of exits and entries that have a call relationship between MSUs.
所述指向MSU控制对照表的指针变量,用于在检查指令中,访问MSU控制对照表。The pointer variable pointing to the MSU control comparison table is used to access the MSU control comparison table in the inspection instruction.
所述指向端口匹配表的指针变量,用于在检查指令中,访问端口匹配表。The pointer variable pointing to the port matching table is used to access the port matching table in a check instruction.
所述用以记录MSU栈底地址值的变量,用于在检查指令中,控制当前MSU的栈区访问边界。此变量的初始值为对应特权级的栈的栈底地址值。The variable used to record the address value of the bottom of the MSU stack is used to control the access boundary of the stack area of the current MSU in the check instruction. The initial value of this variable is the stack bottom address value of the corresponding privileged stack.
在每个MSU数据区的线性地址空间中,以页对齐的方式预留一段空间,空间大小为页大小的整数倍,将控制对照表设置于其中,其它数据不可存入其中,并保存到可执行文件内。In the linear address space of each MSU data area, a piece of space is reserved in page alignment. The size of the space is an integer multiple of the page size. The control table is set in it, and other data cannot be stored in it. Within the execution file.
B1-2限定MSU语法访问规则:B1-2 restricts MSU syntax access rules:
编译器分析语法树中记载的信息,对不符合MSU访问规则的代码不予生成可执行程序,如符合,进入后续的生成汇编代码、链接的流程。The compiler analyzes the information recorded in the syntax tree, and does not generate executable programs for code that does not comply with the MSU access rules. If it does, it enters the subsequent process of generating assembly code and linking.
B1-3生成与MSU访问相关的指令:B1-3 generates instructions related to MSU access:
生成的MSU间调用访问转移指令为:call目标地址值。MSU间调用时,不允许通过call指令进行间接转移。The inter-MSU call access transfer instruction is: call target address value. When calling between MSUs, indirect transfer by call instruction is not allowed.
生成的MSU间返回访问转移指令为:ret。The inter-MSU return access transfer instruction is: ret.
访问本MSU全局数据、堆数据的指令与访问栈数据的指令一致。The instructions for accessing global MSU and heap data are consistent with the instructions for accessing stack data.
B2运行时阶段对MSU信息的处理B2 processing of MSU information during runtime
创建进程时,为每个MSU申请独立的页面,用以加载上述用于边界访问控制的数据,根据进程的用户ID、用户角色类型,设置MSU属性中的MSU所属用户标识信息、MSU所属用户类型信息,页面中不能存在其它内容,为了保证数据的安全,一种优选的方案是:加载后将页面设置为只读,在需要修改这些数据时,关闭只读,修改完成后,再重新设置为只读。When creating a process, apply for a separate page for each MSU to load the above-mentioned data for boundary access control. According to the user ID and user role type of the process, set the MSU user ID information and MSU user type in the MSU attribute. Information, there can be no other content in the page. In order to ensure the security of the data, a preferred solution is to set the page to read-only after loading. When you need to modify the data, turn off the read-only. After the modification is completed, set it back to Read-only.
创建进程时,由操作系统为进程分配栈区域,一种优选的方案是:栈的大小被设置为实际适用的大小,而非整个线性地址空间的大小,代表栈的共享数据MSU的边界设置为与栈的边界相同。When creating a process, the operating system allocates a stack area for the process. A preferred solution is to set the size of the stack to the actual applicable size, rather than the size of the entire linear address space. The boundary of the shared data MSU representing the stack is set to Same boundary as the stack.
如果操作系统加载程序时,MSU的内存分配布局,与编译链接时,确定的用于边界访问控制的数据不同,则需将该数据改为与实际相符。If the memory allocation layout of the MSU when the operating system loads the program is different from the data determined for boundary access control when compiling and linking, the data needs to be changed to be consistent with the actual.
MSU中程序执行时,如果需要申请/释放堆空间,则通过专用系统调用进入内核,由内核中专用程序为其申请/释放堆空间,并相应修改MSU控制对照表中堆区域边界值。When the program in the MSU is executed, if it needs to request / release heap space, it enters the kernel through a dedicated system call, and the dedicated program in the kernel requests / releases heap space for it, and the heap area boundary value in the MSU control comparison table is modified accordingly.
MSU中程序执行时,如果需要添加/删除MSU,则通过专用系统调用进入内核,由内核中专用程序为其添加/删除MSU,并修改相应用于边界访问控制的数据。When the program in the MSU is executed, if it is necessary to add / remove the MSU, it enters the kernel through a dedicated system call, and the dedicated program in the kernel adds / removes the MSU for it, and modifies the corresponding data for boundary access control.

Claims (15)

  1. 一种安全用户架构,其特征在于,包括:设置多种用户角色,限定每种角色的用户的权能集合,每种角色都不拥有全权;设置针对进程权能集合进行控制的集合,保证角色的用户的权能集合在运行时不被突破,所述进程权能集合是指该进程所属的用户的权能集合。A secure user architecture, which includes: setting multiple user roles, limiting the set of capabilities of users in each role, each role does not have full power; setting a set of controls for process capability sets, and ensuring role users The capability set of is not broken at runtime. The process capability set refers to the capability set of the user to which the process belongs.
  2. 根据权利要求1所述的安全用户架构,其特征在于:所述用户角色是指:The secure user architecture according to claim 1, wherein the user role refers to:
    将计算机用户分为不同种类,每个种类称为一种角色,每种角色有自己的最大权能范围;Computer users are divided into different categories, each category is called a role, and each role has its own maximum range of power;
    每个用户都属于且只能属于一种具体的角色,每个用户的权能范围不能超越其所属角色的权能范围。Each user belongs to and can only belong to a specific role, and the range of capabilities of each user cannot exceed the range of capabilities of the role to which they belong.
  3. 根据权利要求1-2之一所述的安全用户架构,其特征在于:The secure user architecture according to any one of claims 1-2, wherein:
    所述用户的权能集合是指:用户的权力和能力的集合;所述能力是属于该用户的进程包含的功能及有权使内核支持其进行的行为的范围;所述权力是指属于该用户的进程的能力可操作的对象的范围;The set of capabilities of a user refers to: the set of powers and capabilities of the user; the capabilities are the scope of functions that belong to the user's process and the scope of the right to enable the kernel to support its actions; the power refers to the user The scope of the process's operable objects;
    所述全权是指一种包含了当前系统中出现的全部能力和权力的权限。The full power refers to a right that includes all the capabilities and powers present in the current system.
  4. 根据权利要求1-3之一所述的安全用户架构,其特征在于:所述针对进程权能集合进行控制的集合,包括:The secure user architecture according to any one of claims 1-3, wherein the set for controlling the process capability set comprises:
    操作系统为不同角色各自设立其可操作的行为及可操作的对象范围;在进程执行过程中,对进程的操作进行判断,判断其行为是否在其对应用户的角色权能范围之内。The operating system establishes operable behaviors and operable object ranges for different roles. During the process execution process, the operation of the process is judged to determine whether its behavior is within the scope of its corresponding user's role capabilities.
  5. 根据权利要求1-4之一所述的安全用户架构,其特征在于:所述用户角色按照用户类型进行划分,包括:使用者角色和维护者角色;The secure user architecture according to any one of claims 1-4, wherein the user roles are divided according to user types, including: user roles and maintainer roles;
    所述使用者角色对应的用户类型的目的是利用计算机完成自己的应用需求,使用目标是计算机上的应用软件;The purpose of the user type corresponding to the user role is to use a computer to complete its own application requirements, and the use target is application software on the computer;
    所述维护者角色所对应的用户类型的目的是维护计算机的正常使用,对计算机进行维护和管理,以支持所述使用者可以正常、方便的使用计算机。The purpose of the user type corresponding to the maintainer role is to maintain the normal use of the computer, and to maintain and manage the computer to support that the user can use the computer normally and conveniently.
  6. 根据权利要求5所述的安全用户架构,其特征在于:所述维护者角色可以分为服务维护者和计算机自身维护者。The secure user architecture according to claim 5, wherein the maintainer role can be divided into a service maintainer and a computer maintainer.
  7. 根据权利要求6所述的安全用户架构,其特征在于:所述计算机自身维护者进一步分为硬件管理员、权力管理员、异常情况管理员。The secure user architecture according to claim 6, wherein the maintainer of the computer is further divided into a hardware administrator, a power administrator, and an abnormal situation administrator.
  8. 根据权利要求5所述的安全用户架构,其特征在于:对于所述使用者角色,仅可访问使用者文件管理结构的根节点以下的文件,内核不支持使用者调用仅可被维护者使用的系统调用。The secure user architecture according to claim 5, characterized in that: for the user role, only files below the root node of the user file management structure can be accessed, and the kernel does not support users to call files that can only be used by the maintainer System call.
  9. 根据权利要求6所述的安全用户架构,其特征在于:对于所述服务维护者,仅可访问服务维护者文件管理结构的根节点以下的文件,内核不支持服务维护者使用仅供用户管理员、硬件管理员、异常情况管理员使用的系统调用。The secure user architecture according to claim 6, wherein for the service maintainer, only the files below the root node of the service maintainer's file management structure can be accessed, and the kernel does not support the use of the service maintainer for user administrators only , Hardware administrators, system calls used by exception administrators.
  10. 根据权利要求7-9之一所述的安全用户架构,其特征在于:The secure user architecture according to any one of claims 7-9, wherein:
    对于所述用户管理员,仅可访问用户管理员文件管理结构的根节点以下的文件,包括:用户登录程序、用户管理程序等用于对用户权力进行管理的应用程序和与其配合的文件等;内核中用于进行与用户管理相关的系统调用,仅供用户管理员角色的用户使用;仅可执行系统为其预设的应用程序,不可以自己添加、修改、删除这些应用程序;For the user administrator, only files below the root node of the user administrator's file management structure can be accessed, including: user login programs, user management programs, and other applications used to manage user rights and files that cooperate with them; The kernel is used to make system calls related to user management, and is only used by users in the user administrator role; only the applications preset by the system can be executed, and these applications cannot be added, modified, or deleted by themselves;
  11. 根据权利要求7-10之一所述的安全用户架构,其特征在于:The secure user architecture according to any one of claims 7 to 10, wherein:
    对于所述硬件管理员,仅可访问硬件管理员文件管理结构的根节点以下的文件,包括:添加删除驱动的管理程序、磁盘管理程序等对系统硬件进行管理的应用程序和与其配合的文件等;内核中用于进行与硬件管理相关的系统调用,仅供硬件管理员角色的用户使用;硬件管理员仅可执行系统为其预设的应用程 序,不可以自己添加、修改、删除这些应用程序。For the hardware administrator, only the files below the root node of the hardware administrator's file management structure can be accessed, including: adding and removing driver management programs, disk management programs, and other applications that manage system hardware and files that cooperate with them ; The kernel is used to make system calls related to hardware management, and is only used by users with the role of hardware administrator; the hardware administrator can only execute applications preset for the system, and cannot add, modify, or delete these applications by itself .
  12. 根据权利要求1-11之一所述的安全用户架构,其特征在于:设置一种由不同角色的进程接续完成一个用户操作的方式:当使用者的权力无法满足使用者的请求,需由服务维护者角色的用户及其程序协助完成时,由使用者的应用程序向服务维护者的维护程序提出特定格式的申请,维护程序处理完毕后将处理结果返回给使用者的应用程序。The secure user architecture according to any one of claims 1-11, characterized in that: a method for successively completing a user operation by processes of different roles is provided: when a user's power cannot satisfy the user's request, it needs to be served by When the user of the maintainer role and its program assist in completing the application, the user's application submits a specific format application to the service maintainer's maintenance program, and the processing result is returned to the user's application after the maintenance program has finished processing.
  13. 根据权利要求12所述的安全用户架构,其特征在于:设置一种将两个用户的程序体现在一个进程中并进行权能范围判断的方式,包括:The secure user architecture according to claim 12, characterized in that: setting a method for reflecting the programs of two users in one process and judging the power range includes:
    在支持MSU的系统中,如需将两个属于不同角色用户的含有可执行代码的文件加载为同一线性地址空间,则将两部分的指令、代码划分为不同的MSU,为各自MSU的属性信息填写实际的用户ID和用户角色类型。当进行权能范围判断时,判断依据为当前MSU所属的用户角色类型;In a system that supports MSU, if two files containing executable code belonging to users with different roles need to be loaded into the same linear address space, the instructions and codes of the two parts are divided into different MSUs, which are attribute information of the respective MSUs. Fill in the actual user ID and user role type. When judging the scope of capabilities, the judgment is based on the type of user role to which the current MSU belongs;
    所述MSU是指内存系统单元。The MSU refers to a memory system unit.
  14. 一种计算装置,其特征在于:增设寄存器,用于保存当前用户ID。A computing device is characterized in that a register is added to store the current user ID.
  15. 一种计算装置,其特征在于:增设寄存器,用于保存当前用户角色类型。A computing device is characterized in that a register is added to save the current user role type.
PCT/CN2019/086496 2018-06-12 2019-05-11 Security user architecture and authority control method WO2019237864A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810599753.7A CN110598393B (en) 2018-06-12 2018-06-12 Safe user architecture and authority control method
CN201810599753.7 2018-06-12

Publications (1)

Publication Number Publication Date
WO2019237864A1 true WO2019237864A1 (en) 2019-12-19

Family

ID=68841924

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/086496 WO2019237864A1 (en) 2018-06-12 2019-05-11 Security user architecture and authority control method

Country Status (2)

Country Link
CN (1) CN110598393B (en)
WO (1) WO2019237864A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117272397A (en) * 2023-11-22 2023-12-22 华信咨询设计研究院有限公司 Role authority modification method of RBAC based on file design

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101827091A (en) * 2010-03-26 2010-09-08 浪潮电子信息产业股份有限公司 Method for detecting Solaris system fault by utilizing mandatory access control
CN102325132A (en) * 2011-08-23 2012-01-18 北京凝思科技有限公司 System level safety domain name system (DNS) protection method
WO2017016231A1 (en) * 2015-07-27 2017-02-02 深圳市中兴微电子技术有限公司 Policy management method, system and computer storage medium
CN106557699A (en) * 2016-11-11 2017-04-05 大唐高鸿信安(浙江)信息科技有限公司 Operating system security strengthening system based on powers and functions module
CN107871077A (en) * 2016-09-27 2018-04-03 阿里巴巴集团控股有限公司 Powers and functions management method, powers and functions management method and device for system service

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1763710A (en) * 2004-10-22 2006-04-26 中国人民解放军国防科学技术大学 Privilege minimizing method based on capability
CN100401223C (en) * 2005-04-28 2008-07-09 中国科学院软件研究所 Strategy and method for realizing minimum privilege control in safety operating system
CN104484594B (en) * 2014-11-06 2017-10-31 中国科学院信息工程研究所 A kind of franchise distribution method of the Linux system based on capability mechanism

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101827091A (en) * 2010-03-26 2010-09-08 浪潮电子信息产业股份有限公司 Method for detecting Solaris system fault by utilizing mandatory access control
CN102325132A (en) * 2011-08-23 2012-01-18 北京凝思科技有限公司 System level safety domain name system (DNS) protection method
WO2017016231A1 (en) * 2015-07-27 2017-02-02 深圳市中兴微电子技术有限公司 Policy management method, system and computer storage medium
CN107871077A (en) * 2016-09-27 2018-04-03 阿里巴巴集团控股有限公司 Powers and functions management method, powers and functions management method and device for system service
CN106557699A (en) * 2016-11-11 2017-04-05 大唐高鸿信安(浙江)信息科技有限公司 Operating system security strengthening system based on powers and functions module

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117272397A (en) * 2023-11-22 2023-12-22 华信咨询设计研究院有限公司 Role authority modification method of RBAC based on file design
CN117272397B (en) * 2023-11-22 2024-04-16 华信咨询设计研究院有限公司 Role authority modification method of RBAC based on file design

Also Published As

Publication number Publication date
CN110598393A (en) 2019-12-20
CN110598393B (en) 2022-02-08

Similar Documents

Publication Publication Date Title
US9747172B2 (en) Selective access to executable memory
US9229881B2 (en) Security in virtualized computer programs
JP4759059B2 (en) Page coloring that maps memory pages to programs
CN105431858B (en) Secure privilege grade executes and accesses protection
RU2640300C2 (en) Memory introspection engine for protecting integrity of virtual machines
US7380049B2 (en) Memory protection within a virtual partition
JP4925422B2 (en) Managing access to content in data processing equipment
US20080126740A1 (en) Restricting type access to high-trust components
US7975117B2 (en) Enforcing isolation among plural operating systems
US20070067590A1 (en) Providing protected access to critical memory regions
KR20010040979A (en) Stack-based access control
BRPI0618027A2 (en) configuration of isolated extensions and device triggers
WO2019237866A1 (en) Method for controlling access at runtime and computing device
US7647629B2 (en) Hosted code runtime protection
CN108154032A (en) It is a kind of that the computer system root of trust construction method of memory integrity ensuring is had the function of based on credible performing environment
US8635664B2 (en) Method and system for securing application program interfaces in unified extensible firmware interface
CN112256396B (en) Memory management method and system, security processing device and data processing device
WO2019237864A1 (en) Security user architecture and authority control method
US20230222211A1 (en) Unified workload runtime protection
WO2018235858A1 (en) Information processing monitoring device, information processing monitoring method, program, recording medium and information processing device
US9798558B2 (en) Modified JVM with multi-tenant application domains and class differentiation
WO2019237863A1 (en) Method for protecting non-immediate value skip and corresponding computing apparatus
US11340915B2 (en) Encaching and sharing transformed libraries
CN110598412B (en) Method and computing device for isolating power information and checking power based on power information
CN114692171B (en) RISC-V based TEE construction method, system and related equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19820399

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19820399

Country of ref document: EP

Kind code of ref document: A1