Snap for 15063687 from af718908fb8a22309c773e8455945639f1d14c71 to 26Q2-release Change-Id: I6541761a4cbe24ea7bda5387ff70902f3eed9bf7
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.
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);