IP Library Granted Patent US 11,003,777
Granted Patent B2
US 11,003,777 · App. 15/954,341 · Granted May 11, 2021

Determining a frequency at which to execute trap code in an execution path of a process executing a program to generate a trap address range to detect potential malicious code

Inventors: Lokesh M. Gupta (Tucson, AZ); Matthew G. Borlick (Tucson, AZ); Trung N. Nguyen (Vail, AZ); Micah Robison (Tucson, AZ)
Assignee: International Business Machines Corporation
G06F21/566G06F21/567G06F2221/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 11,003,777
App. No.
15/954,341
Granted
May 11, 2021
Kind
B2
Abstract

Provided are a computer program product, system, and method for determining a frequency at which to execute trap code in an execution path of a process executing a program to generate a trap address range to detect potential malicious code. Trap code is executed in response to processing a specified type of command in application code to allocate a trap address range used to detect potentially malicious code. A determination is whether to modify a frequency of executing the trap code in response to processing a specified type of command. The frequency of executing the trap code is modified in response to processing the specified type of command in response to determining to determining to modify the frequency of executing the trap code.

Claims (64)

1. A computer program product for detecting malicious code accessing data from a storage, the computer program product comprising a computer readable storage medium having computer readable program code embodied therein that when executed performs operations, the operations comprising:

providing a frequency flag indicating a first value or a second value;

setting the frequency flag to the first value;

executing trap code to allocate a trap address range in an address space that maps to a location in a memory in response to processing a specified type of command in application code only when the frequency flag has the first value;

setting the frequency flag to the second value in response to determining that an application has not accessed the trap address range within a time period determined by a frequency timer; and

providing speculative execution information and a timer to determine whether to disable or enable speculative execution of the application code.

2. The computer program product of claim 1 , wherein the trap address range is not accessed by the application code being executed, and wherein the specified type of command comprises a command to switch from a user mode to kernel mode to access kernel addresses, and wherein the trap address range is defined in a kernel address space.

3. The computer program product of claim 1 , wherein the operations further comprise:

starting the frequency timer in response to executing the trap code, wherein the determining that the application has not accessed the trap address range in the time period is made in response to the frequency timer expiring.

4. The computer program product of claim 3 , wherein the operations further comprise:

determining whether the frequency timer is active in response to executing the trap code, wherein the frequency timer is active if the frequency timer has started and not expired, and wherein the frequency timer is started in response to determining that the frequency timer is not active.

5. The computer program product of claim 1 , wherein the operations further comprises:

executing the trap code in response to processing the specified type of command a number of times.

6. The computer program product of claim 5 , wherein the operations further comprise:

determining whether the specified type of command has been processed the number of times in response to detecting that the frequency flag has the second value.

7. The computer program product of claim 1 , wherein the specified type of command is to access a kernel address space.

8. The computer program product of claim 1 , wherein the trap code is executed in response to processing the specified type of command when the frequency flag has the first value.

9. The computer program product of claim 1 , wherein the operations further comprise:

detecting that a program has accessed the trap address range; and

setting the frequency flag to the first value in response to detecting that the program has accessed the trap address range.

10. The computer program product of claim 9 , wherein the operations further comprise:

starting the frequency timer in response to executing the trap code, wherein the determining that the application has not accessed the trap address range in the time period is made in response to the frequency timer expiring; and

stopping the frequency timer in response to detecting that the program has accessed the trap address range.

11. A system for detecting malicious code accessing data from a storage, comprising:

processor; and

a computer readable storage medium having computer readable program that when executed by the processor performs operations, the operations comprising:

providing a frequency flag indicating a first value or a second value;

setting the frequency flag to the first value;

executing trap code to allocate a trap address range in an address space that maps to a location in a memory in response to processing a specified type of command in application code only when the frequency flag has the first value;

setting the frequency flag to the second value in response to determining that an application has not accessed the trap address range within a time period determined by a frequency timer; and

providing speculative execution information and a timer to determine whether to disable or enable speculative execution of the application code.

12. The system of claim 11 , wherein the operations further comprise:

executing the trap code in response to processing the specified type of command a number of times.

13. The system of claim 12 , wherein the operations further comprise:

determining whether the specified type of command has been processed the number of times in response to detecting that the frequency flag has the second value.

14. The system of claim 11 , wherein the specified type of command is to access a kernel address space.

15. The system of claim 11 , wherein the operations further comprise:

starting the frequency timer in response to executing the trap code, wherein the determining that the application has not accessed the trap address range in the time period is made in response to the frequency timer expiring.

16. The system of claim 11 , wherein the trap code is executed in response to processing the specified type of command when the frequency flag has the first value.

17. The system of claim 11 , wherein the operations further comprise:

detecting that a program has accessed the trap address range; and

setting the frequency flag to the first value in response to detecting that the program has accessed the trap address range.

18. The system of claim 17 , wherein the operations further comprise:

starting the frequency timer in response to executing the trap code, wherein the determining that the application has not accessed the trap address range in the time period is made in response to the frequency timer expiring; and

stopping the frequency timer in response to detecting that the program has accessed the trap address range.

19. A method for detecting malicious code accessing data from a storage, comprising:

providing a frequency flag indicating a first value or a second value;

setting the frequency flag to the first value;

executing trap code to allocate a trap address range in an address space that maps to a location in a memory in response to processing a specified type of command in application code only when the frequency flag has the first value;

setting the frequency flag to the second value in response to determining that an application has not accessed the trap address range within a time period determined by a frequency timer; and

providing speculative execution information and a timer to determine whether to disable or enable speculative execution of the application code.

20. The method of claim 19 , further comprising:

executing the trap code in response to processing the specified type of command a number of times.

21. The method of claim 20 , further comprising:

determining whether the specified type of command has been processed the number of times in response to detecting that the frequency flag has the second value.

22. The method of claim 19 , wherein the specified type of command is to access a kernel address space.

23. The method of claim 19 , further comprising:

starting the frequency timer in response to executing the trap code, wherein the determining that the application has not accessed the trap address range in the time period is made in response to the frequency timer expiring.

24. The method of claim 19 , further comprising:

detecting that a program has accessed the trap address range; and

setting the frequency flag to the first value in response to detecting that the program has accessed the trap address range.

25. The method of claim 24 , further comprising:

starting the frequency timer in response to executing the trap code, wherein the determining that the application has not accessed the trap address range in the time period is made in response to the frequency timer expiring; and

stopping the frequency timer in response to detecting that the program has accessed the trap address range.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 23, 2018
From: GUPTA, LOKESH M; BORLICK, MATTHEW G.; NGUYEN, TRUNG N.; ROBISON, MICAH
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 045615/0498 →
Continuity (1)
Related Publication 20190318091A1 · Oct 17, 2019