Inter-process communication access control method and intelligent vehicle-mounted device
By intercepting and processing IPC messages, the performance improvement of inter-process communication access control is achieved in intelligent vehicle-mounted devices, solving the problem of high access management performance consumption and improving user satisfaction.
Patent Information
- Application Number
- CN202210160234.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-22
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2042-02-22
AI Technical Summary
Access control of inter-process communication in smart vehicle-mounted devices leads to high performance consumption and affects user satisfaction.
By intercepting inter-process communication IPC messages initiated by the access process, extracting the session identifier and obtaining access rights of the access process, configuring it into the IPC message, and sending it to the interviewed process, thereby reducing additional IPC communication permission checks.
Eliminates the performance loss of access control by additional IPC communication permission checks, improves access control performance, and improves user satisfaction with smart car equipment.
Smart Images

Figure CN114610505B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle control technology, and in particular to an inter-process communication access control method and an intelligent vehicle-mounted device. Background Art
[0002] At present, vehicles generally use intelligent vehicle-mounted devices to provide services to users. For example, IVI (In-Vehicle Infotainment) built in intelligent vehicle-mounted devices can provide users with a series of convenient services such as three-dimensional navigation, assisted driving, body control, mobile office, etc., to improve the intelligence level of vehicles.
[0003] In smart vehicle devices, each process generally shares information or accesses services based on inter-process communication (IPC). In order to increase the security of process communication, access control is performed on it. However, the current access control of inter-process communication in smart vehicle devices will cause high performance consumption of access control, resulting in low performance of access control, which greatly reduces user satisfaction with smart vehicle devices.
[0004] Therefore, how to solve the high performance consumption of access control is a fundamental problem that needs to be solved urgently. Summary of the invention
[0005] This specification provides an inter-process communication access control method and an intelligent vehicle-mounted device to solve or partially solve the technical problem of high performance consumption of access control, thereby improving the performance of access control.
[0006] In order to solve the above technical problems, this specification provides an inter-process communication access control method, the method comprising:
[0007] Intercepting an inter-process communication (IPC) message initiated by an accessing process; wherein the IPC message is used to access the accessed process and carries a session identifier;
[0008] Extracting the session identifier from the IPC message, and obtaining access rights for the access process based on the session identifier;
[0009] The access permission of the accessing process is configured into the IPC message, and the IPC message is sent to the accessed process.
[0010] Preferably, before intercepting the inter-process communication (IPC) message initiated by the access process, the method further includes:
[0011] When it is detected that the accessing process has a communication demand for the accessed process, creating a communication session between the accessing process and the accessed process;
[0012] generating the session identifier and the access rights for accessing the process in the communication session;
[0013] The session identifier is sent to the access process so that the access process configures the session identifier into the IPC message.
[0014] Preferably, generating the access rights for accessing the process in the communication session specifically includes:
[0015] Obtaining several permissions of the access process; wherein the number of permissions of the several permissions is determined by the number of inspection permissions of all accessed processes, and the several permissions have respective permission indexes;
[0016] Based on the several permissions and their permission indexes, access rights represented by a binary bit format list are generated; wherein, in the binary bit format list, the number of bits is determined by the number of inspection permissions of all accessed processes, the bit position represents the permission index, and the bit value represents the permission status.
[0017] Preferably, obtaining the access rights of the access process based on the session identifier specifically includes:
[0018] determining the communication session based on the session identifier;
[0019] Access rights for the access process are obtained from the communication session.
[0020] Preferably, configuring the access rights of the access process into the IPC message specifically includes:
[0021] The access rights of the access process are configured to the permission field of the IPC message in the format of a binary bit format list; wherein the format of the permission field of the IPC message and the access rights of the access process are the same.
[0022] Preferably, after sending the configured IPC message to the visited process, the method further includes:
[0023] Acquire the target inspection permission transmitted by the accessed process through the permission inspection interface;
[0024] Obtaining a corresponding target permission index according to the target inspection permission;
[0025] The target permission index is transmitted to the accessed process through the permission check interface, so that the accessed process performs a permission check on the IPC message according to the target permission index.
[0026] Preferably, after sending the configured IPC message to the visited process, the method further includes:
[0027] Acquire the IPC message transmitted by the accessed process or a permission field in the IPC message through a permission check interface;
[0028] Performing a permission check on the IPC message or the permission field in the kernel space to obtain a permission check result of the access process;
[0029] The permission check result of the accessing process is sent to the accessed process.
[0030] Preferably, performing a permission check on the IPC message or the permission field in the kernel space to obtain a permission check result of the access process specifically includes:
[0031] Obtaining the target inspection authority transmitted by the accessed process through the authority inspection interface;
[0032] Determine a corresponding target permission index based on the target inspection permission;
[0033] Perform a permission check on the IPC message or the permission field according to the target permission index to obtain the permission check result.
[0034] Preferably, before intercepting the inter-process communication (IPC) message initiated by the access process, the method further includes:
[0035] Obtain an inspection permission set from the access control policy library, and determine the permission index corresponding to each inspection permission in the inspection permission set; wherein the inspection permission set contains inspection permissions for all processes, and one permission index uniquely locates one inspection permission;
[0036] The checking permission set and its permission index are saved in kernel space.
[0037] This specification also provides an intelligent vehicle-mounted device, including an access control kernel module in kernel space and an access process and an accessed process in user space; in the access control kernel module, including:
[0038] An interception unit, configured to intercept an inter-process communication (IPC) message initiated by the accessing process; wherein the IPC message is used to access the accessed process and carries a session identifier;
[0039] An acquisition unit, configured to extract the session identifier from the IPC message, and acquire access rights of the access process based on the session identifier;
[0040] The permission management unit is used to configure the access permission of the access process into the IPC message and send the IPC message to the accessed process.
[0041] Preferably, the access control kernel module further includes a session management unit, which is used to:
[0042] When the accessing process has a communication demand, creating a communication session between the accessing process and the accessed process;
[0043] generating the session identifier and the access rights for accessing the process in the communication session;
[0044] The session identifier is sent to the access process so that the access process configures the session identifier into the IPC message.
[0045] Preferably, the session management unit is specifically used for:
[0046] Obtaining several permissions of the access process; wherein the number of permissions of the several permissions is determined by the number of inspection permissions of all accessed processes, and the several permissions have respective permission indexes;
[0047] Based on the several permissions and their permission indexes, access rights represented by a binary bit format list are generated; wherein, in the binary bit format list, the number of bits is determined by the number of inspection permissions of all accessed processes, the bit position represents the permission index, and the bit value represents the permission status.
[0048] Preferably, the acquisition unit is specifically used for:
[0049] determining the communication session based on the session identifier;
[0050] Access rights for the access process are obtained from the communication session.
[0051] Preferably, the permission management unit is specifically used to configure the access rights of the access process to the permission field of the IPC message in the format of a binary bit format list; wherein the format of the permission field of the IPC message and the access rights of the access process are the same.
[0052] Preferably, the rights management unit is further used to:
[0053] Acquire the target inspection permission transmitted by the accessed process through the permission inspection interface;
[0054] Obtaining a corresponding target permission index according to the target inspection permission;
[0055] The target permission index is transmitted to the accessed process through the permission check interface, so that the accessed process performs a permission check on the IPC message according to the target permission index.
[0056] Preferably, the rights management unit is further used to:
[0057] Acquire the IPC message transmitted by the accessed process or a permission field in the IPC message through a permission check interface;
[0058] Performing a permission check on the IPC message or the permission field in the kernel space to obtain a permission check result of the access process;
[0059] The permission check result of the accessing process is sent to the accessed process.
[0060] Preferably, the rights management unit is further used to:
[0061] Obtaining the target inspection authority transmitted by the accessed process through the authority inspection interface;
[0062] Determine a corresponding target permission index based on the target inspection permission;
[0063] Perform a permission check on the IPC message or the permission field according to the target permission index to obtain the permission check result.
[0064] Preferably, the rights management unit is further used to:
[0065] Obtain an inspection permission set from the access control policy library, and determine the permission index corresponding to each inspection permission in the inspection permission set; wherein the inspection permission set contains permissions required to be inspected by all processes, and one permission index uniquely locates one inspection permission;
[0066] The checking permission set and its permission index are saved in kernel space.
[0067] This specification discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the above method are implemented.
[0068] This specification discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.
[0069] Through one or more embodiments of this specification, this specification has the following beneficial effects or advantages:
[0070] In this scheme, the inter-process communication IPC message initiated by the accessing process is intercepted, and the access rights of the accessing process are obtained based on the session identifier extracted from the IPC message. The access rights represent the authorization status of the accessing process. Then, the access rights of the accessing process are configured in the IPC message, and the IPC message is sent to the accessed process. Therefore, after receiving the IPC message, the accessed process can obtain the authorization status of the accessing process based on the access rights, without the need to initiate additional IPC communication for permission check, thereby eliminating the performance loss of access control caused by additional IPC communication permission check and improving the performance of access control.
[0071] The above description is only an overview of the technical solution of this specification. In order to more clearly understand the technical means of this specification, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of this specification more obvious and easy to understand, the specific implementation methods of this specification are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present specification. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0073] Figure 1 A flowchart of an inter-process communication access control method according to an embodiment of the present specification is shown;
[0074] Figure 2 A schematic diagram of the overall architecture design of an inter-process communication access control method according to an embodiment of this specification is shown;
[0075] Figure 3 A specific implementation process diagram of backup according to an embodiment of this specification is shown;
[0076] Figure 4 A specific implementation process diagram of creating a communication session according to an embodiment of this specification is shown;
[0077] Figure 5 A schematic diagram of a binary bit format list corresponding to an access process according to an embodiment of this specification is shown;
[0078] Figure 6 A diagram showing an implementation process of permission access checking according to an embodiment of this specification is shown;
[0079] Figure 7 A schematic diagram of the structure of an intelligent vehicle-mounted device according to an embodiment of the present specification is shown;
[0080] Figure 8 A schematic diagram of an electronic device according to an embodiment of the present specification is shown. DETAILED DESCRIPTION
[0081] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0082] In smart car devices, each process uses the IPC mechanism to communicate with each other and provide services. For example, the camera service provides other applications (such as driving recorders) with interfaces for taking photos and recording videos through IPC channels (such as D-Bus, Binder, etc.) for them to call. In order to protect user privacy, the camera service only allows applications that have authorized camera permissions to successfully call the photo and video service interfaces. Unauthorized applications cannot use the camera.
[0083] Here, we take the driving recorder as process 1 and the camera service as process 2 as an example to illustrate the previous control of inter-process communication by smart vehicle-mounted devices.
[0084] Specifically, process 1, process 2, and the access control service are all in user space. Process 1 sends a service interface call request through the IPC channel to access the camera service provided by process 2, and process 2 responds to or rejects the service interface call request of process 1 through the IPC channel. In order to increase the communication security of the two processes, the access control service will perform a permission check on the service interface call request received by process 2. For example, after process 2 receives the service interface call request, it requests the access control service through the IPC channel to check whether process 1 has the camera permission required by process 2. The access control server queries the authorization status of process 1 for the camera permission and returns the permission check result to process 2. Process 2 responds to or rejects the service interface call request of process 1 based on the permission check result. It can be seen that the access control of inter-process communication by smart vehicle-mounted devices requires process 2 and the access control service to perform additional communication through the IPC channel for permission checks, which in turn causes high performance consumption of access control and leads to low performance of access control.
[0085] In order to solve the technical problem of high performance consumption of the above access control, the embodiment of this specification discloses an inter-process communication access control method, which can be used for intelligent vehicle-mounted devices, and can also be implemented in non-intelligent vehicle-mounted devices such as smart phones, desktops, all-in-one computers, laptops, tablet computers, etc. It is worth noting that any related equipment using this method should fall within the scope of protection of this specification.
[0086] See also Figure 1 The inter-process communication access control method of this specification includes the following steps:
[0087] Step 101, intercepting an inter-process communication (IPC) message initiated by an access process.
[0088] Step 102: extract the session identifier from the IPC message, and obtain access rights for accessing the process based on the session identifier.
[0089] Step 103: configure the access permission of the accessing process into an IPC message, and send the IPC message to the accessed process.
[0090] In this scheme, since the access rights of the access process represent the authorization status of the access process, the IPC message is intercepted and the access rights of the access process are obtained. Then, the access rights of the access process are configured into the IPC message and sent to the accessed process. Therefore, after receiving the IPC message, the accessed process can learn the authorization status of the access process based on the access rights. There is no need to initiate additional IPC communication for permission check, which eliminates the performance loss of access control caused by additional IPC communication permission check and can improve the performance of access control.
[0091] In addition, since the previous permission check was performed in user space, and the access control service is also in user space, both the access control service and the permission check are vulnerable to malicious attacks. For example, the access control service was paralyzed by a DOS attack, and the permission check result was monitored, tampered with, etc., causing the permission check to fail, so the previous access control also had security problems. This manual incorporates the overall solution of access control for inter-process communication into the kernel space for implementation, which can avoid various malicious attacks from user space. Therefore, the kernel-state access control solution of this manual has higher security than the above-mentioned user-state access control solution. Combined with the solution itself, it can have the advantages of low consumption and high security.
[0092] In order to illustrate and explain the solution of the embodiment of this specification, this specification first introduces the overall architecture of the solution.
[0093] See also Figure 2 , is a schematic diagram of the overall architecture design of the inter-process communication access control method. Among them, the access process 201, the accessed process 202, the access control service 203, and the access control policy library 204 are all in the user space. This solution is implemented in the kernel space. Specifically, this solution is implemented through the access control component in the kernel space. The access control component is referred to as the access control kernel module 205 in this specification. The following embodiments are all in Figure 2 It is implemented on the basis of the overall architecture.
[0094] In one embodiment of this specification, in order to eliminate the security risks that the access control service is vulnerable to malicious attacks during permission checking, the embodiment of this specification backs up the identity and permission information of each process to the kernel space in advance. In the subsequent access control, the permission can be called directly from the kernel space without requesting the access control service to issue the permission from the IPC channel, which can reduce consumption and eliminate security risks. Figure 3 , first introduce the specific implementation process of backup:
[0095] Step 301: Obtain an inspection permission set from an access control policy library.
[0096] Specifically, the access control service parses the access control policy library to obtain information such as the identity and permissions of each process. Therefore, in this embodiment, it is necessary to communicate with the access control service to obtain the inspection permission set.
[0097] Among them, for each process, when it is an accessed process, it has a corresponding inspection permission that is required to be checked. For example, when the camera service process is an accessed process, the access process is required to provide authorization for the camera permission. At this time, the camera permission is the inspection permission that the camera service process requires to check. When it is an accessing process, there are corresponding access permissions authorized by other accessed processes. For another example, when the positioning service process is an accessed process, the positioning permission is the inspection permission that the positioning service process requires to check. If the camera service process is the accessing process at this time, if the positioning permission process authorizes it, the access permission of the camera service process for the positioning permission is displayed as authorized.
[0098] In this embodiment, the inspection permissions of all processes are combined into an inspection permission set.
[0099] Step 302: determine the permission index corresponding to each inspection permission in the inspection permission set.
[0100] Specifically, the permission index corresponding to each inspection permission in the inspection permission set is determined according to preset rules, and the preset rules include but are not limited to: permission acquisition order, hash order of permission names, alphabetical order of permission names, etc. The following takes the permission acquisition order as an example for explanation, but it does not form a limitation.
[0101] In the process of obtaining the inspection permission set, the inspection permissions of each process are obtained in sequence, so the index of each inspection permission is determined according to the permission acquisition order, and one permission index uniquely locates one inspection permission. See Table 1 below, which is the permission index corresponding to each inspection permission in the inspection permission set.
[0102] Table 1
[0103] Permission Name Permission Index Camera permissions 0 Location Permissions 1 … …
[0104] Step 303: Save the check permission set and its permission index to the kernel space.
[0105] Specifically, the check permission set and its permission index are saved to the process storage in the access control kernel module in the kernel space.
[0106] In one embodiment of the present specification, in order to improve the access control capability of the process, when the process registers or connects to the IPC channel, the service is simultaneously registered to the kernel space for use in subsequent session establishment.
[0107] In one embodiment of the present specification, a communication session between an accessing process and an accessed process is created in the kernel space so as to maintain access rights for use by the accessing process. Figure 4 , comprising the following steps:
[0108] Step 401: when it is detected that the accessing process has a communication demand for the accessed process, a communication session between the accessing process and the accessed process is created.
[0109] In this embodiment, the access process is monitored in real time. Specifically, it is monitored whether the access process generates an access request for the accessed process. The access request at this time is a regular access request generated by the access process accessing the accessed process. When it is monitored that the access process generates an access request, it means that the access process has a communication demand for the accessed process, so it triggers the creation of a communication session between the access process and the accessed process. In addition, since the number of communication interactions between the access process and the accessed process is uncertain, the communication session will be maintained during the life cycle of the access process and the accessed process, so that the access process and the accessed process can directly use the communication session in subsequent communications without having to create it again.
[0110] Step 402: Generate a session identifier and access rights for accessing the process in the communication session.
[0111] Specifically, the session identifier is a unique identifier of a communication session and is used to query the communication session.
[0112] The access process has a number of permissions, and the number of permissions is determined by the number of inspection permissions of all accessed processes. For example, if the number of inspection permissions of the accessed process is 512, the access process also has 512 permissions. In addition, the permissions have their own permission indexes, and the source of the permission index has been introduced in the above embodiment, so it will not be repeated here.
[0113] Furthermore, in the process of generating access rights for accessing a process, a number of rights for accessing the process are obtained, and access rights represented by a binary bit format list are generated based on the number of rights and their right indexes. In the binary bit format list, the number of bits is determined by the number of checked rights of all accessed processes, the bit position represents the right index, and the bit value represents the right status.
[0114] Specifically, first determine the number of bits in the binary bit format list according to the number of check permissions in the check permission set, then sort the bit positions according to the permission index of the check permission set, and then obtain the binary bit format list table, further, fill in several rights of the access process into the binary bit format list according to the permission index, and then generate the access rights represented by the binary bit format list.
[0115] like Figure 5 As shown, it is an access right in the binary bit format list format, with 512 binary bits (i.e., an array of 64-bit unsigned integers of size 8). In the binary bit format list, the number of bits is determined by the number of check permissions in the check permission set, for example, Figure 5 The number of bits in is 512, which is equal to the number of checked permissions. The bit position is determined by the permission index. For example, the 0th bit represents the permission with index 0, the 1st bit represents the permission with index 1, and so on. The bit value represents the permission status. For example, 1 represents authorized and 0 represents unauthorized. The access process has its own access permission status among the 512 checked permissions. For example, in Figure 5 In the example, the 0th bit of the access process represents the camera permission, and the value of the bit is 0, which means that the access process does not have the camera permission. For another example, the 1st bit of the access process represents the location permission, and the value of the bit is 1, which means that the access process has the location permission.
[0116] The above is the implementation process of converting several permissions of the access process into the access permissions expressed in the format of a binary bit format list. Other access processes are also expressed in the format of the above binary bit format list. In this embodiment, by converting several permissions of the access process into access permissions expressed in a binary bit format list, it has a higher performance advantage than other operations, and each permission only requires 1 bit of transmission, so the transmission consumption is low. Therefore, this method of expressing in a binary bit format list can not only reduce the IPC transmission bandwidth occupancy, but also improve the computing efficiency.
[0117] Since the permissions of each process have the characteristics of dynamic change, in the existing access control scheme, since no session is created, when the permissions of a process change, it will inevitably affect all the permission access control related to the process. In this embodiment, the permissions of the access process in each communication session are updated in units of communication sessions. The permission update in each communication session will not affect other communication sessions, which can reduce the impact of the permission update on the access control of inter-process communication. For example, for the same access process, it creates communication session 1 with the accessed process A, and it creates communication session 2 with the accessed process B. Since the permission change is changed in units of communication sessions, the permission change in communication session 1 will not affect communication session 2. If both the accessed process A and the accessed process B need to check the location permission, if the access process in communication session 1 closes the location permission, it only means that the access process's access function to the accessed process A is limited, and it will not affect its communication with the accessed process B in communication session 2.
[0118] Furthermore, since this embodiment updates the access rights of the access process in units of communication sessions, the same access process has different access rights in different communication sessions. In addition, for the same access process and the same accessed process, the access rights of the access process are also different in two communication sessions created at different times.
[0119] Step 403: Send the session identifier to the access process so that the access process configures the session identifier into the IPC message.
[0120] Specifically, the session identifier is used to query the communication session, so it is configured in the IPC message of the access process, which can make the access process forcibly associated with the communication session when communicating with the accessed process, thereby obtaining the access authority generated for the access process in the communication session, and then providing it to the access process for accessing the accessed process, which can reduce performance consumption. In addition, when the two communicate, forcibly associating the communication session provided by this embodiment can eliminate the risk of the access process bypassing access control and directly accessing any service, thereby improving the access control capability and ensuring the communication security between the access process and the accessed process.
[0121] The above is the specific implementation process of creating a communication session for the accessing process and the accessed process. The communication session is the basis for the communication between the accessing process and the accessed process. After the accessing process obtains the session identifier, it will configure it into the IPC message for communication with the accessed process. Therefore, the subsequent accessing process and the accessed process will carry the session identifier during the communication process.
[0122] In one embodiment of the present specification, in the process of intercepting IPC messages, the access process is monitored in real time, and when it is detected that the access process sends an IPC message to the accessed process through the IPC channel, the IPC message is intercepted from the IPC channel to the kernel space for processing. The IPC message is used to access the accessed process and carries a session identifier.
[0123] Among them, the session identifier is a unique identifier of the communication session. Therefore, in one embodiment of the present specification, after extracting the session identifier from the IPC message, the communication session is determined based on the session identifier, and then the access right to access the process is obtained from the communication session.
[0124] Specifically, since a large number of communication sessions are maintained in the kernel space, and each communication session has its own session identifier, the corresponding communication session can be matched from the large number of communication sessions according to the session identifier. Since the communication session also has the access rights of the access process, the access rights are used to characterize the authorization status of the access process. Therefore, after determining the communication session, the access rights of the access process can be obtained from the communication session.
[0125] Of course, in addition to maintaining the session identifier and access rights of the accessing process in the communication conference, the identity information of the accessing process and the accessed process is also maintained, so as to verify the identities of the accessing process and the accessed process when calling the communication conference.
[0126] In one embodiment of the present specification, in the process of configuring the access rights of the access process to the IPC message, the access rights of the access process are configured to the permission field of the IPC message in the format of a binary bit format list. Specifically, a permission field is added to the IPC message, and the format of the permission field of the IPC message and the access rights of the access process are the same. Therefore, during configuration, the bit value can be directly extracted from the binary bit format list corresponding to the access process and configured to the corresponding position in the permission field.
[0127] In one embodiment of the present specification, after the configured IPC message is sent to the accessed process, when the accessed process receives the IPC message, it can simultaneously obtain all access rights possessed by the accessing process. Further, after receiving the IPC message, the accessed process directly extracts the permission field configured in the IPC message and queries the permission of the accessing process through the permission check interface.
[0128] Furthermore, the visited process queries the target permission index by calling the permission check interface, so in this embodiment, a permission check interface is provided for the visited process to use. Specifically, the target inspection permission transmitted by the visited process is obtained through the permission check interface. Among them, the target inspection permission is the inspection permission corresponding to the visited process. After obtaining the target inspection permission, the corresponding target permission index is obtained according to the target inspection permission. Since the correspondence between the permission and the permission index has been determined when the permission is backed up, the target inspection permission can be used to find the target permission index in the correspondence. Thereafter, the target permission index is transmitted to the visited process through the permission check interface, so that the visited process performs a permission check on the IPC message according to the target permission index. For the visited process, after obtaining the target permission index, the corresponding bit value can be extracted from the permission field according to the target permission index, and then it is determined whether the access permission has the corresponding authorization.
[0129] In this embodiment, the accessed process can determine whether the accessing process has the corresponding authority by performing efficient binary logic bit operations, without having to request access control service query authority through the IPC channel.
[0130] In one embodiment of the present specification, after the configured IPC message is sent to the accessed process, the accessed process will transfer the IPC message or the permission field in the IPC message to the kernel space for permission check. Figure 6 , is the implementation process of permission access check in kernel space, including the following steps:
[0131] Step 601: Obtain an IPC message transmitted by the accessed process or a permission field in the IPC message through a permission check interface.
[0132] Specifically, after the accessed process receives the IPC message, it will transmit the IPC message to the kernel space through the permission check interface for permission check. Of course, the permission field can also be extracted from the IPC message and transmitted to the kernel space through the permission check interface for permission check.
[0133] Step 602: Perform a permission check on the IPC message or permission field in the kernel space to obtain a permission check result for the access process.
[0134] Specifically, since during the permission check, the main thing to check is whether the access process has the authorization of the target inspection permission required by the accessed process, during the implementation of this embodiment, the target inspection permission transmitted by the accessed process is obtained through the permission check interface, and the corresponding target permission index is determined based on the target inspection permission. Since the corresponding relationship between the permission and the permission index has been determined when the permission is backed up, the target permission index can be found in the corresponding relationship using the target inspection permission. According to the target permission index, the permission check is performed on the IPC message or permission field to obtain the permission check result. Specifically, if it is an IPC message, the permission field configured in the IPC message is first extracted, and then the corresponding bit value is extracted from the permission field according to the target permission index, and then the access permission is determined. Authorization has a corresponding authorization. If it is a permission field, the corresponding bit value is directly extracted from the permission field according to the target permission index, and then the access permission is determined. For example, it is queried whether the bit value of the position indicated by the current permission index is 1. If it is 1, it means that the access process has permission; if it is 0, it means that the access process has no permission.
[0135] Furthermore, when judging the bit position, it can be done by performing efficient binary logic bit operations. For example, if the permission bit position is u64 perm_bits[8] and the permission index is index, the comparison operation can be expressed as: result = perm_bits[Index>>0x6]&(0x1< <index)。
[0136] Since bit operations have higher performance advantages than other operations, they can improve computing performance. In addition, each permission only requires 1 bit of transmission consumption, which is relatively low.
[0137] Step 603: Send the permission check result of the accessing process to the accessed process.
[0138] Specifically, the permission check result of the accessing process is returned to the accessed process through the permission check interface.
[0139] In the above technical solution, by performing mandatory access checks on the accessed process, the risk of the accessing process directly accessing any service in a connectionless IPC channel can be eliminated, thereby improving the access control capability and ensuring the communication security between the accessing process and the accessed process.
[0140] Based on the same inventive concept as in the above-mentioned embodiment, this specification also provides an intelligent vehicle-mounted device, see Figure 7 , including the access control kernel module 205 in the kernel space and the access process 201 and the accessed process 202 in the user space. In addition, the access control service 203 and the access control policy library 204 also exist in the user space. For the specific architecture, please refer to Figure 2 , I will not go into details here.
[0141] In this embodiment, the access control kernel module 205 includes: an interception unit 2051, an acquisition unit 2052, a permission management unit 2053, a session management unit (not shown in the figure), and a service management unit (not shown in the figure).
[0142] The specific functions of each unit are introduced below.
[0143] The interception unit 2051 is used to intercept the inter-process communication IPC message initiated by the accessing process; wherein the IPC message is used to access the accessed process and carries a session identifier;
[0144] The acquiring unit 2052 is configured to extract the session identifier from the IPC message, and acquire access rights of the access process based on the session identifier;
[0145] The permission management unit 2053 is used to configure the access permission of the access process into the IPC message and send the IPC message to the accessed process.
[0146] In one embodiment of the present specification, the session management unit is used to:
[0147] When the accessing process has a communication demand, creating a communication session between the accessing process and the accessed process;
[0148] generating the session identifier and the access rights for accessing the process in the communication session;
[0149] The session identifier is sent to the access process so that the access process configures the session identifier into the IPC message.
[0150] In one embodiment of the present specification, the session management unit is specifically used to:
[0151] Obtaining several permissions of the access process; wherein the number of permissions of the several permissions is determined by the number of inspection permissions of all accessed processes, and the several permissions have respective permission indexes;
[0152] Based on the several permissions and their permission indexes, access rights represented by a binary bit format list are generated; wherein, in the binary bit format list, the number of bits is determined by the number of inspection permissions of all accessed processes, the bit position represents the permission index, and the bit value represents the permission status.
[0153] In one embodiment of the present specification, the acquisition unit 2052 is specifically used to:
[0154] determining the communication session based on the session identifier;
[0155] Access rights for the access process are obtained from the communication session.
[0156] In one embodiment of the present specification, the permission management unit 2053 is specifically used to configure the access rights of the access process to the permission field of the IPC message in the format of a binary bit format list; wherein the format of the permission field of the IPC message and the access rights of the access process are the same.
[0157] In one embodiment of the present specification, in order to improve the access control capability of the process, the service management unit is used to provide a non-process registration service when the process is registered or connected to an IPC channel, so that the process registers the service to the kernel space for use in subsequent session establishment.
[0158] In one embodiment of the present specification, the permission management unit 2053 is further used to:
[0159] Acquire the target inspection permission transmitted by the accessed process through the permission inspection interface;
[0160] Obtaining a corresponding target permission index according to the target inspection permission;
[0161] The target permission index is transmitted to the accessed process through the permission check interface, so that the accessed process performs a permission check on the IPC message according to the target permission index.
[0162] In one embodiment of the present specification, the permission management unit 2053 is further used to:
[0163] Acquire the IPC message transmitted by the accessed process or a permission field in the IPC message through a permission check interface;
[0164] Performing a permission check on the IPC message or the permission field in the kernel space to obtain a permission check result of the access process;
[0165] The permission check result of the accessing process is sent to the accessed process.
[0166] In one embodiment of the present specification, the permission management unit 2053 is further used to:
[0167] Obtaining the target inspection authority transmitted by the accessed process through the authority inspection interface;
[0168] Determine a corresponding target permission index based on the target inspection permission;
[0169] Perform a permission check on the IPC message or the permission field according to the target permission index to obtain the permission check result.
[0170] In one embodiment of the present specification, the permission management unit 2053 is further used to:
[0171] Obtain an inspection permission set from the access control policy library, and determine the permission index corresponding to each inspection permission in the inspection permission set; wherein the inspection permission set contains permissions required to be inspected by all processes, and one permission index uniquely locates one inspection permission;
[0172] The inspection permission set and its permission index are saved in the kernel space.
[0173] Based on the same inventive concept as in the aforementioned embodiment, the embodiment of this specification further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any of the aforementioned methods are implemented.
[0174] Based on the same inventive concept as in the above-mentioned embodiment, the embodiment of this specification also provides an electronic device, such as Figure 8 As shown, it includes a memory 804, a processor 802, and a computer program stored in the memory 804 and executable on the processor 802. When the processor 802 executes the program, the steps of any of the methods described above are implemented.
[0175] Among them, Figure 8 In the embodiment of the present invention, a bus architecture (represented by bus 800) is shown, and bus 800 may include any number of interconnected buses and bridges, and bus 800 links various circuits including one or more processors represented by processor 802 and memory represented by memory 804. Bus 800 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 805 provides an interface between bus 800 and receiver 801 and transmitter 803. Receiver 801 and transmitter 803 may be the same element, namely a transceiver, providing a unit for communicating with various other terminal devices over a transmission medium. Processor 802 is responsible for managing bus 800 and general processing, while memory 804 may be used to store data used by processor 802 when performing operations.
[0176] Through one or more embodiments of this specification, this specification has the following beneficial effects or advantages:
[0177] 1. By intercepting the inter-process communication IPC message initiated by the accessing process, and obtaining the access rights of the accessing process based on the session identifier extracted from the IPC message, the access rights represent the authorization status of the accessing process, and then configuring the access rights of the accessing process into the IPC message, and sending the IPC message to the accessed process, the accessed process can obtain the authorization status of the accessing process based on the access rights after receiving the IPC message, without the need to initiate additional IPC communication for permission check, thereby eliminating the performance loss of additional IPC communication permission check on access control and improving the performance of access control.
[0178] 2. The kernel-state-based access control solution has higher security than the above-mentioned user-state access control solution.
[0179] 3. Attach access permissions to the IPC message in the form of a binary bit list so that the accessed process can efficiently obtain and check the permissions of the accessing process, which not only reduces the IPC transmission bandwidth usage but also improves the computing efficiency.
[0180] 4. The access control service based on communication sessions eliminates the risk of visitors bypassing the access control service and directly accessing any service in the connectionless IPC channel, thereby improving the access control capability and ensuring the communication security between the accessing process and the accessed process.
[0181] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general purpose systems may also be used together with the teachings based thereon. Based on the above description, it is apparent that the structure required to construct such systems is. In addition, this specification is not directed to any particular programming language. It should be understood that the contents of this specification described herein may be implemented using various programming languages, and the description of the specific languages above is intended to disclose the best mode of implementation of this specification.
[0182] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of this description can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0183] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present specification, the various features of the present specification are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: the claimed specification requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, the inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present specification.
[0184] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0185] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of this specification and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0186] The various component embodiments of this specification may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components of a gateway, a proxy server, or a system according to an embodiment of this specification. This specification may also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing this specification may be stored on a computer-readable medium, or may have the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0187] It should be noted that the above embodiments illustrate rather than limit the present specification, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present specification may be implemented with the aid of hardware comprising a number of different elements and with the aid of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
Claims
1. A method for controlling access to inter-process communication, the method comprising: When it is detected that the accessing process has a communication demand for the accessed process, creating a communication session between the accessing process and the accessed process; generating a session identifier and access rights for the access process in the communication session; Sending the session identifier to the access process so that the access process configures the session identifier into an inter-process communication (IPC) message; Intercepting the IPC message initiated by the access process; wherein the IPC message is used to access the accessed process and carries the session identifier; Extracting the session identifier from the IPC message, and obtaining access rights for the access process based on the session identifier; The access permission of the accessing process is configured into the IPC message, and the IPC message is sent to the accessed process.
2. The method according to claim 1, wherein generating access rights for accessing the process in a communication session comprises: Obtaining several permissions of the access process; wherein the number of permissions of the several permissions is determined by the number of inspection permissions of all accessed processes, and the several permissions have respective permission indexes; Based on the several permissions and their permission indexes, access rights represented by a binary bit format list are generated; wherein, in the binary bit format list, the number of bits is determined by the number of inspection permissions of all accessed processes, the bit position represents the permission index, and the bit value represents the permission status.
3. The method according to claim 1, wherein obtaining access rights of the access process based on the session identifier specifically comprises: determining the communication session based on the session identifier; Access rights for the access process are obtained from the communication session.
4. The method according to claim 1, wherein configuring the access rights of the access process into the IPC message comprises: The access rights of the access process are configured in a binary bit format list format to the permission field of the IPC message; wherein the permission field of the IPC message and the access rights of the access process have the same format.
5. The method according to claim 1, after sending the IPC message to the visited process, the method further comprises: Acquire the target inspection permission transmitted by the accessed process through the permission inspection interface; Obtaining a corresponding target permission index according to the target inspection permission; The target permission index is transmitted to the accessed process through the permission check interface, so that the accessed process performs a permission check on the IPC message according to the target permission index.
6. The method according to claim 1, after sending the IPC message to the visited process, the method further comprises: Acquire the IPC message transmitted by the accessed process or a permission field in the IPC message through a permission check interface; Performing a permission check on the IPC message or the permission field in the kernel space to obtain a permission check result of the access process; The permission check result of the accessing process is sent to the accessed process.
7. The method according to claim 6, wherein the step of performing a permission check on the IPC message or the permission field in the kernel space to obtain a permission check result of the access process specifically comprises: Obtaining the target inspection authority transmitted by the accessed process through the authority inspection interface; Determine a corresponding target permission index based on the target inspection permission; Perform a permission check on the IPC message or the permission field according to the target permission index to obtain the permission check result.
8. The method according to claim 1, before intercepting the IPC message initiated by the access process, the method further comprises: Obtain an inspection permission set from the access control policy library, and determine the permission index corresponding to each inspection permission in the inspection permission set; wherein the inspection permission set contains inspection permissions for all processes, and one permission index uniquely locates one inspection permission; The checking permission set and its permission index are saved in kernel space.
9. An intelligent vehicle-mounted device, comprising an access control kernel module in kernel space and an access process and an accessed process in user space; The access control kernel module includes: The session management unit is used to: create a communication session between the accessing process and the accessed process when it is detected that the accessing process has a communication demand for the accessed process; generate a session identifier and access rights of the accessing process in the communication session; send the session identifier to the accessing process so that the accessing process configures the session identifier into an inter-process communication (IPC) message; An interception unit, configured to intercept the IPC message initiated by the accessing process; wherein the IPC message is used to access the accessed process and carries the session identifier; An acquisition unit, configured to extract the session identifier from the IPC message, and acquire access rights of the access process based on the session identifier; The permission management unit is used to configure the access permission of the access process into the IPC message and send the IPC message to the accessed process.
10. The intelligent vehicle-mounted device according to claim 9, wherein the session management unit is specifically used for: Obtaining several permissions of the access process; wherein, The number of permissions of the plurality of permissions is determined by the number of checked permissions of all accessed processes, and the plurality of permissions have respective permission indexes; Based on the several permissions and their permission indexes, access rights represented by a binary bit format list are generated; wherein, in the binary bit format list, the number of bits is determined by the number of inspection permissions of all accessed processes, the bit position represents the permission index, and the bit value represents the permission status.
11. The intelligent vehicle-mounted device according to claim 9, wherein the acquisition unit is specifically used for: determining the communication session based on the session identifier; Access rights for the access process are obtained from the communication session.
12. The intelligent vehicle-mounted device according to claim 9, wherein the permission management unit is specifically used to configure the access permission of the access process to the permission field of the IPC message in the format of a binary bit format list; wherein, The format of the permission field of the IPC message is the same as the format of the access permission of the access process.
13. The intelligent vehicle-mounted device according to claim 9, wherein the authority management unit is further used for: Acquire the target inspection permission transmitted by the accessed process through the permission inspection interface; Obtaining a corresponding target permission index according to the target inspection permission; The target permission index is transmitted to the accessed process through the permission check interface, so that the accessed process performs a permission check on the IPC message according to the target permission index.
14. The intelligent vehicle-mounted device according to claim 9, wherein the authority management unit is further used for: Acquire the IPC message transmitted by the accessed process or a permission field in the IPC message through a permission check interface; Performing a permission check on the IPC message or the permission field in the kernel space to obtain a permission check result of the access process; The permission check result of the accessing process is sent to the accessed process.
15. The intelligent vehicle-mounted device according to claim 14, wherein the authority management unit is further configured to: Obtaining the target inspection authority transmitted by the accessed process through the authority inspection interface; Determine a corresponding target permission index based on the target inspection permission; Perform a permission check on the IPC message or the permission field according to the target permission index to obtain the permission check result.
16. The intelligent vehicle-mounted device according to claim 9, wherein the authority management unit is further used for: Obtain an inspection permission set from the access control policy library, and determine the permission index corresponding to each inspection permission in the inspection permission set; wherein, The check permission set contains all permissions that the processes require to be checked, and a permission index uniquely locates a check permission; The checking permission set and its permission index are saved in kernel space.
17. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
18. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 8 when executing the program.
Citation Information
Patent Citations
Method, device and system for realizing access between devices, and storage medium
CN112532561A