Software memory tagging for heap overflow protection
AssigneeMicrosoft Technology Licensing, LLC
InventorsJoseph Norman Bialek, Matthew John Parkinson
Life of this patent
Estimating the term…
Abstract
Generally discussed herein are devices, systems, and methods for software memory tagging that provides buffer overflow protection. A method can include responsive to a memory write operation to write data to a heap of a memory, identifying a first tag value associated with a first address of the memory write operation in the bit map, comparing, for each address after the first address affected by the memory write operation, respective tag values in a bit map of the memory to the identified first tag value, and halting execution of the application if any of the respective tag values do not match the first tag value.
Claims20
A compute device with buffer overflow protection, the compute device comprising:
- processing circuitry;
- a memory coupled to the processing circuitry, the memory comprising (i) a heap comprising a plurality of disjoint heap memory allocations, (ii) a map defining tag values of the heap, the map includes (a) a plurality of first tag values, for addresses in a first heap memory allocation, set to a first tag value, and (b) a plurality of second tag values, for a second set of addresses in a second heap memory allocation, set to a second, different tag value, the plurality of first tag values directly adjacent to the plurality of second tag values in the map, and (iii) instructions of a software application that, when executed by the processing circuitry cause the processing circuitry to perform operations comprising:
- responsive to a memory write operation to write data to the heap, identify the first tag value of the tag values associated with a first address of the memory write operation in the map;
- compare, for each respective address of addresses after the first address and affected by the memory write operation, respective tag values of the tag values in the map associated with the respective addresses of the heap to the identified first tag value;
- and
- halt execution of the application if any of the respective tag values do not match the first tag value.
A method for buffer overflow protection, the method comprising:
- responsive to a memory write operation to write data to a heap of a memory, identify a first tag value of the tag values associated with a first address of the memory write operation in a map, the memory including (i) the heap comprising a plurality of disjoint heap memory allocations and (ii) the map defining tag values of the heap, the map includes (a) a plurality of first tag values, for addresses in a first heap memory allocation, set to the first tag value, and (b) a plurality of second tag values, for a second set of addresses in a second heap memory allocation, set to a second, different tag value, the plurality of first tag values directly adjacent to the plurality of second tag values in the map;
- compare, for each respective address of the respective addresses after the first address affected by the memory write operation, respective tag values of the tag values associated with the respective addresses in the map to the identified first tag value;
- and
- halt execution of an application if any of the respective tag values do not match the first tag value.
A non-transitory machine-readable medium including instructions that, when executed by a machine, cause the machine to perform operations for buffer overflow protection, the operations comprising:
- responsive to a memory write operation to write data to a heap of a memory, identify a first tag value of the tag values associated with a first address of the memory write operation in a map, the memory including (i) the heap comprising a plurality of disjoint heap memory allocations and (ii) the map defining tag values of the heap, the map includes (a) a plurality of first tag values, for addresses in a first heap memory allocation, set to the first tag value, and (b) a plurality of second tag values, for a second set of addresses in a second heap memory allocation, set to a second, different tag value, the plurality of first tag values directly adjacent to the plurality of second tag values in the map;
- compare, for each respective address of respective addresses after the first address affected by the memory write operation, respective tag values of the tag values associated with the respective addresses to the identified first tag value;
- and
- halt execution of an application if any of the respective tag values do not match the first tag value.
Dependencies are inferred from the claim text.