+ All Categories
Home > Documents > Efficient Software-Based Fault Isolation

Efficient Software-Based Fault Isolation

Date post: 19-Mar-2016
Category:
Upload: calais
View: 35 times
Download: 1 times
Share this document with a friend
Description:
Efficient Software-Based Fault Isolation. Authors: Robert Wahbe Steven Lucco Thomas E. Anderson Susan L. Graham Presenter: Gregory Netland. The Big Picture. Two Main things: Loading the distrusted code into its own fault domain Only mistrusted Cheaper RPC for cross fault domains - PowerPoint PPT Presentation
Popular Tags:
21
Efficient Software-Based Fault Isolation Authors: Robert Wahbe Steven Lucco Thomas E. Anderson Susan L. Graham Presenter: Gregory Netland
Transcript
Page 1: Efficient Software-Based Fault Isolation

Efficient Software-Based Fault Isolation

Authors: Robert Wahbe Steven Lucco Thomas E. Anderson Susan L. Graham

Presenter: Gregory Netland

Page 2: Efficient Software-Based Fault Isolation

The Big Picture

• Two Main things:– Loading the distrusted code into its own fault

domain• Only mistrusted• Cheaper RPC for cross fault domains

– Modify object code so it doesn’t jump to an area it is not supposed to

Page 3: Efficient Software-Based Fault Isolation

Introduction – More Big Picture

Definitions and such• 1993 - what was happening…133mhz, WTC,

microkernels• Sandboxing – only slightly increases execution

time• Modifying Object Code• Fault Domains – a logically separate portion of

the applications address space, and has a uniques identifier which is used to control its access

Page 4: Efficient Software-Based Fault Isolation

Examples of Programs that could cause problems

• PostGres – queries with extension code can play with data not its own or just mess with database in general

• BSD (three areas)• Microsoft’s Object Linking

• As more things are moved to the user level, more third party code can mess with kernel operations - ?

Page 5: Efficient Software-Based Fault Isolation

Other Examples• Unix vnode interface – easy to add file system• I/O / Active Messages – compiled into kernel for

reasonable performance• Quark Xpress – extension modules can currupt

its data structures

What does this showsignificant portion of time being spent in operating system context switch code

only a small amount of code is distrusted

Page 6: Efficient Software-Based Fault Isolation

Why us software and not Hardware

• Does not scale with processor integer performance

• High Cost for address switching– RPC example: requires at least

• A trap into the operating system kernel• Copying each argument from the caller to callee• Saving and restoring registers• Switching hardware address spaces• Possibly flushing the TLB• A trap back to user level• Rinse and repeat

Page 7: Efficient Software-Based Fault Isolation

Software Enforced Fault Isolation

• Going back to the big picture, we have to locate were faults occur in a software module and then we can look at Sandboxing

• Cut up the virtual address space into separate chunks

Page 8: Efficient Software-Based Fault Isolation

Segment Identifier

• Divide an applications virtual address space into segments

• All virtual addresses share pattern of upper bits

• Fault domain has two segments– One for distrusted module’s code– Other for heap, stack, and static data

Page 9: Efficient Software-Based Fault Isolation

Software Encapsulation

• Distrusted code can only jump within its segment, as well as write to its segment, due to the segment identifiers

• All legal jumps have same bit pattern• This doesn’t solve all problems, the os will

still need to catch illegal things, such as unmapped pages

• We have two techniques for this…….

Page 10: Efficient Software-Based Fault Isolation

Segment matching

• Insert Checking code before any unsafe instruction (unsafe means not statically verifiable…jumps through registers - procedure returns, or stores in registers for target address are considered unsafe)

• Is it in the correct segment?• If not, trap to system error

Page 11: Efficient Software-Based Fault Isolation

• Uses 4 registers, but not a problem based on their tests

• can pinpoint the offending instruction, there for better for development

• Or can skip the pinpointing for efficiency

Page 12: Efficient Software-Based Fault Isolation

Or Sandboxing

• This sets the upper bits to the correct segment identifier

• This doesn’t catch, it stops

• Verifiable• Takes 5 registers

instead of 4

Page 13: Efficient Software-Based Fault Isolation

Optimizations

• Register + offset and guardzones –this avoids uneeded math to compute target addresses. They sandbox reg and not reg + offset to save an instruction.

• MIPS stack pointer as a dedicated register and the stack pointer is only sandboxed when set

• Transformation tool to remove sandboxing from loops

Page 14: Efficient Software-Based Fault Isolation

Process Resources

• Need to stop multiple fault domains that share the same virtual address space from corrupting per-address-space resources

– Let the operating system know– Cross fault domain RPC

Page 15: Efficient Software-Based Fault Isolation

Data Sharing• Cant work the same way hardware implementation does

because hw solution manipulates page table entries in a different way.

• Read only is not a problem because fault domains can read any memory within the address space

• Read-write through lazy pointer swizzling– Modify hardware page tables to map the shared memory region

into every address space segment that needs access– Automatically translates into own segment through sandboxing

• Another option is shared segment matching, dedicated registers to hold bitmap that tells which segments the fault domain can access

Page 16: Efficient Software-Based Fault Isolation

Implementation and Verification

• Unsafe regions are areas of code that modify jump dedicated register

• Is the dedicated register valid upon exiting the region

• Disadvantages– Most modified compilers only support one language– Compiler and verifier must be synchronized– Binary patching can fix these things, however not

robust enough

Page 17: Efficient Software-Based Fault Isolation

Binary patching

• System can encapsulate the module by directly modifying object code

• Unfornately, a good technique for this does not exist yet

Page 18: Efficient Software-Based Fault Isolation

• Jump table is legal address outside the fault domain

• Kept in read only, so only modified by trusted code

• Stubs are unprotected and responsible for copying cross domain arguments

Page 19: Efficient Software-Based Fault Isolation

Fast communication between fault domains

• Calling a trusted stub outside of your domain– Jump table – only modified by trusted code, and legal entry point outside domain

• Arguments are passed between fault domains– Because they are trusted, we can copy directly to target domain***

• Fault isolation– In a cross domain call the registers used by the caller and possibly modified by

the callee are protected– Switch execution stack– Validate registers– Establish register context for encapsulation

• Errors– Addressing violation, loops, etc…

Page 20: Efficient Software-Based Fault Isolation

Results

• How much overhead?• How fast is cross domain fault?

Page 21: Efficient Software-Based Fault Isolation

Related Work• At this time it was typical to buld micro-kernel

operating systems with separate address spaces– This meant heavy ipc with untrusted domains– Performance problems

• Some people loaded modules into kernel address space (co-location)– Which means performance over protection

• So, this paper is trying to get performance and protection.


Recommended