Compare commits

...

3 Commits

Author SHA1 Message Date
89db76e555 update injections + projects (cored c/aot) 2026-04-07 22:13:13 +02:00
28a3c37d41 update hosts for cored target
WIP: currently the hosts are not generic and don't support different
targets
2026-04-07 22:12:57 +02:00
39d2e1c51f switch fail markers to function symbols 2026-04-01 21:17:01 +02:00
107 changed files with 698 additions and 147 deletions

View File

@ -9,9 +9,9 @@ trace module:
-e {{ BUILD_DIR }}-{{ module }}/system.elf \
-i {{ BUILD_DIR }}-{{ module }}/system.iso \
-- \
-Wf,--start-symbol=start_trace \
-Wf,--save-symbol=start_trace \
-Wf,--end-symbol=stop_trace \
-Wf,--start-symbol=fail_start_trace \
-Wf,--save-symbol=fail_start_trace \
-Wf,--end-symbol=fail_stop_trace \
-Wf,--state-file={{ BUILD_DIR }}-{{ module }}/state \
-Wf,--trace-file={{ BUILD_DIR }}-{{ module }}/trace.pb \
-Wf,--elf-file={{ BUILD_DIR }}-{{ module }}/system.elf
@ -62,7 +62,7 @@ import module:
[group("4: fail")]
server module:
{{ FAIL_SERVER }} \
--port {{FAIL_SERVER_PORT}} \
--port {{ FAIL_SERVER_PORT }} \
--database-option-file ./db.conf \
-v {{ module }} \
-b % \
@ -87,12 +87,13 @@ client module:
-i {{ BUILD_DIR }}-{{ module }}/system.iso \
-j {{ num_cpus() }} \
-- \
-Wf,--server-port={{FAIL_SERVER_PORT}} \
-Wf,--server-port={{ FAIL_SERVER_PORT }} \
-Wf,--state-dir={{ BUILD_DIR }}-{{ module }}/state \
-Wf,--trap \
-Wf,--timeout=500000 \
-Wf,--ok-marker=ok_marker \
-Wf,--fail-marker=fail_marker \
-Wf,--ok-marker=fail_marker_positive \
-Wf,--fail-marker=fail_marker_negative \
-Wf,--detected-marker=fail_marker_detected \
> /dev/null
@echo "Next step: \"just result {{ module }}\" or \"just resultbrowser\""
@ -127,4 +128,4 @@ result-csv module:
[doc("Start the FAIL* resultbrowser")]
[group("4: fail")]
resultbrowser:
{{ RESULT_BROWSER }} -c ./db.conf --host=0.0.0.0 --port={{RESULTBROWSER_PORT}}
{{ RESULT_BROWSER }} -c ./db.conf --host=0.0.0.0 --port={{ RESULTBROWSER_PORT }}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<PROJECT>
<PROJECT_DATA_XML_NAME NAME="DISPLAY_DATA">
<SAVE_STATE>
<ARRAY NAME="EXPANDED_PATHS" TYPE="string">
<A VALUE="2026-04-07_20-53_cored_c_fail:" />
</ARRAY>
<STATE NAME="SHOW_TABLE" TYPE="boolean" VALUE="false" />
</SAVE_STATE>
</PROJECT_DATA_XML_NAME>
<TOOL_MANAGER ACTIVE_WORKSPACE="Workspace">
<WORKSPACE NAME="Workspace" ACTIVE="true" />
</TOOL_MANAGER>
</PROJECT>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<PROJECT>
<PROJECT_DATA_XML_NAME NAME="DISPLAY_DATA">
<SAVE_STATE>
<ARRAY NAME="EXPANDED_PATHS" TYPE="string">
<A VALUE="2026-04-07_21-44_cored_aot_fail:" />
</ARRAY>
<STATE NAME="SHOW_TABLE" TYPE="boolean" VALUE="false" />
</SAVE_STATE>
</PROJECT_DATA_XML_NAME>
<TOOL_MANAGER ACTIVE_WORKSPACE="Workspace">
<WORKSPACE NAME="Workspace" ACTIVE="true" />
</TOOL_MANAGER>
</PROJECT>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/c_host.o (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/c_module.o (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/grub/boot/system.elf (Stored with Git LFS) Executable file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/markers.csv (Stored with Git LFS) Normal file

Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:25b54cd9a3116901ef5de179db051eea2851cd8ec8d0c1621e346aa1db261900
3 size 178

BIN
injections/2026-04-07_20-53_cored_c_fail/results.txt (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/startup.o (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/cmos (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/config (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/cpu0 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/dma (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/drive0.buffer (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/floppy (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/floppy.buffer (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/gameport (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/hard_drive (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/ioapic (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/keyboard (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/memory (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/memory.ram (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/pc_system (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/pic (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/pit (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/serial (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/vga (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/vga.memory (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/vga.pel_data (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/state/virt_timer (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/system.elf (Stored with Git LFS) Executable file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/system.iso (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_20-53_cored_c_fail/trace.pb (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/grub/boot/system.elf (Stored with Git LFS) Executable file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/markers.csv (Stored with Git LFS) Normal file

Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:ffc8ebed455f1a5659cc43ab844c134e7c7327a384cbcde4d285c3951fd970fc
3 size 2413

BIN
injections/2026-04-07_21-44_cored_aot_fail/module_host.c (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/results.txt (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/startup.o (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/cmos (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/config (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/cpu0 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/dma (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/floppy (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/gameport (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/hard_drive (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/ioapic (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/keyboard (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/memory (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/memory.ram (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/pc_system (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/pic (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/pit (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/serial (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/vga (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/vga.memory (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/state/virt_timer (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/syscalls.o (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/system.elf (Stored with Git LFS) Executable file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/system.iso (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/system.o (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/trace.pb (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/wasm_aot_array.c (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/wasm_module.aot (Stored with Git LFS) Normal file

Binary file not shown.

BIN
injections/2026-04-07_21-44_cored_aot_fail/wasm_module.wasm (Stored with Git LFS) Executable file

Binary file not shown.

View File

@ -1,17 +1,53 @@
#include "lib.h"
#include "../lib.h"
#include "../lib_cored.h"
void fail_start_trace(void) {}
void fail_stop_trace(void) {}
void fail_marker_positive(void) {}
void fail_marker_negative(void) {}
void fail_marker_detected(void) {}
void init_outputs(plain_t x_c, plain_t y_c, plain_t z_c);
int wasm_module(void);
enc_t get_cored_res(void);
MAIN() {
int result;
void os_main(void) {
init_outputs(100, 142, 100);
MARKER(start_trace);
result = wasm_module();
MARKER(stop_trace);
fail_start_trace();
sign_t static_sig = wasm_module();
fail_stop_trace();
if (result == 100) {
MARKER(ok_marker);
sign_t vote_result_sig;
switch (static_sig) {
case SIG_s_XYZ:
case SIG_s_XY:
case SIG_s_XZ:
vote_result_sig = SIG_X;
break;
case SIG_s_YZ:
vote_result_sig = SIG_Y;
break;
default:
break;
}
// Inversely apply constant program flow signature.
enc_t cored_res = get_cored_res();
cored_res -= static_sig;
/* Validate Vote result */
if (!check(cored_res, THE_A, vote_result_sig)) {
fail_marker_detected();
return;
}
plain_t res = decode(cored_res, THE_A, vote_result_sig);
if (res == 100) {
fail_marker_positive();
return;
} else {
MARKER(fail_marker);
fail_marker_negative();
return;
}
}

View File

@ -1,35 +0,0 @@
#pragma once
#define INLINE __attribute__((always_inline)) inline
#define NOINLINE __attribute__((noinline))
#define __QUOTE(x) #x
#define QUOTE(x) __QUOTE(x)
#ifndef ARCH_ASM_CLOBBER_ALL
#define ARCH_ASM_CLOBBER_ALL "eax", "ebx", "ecx", "edx", "esi", "edi", "ebp"
#endif
#ifndef MARKER
#define MARKER(str) \
__asm__ volatile(QUOTE(str) ":" \
: /* no inputs */ \
: /* no outputs */ \
: "memory", ARCH_ASM_CLOBBER_ALL)
#endif
#ifndef MAIN
#define MAIN() void os_main(void)
#endif
#ifndef POSIX_PRINTF
#define POSIX_PRINTF(...)
#endif
typedef __UINT8_TYPE__ uint8_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __UINT32_TYPE__ uint32_t;
typedef __INT8_TYPE__ int8_t;
typedef __INT16_TYPE__ int16_t;
typedef __INT32_TYPE__ int32_t;

View File

@ -1,15 +1,56 @@
#include "../lib_cored.h"
#include <stdio.h>
void init_outputs(plain_t x_c, plain_t y_c, plain_t z_c);
int wasm_module(void);
enc_t get_cored_res(void);
void fail_marker_detected(void) {}
int main(int argc, char *argv[]) {
int result = wasm_module();
init_outputs(100, 142, 100);
sign_t static_sig = wasm_module();
if (result == 100) {
printf("OK Marker\n");
sign_t vote_result_sig;
switch (static_sig) {
case SIG_s_XYZ:
case SIG_s_XY:
case SIG_s_XZ:
vote_result_sig = SIG_X;
break;
case SIG_s_YZ:
vote_result_sig = SIG_Y;
break;
default:
// printf("ERROR: Unknown static_sig %d\n", static_sig);
break;
}
// Inversely apply constant program flow signature.
enc_t cored_res = get_cored_res();
printf("Inversely apply: cored_res=%d static_sig=%d\n", cored_res,
static_sig);
cored_res -= static_sig;
/* Validate Vote result */
printf(
"Validating vote result: cored_res=%d THE_A=%d vote_result_sig = % d\n ",
cored_res, THE_A, vote_result_sig);
if (!check(cored_res, THE_A, vote_result_sig)) {
printf("Validation failed :(\n");
// fail_marker_detected();
return 1;
}
plain_t res = decode(cored_res, THE_A, vote_result_sig);
// printf("Decoded result: %d (%f)\n", res, q_to_float(res));
if (res == 100) {
// fail_marker_positive();
printf("Marker Positive\n");
return 0;
} else {
printf("FAIL Marker\n");
printf("Marker Negative\n");
// fail_marker_negative();
return 1;
}
}

Some files were not shown because too many files have changed in this diff Show More