For conventional Android's high-level operating system (OS) that uses a monolithic OS (e.g. a Linux) as a kernel, protection of resources (e.g. a memory allocated by the Linux kernel, and the memory may be controlled by the Linux kernel for applications (APPs), drivers, and services in use) is implemented by the Linux kernel or a trusted execution environment (TEE). Under the condition that the resource protection is implemented by the Linux kernel, since the vulnerability of the Linux kernel, it is easy to become a springboard for attackers, causing failure of the resource protection. In addition, under the condition that the resource protection is implemented by the TEE, although the TEE may have high security, the TEE may have limited resources and large overhead, and the TEE is not good for function development. As a result, a novel system to protect the memory allocated by the kernel of the OS that will not degrade kernel performance and increase cost is urgently needed.
It is therefore one of the objectives of the present invention to provide a system to enhance memory protection associated with a kernel of an OS, to address the above-mentioned problems.
According to an embodiment of the present invention, a system to enhance memory protection associated with a kernel of an OS is provided. The system may include a processor, and the processor may be arranged to execute: a guest virtual machine (VM), a hypervisor, and a primary VM, wherein the OS may run on the guest VM, and an application (APP) may run on the OS. The kernel of the OS may include a protection service module and a memory management unit (MMU) manager. The protection service module may be arranged to receive at least one virtual address and a first size information corresponding to the at least one virtual address sent by a client of the APP. The MMU manager may be arranged to manage an MMU. The hypervisor may be arranged to receive the at least one virtual address and the first size information sent by the protection service module. The primary VM may include a protection manager, and the protection manager may be arranged to: receive the at least one virtual address and the first size information sent by the hypervisor; and obtain a physical address array and a second size information corresponding to the physical address array according to the at least one virtual address and the first size information.
According to an embodiment of the present invention, a method in a computing system of enhancing memory protection associated with a kernel of an operating system (OS) is provided. The method comprises: running the OS on a guest VM; running an application (APP) on the OS; receiving, by a hypervisor, at least one virtual address and a first size information corresponding to at least one virtual address sent by a client of the APP; receiving, by a primary VM, the at least one virtual address and the first size information sent by the hypervisor; obtaining, by the primary VM, a physical address array and a second size information corresponding to the physical address array according to the at least one virtual address and the first size information; and protecting a memory allocated by the kernel of the OS according to the physical address array and the second size information.
One of the benefits of the present invention is that, since the protection manager directly obtains the physical address array and the second size information from the MMU manager according to the at least one virtual address and the first size information sent by the hypervisor, the performance of the system can be improved. In addition, the system can be prevented from being tampered with or attacked in the process of transmitting the at least one virtual address and the first size information to the protection manager through the hypervisor, and the credibility of the at least one virtual address and the first size information can be ensured by protecting or monitoring the at least one L2P address mapping table. As a result, the security of the system can be guaranteed.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Certain terms are used throughout the following description and claims, which refer to particular components. As one skilled in the art will appreciate, electronic equipment manufacturers may refer to a component by different names. This document does not intend to distinguish between components that differ in name but not in function. In the following description and in the claims, the terms “include” and “comprise” are used in an open-ended fashion, and thus should be interpreted to mean “include, but not limited to . . . ”. Also, the term “couple” is intended to mean either an indirect or direct electrical connection. Accordingly, if one device is coupled to another device, that connection may be through a direct electrical connection, or through an indirect electrical connection via other devices and connections.
The Linux kernel may include a protection service module 206 and a memory management unit (MMU) manager 208. The protection service module 206 may be arranged to receive at least one virtual address VA and the first size information SIZE_1 sent by the client 204 of the APP 202, for protecting the memory 210. The MMU manager 208 may be arranged to manage an MMU (not shown in
The primary VM 240 may include a protection manager 242, wherein the protection manager 242 may be arranged to: receive the at least one virtual address VA and the first size information SIZE_1 sent by the hypervisor 220; obtain the physical address array PA_ARRAY and the second size information SIZE_2 from the MMU manager 208 according to the at least one virtual address VA and the first size information SIZE_1; and protect the memory 210 according to the physical address array PA_ARRAY and the second size information SIZE_2. In addition, the primary VM 240 may further include an MMU integrity protection module 244. The MMU integrity protection module 244 may be arranged to protect the at least one L2P address mapping table 209 (labeled as “Protection” in
Consider a case where the primary VM 240 only includes the protection manager 242, and receives the physical address array PA_ARRAY and the second size information SIZE_2 from the hypervisor 220, that is, the protection service module 206 obtains the physical address array PA_ARRAY and the second size information SIZE_2 from the MMU manager 208 according to the at least one virtual address VA and the first size information SIZE_1, and sends the physical address array PA_ARRAY and the second size information SIZE_2 to the protection manager 242 through the hypervisor 220. In this case, in terms of security, the credibility of the physical address array PA_ARRAY obtained from the MMA manager 208 cannot be confirmed, and the obtained physical address array PA_ARRAY may be tampered with or attacked (e.g. the attackers may utilize a fake protection service module to attack the system 20) in the process of transmitting it to the protection manager 242 through the hypervisor 220. In terms of performance, transmitting the physical address array PA_ARRAY to the protection manager 242 through the hypervisor 220 may degrade the performance of the system 20. For example, to protect a memory with size of 32 megabytes (MB), it is necessary to transmit a physical address array with size of 34 kilobytes (KB).
Compared with this case, in the system 20 shown in
However, protecting the at least one L2P address mapping table 209 may degrade performance of the Linux kernel. In addition, write mechanism for the at least one L2P address mapping table 209 may be provided to the MMU manager 208 by the MMU integrity protection module 244, wherein the high overhead of the write mechanism may affect the performance of the MMU. In order to address the above-mentioned problems, at least one virtual L2P address mapping table may be provided to the MMU manager 208. Please refer to
The Linux kernel may include a protection service module 306 and an MMU manager 308. The protection service module 306 may be arranged to receive the at least one virtual address VA and the first size information SIZE_1 sent by the client 304 of the APP 302, for protecting the memory 310. The MMU manager 308 may be arranged to manage an MMU (not shown in
The primary VM 340 may include a protection manager 342, wherein the protection manager 342 may be arranged to: receive the at least one virtual address VA and the first size information SIZE_1 sent by the hypervisor 320; obtain the physical address array PA_ARRAY and the second size information SIZE_2 from the virtual L2P address mapping table manager 321 according to the at least one virtual address VA and the first size information SIZE_1; and protect the memory 310 according to the physical address array PA_ARRAY and the second size information SIZE_2. In addition, the primary VM 340 may further include an MMU integrity protection module 344. In this embodiment, The MMU integrity protection module 344 may be arranged to protect the virtual L2P address mapping table manager 321 (labeled as “Protection” in
Compared with the system 20 shown in
The Linux kernel may include a protection service module 406 and an MMU manager 408. The protection service module 406 may be arranged to receive the at least one virtual address VA and the first size information SIZE_1 sent by the client 404 of the APP 402, for protecting the memory 410. The MMU manager 408 may be arranged to manage an MMU (not shown in
The primary VM 440 may include a protection manager 442, wherein the protection manager 442 may be arranged to: receive the at least one virtual address VA and the first size information SIZE_1 sent by the hypervisor 420; obtain the physical address array PA_ARRAY and the second size information SIZE_2 from the MMU manager 408 according to the at least one virtual address VA and the first size information SIZE_1; and protect the memory 410 according to the physical address array PA_ARRAY and the second size information SIZE_2. The difference between the system 20 shown in
In this embodiment, the MMU manager 408 is legal to the system 40, and the MMU integrity monitor 444 may be arranged to monitor access (e.g. read or write) of the at least one L2P address mapping table 409 according to the monitoring signal MS sent by the hypervisor 420 (labeled as “Monitor” in
In some embodiments, it is unnecessary to ensure that the MMU manager 408 is legal to the system 40. Whether or not the MMU manager 408 is legal to the system 40, the MMU integrity monitor 444 may be arranged to monitor resource of the MMU manager 408, to determine whether the resource of the MMU manager 408 is illegal to the system 40. In response to the resource of the MMU manager 408 being illegal to the system 40, the MMU integrity monitor 444 may be further arranged to prevent the protection manager 442 from protecting the memory 410.
In summary, since the protection manager 242/442 directly obtains the physical address array PA_ARRAY and the second size information SIZE_2 from the MMU manager 208/408 according to the at least one virtual address VA and the first size information SIZE_1 sent by the hypervisor 220/420, the performance of the system 20/40 can be improved. In addition, the system 20/40 can be prevented from being tampered with or attacked in the process of transmitting the at least one virtual address VA and the first size information SIZE_1 to the protection manager 242/442 through the hypervisor 220/420, and the credibility of the at least one virtual address VA and the first size information SIZE_1 can be ensured by protecting or monitoring the at least one L2P address mapping. As a result, the security of the system 20/40 can be guaranteed.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
This application is a continuation-in-part of U.S. application Ser. No. 17/853,950, filed on Jun. 30th, 2022, which claims the benefit of U.S. Provisional Application No. 63/245,235, filed on Sep. 17th, 2021. Further, this application claims the benefit of U.S. Provisional Application No. 63/325,136, filed on Mar. 29th, 2022. The contents of these applications are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
63245235 | Sep 2021 | US | |
63325136 | Mar 2022 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 17853950 | Jun 2022 | US |
Child | 17978995 | US |