IP Library Granted Patent US 12,499,212
Granted Patent B2
US 12,499,212 · App. 17/555,043 · Granted Dec 16, 2025

Apparatus and method for kernel runtime randomization

Inventor: Dmitry Kasatkin (Helsinki, FI)
Assignee: Huawei Technologies Co., Ltd.
G06F21/52G06F21/12G06F21/1062G06F2221/033
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,499,212
App. No.
17/555,043
Granted
Dec 16, 2025
Kind
B2
Abstract

An apparatus includes a processor coupled to a non-volatile memory and a runtime memory. The processor is configured to read, from the non-volatile memory, a linked executable image and a randomization image. The linked executable image includes a linked executable program, and the randomization image includes one or more of a symbol table, a relocation table, and an object table. The processor loads the linked executable image to generate a runtime program, performs a runtime randomization to generate a randomized runtime program, and executes the randomized runtime program. The runtime randomization includes: copying a segment of the runtime program to a temporary location, wherein the copied segment comprises a plurality of relocatable objects; generating a randomized runtime program by writing each relocatable object into the runtime program based on a random ordering of the plurality of relocatable objects; and performing relocations for the randomized runtime program.

Claims (69)

1 . An apparatus comprising a processor coupled to a non-volatile memory and a runtime memory, wherein the processor is configured to carry out a method comprising:

reading, from the non-volatile memory, a linked executable image and a randomization image, wherein the linked executable image comprises a linked executable program, and the randomization image comprises one or more tables taken from the group consisting of: a symbol table, a relocation table, and an object table;

loading the linked executable image within the runtime memory to generate a runtime program;

performing a runtime randomization on the runtime program to generate a randomized runtime program; and

executing the randomized runtime program,

wherein the performing the runtime randomization on the runtime program comprises:

copying a segment of the runtime program to a temporary location, wherein the copied segment comprises a plurality of relocatable objects; and

generating, after the copying the segment, the randomized runtime program by writing each relocatable object in the plurality of relocatable objects into the runtime program within the runtime memory at updated addresses based on a random ordering of the plurality of relocatable objects; and

performing relocations for the randomized runtime program, wherein the performing the relocations comprises updating addresses of the plurality of relocatable objects within the runtime memory to the updated addresses in the one or more tables taken from the group consisting of: the symbol table, the relocation table, and the object table;

wherein the method further comprises:

erasing, after the copying, the segment; and

initializing, after the erasing, the segment to random data or deliberately fake information; and

wherein the loading the linked executable image comprises:

generating a random offset value;

loading the runtime program based on the random offset value; and

updating a dynamic relocation table based on the random offset value.

2 . The apparatus of claim 1 wherein the segment comprises a plurality of segments and the plurality of segments comprises one or more of a text segment and a data segment, and the processor is configured to copy the plurality of segments to the temporary location.

3 . The apparatus of claim 1 wherein the linked executable image and the randomization image comprise a compressed data, and the processor is configured to read and decompress the compressed data.

4 . The apparatus of claim 1 wherein the plurality of relocatable objects comprises one or more of a compilation unit, a function, and a data object, and the processor is configured to write each relocatable object in the plurality of relocatable objects into the randomized runtime program based on the random ordering of the plurality of relocatable objects.

5 . The apparatus of claim 1 wherein the processor is configured to perform the runtime randomization within the context of a boot loader.

6 . The apparatus of claim 1 wherein the randomization image is embedded within the linked executable image and the processor is configured to read the linked executable image and the randomization image.

7 . The apparatus of claim 1 wherein the runtime program comprises a kernel and the processor is configured to perform the runtime randomization within the context of the kernel.

8 . The apparatus of claim 1 wherein the apparatus comprises a mobile communication device.

9 . A method comprising:

reading, from a non-volatile memory, a linked executable image and a randomization image, wherein the linked executable image comprises a linked executable program, and the randomization image comprises one or more tables taken from the group consisting of: a symbol table, a relocation table, and an object table;

loading the linked executable image within the runtime memory to generate a runtime program;

performing a runtime randomization on the runtime program to generate a randomized runtime program; and

executing the randomized runtime program,

wherein the performing the runtime randomization on the runtime program comprises:

copying a segment of the runtime program to a temporary location, wherein the copied segment comprises a plurality of relocatable objects; and

generating, after the copying the segment, the randomized runtime program by writing each relocatable object in the plurality of relocatable objects into the runtime program within the runtime memory at updated addresses based on a random ordering of the plurality of relocatable objects; and

performing relocations of the randomized runtime program, wherein the performing the relocations comprises updating addresses of the plurality of relocatable objects within the runtime memory to the updated addresses in the one or more tables taken from the group consisting of: the symbol table, the relocation table, and the object table;

wherein the method further includes:

erasing, after the copying, the segment; and

initializing, after the erasing, the segment to random data or deliberately fake information; and

wherein the loading the linked executable image comprises:

generating a random offset value;

loading the runtime program based on the random offset value; and

updating a dynamic relocation table based on the random offset value.

10 . The method of claim 9 wherein the segment comprises a plurality of segments and the plurality of segments comprises one or more of a text segment and a data segment, and the plurality of segments are copied to the temporary location.

11 . The method of claim 9 wherein the method is performed within a mobile communication device.

12 . A computer program product comprising non-transitory computer program instructions that when executed by a processor are configured to cause the processor to perform the method comprising:

reading, from a non-volatile memory, a linked executable image and a randomization image, wherein the linked executable image comprises a linked executable program, and the randomization image comprises one or more tables taken from the group consisting of: a symbol table, a relocation table, and an object table;

loading the linked executable image within the runtime memory to generate a runtime program;

performing a runtime randomization on the runtime program to generate a randomized runtime program; and

executing the randomized runtime program,

wherein the performing the runtime randomization on the runtime program comprises:

copying a segment of the runtime program to a temporary location, wherein the copied segment comprises a plurality of relocatable objects; and

generating, after the copying the segment, the randomized runtime program by writing each relocatable object in the plurality of relocatable objects into the runtime program within the runtime memory at updated addresses based on a random ordering of the plurality of relocatable objects; and

performing relocations of the randomized runtime program, wherein the performing the relocations comprises updating addresses of the plurality of relocatable objects within the runtime memory to the updated addresses in the one or more tables taken from the group consisting of: the symbol table, the relocation table, and the object table;

wherein the method further includes:

erasing, after the copying, the segment; and

initializing, after the erasing, the segment to random data or deliberately fake information; and

wherein the loading the linked executable image comprises:

generating a random offset value;

loading the runtime program based on the random offset value; and

updating a dynamic relocation table based on the random offset value.

13 . The computer program product of claim 12 , wherein the segment comprises a plurality of segments and the plurality of segments comprises one or more of a text segment and a data segment, and the plurality of segments are copied to the temporary location.

14 . The computer program product of claim 12 , wherein the linked executable image and the randomization image comprise a compressed data, and the processor is configured to read and decompress the compressed data.

15 . The computer program product of claim 12 , wherein the plurality of relocatable objects comprises one or more of a compilation unit, a function, and a data object, and the processor is configured to write each relocatable object in the plurality of relocatable objects into the randomized runtime program based on the random ordering of the plurality of relocatable objects.

16 . The computer program product of claim 12 , wherein the processor is configured to perform the runtime randomization within the context of a boot loader.

17 . The computer program product of claim 12 , wherein the randomization image is embedded within the linked executable image and the processor is configured to read the linked executable image and the randomization image.

18 . The computer program product of claim 12 , wherein the runtime program comprises a kernel and the processor is configured to perform the runtime randomization within the context of the kernel.

19 . The computer program product of claim 12 , wherein the method is performed in a mobile communication device.

20 . The method of claim 9 , wherein the linked executable image and the randomization image comprise a compressed data, and the processor is configured to read and decompress the compressed data.

21 . The method of claim 9 , wherein the plurality of relocatable objects comprises one or more of a compilation unit, a function, and a data object, and the processor is configured to write each relocatable object in the plurality of relocatable objects into the randomized runtime program based on the random ordering of the plurality of relocatable objects.

22 . The method of claim 9 , wherein the processor is configured to perform the runtime randomization within the context of a boot loader.

23 . The method of claim 9 , wherein the randomization image is embedded within the linked executable image and the processor is configured to read the linked executable image and the randomization image.

24 . The method of claim 9 , wherein the runtime program comprises a kernel and the processor is configured to perform the runtime randomization within the context of the kernel.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 3, 2022
From: KASATKIN, DMITRY
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 058881/0184 →
Continuity (2)
Continuation PCTEP2019066136 · Jun 19, 2019
Related Publication 20220108003A1 · Apr 7, 2022
References Cited (19)
US 7877561B2 · Francis · 2011 [cited by examiner]
US 10311228B2 · Vidrine · 2019 [cited by examiner]
US 11809871B2 · Hong · 2023 [cited by examiner]
US 20070234002A1 · Litke · 2007 [cited by examiner]
US 20080222207A1 · Ito · 2008 [cited by applicant]
US 20150047049A1 · Panchenko · 2015 [cited by examiner]
US 20150347162A1 · Ahmad · 2015 [cited by examiner]
US 20160092675A1 · Vidrine · 2016 [cited by examiner]
US 20170344304A1 · Alves · 2017 [cited by examiner]
US 20180046585A1 · Okhravi · 2018 [cited by examiner]
US 20190114401A1 · De · 2019 [cited by examiner]
US 20190155743A1 · Loreskar · 2019 [cited by examiner]
US 20200089502A1 · Hong · 2020 [cited by examiner]
US 20220284115A1 · Tang · 2022 [cited by examiner]
CN 105787368A · 2016 [cited by applicant]
“ELF for the ARM 64-bit architecture (AArch64),” ARM IHI 0056B, current through AArch64 ABI release 1.0, pp. 1-27, ARM Limited (May 22, 2013). [cited by applicant]
“Linux Kernel 2.6.36-rc8—‘RDS Protocol’ Local Privilege Escalation,” https://www.exploit-db.com/exploits/15285, Total 7 pages (Oct. 19, 2010). [cited by applicant]
“Address space layout randomization,” https://en.wikipedia.org/wiki/Address_space_layout_randomization, Total 10 pages, Wikipedia (Jan. 2022). [cited by applicant]
“Executable and Linkable Format,” https://en.wikipedia.org/wiki/Executable_and_Linkable_Format, Total 16 pages, Wikipedia (Jan. 2022). [cited by applicant]