• Tidak ada hasil yang ditemukan

Avoiding Hardware Aliasing (RSDA 2014)

N/A
N/A
Protected

Academic year: 2017

Membagikan "Avoiding Hardware Aliasing (RSDA 2014)"

Copied!
18
0
0

Teks penuh

(1)

Avoiding Hardware Aliasing

Peter T. Breuer and Jonathan P. Bowen

Birmingham City University

(2)

Imagine the Lander is on Mars

A cosmic ray tracks through the processor

Arithmetic Logic Unit

– From then on 1+1=3

How do we save the mission?

– An answer turns out to be 'reliable' code

(3)

Extreme: every

operation 'wrong'

Krypto-Processor (KPU)

– Natively encrypted computing

● Instead of 4 - 4 = 0 ...

99900 - 99900 = 78763298

Potential Holy Grail Security Cure-All

● Encryption is 1-to-many

 99900(4) + 78763298(0) = 2980(4)  Same address (4) accesses

different memory (99900, 2980)

(4)

Called

Hardware

Aliasing

Two devices/memory live at one address

– E.g. old Windows shared library problem

● All versions load at same address

● Applications get unexpected functionality

Still around today

● M/S mem-maps library files by basename

➔ different versions of same library in same

directory don't work. Also .net (sub-4)

Application sees same address access

(5)

Different cause, different rescue

Don't use processor register with stuck bit

Pre/post-correct ALU arithmetic

(6)

The messed-up arithmetic case

Model: Imagine there's a devil

messing with calculations:

● Think: values have invisible extra bits

● 42.1101101

● Represents the many ways of saying '42'

Processor ignores and mutates extra bits

● 42.1101101 + 42.1100001 = 84.0110110

Memory/peripherals

sensitive to extra bits

(7)

Fixing Processor Arithmetic

Clue: processors are

Deterministic

behind the scenes

No matter how haphazard it seems

Solution: deterministic

(8)

Krypto-processor (KPU) case

Many different bit-patterns signify same address 'messed-up on purpose'

Data in one of the crypto-equivalent addresses!

1011

(&4)

&99900 &2980

Soln: always calculate same address same way

(9)

Example

Left program returns

different alias

to caller

 SP – 32 + 32, SP equivalent, not identical  Different calculation, different result

Subroutine foo:

SP -= 32 # 8 local vars

…code ...

SP += 32 # destroy frame

return

Subroutine foo:

GP = SP

SP -= 32

…code ...

SP = GP

return

(10)

Use t

yping

Milner typing

– Assign type variables to every register

and local stack position

– Distinguish by type

● Data

● Data address

– Array data address

– String data address

A type-correct machine code …

(11)

Call stack

Variables in the local frame are ...

– Accessed like arraysBase address + offset

Base address = bottom of stack

● Every stack change starts fresh frame

If

offset < local frame size. there is ...

Only one way of calculating local address

(12)

Heap access

Contains both

array

and

string

addresses

Array … I just did that

– String access: base+1+1+1+1+..+1

(13)

Apply typing

Type-check machine code as per paper...

– Pass guarantees each address …

● Calculated same way each time

– Deterministic processor

– Implies same bit-pattern results each time

Code is safe against hardware aliasing

(14)

Interesting Abstract Computer

Science Things

Formal logic

of

machine code

Each instruction has many interpretations

addiu r1 r1 4

● Change stack pointer in r1 by 4 ● Add 4 to datum in register r1

Disambiguated by decompilation

– Self-consistent decompilation is a proof

Decompiled instructions are proof step names

At most 32 possible code decompilations

(15)

Interesting Abstract Computer

Science Things

Formal logic of machine code

Each instruction has many interpretations

addiu r1 r1 4

● Change stack pointer in r1 by 4 ● Add 4 to datum in register r1

Disambiguated by decompilation

– Self-consistent decompilation is a proof

Decompiled instructions are proof step names

At most 32 possible code decompilations

(16)

Example

32B current frame

{ sp=

c

32

!10

;

(10)=

x

}

ld gp 10(sp)

[

get 10 gp

]

{sp=

c

32

!10

;

(10)=gp=

x

}

'

c

32

!10

' means 'pointer to 32B that ...

has already been written to at offset 10'

(10)=

x

means stack cell 10 is an

x

-thing

Machine code

is '

ld gp 10(sp)

'

– 'load reg gp from offset 10 off stack ptr'

(17)

Uninteresting Abstract

Computer Science Things

Typing restricts the number of valid codes

In machine code, normally everything goes – But only well-typed codes will type

● There are effectively NONE in existence

– We can fix existing ones and check the fix

– We can keep checking through maintenance

– Worse, only iterative sequential machine code

● Makes sense to our typing system

This is not surprising!

Typing is theoretically double-exponential

(18)

Conclusion

Encrypted processing/KPU is what we like

– Secure!

But it has horrible hardware aliasing

● Same address accesses different memory

Solution for class of `damaged' processors

Resilient machine code that

● Calculates each address same way each time ● Processor arithmetic `error' does not matter

Referensi

Dokumen terkait

5 Dinas Pemuda dan Olahraga Biaya Pengawasan Fisik (tidak sederhana), Nilai. Pekerjaan 3,7 M Finishing Tribun dan Lapangan Hockey Dharmawangsa

Kepada para peserta yang merasa keberatan atas penetapan tersebut diatas, diberikan hak untuk menyampaikan sanggahan baik secara sendiri maupun bersama-sama, mulai hari ini

Ada dua hal yang akan dirumuskan kembali dalam cash budget yang sesuai dengan sistem bisnis Islam, yaitu (1) bagaimana bentuk permodalan yang dijalankan dalam

The total rate of cometary mass loss depends on the rate of the ices sublimation, the ionization of gas coma, the liberation of the dust particles, and the solar

Letak wilayah Badau yang sangat jauh dari Pontianak sebagai ibukota Provinsi Kalimantan Barat, dan secara geografis lebih dekat dengan Negara tetangga Malaysia,

Penafsiran ayat al-Qur’an terkait tema tentang relasi politik dan dakwah, dalam konteks kegiatan Majelis Dzikir SBY “Nurussalam”, dapat dipilah sebuah sub tema penting

data ke dalam tabel distribusi frekuensi, tutor meminta kepada seluruh mahasiswa untuk menuliskan data tentang berat badannya di papan tulis, dan melalui data berat badan

[r]