Android CTS 17.0 release 1
Snap for 15063687 from af718908fb8a22309c773e8455945639f1d14c71 to 26Q2-release

Change-Id: I6541761a4cbe24ea7bda5387ff70902f3eed9bf7
tree: a497de769021a0883b3082850a734be777b152a8
  1. src/
  2. subprojects/
  3. test/
  4. tools/
  5. .gitignore
  6. Android.bp
  7. LICENSE
  8. meson.build
  9. meson_options.txt
  10. METADATA
  11. MODULE_LICENSE_MIT
  12. OWNERS
  13. README.md
  14. TEST_MAPPING
README.md

LFI Verifier

Installation

meson setup build
cd build
ninja

This produces the liblfiv.a library, along with a lfi-verify tool that can be used on ELF binaries.

Usage

For actual usage of the verifier, you should link with the liblfiv.a library, which provides the following API:

enum LFIBoxType {
    LFI_BOX_FULL,
    LFI_BOX_STORES,
};

struct LFIVOptions {
    // Sandbox type (full, stores-only).
    enum LFIBoxType box;

    // Callback to print a null-terminated error message if verification fails.
    void (*err)(char *msg, size_t size);
};

struct LFIVerifier {
    // Verifier options.
    struct LFIVOptions opts;

    // Verify the given code buffer, assuming a start address of vaddr.
    bool (*verify)(char *code, size_t size, uintptr_t vaddr, struct LFIVOptions *opts);
};

// Run the arm64 verifier.
bool
lfiv_verify_arm64(char *code, size_t size, uintptr_t addr, struct LFIVOptions *opts);

// Run the x64 verifier.
bool
lfiv_verify_x64(char *code, size_t size, uintptr_t addr, struct LFIVOptions *opts);