US 11,868,466 B2
Apparatus and method for enforcing hardware-assisted memory safety
Jan-Erik Ekberg, Helsinki (FI)
Assigned to HUAWEI TECHNOLOGIES CO., LTD., Shenzhen (CN)
Appl. No. 17/434,643
Filed by Huawei Technologies Co., Ltd., Shenzhen (CN); and Jan-Erik Ekberg, Helsinki (FI)
PCT Filed Mar. 12, 2019, PCT No. PCT/EP2019/056138
§ 371(c)(1), (2) Date Aug. 27, 2021,
PCT Pub. No. WO2020/182296, PCT Pub. Date Sep. 17, 2020.
Prior Publication US 2022/0179947 A1, Jun. 9, 2022
Int. Cl. G06F 21/54 (2013.01); G06F 21/55 (2013.01); G06F 21/79 (2013.01); G06F 9/30 (2018.01)
CPC G06F 21/54 (2013.01) [G06F 9/3004 (2013.01); G06F 9/30058 (2013.01); G06F 21/556 (2013.01); G06F 21/79 (2013.01)] 20 Claims
OG exemplary drawing
 
1. An apparatus comprising:
a memory configured to store program instructions; and
a processor coupled to the memory, wherein the program instructions cause the processor to be configured to call a second function from a first function by:
coloring with an inaccessible color value, a first memory area associated with the first function;
branching to the second function;
coloring with a second color value a second memory area associated with the second function;
operating on the second memory area;
coloring with the inaccessible color value, the second memory area;
returning to the first function; and
coloring with a first color value, the first memory area,
wherein each of the first color value, the second color value, and the inaccessible color value comprises distinct color values, and
wherein coloring a memory area comprises:
branching to a coloring routine, wherein the coloring routine comprises a basic block that comprises and begins with a single branch target instruction and does not comprise another branch instruction;
identifying and authorizing a calling routine;
coloring with a hardcoded color value the memory area associated with the calling routine, wherein the calling routine comprises code including the hardcoded color value that is preset at code generation time and that is applied by the coloring routine to the associated memory area; and
returning to the calling routine.