CN117648196A - Memory allocation protection method, device, equipment and medium - Google Patents

Memory allocation protection method, device, equipment and medium Download PDF

Info

Publication number
CN117648196A
CN117648196A CN202410122647.5A CN202410122647A CN117648196A CN 117648196 A CN117648196 A CN 117648196A CN 202410122647 A CN202410122647 A CN 202410122647A CN 117648196 A CN117648196 A CN 117648196A
Authority
CN
China
Prior art keywords
memory
page
request
memory page
allocation
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202410122647.5A
Other languages
Chinese (zh)
Other versions
CN117648196B (en
Inventor
张武
孙京本
孙明刚
刘清林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology Co Ltd
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 Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202410122647.5A priority Critical patent/CN117648196B/en
Publication of CN117648196A publication Critical patent/CN117648196A/en
Application granted granted Critical
Publication of CN117648196B publication Critical patent/CN117648196B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention relates to the technical field of computers, and provides a memory allocation protection method, device, equipment and medium, wherein the method comprises the following steps: responding to a first request of the system for requesting to allocate the memory, and analyzing the first request; allocating a corresponding memory space for the first request based on the analysis result, and setting the front memory page and the rear memory page as read-only memory based on the front memory page and the rear memory page of the memory space, setting the memory space as readable and writable, and returning the address of the memory space to the requester; the requester performs read-write operation based on the address of the memory space; and triggering the kernel exception to locate the exception position in response to the pointer with the read-write operation pointing to the front memory page or the rear memory page. The scheme of the invention does not need to define extra variable resources, reduces processing logic in the use process of the memory, avoids influencing the execution efficiency in the use process of the memory, and realizes the positioning analysis of the damage position.

Description

Memory allocation protection method, device, equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for protecting memory allocation.
Background
Memory is an important system resource of an operating system, for example, for a Linux operating system, the memory is not reasonably used or abnormal, which can cause a program to exit or a system to crash. The size of the memory allocation space required by different application scenes is different, and if the data length for realizing the read-write operation is larger than the size of the allocated memory or the allocated memory and the memory allocated correspondingly to other service modules are under the same memory model, the allocated memory can be damaged. In actual use, after the memory data is abnormally destroyed, the memory data is not abnormal or crashed immediately, and only if the related service module is executed to the destroyed memory and does not accord with logic, the error exit or crashed is reported.
In the prior art, a method for protecting memory allocation is to allocate memory corresponding to a check block of the memory at the same time when allocating the memory, and judge and analyze modes such as a check block use mark, a count and the like according to actual use conditions so as to judge the state of the allocated memory. The method cannot perform positioning analysis on the memory allocated by the kernel and the driving module, and meanwhile, additional variable resources need to be defined, more processing logic is needed in the memory use process, and the execution efficiency in the memory use process is affected.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a method, apparatus, device and medium for protecting memory allocation.
According to a first aspect of the present invention, there is provided a method for protecting memory allocation, the method for protecting memory allocation comprising:
responding to a first request of a system for requesting to allocate memory, and analyzing the first request;
allocating a corresponding memory space for the first request based on an analysis result, and further setting the front memory page and the rear memory page to be read-only respectively based on the front memory page and the rear memory page of the memory space, setting the memory space to be read-write, and returning the address of the memory space to a requester;
the requester performs read-write operation based on the address of the memory space;
and responding to the pointer with read-write operation to point to the front memory page or the rear memory page, triggering the kernel exception so as to locate the exception position.
In some embodiments, the step of parsing the first request includes:
and analyzing the first request, and confirming that the first request is a page-level memory allocation request or a non-page-level memory allocation request.
In some embodiments, the step of allocating a corresponding memory space for the first request based on the parsing result and the front memory page and the rear memory page based on the memory space includes:
and responding to the first request to confirm that the first request is a page-level memory allocation request, allocating a corresponding memory page for the first request, and leading memory pages and trailing memory pages based on the memory page.
In some embodiments, the step of allocating a corresponding memory page for the first request and a pre-memory page and a post-memory page based on the memory page in response to confirming the first request is a page-level memory allocation request includes:
and responding to the first request as a page-level memory allocation request, and allocating a corresponding memory page for the first request based on the size relation between a memory space corresponding to the first request and a memory page of the system and based on a front memory page and a rear memory page of the memory page.
In some embodiments, the step of allocating a corresponding memory page for the first request based on a size relationship between a memory space corresponding to the first request and a memory page of the system, and a front memory page and a rear memory page based on the memory page, includes:
And in response to the memory space corresponding to the first request being larger than the memory pages of the system, allocating a plurality of corresponding memory pages for the first request and a front memory page and a rear memory page based on the plurality of memory pages.
In some embodiments, the pre-memory page is a preceding memory page that is contiguous with the plurality of memory pages, and the post-memory page is a subsequent memory page that is contiguous with the plurality of memory pages.
In some embodiments, the step of allocating a corresponding memory page for the first request based on a size relationship between a memory space corresponding to the first request and a memory page of the system, and a front memory page and a rear memory page based on the memory page, includes:
and in response to the memory space corresponding to the first request being not larger than the memory page of the system, allocating a corresponding one of the memory pages for the first request and a front memory page and a rear memory page based on the one of the memory pages.
In some embodiments, the pre-memory page is a preceding memory page of the one memory page, and the post-memory page is a following memory page of the one memory page.
In some embodiments, the step of triggering the kernel exception in response to the pointer having the read-write operation pointing to the pre-memory page or the post-memory page includes:
And responding to the pointers of the read-write operations corresponding to the first request to point to the preposed memory page, and triggering the kernel exception.
In some embodiments, the step of triggering the kernel exception in response to the pointer with the read-write operation pointing to the pre-memory page or the post-memory page further includes:
and responding to the fact that the address length of the read-write operation corresponding to the first request is larger than the address length of the corresponding memory space allocated for the first request, wherein a pointer of the read-write operation corresponding to the first request points to the rear memory page, and triggering the kernel exception.
In some embodiments, the step of returning the address of the memory space to the requestor includes:
and responding to the first request as a page-level memory allocation request, and returning the address of the first memory page in the corresponding memory pages to a requester.
In some embodiments, the step of returning the address of the first memory page of the corresponding memory pages to the requester in response to confirming that the first request is a page-level memory allocation request includes:
and responding to the first request as a page-level memory allocation request, and returning the address corresponding to the backward one memory page of the front memory page to a page allocation function so as to return the address corresponding to the backward one memory page of the front memory page to a requester through the page allocation function.
In some embodiments, the method for protecting memory allocation further includes:
a protection switch is set in the page allocation function.
In some embodiments, the step of allocating a corresponding memory page for the first request and a pre-memory page and a post-memory page based on the memory page in response to confirming the first request is a page-level memory allocation request includes:
responding to the first request to confirm that the first request is a page-level memory allocation request, and judging whether the protection switch in the page allocation function is turned on or not;
and responding to the protection switch to be started, distributing a plurality of corresponding memory pages for the first request, and leading memory pages and trailing memory pages based on the plurality of memory pages.
In some embodiments, the step of allocating a corresponding memory space for the first request based on the parsing result and the front memory page and the rear memory page based on the memory space includes:
and responding to the first request to allocate a request for non-page-level memory, allocating a corresponding memory space for the first request according to bytes based on the first request, and leading memory pages and trailing memory pages based on the memory space.
In some embodiments, the step of performing the read-write operation by the requester based on the address of the memory space includes:
and responding to the first request to confirm that the first request is a page-level memory allocation request, and performing read-write operation according to an address sequence by the requester based on the address of the first memory page.
In some embodiments, the step of triggering the kernel exception to locate an exception location in response to the pointer having a read-write operation pointing to the pre-memory page or the post-memory page includes:
and responding to the pointers with read-write operations to point to the front memory page or the rear memory page, triggering a crash dump mechanism of the kernel, reserving a corresponding memory space allocated for the first request and positioning an abnormal position in the corresponding memory space so as to perform abnormal processing.
According to a second aspect of the present invention, there is provided a protection device for memory allocation, the device comprising:
the system comprises a first module, a second module and a third module, wherein the first module is used for responding to a first request of the system for requesting to allocate the memory and analyzing the first request;
the second module is used for distributing a corresponding memory space for the first request based on an analysis result, further setting the front memory page and the rear memory page to be read-only respectively based on the front memory page and the rear memory page of the memory space, setting the memory space to be read-write, and returning the address of the memory space to a requester;
A third module, configured to perform a read-write operation by the requester based on the address of the memory space;
and the fourth module is used for responding to the fact that the pointer with read-write operation points to the front memory page or the rear memory page, triggering the kernel exception so as to locate the exception position.
In some embodiments, the first module is further to: and analyzing the first request, and confirming that the first request is a page-level memory allocation request or a non-page-level memory allocation request.
In some embodiments, the second module is further to: and responding to the first request to confirm that the first request is a page-level memory allocation request, allocating a corresponding memory page for the first request, and leading memory pages and trailing memory pages based on the memory page.
In some embodiments, the second module is further to: and responding to the first request as a page-level memory allocation request, and allocating a corresponding memory page for the first request based on the size relation between a memory space corresponding to the first request and a memory page of the system and based on a front memory page and a rear memory page of the memory page.
In some embodiments, the second module is further to: and in response to the memory space corresponding to the first request being larger than the memory pages of the system, allocating a plurality of corresponding memory pages for the first request and a front memory page and a rear memory page based on the plurality of memory pages.
In some embodiments, the pre-memory page is a preceding memory page that is contiguous with the plurality of memory pages, and the post-memory page is a subsequent memory page that is contiguous with the plurality of memory pages.
In some embodiments, the second module is further to: and in response to the memory space corresponding to the first request being not larger than the memory page of the system, allocating a corresponding one of the memory pages for the first request and a front memory page and a rear memory page based on the one of the memory pages.
In some embodiments, the pre-memory page is a preceding memory page of the one memory page, and the post-memory page is a following memory page of the one memory page.
In some embodiments, the fourth module is further to: and responding to the pointers of the read-write operations corresponding to the first request to point to the preposed memory page, and triggering the kernel exception.
In some embodiments, the fourth module is further to: and responding to the fact that the address length of the read-write operation corresponding to the first request is larger than the address length of the corresponding memory space allocated for the first request, wherein a pointer of the read-write operation corresponding to the first request points to the rear memory page, and triggering the kernel exception.
In some embodiments, the second module is further to: and responding to the first request as a page-level memory allocation request, and returning the address of the first memory page in the corresponding memory pages to a requester.
In some embodiments, the second module is further to: and responding to the first request as a page-level memory allocation request, and returning the address corresponding to the backward one memory page of the front memory page to a page allocation function so as to return the address corresponding to the backward one memory page of the front memory page to a requester through the page allocation function.
In some embodiments, the memory allocation protection device further includes a module for performing the following steps:
a protection switch is set in the page allocation function.
In some embodiments, the second module is further to: responding to the first request to confirm that the first request is a page-level memory allocation request, and judging whether the protection switch in the page allocation function is turned on or not; and responding to the protection switch to be started, distributing a plurality of corresponding memory pages for the first request, and leading memory pages and trailing memory pages based on the plurality of memory pages.
In some embodiments, the second module is further to: and responding to the first request to allocate a request for non-page-level memory, allocating a corresponding memory space for the first request according to bytes based on the first request, and leading memory pages and trailing memory pages based on the memory space.
In some embodiments, the third module is further to: and responding to the first request to confirm that the first request is a page-level memory allocation request, and performing read-write operation according to an address sequence by the requester based on the address of the first memory page.
In some embodiments, the fourth module is further to: and responding to the pointers with read-write operations to point to the front memory page or the rear memory page, triggering a crash dump mechanism of the kernel, reserving a corresponding memory space allocated for the first request and positioning an abnormal position in the corresponding memory space so as to perform abnormal processing.
According to a third aspect of the present invention, there is also provided an electronic device including:
at least one processor; and
and the memory stores a computer program which can be run on the processor, and the processor executes the protection method for memory allocation when executing the program.
According to a fourth aspect of the present invention, there is also provided a computer readable storage medium storing a computer program which when executed by a processor performs the aforementioned memory allocation protection method.
According to the memory allocation protection method, the corresponding memory space, the front memory page and the rear memory page based on the memory space are allocated for the first request for requesting to allocate the memory, the front memory page and the rear memory page are set to be read-only, the memory space is set to be read-write, the address of the memory space corresponding to the first request for allocation is returned to a requester, so that the requester performs read-write operation, when a pointer of the read-write operation points to the front memory page or the rear memory page, the kernel exception is triggered, the exception position is further located, and exception processing can be further performed. The method has the advantages that no additional variable resource is required to be defined, processing logic in the memory use process is reduced, the influence on the execution efficiency in the memory use process is avoided, meanwhile, when the memory allocated by the kernel and the driving module is damaged, the damaged memory can be reserved, the kernel abnormality is triggered, and the positioning analysis of the damage position is realized.
In addition, the invention also provides a memory allocation protection device, an electronic device and a computer readable storage medium, which can also realize the technical effects, and are not repeated here.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention and that other embodiments may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for protecting memory allocation according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for protecting memory allocation according to one embodiment of the present invention;
FIG. 3 is a schematic diagram of triggering an exception based on a post-memory page according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of triggering exceptions based on a pre-memory page according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a protection device for memory allocation according to another embodiment of the present invention;
FIG. 6 is an internal block diagram of an electronic device in accordance with another embodiment of the present invention;
fig. 7 is a block diagram of a computer readable storage medium according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention will be further described in detail with reference to the accompanying drawings.
It should be noted that, in the embodiments of the present invention, all the expressions "first" and "second" are used to distinguish two entities with the same name but different entities or different parameters, and it is noted that the "first" and "second" are only used for convenience of expression, and should not be construed as limiting the embodiments of the present invention, and the following embodiments are not described one by one.
In one embodiment, referring to fig. 1, the present invention provides a memory allocation protection method 100, specifically, the memory allocation protection method includes the following steps:
step 101, responding to a first request of a system for requesting memory allocation, and analyzing the first request;
step 102, allocating a corresponding memory space for the first request based on an analysis result, and further setting the front memory page and the rear memory page to be read-only respectively based on the front memory page and the rear memory page of the memory space, setting the memory space to be readable and writable, and returning the address of the memory space to a requester;
Step 103, the requester performs read-write operation based on the address of the memory space;
step 104, triggering the kernel exception to locate the exception position in response to the pointer with the read-write operation pointing to the pre-memory page or the post-memory page.
According to the memory allocation protection method, the corresponding memory space, the front memory page and the rear memory page based on the memory space are allocated for the first request for requesting to allocate the memory, the front memory page and the rear memory page are set to be read-only, the memory space is set to be read-write, the address of the memory space corresponding to the first request for allocation is returned to a requester, so that the requester performs read-write operation, when a pointer of the read-write operation points to the front memory page or the rear memory page, the kernel exception is triggered, the exception position is further located, and exception processing can be further performed. The method has the advantages that no additional variable resource is required to be defined, processing logic in the memory use process is reduced, the influence on the execution efficiency in the memory use process is avoided, meanwhile, when the memory allocated by the kernel and the driving module is damaged, the damaged memory can be reserved, the kernel abnormality is triggered, and the positioning analysis of the damage position is realized.
For further understanding of the method for protecting memory allocation provided by the present invention, fig. 2 shows another flowchart of the method for protecting memory allocation provided by the embodiment of the present invention.
According to several embodiments of the present invention, the step of parsing the first request includes:
and analyzing the first request, and confirming that the first request is a page-level memory allocation request or a non-page-level memory allocation request.
Before responding to the first request, judging that the first request is a page-level memory allocation request or a non-page-level memory allocation request, so as to allocate the corresponding memory according to a judging result.
In some embodiments, referring to fig. 2, after a system receives a request for allocating memory, the request is parsed to determine whether the request is a page-level memory allocation request or a non-page-level memory allocation request, where the page-level memory allocation request corresponds to memory allocated for a page-level memory allocator of a kernel and the non-page-level memory allocation request corresponds to memory not allocated by the page-level memory allocator of the kernel.
According to several embodiments of the present invention, the step of allocating a corresponding memory space for the first request based on the parsing result and a front memory page and a rear memory page based on the memory space includes:
And responding to the first request to confirm that the first request is a page-level memory allocation request, allocating a corresponding memory page for the first request, and leading memory pages and trailing memory pages based on the memory page.
If the first request is a page-level memory allocation request, the page-level memory allocator of the kernel allocates a plurality of corresponding memory pages for the first request, allocates a front memory page and a rear memory page for the first request on the basis of allocating a plurality of corresponding memory pages for the first request, and can trigger the kernel exception and save the damage site in the first time when the memory is damaged through the front memory page and the rear memory page.
According to several embodiments of the present invention, the step of allocating a corresponding memory page for the first request and a front memory page and a rear memory page based on the memory page in response to confirming that the first request is a page-level memory allocation request includes:
and responding to the first request as a page-level memory allocation request, and allocating a corresponding memory page for the first request based on the size relation between a memory space corresponding to the first request and a memory page of the system and based on a front memory page and a rear memory page of the memory page.
According to several embodiments of the present invention, the step of allocating a corresponding memory page for the first request based on a size relationship between a memory space corresponding to the first request and a memory page of the system, and a front memory page and a rear memory page based on the memory page includes:
and in response to the memory space corresponding to the first request being larger than the memory pages of the system, allocating a plurality of corresponding memory pages for the first request and a front memory page and a rear memory page based on the plurality of memory pages.
If the memory space corresponding to the first request is larger than the memory page of the system, a plurality of memory pages need to be allocated for the first request, the front memory page and the rear memory page are memory pages continuous with the addresses of the plurality of memory pages, and the continuous memory consisting of the front memory page, the plurality of memory pages and the rear memory page can be realized.
In some embodiments, please continue to refer to fig. 2, if it is confirmed that the first request is a page-level memory allocation request, the page-level memory allocator of the kernel allocates memory, and if the memory required by the first request is a space of the first memory, for example, 3 memory page sizes, 5 memory page sizes, etc., the page-level memory allocator of the kernel further allocates a front memory page and a rear memory page that are continuous with addresses of the plurality of memory pages based on allocating a plurality of memory pages corresponding to the first memory, for example, the page-level memory allocator of the kernel allocates a plurality of memory pages corresponding to the first memory and a front plurality of memory pages and a rear plurality of memory pages that are continuous with addresses of the plurality of memory pages.
According to several embodiments of the present invention, the pre-memory page is the first several memory pages consecutive to the memory pages, and the post-memory page is the last several memory pages consecutive to the memory pages.
In some embodiments, for the front memory page and the rear memory page, each of the front memory page and the rear memory page includes several memory pages, which may be flexibly set according to actual use conditions, and preferably, the front memory pages and the rear memory pages are the front memory page and the rear memory page that are consecutive to the addresses of the memory pages. The front memory page, the memory pages corresponding to the first memory and the rear memory page are a section of continuous memory. The process does not need to define additional variable resources, and is beneficial to improving the execution efficiency in the memory use process.
According to several embodiments of the present invention, the step of allocating a corresponding memory page for the first request based on a size relationship between a memory space corresponding to the first request and a memory page of the system, and a front memory page and a rear memory page based on the memory page includes:
and in response to the memory space corresponding to the first request being not larger than the memory page of the system, allocating a corresponding one of the memory pages for the first request and a front memory page and a rear memory page based on the one of the memory pages.
According to several embodiments of the present invention, the pre-memory page is a previous memory page of the one memory page, and the post-memory page is a subsequent memory page of the one memory page.
On the basis that the first request is a page allocation request, if the memory space corresponding to the first request is not larger than the memory page of the system, only one memory page is allocated for the first request, the front memory page and the rear memory page are memory pages with continuous addresses of the memory page, and form a continuous memory together, when the memory is destroyed, the front memory page or the rear memory page is triggered, a call chain when the memory is destroyed can be obtained at the first time, and then the positioning analysis of the memory allocated by the kernel and the driving module is realized.
According to several embodiments of the present invention, the step of triggering the kernel exception in response to the pointer having the read-write operation pointing to the pre-memory page or the post-memory page includes:
and responding to the pointers of the read-write operations corresponding to the first request to point to the preposed memory page, and triggering the kernel exception.
If the pointer with the read-write operation points to the front memory page, the kernel exception is triggered, and the location analysis of the damage position is realized.
In some embodiments, if the pointer of the read-write operation corresponding to the non-first request points to the pre-memory page corresponding to the first request, the kernel exception is directly triggered, and the first site of the memory corruption is reserved to perform positioning analysis on the corruption position.
According to several embodiments of the present invention, the step of triggering the kernel exception in response to the pointer having the read-write operation pointing to the pre-memory page or the post-memory page further includes:
and responding to the fact that the address length of the read-write operation corresponding to the first request is larger than the address length of the corresponding memory space allocated for the first request, wherein a pointer of the read-write operation corresponding to the first request points to the rear memory page, and triggering the kernel exception.
If the pointer with the read-write operation points to the rear memory page, the kernel exception is triggered, and the location analysis of the damage position is realized.
In some embodiments, please refer to fig. 3, fig. 3 shows a schematic diagram based on a post-memory page triggering exception provided by the embodiment of the present invention, when an address length of a memory page corresponding to an actual read-write operation of a first request is greater than an address length of a corresponding memory space allocated for the first request, a pointer of the read-write operation points to the post-memory page, and since the post-memory page is read-only, a core exception is triggered, a first site of memory failure is reserved, and positioning analysis of a failure location is implemented.
According to several embodiments of the present invention, the step of returning the address of the memory space to the requester includes:
and responding to the first request as a page-level memory allocation request, and returning the address of the first memory page in the corresponding memory pages to a requester.
And returning the address corresponding to the first memory page in the memory pages to the requester by setting a page allocation function so that the requester starts the read-write operation from the first memory page.
According to several embodiments of the present invention, the step of returning the address of the first memory page in the corresponding memory pages to the requester in response to the confirmation that the first request is a page-level memory allocation request includes:
and responding to the first request as a page-level memory allocation request, and returning the address corresponding to the backward one memory page of the front memory page to a page allocation function so as to return the address corresponding to the backward one memory page of the front memory page to a requester through the page allocation function.
In some embodiments, please continue to refer to fig. 2, if the first request is a page allocation memory request, the address of the next memory page of the front memory page is returned to the requester as the first address through the page allocation function, so that the requester starts the read/write operation on the memory page from the first address.
According to several embodiments of the present invention, the memory allocation protection method further includes:
a protection switch is set in the page allocation function.
In some embodiments, for example, a switch page_pro is added to the PAGE allocation function, page_pro is turned on, and the PAGE allocation function enters a protection flow for memory allocation.
According to several embodiments of the present invention, the step of allocating a corresponding memory page for the first request and a front memory page and a rear memory page based on the memory page in response to confirming that the first request is a page-level memory allocation request includes:
responding to the first request to confirm that the first request is a page-level memory allocation request, and judging whether the protection switch in the page allocation function is turned on or not; and responding to the protection switch to be started, distributing a plurality of corresponding memory pages for the first request, and leading memory pages and trailing memory pages based on the plurality of memory pages.
By setting the protection switch in the page allocation function, on the basis that the first request is the page allocation request, the protection flow of page-level memory allocation can be entered only by opening the protection switch in the page allocation function, and meanwhile, the protection flow can be flexibly set according to the user requirements.
According to several embodiments of the present invention, the step of allocating a corresponding memory space for the first request based on the parsing result and a front memory page and a rear memory page based on the memory space includes:
and responding to the first request to allocate a request for non-page-level memory, allocating a corresponding memory space for the first request according to bytes based on the first request, and leading memory pages and trailing memory pages based on the memory space.
In some embodiments, please refer to fig. 4, fig. 4 illustrates a schematic diagram based on a trigger exception of a pre-memory page provided in an embodiment of the present invention, if a first request is a non-page memory allocation request, when a memory allocated by another kernel or a driving module does not satisfy a memory size (memory read/write overflow) actually used by a read/write operation, a pointer of the read/write operation points to the pre-memory page, and when the pre-memory page is read-only, a kernel exception is triggered and a first site of memory damage is reserved to implement positioning analysis on a damage position.
According to several embodiments of the present invention, the step of performing a read-write operation by the requester based on the address of the memory space includes:
And responding to the first request to confirm that the first request is a page-level memory allocation request, and performing read-write operation according to an address sequence by the requester based on the address of the first memory page.
If the first request is a page-level memory allocation request, a plurality of memory pages are allocated to the page-level memory allocation request through a page-level memory allocator of the kernel, and the address of the first memory page in the plurality of memory pages is sent to a requester, so that the requester starts from the address of the first memory page and performs read-write operation according to the address sequence, thereby being beneficial to realizing ordered response to the page-level memory allocation request and avoiding the problem of disordered system response.
In some embodiments, the pre-memory page and the post-memory page are set to be read-only and the plurality of memory pages are set to be read-write respectively by a memory management unit of the kernel.
In some embodiments, please continue to refer to fig. 2, if the first request is a page-level memory allocation request, after the page-level memory allocator of the kernel allocates a continuous memory segment formed by a front memory page, a plurality of memory pages corresponding to the first memory, and a rear memory page, the first memory page (front memory page) and the last memory page (rear memory page) are set to be read-only for protection respectively through a memory protection mechanism provided by the memory management unit (Memory Management Unit, MMU), and the plurality of memory pages corresponding to the first memory are set to be readable and writable.
According to several embodiments of the present invention, the step of triggering the kernel exception to locate an exception location in response to a pointer having a read-write operation pointing to the pre-memory page or the post-memory page includes:
and responding to the pointers with read-write operations to point to the front memory page or the rear memory page, triggering a crash dump mechanism of the kernel, reserving a corresponding memory space allocated for the first request, and positioning an abnormal position in the memory space to perform abnormal processing.
In some embodiments, referring to fig. 5, the present invention further provides a protection device 200 for memory allocation, where the device includes: a first module 201, configured to parse a first request for allocating memory in response to the system receiving the first request; a second module 202, configured to allocate a plurality of corresponding memory pages for the first request based on the analysis result, and further set the front memory page and the rear memory page to be read-only, set the plurality of memory pages to be read-write, and return the address of the memory space to a requester; a third module 203, configured to perform a read-write operation by the requester based on the address of the memory space; a fourth module 204 is configured to trigger a kernel exception to locate an exception location in response to the pointer with the read/write operation pointing to the pre-memory page or the post-memory page.
In some embodiments, the first module 201 is further configured to: and analyzing the first request, and confirming that the first request is a page-level memory allocation request or a non-page-level memory allocation request.
In some embodiments, the second module 202 is further configured to: and responding to the first request to confirm that the first request is a page-level memory allocation request, allocating a corresponding memory page for the first request, and leading memory pages and trailing memory pages based on the memory page.
In some embodiments, the second module 202 is further configured to: and responding to the first request as a page-level memory allocation request, and allocating a corresponding memory page for the first request based on the size relation between a memory space corresponding to the first request and a memory page of the system and based on a front memory page and a rear memory page of the memory page.
In some embodiments, the second module 202 is further configured to: and in response to the memory space corresponding to the first request being larger than the memory pages of the system, allocating a plurality of corresponding memory pages for the first request and a front memory page and a rear memory page based on the plurality of memory pages.
In some embodiments, the pre-memory page is a preceding memory page that is contiguous with the plurality of memory pages, and the post-memory page is a subsequent memory page that is contiguous with the plurality of memory pages.
In some embodiments, the second module 202 is further configured to: and in response to the memory space corresponding to the first request being not larger than the memory page of the system, allocating a corresponding one of the memory pages for the first request and a front memory page and a rear memory page based on the one of the memory pages.
In some embodiments, the pre-memory page is a preceding memory page of the one memory page, and the post-memory page is a following memory page of the one memory page.
In some embodiments, the fourth module 204 is further to: and responding to the pointers of the read-write operations corresponding to the first request to point to the preposed memory page, and triggering the kernel exception.
In some embodiments, the fourth module 204 is further to: and responding to the fact that the address length of the read-write operation corresponding to the first request is larger than the address length of the corresponding memory space allocated for the first request, wherein a pointer of the read-write operation corresponding to the first request points to the rear memory page, and triggering the kernel exception.
In some embodiments, the second module 202 is further configured to: and responding to the first request as a page-level memory allocation request, and returning the address of the first memory page in the corresponding memory pages to a requester.
In some embodiments, the second module 202 is further configured to: and responding to the first request as a page-level memory allocation request, and returning the address corresponding to the backward one memory page of the front memory page to a page allocation function so as to return the address corresponding to the backward one memory page of the front memory page to a requester through the page allocation function.
In some embodiments, the memory allocation protection device 200 further includes a module for performing the following steps:
a protection switch is set in the page allocation function.
In some embodiments, the second module 202 is further configured to: and responding to the first request to confirm that the first request is a page-level memory allocation request, judging whether the protection switch in the page allocation function is turned on, and responding to the protection switch to allocate a plurality of corresponding memory pages for the first request and a front memory page and a rear memory page based on the plurality of memory pages.
In some embodiments, the second module 202 is further configured to: and responding to the first request to allocate a request for non-page-level memory, allocating a corresponding memory space for the first request according to bytes based on the first request, and leading memory pages and trailing memory pages based on the memory space.
In some embodiments, the third module 203 is further configured to: and responding to the first request to confirm that the first request is a page-level memory allocation request, and performing read-write operation according to an address sequence by the requester based on the address of the first memory page.
In some embodiments, the fourth module 204 is further to: and responding to the pointers with read-write operations to point to the front memory page or the rear memory page, triggering a crash dump mechanism of the kernel, reserving a corresponding memory space allocated for the first request and positioning an abnormal position in the corresponding memory space so as to perform abnormal processing.
The invention provides a memory allocation protection device, which allocates corresponding memory space and front memory page and rear memory page based on the memory space for a first request for requesting to allocate memory, sets the front memory page and the rear memory page as read-only and sets the memory space as read-write, and returns the address of the memory space corresponding to the first request to a requester so as to enable the requester to perform read-write operation, and when a pointer of the read-write operation points to the front memory page or the rear memory page, the kernel exception is triggered, and further the exception position is positioned, so that exception handling can be further performed. The method has the advantages that no additional variable resource is required to be defined, processing logic in the memory use process is reduced, the influence on the execution efficiency in the memory use process is avoided, meanwhile, when the memory allocated by the kernel and the driving module is damaged, the damaged memory can be reserved, the kernel abnormality is triggered, and the positioning analysis of the damage position is realized.
It should be noted that, the specific limitation of the protection device for memory allocation may be referred to the limitation of the protection method for memory allocation, and will not be described herein. The modules in the memory allocation protection device may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or independent of a processor in the electronic device, or may be stored in software in a memory in the electronic device, so that the processor may call and execute operations corresponding to the above modules.
According to another aspect of the present invention, there is provided an electronic device, which may be a server, and an internal structure thereof is shown in fig. 6. The electronic device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the electronic device is for storing data. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements the memory allocation protection method described above, where the memory allocation protection method includes:
Responding to a first request of a system for requesting to allocate memory, and analyzing the first request;
allocating a corresponding memory space for the first request based on an analysis result, and further setting the front memory page and the rear memory page to be read-only respectively based on the front memory page and the rear memory page of the memory space, setting the memory space to be read-write, and returning the address of the memory space to a requester;
the requester performs read-write operation based on the address of the memory space;
and responding to the pointer with read-write operation to point to the front memory page or the rear memory page, triggering the kernel exception so as to locate the exception position.
In some embodiments, the step of parsing the first request includes:
and analyzing the first request, and confirming that the first request is a page-level memory allocation request or a non-page-level memory allocation request.
In some embodiments, the step of allocating a corresponding memory space for the first request based on the parsing result and the front memory page and the rear memory page based on the memory space includes:
and responding to the first request to confirm that the first request is a page-level memory allocation request, allocating a corresponding memory page for the first request, and leading memory pages and trailing memory pages based on the memory page.
In some embodiments, the step of allocating a corresponding memory page for the first request and a pre-memory page and a post-memory page based on the memory page in response to confirming the first request is a page-level memory allocation request includes:
and responding to the first request as a page-level memory allocation request, and allocating a corresponding memory page for the first request based on the size relation between a memory space corresponding to the first request and a memory page of the system and based on a front memory page and a rear memory page of the memory page.
In some embodiments, the step of allocating a corresponding memory page for the first request based on a size relationship between a memory space corresponding to the first request and a memory page of the system, and a front memory page and a rear memory page based on the memory page, includes:
and in response to the memory space corresponding to the first request being larger than the memory pages of the system, allocating a plurality of corresponding memory pages for the first request and a front memory page and a rear memory page based on the plurality of memory pages.
In some embodiments, the pre-memory page is a preceding memory page that is contiguous with the plurality of memory pages, and the post-memory page is a subsequent memory page that is contiguous with the plurality of memory pages.
In some embodiments, the step of allocating a corresponding memory page for the first request based on a size relationship between a memory space corresponding to the first request and a memory page of the system, and a front memory page and a rear memory page based on the memory page, includes:
and in response to the memory space corresponding to the first request being not larger than the memory page of the system, allocating a corresponding one of the memory pages for the first request and a front memory page and a rear memory page based on the one of the memory pages.
In some embodiments, the pre-memory page is a preceding memory page of the one memory page, and the post-memory page is a following memory page of the one memory page.
In some embodiments, the step of triggering the kernel exception in response to the pointer having the read-write operation pointing to the pre-memory page or the post-memory page includes:
and responding to the pointers of the read-write operations corresponding to the first request to point to the preposed memory page, and triggering the kernel exception.
In some embodiments, the step of triggering the kernel exception in response to the pointer with the read-write operation pointing to the pre-memory page or the post-memory page further includes:
And responding to the fact that the address length of the read-write operation corresponding to the first request is larger than the address length of the corresponding memory space allocated for the first request, wherein a pointer of the read-write operation corresponding to the first request points to the rear memory page, and triggering the kernel exception.
In some embodiments, the step of returning the address of the memory space to the requestor includes:
and responding to the first request as a page-level memory allocation request, and returning the address of the first memory page in the corresponding memory pages to a requester.
In some embodiments, the step of returning the address of the first memory page of the corresponding memory pages to the requester in response to confirming that the first request is a page-level memory allocation request includes:
and responding to the first request as a page-level memory allocation request, and returning the address corresponding to the backward one memory page of the front memory page to a page allocation function so as to return the address corresponding to the backward one memory page of the front memory page to a requester through the page allocation function.
In some embodiments, the method for protecting memory allocation further includes:
a protection switch is set in the page allocation function.
In some embodiments, the step of allocating a corresponding memory page for the first request and a pre-memory page and a post-memory page based on the memory page in response to confirming the first request is a page-level memory allocation request includes:
and responding to the first request to confirm that the first request is a page-level memory allocation request, judging whether the protection switch in the page allocation function is turned on, and responding to the protection switch to allocate a plurality of corresponding memory pages for the first request and a front memory page and a rear memory page based on the plurality of memory pages.
In some embodiments, the step of allocating a corresponding memory space for the first request based on the parsing result and the front memory page and the rear memory page based on the memory space includes:
and responding to the first request to allocate a request for non-page-level memory, allocating a corresponding memory space for the first request according to bytes based on the first request, and leading memory pages and trailing memory pages based on the memory space.
In some embodiments, the step of performing the read-write operation by the requester based on the address of the memory space includes:
and responding to the first request to confirm that the first request is a page-level memory allocation request, and performing read-write operation according to an address sequence by the requester based on the address of the first memory page.
In some embodiments, the step of triggering the kernel exception to locate an exception location in response to the pointer having a read-write operation pointing to the pre-memory page or the post-memory page includes:
and responding to the pointers with read-write operations to point to the front memory page or the rear memory page, triggering a crash dump mechanism of the kernel, reserving a corresponding memory space allocated for the first request and positioning an abnormal position in the corresponding memory space so as to perform abnormal processing.
According to still another aspect of the present invention, a computer readable storage medium is provided, as shown in fig. 7, on which a computer program is stored, the computer program implementing the above-mentioned memory allocation protection method when executed by a processor, where the memory allocation protection method includes:
responding to a first request of a system for requesting to allocate memory, and analyzing the first request;
allocating a corresponding memory space for the first request based on an analysis result, and further setting the front memory page and the rear memory page to be read-only respectively based on the front memory page and the rear memory page of the memory space, setting the memory space to be read-write, and returning the address of the memory space to a requester;
The requester performs read-write operation based on the address of the memory space;
and responding to the pointer with read-write operation to point to the front memory page or the rear memory page, triggering the kernel exception so as to locate the exception position.
It should be understood that all of the embodiments, features and advantages set forth above for the method of the invention equally apply to the apparatus, device and medium according to the invention, without conflict. For the sake of brevity of this disclosure, the description is not repeated here.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (20)

1. The memory allocation protection method is characterized by comprising the following steps:
responding to a first request of a system for requesting to allocate memory, and analyzing the first request;
allocating a corresponding memory space for the first request based on an analysis result, and further setting the front memory page and the rear memory page to be read-only respectively based on the front memory page and the rear memory page of the memory space, setting the memory space to be read-write, and returning the address of the memory space to a requester;
The requester performs read-write operation based on the address of the memory space;
and responding to the pointer with read-write operation to point to the front memory page or the rear memory page, triggering the kernel exception so as to locate the exception position.
2. The method for protecting memory allocation according to claim 1, wherein the step of parsing the first request includes:
and analyzing the first request, and confirming that the first request is a page-level memory allocation request or a non-page-level memory allocation request.
3. The method according to claim 2, wherein the step of allocating a corresponding memory space for the first request based on the analysis result and the front memory page and the rear memory page based on the memory space comprises:
and responding to the first request to confirm that the first request is a page-level memory allocation request, allocating a corresponding memory page for the first request, and leading memory pages and trailing memory pages based on the memory page.
4. The method of claim 3, wherein the step of allocating a corresponding memory page for the first request and a front memory page and a rear memory page based on the memory page in response to confirming that the first request is a page-level memory allocation request comprises:
And responding to the first request as a page-level memory allocation request, and allocating a corresponding memory page for the first request based on the size relation between a memory space corresponding to the first request and a memory page of the system and based on a front memory page and a rear memory page of the memory page.
5. The method according to claim 4, wherein the step of allocating a corresponding memory page for the first request based on a size relationship between a memory space corresponding to the first request and a memory page of the system and a front memory page and a rear memory page based on the memory page includes:
and in response to the memory space corresponding to the first request being larger than the memory pages of the system, allocating a plurality of corresponding memory pages for the first request and a front memory page and a rear memory page based on the plurality of memory pages.
6. The method of claim 5, wherein the pre-memory page is a preceding memory page that is contiguous with the plurality of memory pages, and the post-memory page is a subsequent memory page that is contiguous with the plurality of memory pages.
7. The method according to claim 4, wherein the step of allocating a corresponding memory page for the first request based on a size relationship between a memory space corresponding to the first request and a memory page of the system and a front memory page and a rear memory page based on the memory page includes:
And in response to the memory space corresponding to the first request being not larger than the memory page of the system, allocating a corresponding one of the memory pages for the first request and a front memory page and a rear memory page based on the one of the memory pages.
8. The method of claim 7, wherein the pre-memory page is a preceding memory page of the one memory page and the post-memory page is a following memory page of the one memory page.
9. The method according to claim 1, wherein the step of triggering the kernel exception in response to the pointer having the read-write operation pointing to the pre-memory page or the post-memory page comprises:
and responding to the pointers of the read-write operations corresponding to the first request to point to the preposed memory page, and triggering the kernel exception.
10. The method of claim 1, wherein the step of triggering the kernel exception in response to the pointer with the read/write operation pointing to the pre-memory page or the post-memory page further comprises:
and responding to the fact that the address length of the read-write operation corresponding to the first request is larger than the address length of the corresponding memory space allocated for the first request, wherein a pointer of the read-write operation corresponding to the first request points to the rear memory page, and triggering the kernel exception.
11. A method of protecting memory allocation according to claim 3, wherein the step of returning the address of the memory space to the requestor comprises:
and responding to the first request as a page-level memory allocation request, and returning the address of the first memory page in the corresponding memory pages to a requester.
12. The method of claim 11, wherein the step of returning the address of the first memory page of the corresponding memory pages to the requester in response to the confirmation that the first request is a page-level memory allocation request comprises:
and responding to the first request as a page-level memory allocation request, and returning the address corresponding to the backward one memory page of the front memory page to a page allocation function so as to return the address corresponding to the backward one memory page of the front memory page to a requester through the page allocation function.
13. The method for protecting memory allocation according to claim 12, wherein the method for protecting memory allocation further comprises:
a protection switch is set in the page allocation function.
14. The method of claim 13, wherein the step of allocating a corresponding memory page for the first request and a pre-memory page and a post-memory page based on the memory page in response to determining that the first request is a page-level memory allocation request comprises:
Responding to the first request to confirm that the first request is a page-level memory allocation request, and judging whether the protection switch in the page allocation function is turned on or not;
and responding to the protection switch to be started, distributing a plurality of corresponding memory pages for the first request, and leading memory pages and trailing memory pages based on the plurality of memory pages.
15. The method according to claim 2, wherein the step of allocating a corresponding memory space for the first request based on the analysis result and the front memory page and the rear memory page based on the memory space comprises:
and responding to the first request to allocate a request for non-page-level memory, allocating a corresponding memory space for the first request according to bytes based on the first request, and leading memory pages and trailing memory pages based on the memory space.
16. The method for protecting memory allocation according to claim 11, wherein the step of the requester performing a read-write operation based on the address of the memory space comprises:
and responding to the first request to confirm that the first request is a page-level memory allocation request, and performing read-write operation according to an address sequence by the requester based on the address of the first memory page.
17. The method according to claim 1, wherein the step of triggering the kernel exception to locate an exception location in response to the pointer with the read/write operation pointing to the pre-memory page or the post-memory page comprises:
and responding to the pointers with read-write operations to point to the front memory page or the rear memory page, triggering a crash dump mechanism of the kernel, reserving a corresponding memory space allocated for the first request and positioning an abnormal position in the corresponding memory space so as to perform abnormal processing.
18. A memory allocation protection device, the device comprising:
the system comprises a first module, a second module and a third module, wherein the first module is used for responding to a first request of the system for requesting to allocate the memory and analyzing the first request;
the second module is used for distributing a corresponding memory space for the first request based on an analysis result, further setting the front memory page and the rear memory page to be read-only respectively based on the front memory page and the rear memory page of the memory space, setting the memory space to be read-write, and returning the address of the memory space to a requester;
a third module, configured to perform a read-write operation by the requester based on the address of the memory space;
And the fourth module is used for responding to the fact that the pointer with read-write operation points to the front memory page or the rear memory page, triggering the kernel exception so as to locate the exception position.
19. An electronic device, comprising:
at least one processor; and
a memory storing a computer program executable in the processor, the processor executing the method of memory allocation protection as claimed in any one of claims 1 to 17 when the program is executed.
20. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor performs the memory allocation protection method of any one of claims 1-17.
CN202410122647.5A 2024-01-29 2024-01-29 Memory allocation protection method, device, equipment and medium Active CN117648196B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410122647.5A CN117648196B (en) 2024-01-29 2024-01-29 Memory allocation protection method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410122647.5A CN117648196B (en) 2024-01-29 2024-01-29 Memory allocation protection method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN117648196A true CN117648196A (en) 2024-03-05
CN117648196B CN117648196B (en) 2024-04-26

Family

ID=90045515

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410122647.5A Active CN117648196B (en) 2024-01-29 2024-01-29 Memory allocation protection method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117648196B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1581108A (en) * 2003-07-31 2005-02-16 深圳市中兴通讯股份有限公司南京分公司 Internal memory management method with internal memory protection function
CN1967508A (en) * 2005-11-15 2007-05-23 华为技术有限公司 A method for protecting EMS memory
CN101520754A (en) * 2009-03-24 2009-09-02 中兴通讯股份有限公司 Method and device for positioning function and/or task violating memory access
WO2012119446A1 (en) * 2011-09-20 2012-09-13 华为技术有限公司 Memory monitoring method and device
CN103164290A (en) * 2011-12-14 2013-06-19 腾讯科技(深圳)有限公司 Management method and management device of application memory
CN104899157A (en) * 2015-05-28 2015-09-09 北京北信源软件股份有限公司 Memory overflow detection method and system
CN115373964A (en) * 2022-10-24 2022-11-22 北京智芯微电子科技有限公司 Memory out-of-range detection method, device, equipment and medium
CN117149644A (en) * 2023-09-05 2023-12-01 科东(广州)软件科技有限公司 Memory overflow detection method, device, operating system, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1581108A (en) * 2003-07-31 2005-02-16 深圳市中兴通讯股份有限公司南京分公司 Internal memory management method with internal memory protection function
CN1967508A (en) * 2005-11-15 2007-05-23 华为技术有限公司 A method for protecting EMS memory
CN101520754A (en) * 2009-03-24 2009-09-02 中兴通讯股份有限公司 Method and device for positioning function and/or task violating memory access
WO2012119446A1 (en) * 2011-09-20 2012-09-13 华为技术有限公司 Memory monitoring method and device
CN103164290A (en) * 2011-12-14 2013-06-19 腾讯科技(深圳)有限公司 Management method and management device of application memory
CN104899157A (en) * 2015-05-28 2015-09-09 北京北信源软件股份有限公司 Memory overflow detection method and system
CN115373964A (en) * 2022-10-24 2022-11-22 北京智芯微电子科技有限公司 Memory out-of-range detection method, device, equipment and medium
CN117149644A (en) * 2023-09-05 2023-12-01 科东(广州)软件科技有限公司 Memory overflow detection method, device, operating system, equipment and storage medium

Also Published As

Publication number Publication date
CN117648196B (en) 2024-04-26

Similar Documents

Publication Publication Date Title
CN111723057B (en) File pre-reading method, device, equipment and storage medium
CN113672237B (en) Program compiling method and device for preventing memory boundary crossing
CN117648196B (en) Memory allocation protection method, device, equipment and medium
US8910004B2 (en) Information processing apparatus, and method of controlling information processing apparatus
KR102254159B1 (en) Method for detecting real-time error in operating system kernel memory
CN114691532A (en) Memory access method, memory address allocation method and device
US10417121B1 (en) Monitoring memory usage in computing devices
CN111666102A (en) File format conversion method, chip verification method, related device and network chip
CN109408265B (en) IOS abnormal operation protection method and device, terminal equipment and storage medium
CN114168225B (en) Method, device, computer equipment and storage medium for updating solid state disk mapping table in delayed mode
CN115470155A (en) L2P table caching method and device supporting solid state disk multi-scene multiplexing
CN113849311B (en) Memory space management method, device, computer equipment and storage medium
CN113704027B (en) File aggregation compatible method and device, computer equipment and storage medium
CN115576818A (en) Memory out-of-range detection method and device, electronic equipment and storage medium
CN115599542A (en) Method and system for realizing shared memory pool
CN115344387A (en) Memory allocation device, method, equipment and medium
CN113961302A (en) Resource allocation method, device, electronic equipment and storage medium
US11055202B1 (en) Compilation scheme for tagged global variables
CN109284260B (en) Big data file reading method and device, computer equipment and storage medium
CN114153560A (en) Virtual interrupt processing method, device, equipment and medium
CN111124814A (en) SOC memory access monitoring method and device and computer equipment
CN113608675B (en) RAID data IO processing method and device, computer equipment and medium
CN115576865A (en) Method and device for realizing data zero copy, computer equipment and storage medium
CN117170753B (en) Program processing method, program processing device, vehicle, and storage medium
CN112965789B (en) Virtual machine memory space processing method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant