safe software updates via multi version execution
play

SAFE SOFTWARE UPDATES VIA MULTI-VERSION EXECUTION PETR HOSEK - PowerPoint PPT Presentation

SAFE SOFTWARE UPDATES VIA MULTI-VERSION EXECUTION PETR HOSEK CRISTIAN CADAR Petr Hosek is a recipient of the Google European Fellowship in Software Engineering and this research is supported in part by this Google Fellowship 2009 2010 10 11


  1. SAFE SOFTWARE UPDATES VIA MULTI-VERSION EXECUTION PETR HOSEK CRISTIAN CADAR Petr Hosek is a recipient of the Google European Fellowship in Software Engineering and this research is supported in part by this Google Fellowship

  2. 2009 2010 10 11 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 2

  3. 2009 2010 10 11 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 for (h = 0, i = 0; i < etag->used; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); HTTP ETag hash value computation in etag_mutate 2

  4. 2009 2010 10 11 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 for (h = 0, i = 0; i < etag->used - 1; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); HTTP ETag hash value computation in etag_mutate 2

  5. 2009 2010 10 11 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 Bug diagnosed in issue tracker for (h = 0, i = 0; i < etag->used - 1; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); HTTP ETag hash value computation in etag_mutate 2

  6. etag_mutate(con->physical.etag, srv->tmp_buf); File (re)compression in mod_compress_physical 2009 2010 10 11 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 Bug diagnosed in issue tracker for (h = 0, i = 0; i < etag->used - 1; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); HTTP ETag hash value computation in etag_mutate 2

  7. if (use_etag) { etag_mutate(con->physical.etag, srv->tmp_buf); } File (re)compression in mod_compress_physical 2009 2010 10 11 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 Bug diagnosed in issue tracker for (h = 0, i = 0; i < etag->used - 1; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); HTTP ETag hash value computation in etag_mutate 2

  8. if (use_etag) { etag_mutate(con->physical.etag, srv->tmp_buf); } File (re)compression in mod_compress_physical 2009 2010 10 11 12 01 02 03 04 04 05 05 06 06 07 07 08 08 09 09 10 10 11 11 12 12 01 01 02 02 03 03 04 04 05 06 07 08 09 10 11 12 01 02 03 Bug diagnosed in issue tracker for (h = 0, i = 0; i < etag->used - 1; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); HTTP ETag hash value computation in etag_mutate 2

  9. A year ago in a city far far away... Introducing novel approach for improving software updates: Multi-version execution based approach Relying on abundance of resources to improve reliability Run the new version in parallel with the existing one Synchronise the execution of the versions Use output of correctly executing version 3

  10. LIGHTTPD 1.4.23 LIGHTTPD 1.4.22 Synchronisation and fail-recovery mechanism 4

  11. LIGHTTPD 1.4.23 LIGHTTPD 1.4.22 Synchronisation Compare individual system calls and their arguments Synchronisation and fail-recovery mechanism 4

  12. LIGHTTPD 1.4.23 LIGHTTPD 1.4.22 GET /index.html HTTP/1.1 Synchronisation Host: srg.doc.ic.ac.uk Accept-Encoding: gzip Compare individual system calls and their arguments Synchronisation and fail-recovery mechanism 4

  13. LIGHTTPD 1.4.23 LIGHTTPD 1.4.22 GET /index.html HTTP/1.1 Checkpointing Synchronisation Host: srg.doc.ic.ac.uk Accept-Encoding: gzip Compare individual Use clone to take a system calls and snapshot of a process their arguments Synchronisation and fail-recovery mechanism 4

  14. LIGHTTPD 1.4.23 LIGHTTPD 1.4.22 GET /index.html HTTP/1.1 Checkpointing Synchronisation Host: srg.doc.ic.ac.uk Accept-Encoding: gzip Compare individual Use clone to take a system calls and snapshot of a process their arguments for (h = 0, i = 0; i < etag->used; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); Synchronisation and fail-recovery mechanism 4

  15. LIGHTTPD 1.4.23 LIGHTTPD 1.4.22 GET /index.html HTTP/1.1 Checkpointing Synchronisation Host: srg.doc.ic.ac.uk Accept-Encoding: gzip Compare individual Use clone to take a system calls and snapshot of a process their arguments for (h = 0, i = 0; i < etag->used; ++i) for (h = 0, i = 0; i < etag->used - 1; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); Crash Segmentation fault Synchronisation and fail-recovery mechanism 4

  16. LIGHTTPD 1.4.23 LIGHTTPD 1.4.22 GET /index.html HTTP/1.1 Checkpointing Synchronisation Host: srg.doc.ic.ac.uk Accept-Encoding: gzip Compare individual Use clone to take a system calls and snapshot of a process their arguments for (h = 0, i = 0; i < etag->used; ++i) for (h = 0, i = 0; i < etag->used - 1; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); Crash Segmentation fault Failure recovery Restart the snapshot and replace the code with the code of the new version Synchronisation and fail-recovery mechanism 4

  17. LIGHTTPD 1.4.23 LIGHTTPD 1.4.22 GET /index.html HTTP/1.1 Checkpointing Synchronisation Host: srg.doc.ic.ac.uk Accept-Encoding: gzip Compare individual Use clone to take a system calls and snapshot of a process their arguments for (h = 0, i = 0; i < etag->used; ++i) for (h = 0, i = 0; i < etag->used - 1; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); Crash Segmentation fault Failure recovery for (h = 0, i = 0; i < etag->used; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); Restart the snapshot and replace the code Reconvergence with the code of the Return to the new version original code and continue execution Synchronisation and fail-recovery mechanism 4

  18. LIGHTTPD 1.4.23 LIGHTTPD 1.4.22 GET /index.html HTTP/1.1 Checkpointing Synchronisation Host: srg.doc.ic.ac.uk Accept-Encoding: gzip Compare individual Use clone to take a system calls and snapshot of a process their arguments for (h = 0, i = 0; i < etag->used; ++i) for (h = 0, i = 0; i < etag->used - 1; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); Crash Segmentation fault Failure recovery for (h = 0, i = 0; i < etag->used; ++i) h = (h << 5) ^ (h >> 27) ^ (etag->ptr[i]); Restart the snapshot and replace the code Reconvergence with the code of the Return to the new version original code and continue execution Synchronisation and fail-recovery mechanism 4

  19. Assumptions Recovery considered successful if versions exhibit the same externally observable behaviour after recovery: Assumes small bug propagation distance Crashes are the only type of observable divergences The non-crashing version used as an oracle If unrecoverable, continue with the non-crashing version 5

  20. Uncoordinated Execution Total Synchronisation Synchronisation possible at multiple levels of abstraction 6

  21. Uncoordinated Execution Total Synchronisation System Calls Synchronisation possible at multiple levels of abstraction 6

  22. Uncoordinated Execution Function Calls Total Synchronisation System Calls Synchronisation possible at multiple levels of abstraction 6

  23. Uncoordinated Execution Function Calls Total Synchronisation System Calls Inputs/Outputs Synchronisation possible at multiple levels of abstraction 6

  24. System calls define external behaviour VERSION 1 VERSION 2 void fib( int n) void fib( int n) { { int f[n+1]; int a = 1, b = 1; f[1] = f[2] = 1; for ( int i = 3; i <= n; ++i) { for ( int i = 3; i <= n; ++i) int c = a + b; f[i] = f[i-1] + f[i-2]; a = b, b = c; } printf(“%d\n”, f[n]); printf(“%d\n”, b); } } int main( int argc, char **argv) { fib(5); fib(6); } Example testing code Tested with both implementations 7

  25. System calls define external behaviour VERSION 1 VERSION 1 VERSION 2 VERSION 2 void fib( int n) void fib( int n) { { int f[n+1]; int a = 1, b = 1; f[1] = f[2] = 1; for ( int i = 3; i <= n; ++i) { write(1, “5\n”, 2) = 2 write(1, “5\n”, 2) = 2 for ( int i = 3; i <= n; ++i) int c = a + b; write(1, “8\n”, 2) = 2 write(1, “8\n”, 2) = 2 f[i] = f[i-1] + f[i-2]; a = b, b = c; } printf(“%d\n”, f[n]); printf(“%d\n”, b); } } Snippet of system call trace Snippet of system call trace Obtained using the strace tool Obtained using the strace tool int main( int argc, char **argv) { fib(5); fib(6); } Example testing code Tested with both implementations 7

  26. External behaviour evolves sporadically 95% of revisions introduce no change 1 Traces Source code 0.75 difference (normalised) 0.5 0.25 0 2379 2393 2411 2432 2473 2494 2517 2546 2578 2599 2621 2635 lighttpd Subversion revision Measured using lighttpd regression suite on 164 revisions Taken on Linux kernel 2.6.40 and glibc 2.14 using strace tool and custom post-processing (details in the paper) 8

  27. Mx architecture RUNTIME MANIPULATION STATIC ANALYSIS MULTI-VERSION APPLICATION CONVENTIONAL APPLICATION SYSTEM CALL INTERPOSITION Mx Execution Environment OPERATING SYSTEM LINUX KERNEL 9

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend