Shared memory access method and related apparatus
AssigneeHuawei Technologies Co., Ltd.
InventorsYan Zhu, Jubin Zhong, Xu Wang, Zhou Zhang
Life of this patent
Estimating the term…
Abstract
A shared memory access method is applied to implement access to a shared memory in an electronic device. In the method, the shared memory is divided into a plurality of memory segments corresponding to different permissions, and different permissions are granted to different processes. Then, a process with a high permission can normally access a memory segment corresponding to a high permission or a low permission. Furthermore, when a process with a low permission accesses a memory segment corresponding to a high permission, security detection needs to be performed, thereby ensuring security of data in the shared memory and improving process running reliability.
Claims20
A shared memory access method, comprising:
- obtaining a first access request from a first process and a second access request from a second process, wherein the first access request is used to request to access a first address in a shared memory, the second access request is used to request to access a second address in the shared memory, the shared memory comprises a plurality of memory segments, and the plurality of memory segments respectively correspond to different access permissions;
- executing the first access request in response to an access permission of the first process being not lower than an access permission corresponding to a memory segment to which the first address belongs;
- and
- performing security detection on the second access request in response to an access permission of the second process being lower than an access permission corresponding to a memory segment to which the second address belongs, to trigger execution of the second access request when the security detection on the second access request succeeds.
A shared memory access apparatus, comprising a memory and a processor, wherein the memory stores code, the processor is configured to execute the code, and when the code is executed, cause the apparatus to perform operations comprising:
- obtaining a first access request from a first process and a second access request from a second process, wherein the first access request is used to request to access a first address in a shared memory, the second access request is used to request to access a second address in the shared memory, the shared memory comprises a plurality of memory segments, and the plurality of memory segments respectively correspond to different access permissions;
- executing the first access request in response to an access permission of the first process being not lower than an access permission corresponding to a memory segment to which the first address belongs;
- and
- performing security detection on the second access request in response to an access permission of the second process being lower than an access permission corresponding to a memory segment to which the second address belongs, to trigger execution of the second access request when the security detection on the second access request succeeds.
A computer storage medium, wherein the computer storage medium stores instructions, and when the instructions are executed by a computer, the computer is enabled to implement operations comprising:
- obtaining a first access request from a first process and a second access request from a second process, wherein the first access request is used to request to access a first address in a shared memory, the second access request is used to request to access a second address in the shared memory, the shared memory comprises a plurality of memory segments, and the plurality of memory segments respectively correspond to different access permissions;
- executing the first access request in response to an access permission of the first process being not lower than an access permission corresponding to a memory segment to which the first address belongs;
- and
- performing security detection on the second access request in response to an access permission of the second process being lower than an access permission corresponding to a memory segment to which the second address belongs, to trigger execution of the second access request when the security detection on the second access request succeeds.
Dependencies are inferred from the claim text.