Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

MEMORY ACCESS AUDIT TOOL

IP.com Disclosure Number: IPCOM000245764D
Publication Date: 2016-Apr-05
Document File: 6 page(s) / 82K

Publishing Venue

The IP.com Prior Art Database

Abstract

A memory access audit tool is described. There are two main thrusts to the memory access audit tool – heap audit and stack audit. Both rely on the usage of a memory management unit (MMU) typically associated with the processor (CPU). Typically, the MMU is used to virtualize memory for tasks or processes. Not only may it perform address translation, it may also deny specific types of read or write accesses. One of the key thrusts of this memory access audit tool is to deny all accesses to MMU-mapped memory. The tool audits all memory accesses; not just the illegal ones. Illegal reads are particularly challenging to catch and this is really where the tool excels. By not allocating the physical memory with the virtual memory, no alignment rules need to be respected. (e.g. 4K page alignment). The physical memory can be tightly packed together. This is especially useful for embedded systems (where memory is tight). This is handy as the original memory allocator may be used as-is if you know what you are doing. The real physical memory may come from a variety of memory access areas (RAM, FLASH).

This text was extracted from a Microsoft Word document.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 19% of the total text.

MEMORY ACCESS AUDIT TOOL

ABSTRACT

[0001]               A memory access audit tool is described.  There are two main thrusts to the memory access audit tool – heap audit and stack audit.  Both rely on the usage of a memory management unit (MMU) typically associated with the processor (CPU). Typically, the MMU is used to virtualize memory for tasks or processes. Not only may it perform address translation, it may also deny specific types of read or write accesses. One of the key thrusts of this memory access audit tool is to deny all accesses to MMU-mapped memory.   The tool audits all memory accesses; not just the illegal ones.  Illegal reads are particularly challenging to catch and this is really where the tool excels.  By not allocating the physical memory with the virtual memory, no alignment rules need to be respected. (e.g. 4K page alignment). The physical memory can be tightly packed together.  This is especially useful for embedded systems (where memory is tight). This is handy as the original memory allocator may be used as-is if you know what you are doing.  The real physical memory may come from a variety of memory access areas (RAM, FLASH).

BACKGROUND

[0002]               Software may intentionally or unintentionally access memory (e.g., read and write) that is should not.  Examples include NULL pointer dereference, access beyond array scope, continued access of release memory, etc.  There are conventional tools that can perform this function, such as valgrind which can automatically detect many memory management and threading bugs.  This tool catches all memory access of a specific type (e.g. heap, stack) in real time, audits the access and if permitted completes the access.

[0003]               The most commonly employed stack audit functions include allocating virtual page aligned memory (e.g. 4K), filling it with a known value, and making a number of virtual pages immediately above and below the stack inaccessible (i.e., an electric fence technique).  More modern micro-processors have the ability to watch a block of memory (e.g., typically from 1 B to 4 kB).  A data address register is employed. Cruder implementations require some strict alignment rule (e.g. cache line burst, virtual page alignment). More sophisticated implementations may relax this rule.  Some allow the ability to audit either the read or the write or both.  There are many techniques that attempt to find illegal memory accesses from the heap. Unless some form of an electric fence is used, most illegal accesses are detected after the fact. Fence posting is a common technique.  This is the act of allocating additional memory above and below the returned memory, filling it with known values and detecting on free (return memory to the heap).  A periodic fence post audit tool may run (e.g., every context switch, every second) to try and find the illegal access (write).  Another technique is to fill the heap with specific values when memory is allocated or released and hope for some valu...