GithubHelp home page GithubHelp logo

jtcriswell / sva Goto Github PK

View Code? Open in Web Editor NEW
41.0 41.0 17.0 21.42 MB

Secure Virtual Architecture

Home Page: http://sva.cs.illinois.edu

License: Other

Makefile 0.52% C 4.42% Objective-C 2.09% C++ 68.35% Assembly 4.52% CMake 0.25% Shell 0.67% OCaml 0.44% Python 0.83% HTML 4.10% Perl 0.16% CSS 0.06% LLVM 13.08% Objective-C++ 0.41% MATLAB 0.03% Mercury 0.01% Cuda 0.01% M 0.01% JavaScript 0.02% Emacs Lisp 0.03%

sva's People

Contributors

bluefintuna avatar chaosdefinition avatar irichter avatar jtcriswell avatar ndauten avatar roulika avatar xiaowandong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sva's Issues

Must recompile libc with TLS disabled

The libc library must be recompiled with thread-local storage (TLS) disabled in order to work on SVA. This requires recompiling init and possibly mount and sh as well since they are statically linked.

Building /sbin fails when following build directions

Building /sbin fails when following the build directions in README.md. The problem is that one of the network utilities includes proc.h from the kernel which, in turn, includes an SVA header file which cannot be found because the user-space Makefiles aren't looking in the right directories for SVA header files.

Interrupt Context to Trapframe Hack exposes application registers

The hacks in SVA/lib/debug.c that convert the Interrupt Context into a FreeBSD trapframe so that we don't need to recode the FreeBSD trap handling functions exposes application registers that Virtual Ghost is designed to hide (the full port of Linux 2.4.22 to SVA demonstrated that such hacks were unnecessary). Furthermore, for all SVA-based systems, it unnecessarily increases interrupt, trap, and system call latency.

Freeing Ghost Memory Causes Kernel Panic

An attempt to deallocate ghost memory (either on process exit or explicitly via a hyper call) causes a panic. The problem is that the unmapSecureMemory() function within SVA (Virtual Ghost) assumes that the page tables it should use are from the current process. However, in some cases, the ghost memory to free belongs to another process.

CFI Checks Permit User-Space Targets

The CFI instrumentation does not add code to set the higher-order bits of an indirect branch target if the branch instruction reads its operand from memory. The purpose of setting these higher-order bits is to ensure that the target of the indirect branch resides in the kernel's code segment (as opposed to a user-space code segment).

Make SVAThread Allocation Dynamic

The current SVA implementation statically allocates SVAThread structures; it is possible to run out of SVAThreads even if the system has ample physical memory. The SVA implementation should be changed so that SVAThreads are allocated and freed dynamically.

Configuration macros not used in handlers.S

The handlers.S file does not include config.h, preventing Virtual Ghost configuration options from enabling code within the assembly code. Virtual Ghost features in C code including config.h are conditionally compiled properly.

setoperand() causes error in LLVM4.0.1 or newer version

SI.setOperand (1, newPtr);

For a LoadInst or StoreInst I, we get its pointer by I->getPointerOperand(). After some bit-masking operations on the pointer we updated the pointer in the Instruction by I->setoperand().

In the current commit, it's done by I->set(0, newPtr); however, this would cause error for LLVM 4.0.1 or newer versions. There is no compilation error, but when we use opt to optimize programs, this would throw errors like i32Stored value type does not match pointer operand type!.

Current implementation of getPointerOperand() shows that the pointer operand is the second one (see http://llvm.org/doxygen/Instructions_8h_source.html#l00402). So we should use I->setoperand(1, newPtr) to update the bit-masked address in new LLVM.

Incorrect bound checking in secmem.c

The function freeSecureMemory() in secmem.c tries to check if a value is within a range by chaining the comparisons together (SECMEMSTART <= pint < SECMEMEND).

Make SVA Support Thread Local Storage (TLS)

The current SVA implementation does not support Thread Local Storage (TLS). This requires us to modify the C library so that malloc() does not use TLS. This, in turn, is a problem as later FreeBSD C libraries do not provide a simple option to disable TLS.

The SVA implementation should be enhanced so that existing binaries that use TLS work.

SVA ghost memory free hyper call does not free all ghost memory

The SVA VM "hyper call" for deallocating ghost memory assumes that it is only freeing a single page of ghost memory. Other ghost memory pages remain allocated. While this may have originally been intended, it really should accept an arbitrary size of ghost memory to free and free it.

Error when building llvm

Hello!
I'm trying to follow the instruction in README.md to install SVA, but an error occured when running 'make' in ${REPO_DIR}/llvm. The logs are as follows:

llvm[2]: Constructing LLVMBuild project information.
Traceback (most recent call last):
  File "/home/yan_ice/Desktop/Teecert/SVA/llvm/utils/llvm-build/llvm-build", line 3, in <module>
    import llvmbuild
  File "/home/yan_ice/Desktop/Teecert/SVA/llvm/utils/llvm-build/llvmbuild/__init__.py", line 1, in <module>
    from main import main
ModuleNotFoundError: No module named 'main'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/yan_ice/Desktop/Teecert/SVA/llvm/lib/DebugInfo'
make[1]: Leaving directory '/home/yan_ice/Desktop/Teecert/SVA/llvm/lib'
make[1]: Entering directory '/home/yan_ice/Desktop/Teecert/SVA/llvm/tools/llvm-config'
llvm[1]: Constructing LLVMBuild project information.
Traceback (most recent call last):
  File "/home/yan_ice/Desktop/Teecert/SVA/llvm/utils/llvm-build/llvm-build", line 3, in <module>
    import llvmbuild
  File "/home/yan_ice/Desktop/Teecert/SVA/llvm/utils/llvm-build/llvmbuild/__init__.py", line 1, in <module>
    from main import main
ModuleNotFoundError: No module named 'main'
llvm[1]: Compiling llvm-config.cpp for Release+Asserts build
llvm-config.cpp:45:10: fatal error: 'LibraryDependencies.inc' file not found
#include "LibraryDependencies.inc"
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

It seems that there is something wrong with my python environment. I've tried to find some solutions about it, but they were all failed.
I'm using Ubuntu 20.04, and my python version is 3.9.16 with minoconda installed. How to solve it?
Thanks for your help!

The sva_mm_load_pgtable() intrinsic fails to flush TLB when swapping Ghost Memory

The sva_mm_load_pgtable() SVA-OS instruction fails to flush the TLB after modifying the PML4E entry that maps ghost memory for the currently running thread. This could cause a thread to access another thread's ghost memory if the processor somehow loads a TLB entry with the old PML4E entry before sva_mm_load_pgtable() finishes execution.

Configure script requires that many options be explicitly specified

The Autoconf configure script for SVA, being written at the last minute and at great expense, requires that many of the --enable and --disable options be specified explicitly on the configure command line instead of having defaults. This is annoying and should be fixed.

SVA fails to deallocate ghost memory upon process termination

When a process exits, the sva_release_stack() intrinsic does not deallocate the physical memory used for ghost memory. Instead, it merely unmaps it and releases page table pages that are no longer needed for mapping the now unused ghost memory.

SVA-OS Intrinsics Should Vet State ID

SVA-OS intrinsics that take, as input, a state ID number should vet that the ID is valid. At least one intrinsic (sva_release_stack()) does not; there may be others.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.