IP Library Granted Patent US 12,174,948
Granted Patent B2
US 12,174,948 · App. 16/931,669 · Granted Dec 24, 2024

Using a variable write profile for detecting intrusion of a computer program

Inventors: Glenn Daniel Wurster (Kitchener, CA); Benjamin Gnahm (Augsburg, DE); Paul Henri Michel Virally (Westmount, CA)
Assignee: BlackBerry Limited
G06F21/554G06F21/52G06F21/566G06F21/577G06F21/79
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,174,948
App. No.
16/931,669
Granted
Dec 24, 2024
Kind
B2
Abstract

A computer-implemented method is disclosed. The method includes: identifying a set of program variables associated with a computer program; generating a profile of variable writes for the computer program based on tracking, for each variable in the set of program variables: a count of memory write operations for writing to the variable; and timestamps associated with the memory write operations; detecting a trigger condition associated with the set of program variables, the detecting including: monitoring a pattern of memory accesses by the computer program, the pattern of memory accesses indicating accesses of memory allocated to variables in the set of program variables; and detecting a deviation of the pattern of memory accesses from the profile of variable writes; and in response to detecting the trigger condition, generating a notification indicating an attack status on the computer program.

Claims (50)

1. A computer-implemented method, comprising:

identifying, by a processor of a computing device, a set of program variables associated with a computer program executing on the computing device;

generating, by the processor, a profile of variable writes for the computer program based on:

tracking, by the processor, during execution of the computer program, function calls and variable write operations corresponding to the function calls; and

determining, by the processor, for each respective variable in the set of program variables:

a count of memory write operations for writing to the respective variable, wherein determining the count includes instrumenting, by a compiler, each assignment in source code of the computer program with a corresponding increment of a related shadow memory value; and

timestamps associated with the memory write operations for writing to the respective variable;

detecting, by the processor, a trigger condition associated with the set of program variables, the detecting including:

monitoring, by the processor, a pattern of memory accesses by the computer program, the pattern of memory accesses indicating accesses, by the computer program, of memory allocated to first variables in the set of program variables, wherein the accesses of memory are for writing to the first variables; and

detecting, by the processor, a deviation of the pattern of memory accesses from the profile of variable writes; and

in response to detecting the trigger condition, generating, by the processor, a notification indicating an attack status on the computer program.

2. The method of claim 1 , wherein detecting a deviation comprises determining by the processor, for at least one variable in the set of program variables, that a count of memory write operations for writing to the at least one variable in a given time period deviates from a frequency of write access for the at least one variable indicated in the profile of variable writes by more than a predefined threshold amount.

3. The method of claim 1 , wherein detecting a deviation comprises determining by the processor, for at least one variable in the set of program variables, that a memory write operation for writing to the at least one variable has occurred at a time that is different from an expected time of write access indicated in the profile of variable writes.

4. The method of claim 1 , wherein the tracking further comprises identifying by the processor, for each of one or more heap allocated program variables, a memory address within heap memory that is allocated to the respective heap allocated program variable.

5. The method of claim 1 , further comprising:

identifying by the processor, based on the profile of variable writes, one or more program variables that are written to only during initialization of the computer program; and

setting, by the processor, allocated memory for the identified program variables to read-only access.

6. The method of claim 1 , further comprising:

identifying by the processor, based on the profile of variable writes, one or more program variables that are written to only during a configuration change associated with the computer program; and

setting, by the processor, allocated memory for the identified program variables to read-only access.

7. The method of claim 1 , wherein the set of program variables is stored in a secure enclave, and wherein memory accesses for writing to the variables in the set of program variables are checked against a memory access control policy.

8. The method of claim 7 , wherein a decision of whether to allow memory access for writing to a first program variable is based on at least one of:

a value that is being written to the first program variable; or

a source of instruction of a memory write operation for writing to the first program variable.

9. A computing device, comprising:

a processor; and

a memory coupled to the processor, the memory storing processor-executable instructions that, when executed by the processor, configure the processor to:

identify a set of program variables associated with a computer program executing on the computing device;

generate a profile of variable writes for the computer program based on:

tracking, during execution of the computer program, function calls and variable write operations corresponding to the function calls; and

determining, for each respective variable in the set of program variables:

a count of memory write operations for writing to the respective variable, wherein determining the count includes instrumenting, by a compiler, each assignment in source code of the computer program with a corresponding increment of a related shadow memory value; and

timestamps associated with the memory write operations for writing to the respective variable;

detect a trigger condition associated with the set of program variables, the detecting including:

monitoring a pattern of memory accesses by the computer program, the pattern of memory accesses indicating accesses, by the computer program, of memory allocated to first variables in the set of program variables, wherein the accesses of memory are for writing to the first variables; and

detecting a deviation of the pattern of memory accesses from the profile of variable writes; and

in response to detecting the trigger condition, generate a notification indicating an attack status on the computer program.

10. The computing device of claim 9 , wherein detecting a deviation comprises determining, for at least one variable in the set of program variables, that a count of memory write operations for writing to the at least one variable in a given time period deviates from a frequency of write access for the at least one variable indicated in the profile of variable writes by more than a predefined threshold amount.

11. The computing device of claim 9 , wherein detecting a deviation comprises determining, for at least one variable in the set of program variables, that a memory write operation for writing to the at least one variable has occurred at a time that is different from an expected time of write access indicated in the profile of variable writes.

12. The computing device of claim 9 , wherein the tracking further comprises identifying, for each of one or more heap allocated program variables, a memory address within heap memory that is allocated to the respective heap allocated program variable.

13. The computing device of claim 9 , wherein the processor is further configured to:

identify, based on the profile of variable writes, one or more program variables that are written to only during initialization of the computer program; and

set allocated memory for the identified program variables to read-only access.

14. The computing device of claim 9 , wherein the processor is further configured to:

identify, based on the profile of variable writes, one or more program variables that are written to only during a configuration change associated with the computer program; and

set allocated memory for the identified program variables to read-only access.

15. The computing device of claim 9 , wherein the set of program variables is stored in a secure enclave, and wherein memory accesses for writing to the variables in the set of program variables are checked against a memory access control policy.

16. The computing device of claim 15 , wherein a decision of whether to allow memory access for writing to a first program variable is based on at least one of:

a value that is being written to the first program variable; or

a source of instruction of a memory write operation for writing to the first program variable.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 21, 2020
From: BLACKBERRY DEUTSCHLAND GMBH
To: BLACKBERRY LIMITED
Reel/Frame 053829/0196 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 15, 2020
From: GNAHM, BENJAMIN
To: BLACKBERRY DEUTSCHLAND GMBH
Reel/Frame 053773/0663 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 15, 2020
From: WURSTER, GLENN DANIEL; VIRALLY, PAUL HENRI MICHEL
To: BLACKBERRY LIMITED
Reel/Frame 053773/0808 →
Continuity (1)
Related Publication 20220019656A1 · Jan 20, 2022
Cited By (1)
US 12,688,071