06.11.2014 Views

A User Centric Security Model for Tamper-Resistant Devices

A User Centric Security Model for Tamper-Resistant Devices

A User Centric Security Model for Tamper-Resistant Devices

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

8.3 Runtime Protection Mechanism<br />

C<br />

1<br />

2<br />

B<br />

B 2<br />

SG<br />

3<br />

Return<br />

1<br />

2<br />

D<br />

Figure 8.6: Control ow diagram of an example method B<br />

The ControlFlowGraph in the property le (listing 8.1) is simply constructed by taking into<br />

account every possible (legal) execution ow of a method. Taking the example method B, as<br />

shown in gure 8.6 the rst jump can either be to method C or D depending upon the input<br />

to method B (inputValue in listing 8.3). The rst two possible jumps shown in gure 8.6<br />

are B→C and B→D, where → represents the direction of the jump. The construction of the<br />

ControlFlowGraph (set of legal jumps) is constructed by XORing the method identiers<br />

of individual jumps (B→C and B→D). The rst legal jump in the ControlFlowGraph would<br />

be either Jump 1 = 0xF122 ⊕ 0xF123 (i.e. B→C) and Jump 1 = 0xF122 ⊕ 0xF124 (i.e.<br />

B→D). The next possible jumps in the method B can be either C→SG or D→SG that are<br />

represented in the ControlFlowGraph as Jump 3 = Jump 1 ⊕ 0xF125 and Jump 4 = Jump 2 ⊕<br />

0xF125, respectively. Finally, <strong>for</strong> the third jump illustrated in gure 8.6 is SG→Return<br />

that returns the execution back to the method that initiated the method B. There<strong>for</strong>e, the<br />

ControlFlowGraph of method B would be B cfa-Set = (Jump 1 , Jump 2 , Jump 3 , Jump 4 ).<br />

The control ow analysis requires that the runtime security manager have a control ow<br />

analysis variable cfa that stores the path taken by an application as cfa = Σ n j=1 C j.<br />

Where C j represents the jumps taken during execution of an application. During the<br />

execution of a method, when the JCVM encounters a jump to another method the runtime<br />

security manager XORs the method identier with the current value of cfa and lookup<br />

the ControlFlowGraph of the given method in the associated property le. If it nds a<br />

matching value, the JCVM will proceed with the execution; if not it will terminate the<br />

execution. Taking our example of the method B, when the JCVM encounters the rst jump<br />

B→C the runtime security manager will calculate the cfa = 0xF122 ⊕ 0xF123 and compare<br />

it with the values in the respective ControlFlowGraph. As the cfa matches with the value<br />

Jump 1 , the runtime execution manager assumes the jump B→C is legal (permitted).<br />

A potential problem with this scheme might be loop instructions that contain jumps to<br />

multiple methods depending upon the loop condition. For example, <strong>for</strong> an odd value of `i'<br />

jump to method B and <strong>for</strong> even values jump to method C. The loop iterates through<br />

the values of `i' until it meets the condition that might be based on runtime values<br />

(i.e. unpredictable at the time of the compilation of the application). However, we consider<br />

that this problem is intrinsically managed by the scheme. Consider a control ow<br />

graph of four methods: A, B, C, and D. Methods B and C are part of a loop as dis-<br />

204

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!