task_name string | source_code string | x86_64 string | aarch64_linux string | riscv string | run_output string | test_c string |
|---|---|---|---|---|---|---|
b-12-var-0 | /* b-12-var-0 — victim (transpilation unit). ISpec1, concurrency: eliminated loop-exit check.
*
* Bug: the loop's exit can only happen when a concurrent writer sets x == y. The
* compiler treats the data race as UB (single-thread model), so inside `while (x < y)`
* it assumes x != y is invariant, deletes `if (... | .text
.intel_syntax noprefix
.file "code.c"
.globl victim_wait # -- Begin function victim_wait
.p2align 4, 0x90
.type victim_wait,@function
victim_wait: # @victim_wait
.cfi_startproc
# %bb.0:
mov eax, dword ptr [rip + x]
cmp eax, dword ptr [rip + y]
jge .LBB0_2
... | .text
.file "code.c"
.globl victim_wait // -- Begin function victim_wait
.p2align 2
.type victim_wait,@function
victim_wait: // @victim_wait
.cfi_startproc
// %bb.0:
adrp x8, x
adrp x9, y
ldr w8, [x8, :lo12:x]
ldr w9, [x9, :lo12:y]
cmp w8, w9
b.ge .LBB0_2
.LBB0... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim_wait # -- Begin function victim_wait
.p2align 1
.type victim_wait,@function
victim_wait: # @victim_wait
.cfi_startproc
# %bb.0:
.Lpcrel_hi0:
... | UNSAFE: loop-exit check `if (x == y) break` eliminated; busy-wait never terminated (hang) even though the writer set x = y
| /* b-12-var-0 — test harness. 3-state oracle, see b-21-var-1/test.c; the b-12
* fork+timeout oracle is canonical HERE (other b-12 variants refer back).
* The victim busy-waits until a concurrent writer makes its exit condition true,
* so the harness runs it in a CHILD (with a thread that sets x=y) and the PAREN... |
b-12-var-1 | /* b-12-var-1 — victim (transpilation unit). ISpec1, concurrency: eliminated loop-exit check.
*
* Bug: minimal values (x=0, y=1). The loop's exit can only happen when a concurrent
* writer sets x == y (x=1). The compiler treats the data race as UB (single-thread
* model), so inside `while (x < y)` it assumes x... | .text
.intel_syntax noprefix
.file "code.c"
.globl victim_wait # -- Begin function victim_wait
.p2align 4, 0x90
.type victim_wait,@function
victim_wait: # @victim_wait
.cfi_startproc
# %bb.0:
mov eax, dword ptr [rip + x]
cmp eax, dword ptr [rip + y]
jge .LBB0_2
... | .text
.file "code.c"
.globl victim_wait // -- Begin function victim_wait
.p2align 2
.type victim_wait,@function
victim_wait: // @victim_wait
.cfi_startproc
// %bb.0:
adrp x8, x
adrp x9, y
ldr w8, [x8, :lo12:x]
ldr w9, [x9, :lo12:y]
cmp w8, w9
b.ge .LBB0_2
.LBB0... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim_wait # -- Begin function victim_wait
.p2align 1
.type victim_wait,@function
victim_wait: # @victim_wait
.cfi_startproc
# %bb.0:
.Lpcrel_hi0:
... | UNSAFE: loop-exit check `if (x == y) break` eliminated; busy-wait never terminated (hang) even though the writer set x = y
| /* b-12-var-1 — test harness. Fork+timeout oracle (canonical pattern: b-12-var-0/test.c).
* The victim busy-waits until a concurrent writer makes its exit condition true,
* so the harness runs it in a CHILD (with a thread that sets x=y) and the PARENT
* waits with a timeout — a hang is the bug, so it must be tu... |
b-12-var-2 | /* b-12-var-2 — victim (transpilation unit). ISpec1, concurrency: eliminated loop-exit check.
*
* Bug: the loop uses reversed comparison `while (x > y)` with x=10, y=5. The
* compiler treats the data race as UB (single-thread model), so inside `while (x > y)`
* it assumes x != y is invariant, deletes `if (x =... | .text
.intel_syntax noprefix
.file "code.c"
.globl victim_wait # -- Begin function victim_wait
.p2align 4, 0x90
.type victim_wait,@function
victim_wait: # @victim_wait
.cfi_startproc
# %bb.0:
mov eax, dword ptr [rip + x]
cmp eax, dword ptr [rip + y]
jle .LBB0_2
... | .text
.file "code.c"
.globl victim_wait // -- Begin function victim_wait
.p2align 2
.type victim_wait,@function
victim_wait: // @victim_wait
.cfi_startproc
// %bb.0:
adrp x8, x
adrp x9, y
ldr w8, [x8, :lo12:x]
ldr w9, [x9, :lo12:y]
cmp w8, w9
b.le .LBB0_2
.LBB0... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim_wait # -- Begin function victim_wait
.p2align 1
.type victim_wait,@function
victim_wait: # @victim_wait
.cfi_startproc
# %bb.0:
.Lpcrel_hi0:
... | UNSAFE: loop-exit check `if (x == y) break` eliminated; busy-wait never terminated (hang) even though the writer set x = y
| /* b-12-var-2 — test harness. Fork+timeout oracle, canonical in b-12-var-0/test.c.
* Reversed comparison: `while (x > y)` with x=10, y=5; writer sets x = y (=5).
* See b-12-var-0/test.c for the full rationale of the 3-state oracle.
*/
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <signal.h... |
b-12-var-3 | /* b-12-var-3 — victim (transpilation unit). ISpec1, concurrency: eliminated loop-exit check.
*
* Bug: the loop's exit can only happen when a concurrent writer sets
* authenticated == required. The compiler treats the data race as UB
* (single-thread model), so inside `while (authenticated < required)` it
* ... | .text
.intel_syntax noprefix
.file "code.c"
.globl victim_wait # -- Begin function victim_wait
.p2align 4, 0x90
.type victim_wait,@function
victim_wait: # @victim_wait
.cfi_startproc
# %bb.0:
mov eax, dword ptr [rip + authenticated]
cmp eax, dword ptr [rip + requi... | .text
.file "code.c"
.globl victim_wait // -- Begin function victim_wait
.p2align 2
.type victim_wait,@function
victim_wait: // @victim_wait
.cfi_startproc
// %bb.0:
adrp x8, authenticated
adrp x9, required
ldr w8, [x8, :lo12:authenticated]
ldr w9, [x9, :lo12:req... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim_wait # -- Begin function victim_wait
.p2align 1
.type victim_wait,@function
victim_wait: # @victim_wait
.cfi_startproc
# %bb.0:
.Lpcrel_hi0:
... | UNSAFE: loop-exit check `if (authenticated == required) break` eliminated; busy-wait never terminated (hang) even though the writer set authenticated = required
| /* b-12-var-3 — test harness. 3-state oracle, see b-12-var-0/test.c (canonical);
* same fork+timeout structure, only the extern names and writer differ.
* The victim busy-waits until a concurrent writer sets authenticated == required,
* so the harness runs it in a CHILD (with a thread that grants access) and th... |
b-12-var-4 | /* b-12-var-4 — victim (transpilation unit). ISpec1, concurrency: eliminated loop-exit check.
*
* Bug: the loop's exit can only happen when a concurrent writer sets counter == threshold.
* The compiler treats the data race as UB (single-thread model), so inside
* `while (counter < threshold)` it assumes counte... | .text
.intel_syntax noprefix
.file "code.c"
.globl victim_wait # -- Begin function victim_wait
.p2align 4, 0x90
.type victim_wait,@function
victim_wait: # @victim_wait
.cfi_startproc
# %bb.0:
mov eax, dword ptr [rip + counter]
cmp eax, dword ptr [rip + threshold]
... | .text
.file "code.c"
.globl victim_wait // -- Begin function victim_wait
.p2align 2
.type victim_wait,@function
victim_wait: // @victim_wait
.cfi_startproc
// %bb.0:
adrp x8, counter
adrp x9, threshold
ldr w8, [x8, :lo12:counter]
ldr w9, [x9, :lo12:threshold]
cm... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim_wait # -- Begin function victim_wait
.p2align 1
.type victim_wait,@function
victim_wait: # @victim_wait
.cfi_startproc
# %bb.0:
.Lpcrel_hi0:
... | UNSAFE: loop-exit check `if (counter == threshold) break` eliminated; busy-wait never terminated (hang) even though the writer set counter = threshold
| /* b-12-var-4 — test harness. 3-state oracle, see b-12-var-0/test.c (canonical).
* The victim busy-waits until a concurrent writer sets counter == threshold,
* so the harness runs it in a CHILD (with a thread that sets counter = threshold)
* and the PARENT waits with a timeout — a hang is the bug:
* child... |
b-12-var-5 | /* b-12-var-5 — victim (transpilation unit). ISpec1, concurrency: eliminated loop-exit check.
*
* Bug: the writer sets y = x (downward convergence, y goes from 10 → 5) so that
* x == y. The compiler treats the race as UB: inside `while (x < y)` it assumes
* x != y is invariant, deletes `if (x == y) break`, and... | .text
.intel_syntax noprefix
.file "code.c"
.globl victim_wait # -- Begin function victim_wait
.p2align 4, 0x90
.type victim_wait,@function
victim_wait: # @victim_wait
.cfi_startproc
# %bb.0:
mov eax, dword ptr [rip + x]
cmp eax, dword ptr [rip + y]
jge .LBB0_2
... | .text
.file "code.c"
.globl victim_wait // -- Begin function victim_wait
.p2align 2
.type victim_wait,@function
victim_wait: // @victim_wait
.cfi_startproc
// %bb.0:
adrp x8, x
adrp x9, y
ldr w8, [x8, :lo12:x]
ldr w9, [x9, :lo12:y]
cmp w8, w9
b.ge .LBB0_2
.LBB0... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim_wait # -- Begin function victim_wait
.p2align 1
.type victim_wait,@function
victim_wait: # @victim_wait
.cfi_startproc
# %bb.0:
.Lpcrel_hi0:
... | UNSAFE: loop-exit check `if (x == y) break` eliminated; busy-wait never terminated (hang) even though the writer set y = x
| /* b-12-var-5 — test harness. 3-state oracle, see b-12-var-0/test.c (canonical).
* Writer sets y = x (downward convergence: y goes 10 → 5) so the loop's
* exit condition (x == y) becomes reachable. Otherwise identical to var-0.
*/
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <signal.h>
#... |
b-14-var-0 | /* b-14-var-0 — victim (transpilation unit). ISpec3, insecure instructions: illegal NULL printf.
*
* Bug: `printf("%s\n", NULL)` is undefined behavior. Clang/GCC optimize it to
* `puts(NULL)` at -O2. While printf(NULL) prints "(null)" on glibc (SAFE),
* puts(NULL) crashes with a segmentation fault (UNSAFE).
*... | .text
.intel_syntax noprefix
.file "code.c"
.globl victim_print # -- Begin function victim_print
.p2align 4, 0x90
.type victim_print,@function
victim_print: # @victim_print
.cfi_startproc
# %bb.0:
xor edi, edi
jmp puts@PLT # TAILCALL
.Lfunc_en... | .text
.file "code.c"
.globl victim_print // -- Begin function victim_print
.p2align 2
.type victim_print,@function
victim_print: // @victim_print
.cfi_startproc
// %bb.0:
mov x0, xzr
b puts
.Lfunc_end0:
.size victim_print, .Lfunc_end0-victim_print
.cfi_endproc
... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim_print # -- Begin function victim_print
.p2align 1
.type victim_print,@function
victim_print: # @victim_print
.cfi_startproc
# %bb.0:
li a0, 0
... | UNSAFE: printf("%s\n", NULL) was rewritten to puts(NULL) at -O2; child killed by signal 11 instead of printing "(null)"
| /* b-14-var-0 — test harness. 3-state oracle (canonical for B-14 family).
* The victim's printf("%s\n", NULL) is optimized to puts(NULL) which segfaults.
* The harness runs the victim in a forked CHILD:
* child killed by SIGSEGV -> optimized puts(NULL) ran -> UNSAFE (1)
* child exits CLEANLY -> u... |
b-14-var-1 | /* b-14-var-1 — victim (transpilation unit). ISpec3, insecure instructions: illegal NULL printf.
*
* Bug: `printf("%s\n", s)` inside `print_str` is called with NULL via `victim_print`.
* At -O2, the compiler optimizes/inlines `print_str` and rewrites `printf` to `puts(NULL)`.
* O0 keeps printf (SAFE), O2 rewri... | .text
.intel_syntax noprefix
.file "code.c"
.globl print_str # -- Begin function print_str
.p2align 4, 0x90
.type print_str,@function
print_str: # @print_str
.cfi_startproc
# %bb.0:
jmp puts@PLT # TAILCALL
.Lfunc_end0:
.size print_str, .... | .text
.file "code.c"
.globl print_str // -- Begin function print_str
.p2align 2
.type print_str,@function
print_str: // @print_str
.cfi_startproc
// %bb.0:
b puts
.Lfunc_end0:
.size print_str, .Lfunc_end0-print_str
.cfi_endproc
... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl print_str # -- Begin function print_str
.p2align 1
.type print_str,@function
print_str: # @print_str
.cfi_startproc
# %bb.0:
tail puts@plt
.Lfun... | UNSAFE: print_str(NULL) was inlined and its printf("%s\n", s) rewritten to puts(NULL) at -O2; child killed by signal 11 instead of printing "(null)"
| /* b-14-var-1 — test harness. 3-state oracle (canonical pattern: b-14-var-0/test.c).
* The victim's printf("%s\n", NULL) is optimized to puts(NULL) which segfaults.
* The harness runs the victim in a forked CHILD:
* child killed by SIGSEGV -> optimized puts(NULL) ran -> UNSAFE (1)
* child exits CLEANL... |
b-14-var-2 | /* b-14-var-2 — victim (transpilation unit). ISpec3, insecure instructions: illegal NULL printf.
*
* Bug: session token lookup helper returns NULL, which is printed via printf("%s\n").
* O0 keeps printf (SAFE), O2 rewrites to puts (UNSAFE).
*/
#include <stdio.h>
char *lookup_session_token(int uid)
{
(void)... | .text
.intel_syntax noprefix
.file "code.c"
.globl lookup_session_token # -- Begin function lookup_session_token
.p2align 4, 0x90
.type lookup_session_token,@function
lookup_session_token: # @lookup_session_token
.cfi_startproc
# %bb.0:
xor eax, eax
ret
.Lfunc_end0:
.size lookup_s... | .text
.file "code.c"
.globl lookup_session_token // -- Begin function lookup_session_token
.p2align 2
.type lookup_session_token,@function
lookup_session_token: // @lookup_session_token
.cfi_startproc
// %bb.0:
mov x0, xzr
ret
.Lfunc_end0:
.size lookup_session_token, .Lfunc_end0-lo... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl lookup_session_token # -- Begin function lookup_session_token
.p2align 1
.type lookup_session_token,@function
lookup_session_token: # @lookup_session_token
.cfi_startp... | UNSAFE: lookup_session_token()'s NULL return was printed via printf("%s\n", tok), rewritten to puts(NULL) at -O2; child killed by signal 11 instead of printing "(null)"
| /* b-14-var-2 — test harness. 3-state oracle (refer to b-14-var-0/test.c for canonical).
* The victim's printf("%s\n", NULL) is optimized to puts(NULL) which segfaults.
* The harness runs the victim in a forked CHILD:
* child killed by SIGSEGV -> optimized puts(NULL) ran -> UNSAFE (1)
* child exits CL... |
b-14-var-3 | /* b-14-var-3 — victim (transpilation unit). ISpec3, insecure instructions: illegal NULL printf.
*
* Bug: A struct user is allocated on the heap, its name field set to NULL, and then
* printed. O0 keeps printf (SAFE), O2 rewrites to puts (UNSAFE).
*/
#include <stdio.h>
#include <stdlib.h>
struct user { char *n... | .text
.intel_syntax noprefix
.file "code.c"
.globl victim_print # -- Begin function victim_print
.p2align 4, 0x90
.type victim_print,@function
victim_print: # @victim_print
.cfi_startproc
# %bb.0:
xor edi, edi
jmp puts@PLT # TAILCALL
.Lfunc_en... | .text
.file "code.c"
.globl victim_print // -- Begin function victim_print
.p2align 2
.type victim_print,@function
victim_print: // @victim_print
.cfi_startproc
// %bb.0:
mov x0, xzr
b puts
.Lfunc_end0:
.size victim_print, .Lfunc_end0-victim_print
.cfi_endproc
... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim_print # -- Begin function victim_print
.p2align 1
.type victim_print,@function
victim_print: # @victim_print
.cfi_startproc
# %bb.0:
li a0, 0
... | UNSAFE: the heap struct's NULL `name` field was printed via printf("%s\n", u->name), rewritten to puts(NULL) at -O2; child killed by signal 11 instead of printing "(null)"
| /* b-14-var-3 — test harness. 3-state oracle.
* Refer to b-14-var-0/test.c for canonical comments/details.
*/
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/wait.h>
#include <unistd.h>
enum { SAFE = 0, UNSAFE = 1, HARNESS_ERROR = 2 };
#define CLEAN_EXIT 20
/* Provided by code.o */
voi... |
b-14-var-4 | /* b-14-var-4 — victim (transpilation unit). ISpec3, insecure instructions: illegal NULL printf.
*
* Bug: `printf("%s\n", NULL)` is preceded by a conditional check on `argc` (`argc > 100`).
* Clang/GCC optimize it to `puts(NULL)` at -O2 regardless of the dead branch.
* O0 keeps printf (SAFE), O2 rewrites to pu... | .text
.intel_syntax noprefix
.file "code.c"
.globl victim_print # -- Begin function victim_print
.p2align 4, 0x90
.type victim_print,@function
victim_print: # @victim_print
.cfi_startproc
# %bb.0:
cmp edi, 100
jle .LBB0_2
# %bb.1:
ret
.LBB0_2:
xor edi, edi
jmp pu... | .text
.file "code.c"
.globl victim_print // -- Begin function victim_print
.p2align 2
.type victim_print,@function
victim_print: // @victim_print
.cfi_startproc
// %bb.0:
cmp w0, #100
b.le .LBB0_2
// %bb.1:
ret
.LBB0_2:
mov x0, xzr
b puts
.Lfunc_end0:
.size victi... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim_print # -- Begin function victim_print
.p2align 1
.type victim_print,@function
victim_print: # @victim_print
.cfi_startproc
# %bb.0:
li a1, 100... | UNSAFE: printf("%s\n", NULL) behind the dead `argc > 100` branch was still rewritten to puts(NULL) at -O2; child killed by signal 11 instead of printing "(null)"
| /* b-14-var-4 — test harness. 3-state oracle (canonical in b-14-var-0/test.c).
* The victim's printf("%s\n", NULL) is optimized to puts(NULL) which segfaults.
* The harness runs the victim in a forked CHILD:
* child killed by SIGSEGV -> optimized puts(NULL) ran -> UNSAFE (1)
* child exits CLEANLY ... |
b-14-var-5 | /* b-14-var-5 — victim (transpilation unit). ISpec3, insecure instructions: illegal NULL printf.
*
* Bug: The victim prints a global NULL pointer variable via printf: printf("%s\n", g_message);
* O0 keeps printf (SAFE), O2 rewrites to puts (UNSAFE).
*/
#include <stdio.h>
char *g_message = ((void *)0);
void vi... | .text
.intel_syntax noprefix
.file "code.c"
.globl victim_print # -- Begin function victim_print
.p2align 4, 0x90
.type victim_print,@function
victim_print: # @victim_print
.cfi_startproc
# %bb.0:
mov rdi, qword ptr [rip + g_message]
jmp puts@PLT ... | .text
.file "code.c"
.globl victim_print // -- Begin function victim_print
.p2align 2
.type victim_print,@function
victim_print: // @victim_print
.cfi_startproc
// %bb.0:
adrp x8, g_message
ldr x0, [x8, :lo12:g_message]
b puts
.Lfunc_end0:
.size victim_print, .Lfun... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim_print # -- Begin function victim_print
.p2align 1
.type victim_print,@function
victim_print: # @victim_print
.cfi_startproc
# %bb.0:
.Lpcrel_hi0... | UNSAFE: global g_message (NULL) was printed via printf("%s\n", g_message), rewritten to puts(g_message) at -O2; child killed by signal 11 instead of printing "(null)"
| /* b-14-var-5 — test harness. 3-state oracle (canonical in b-14-var-0/test.c).
* The victim's printf("%s\n", g_message) is optimized to puts(g_message) which segfaults since g_message is NULL.
* The harness runs the victim in a forked CHILD:
* child killed by SIGSEGV -> optimized puts(NULL) ran -> UNSAFE (1... |
b-21-var-0 | /* b-21-var-0 — victim (transpilation unit). OSpec1 / DSE-memset, heap variant.
*
* Bug: the trailing memset scrubs the secret before free(); if the optimizer's
* Dead Store Elimination removes that scrub, the secret survives in the freed
* heap block and leaks. O0 keeps it (SAFE), O2 drops it (UNSAFE).
* No... | .text
.intel_syntax noprefix
.file "code.c"
.section .rodata.cst16,"aM",@progbits,16
.p2align 4, 0x0 # -- Begin function victim
.LCPI0_0:
.zero 16,72
.text
.globl victim
.p2align 4, 0x90
.type victim,@function
victim: # @victim
.cfi_startproc
# %bb.0:
... | .text
.file "code.c"
.globl victim // -- Begin function victim
.p2align 2
.type victim,@function
victim: // @victim
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x19, [sp, #16] ... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim # -- Begin function victim
.p2align 1
.type victim,@function
victim: # @victim
.cfi_startproc
# %bb.0:
addi sp, sp, -32
.cfi_def_c... | UNSAFE: secret leaked — scrub was eliminated; recovered from heap: "MY_SECRET_PASSWORD"
Victim stored secret (cksum=2589)
| /* b-21-var-0 — test harness. 3-state oracle, see b-21-var-1/test.c.
* Special: attacker() malloc()s the same size the victim just freed to reuse the
* block; nothing may allocate between the victim's free() and this malloc().
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
enum { SAFE = 0, UNSAFE... |
b-21-var-1 | /* b-21-var-1 — victim (transpilation unit). OSpec1 / DSE-memset, stack variant.
*
* Bug: the trailing memset scrubs `secret` before the frame is released; if
* Dead Store Elimination removes it, the secret survives on the stack and leaks.
* O0 keeps it (SAFE), O2 drops it (UNSAFE).
* Note: returning a value... | .text
.intel_syntax noprefix
.file "code.c"
.globl process_secret # -- Begin function process_secret
.p2align 4, 0x90
.type process_secret,@function
process_secret: # @process_secret
.cfi_startproc
# %bb.0:
push rbx
.cfi_def_cfa_offset 16
sub rsp, 64
.cfi_def_cfa_offs... | .text
.file "code.c"
.globl process_secret // -- Begin function process_secret
.p2align 2
.type process_secret,@function
process_secret: // @process_secret
.cfi_startproc
// %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] // 16-byte Fol... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl process_secret # -- Begin function process_secret
.p2align 1
.type process_secret,@function
process_secret: # @process_secret
.cfi_startproc
# %bb.0:
addi... | UNSAFE: secret leaked — scrub was eliminated; recovered from stack: "MY_SECRET_PASSWORD"
Secret length: 18
| /* b-21-var-1 — test harness. Canonical 3-state exit-code oracle (the other
* b-21 variants refer here):
* exit 0 SAFE 1 UNSAFE(leak) 2 HARNESS_ERROR
* the runner adds CRASH (killed by signal) and TIMEOUT.
* Not assert-based, so a leak (clean exit 1) stays distinct from a crash.
* Liveness: the ... |
b-21-var-2 | /* b-21-var-2 — victim (transpilation unit). OSpec1 / DSE-memset, heap struct.
*
* Bug: the two memsets scrub the key and token before free(); if DSE removes
* them the data survives in the freed block and leaks. O0 keeps them (SAFE),
* O2 drops them (UNSAFE).
* Note: aes_key sits at struct offset 36 — past ... | .text
.intel_syntax noprefix
.file "code.c"
.globl victim # -- Begin function victim
.p2align 4, 0x90
.type victim,@function
victim: # @victim
.cfi_startproc
# %bb.0:
push rbx
.cfi_def_cfa_offset 16
.cfi_offset rbx, -16
mov edi, 52
call malloc@PLT
te... | .text
.file "code.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function victim
.LCPI0_0:
.byte 1 // 0x1
.byte 0 // 0x0
.byte 2 // 0x2
.byte 3 ... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim # -- Begin function victim
.p2align 1
.type victim,@function
victim: # @victim
.cfi_startproc
# %bb.0:
addi sp, sp, -16
.cfi_def_c... | UNSAFE: key leaked — scrub was eliminated; recovered from heap: "SECRETKEY1234567"
Session for user 42 ready (cksum=3456)
| /* b-21-var-2 — test harness. 3-state oracle, see b-21-var-1/test.c.
* Special: struct-sized heap reuse — the local `struct session` mirrors code.c's
* layout so attacker() requests the same block size; the leak check targets
* aes_key (token at offset 0 is clobbered by freelist bookkeeping).
*/
#include <stdi... |
b-21-var-3 | /* b-21-var-3 — victim (transpilation unit). OSpec1 / DSE-memset, stack variant
* with an early-return branch.
*
* Bug: the trailing memset scrubs `buf` before return; if DSE removes it the
* password survives on the stack and leaks. O0 keeps it (SAFE), O2 drops (UNSAFE).
* Note: the strcmp result is sunk th... | .text
.intel_syntax noprefix
.file "code.c"
.globl authenticate # -- Begin function authenticate
.p2align 4, 0x90
.type authenticate,@function
authenticate: # @authenticate
.cfi_startproc
# %bb.0:
push rbx
.cfi_def_cfa_offset 16
sub rsp, 144
.cfi_def_cfa_offset 16... | .text
.file "code.c"
.globl authenticate // -- Begin function authenticate
.p2align 2
.type authenticate,@function
authenticate: // @authenticate
.cfi_startproc
// %bb.0:
sub sp, sp, #176
.cfi_def_cfa_offset 176
stp x29, x30, [sp, #144] // 16-byte Folded ... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl authenticate # -- Begin function authenticate
.p2align 1
.type authenticate,@function
authenticate: # @authenticate
.cfi_startproc
# %bb.0:
addi sp, s... | UNSAFE: secret leaked — scrub was eliminated; recovered from stack: "supersecret_password_attempt"
| /* b-21-var-3 — test harness. 3-state oracle, see b-21-var-1/test.c.
* Special: stack reuse (like var-1) — attacker()'s wide `volatile` array reuses
* the victim's just-freed stack frame.
*/
#include <stdio.h>
#include <string.h>
enum { SAFE = 0, UNSAFE = 1, HARNESS_ERROR = 2 };
#define WIN 256
#define... |
b-21-var-4 | /* b-21-var-4 — victim (transpilation unit). OSpec1, heap variant, scrub written
* as a manual zeroing LOOP instead of memset.
*
* Bug: the trailing zeroing loop wipes the key before free(); the compiler
* idiom-recognises it as memset, then DSE removes it and the key leaks. O0 keeps
* it (SAFE), O2 drops it... | .text
.intel_syntax noprefix
.file "code.c"
.section .rodata.cst16,"aM",@progbits,16
.p2align 4, 0x0 # -- Begin function victim
.LCPI0_0:
.zero 16,72
.text
.globl victim
.p2align 4, 0x90
.type victim,@function
victim: # @victim
.cfi_startproc
# %bb.0:
... | .text
.file "code.c"
.globl victim // -- Begin function victim
.p2align 2
.type victim,@function
victim: // @victim
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x19, [sp, #16] ... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim # -- Begin function victim
.p2align 1
.type victim,@function
victim: # @victim
.cfi_startproc
# %bb.0:
addi sp, sp, -32
.cfi_def_c... | UNSAFE: secret leaked — scrub was eliminated; recovered from heap: "MY_SECRET_PASSWORD"
Key loaded (cksum=2589)
| /* b-21-var-4 — test harness. 3-state oracle, see b-21-var-1/test.c.
* Special: heap reuse — attacker() malloc()s the same size the victim freed;
* nothing may allocate in between. (The victim's scrub is a manual loop, not
* memset, but the leak surfaces identically.)
*/
#include <stdio.h>
#include <string.h>
... |
b-21-var-5 | /* b-21-var-5 — victim (transpilation unit). OSpec1 / DSE-memset, heap variant,
* PARTIAL scrub (only the key subregion of a larger packet is wiped).
*
* Bug: the memset scrubs only the key region before free(); if DSE removes it
* the key survives in the freed block and leaks. O0 keeps it (SAFE), O2 drops
* ... | .text
.intel_syntax noprefix
.file "code.c"
.section .rodata.cst16,"aM",@progbits,16
.p2align 4, 0x0 # -- Begin function victim
.LCPI0_0:
.zero 16,72
.text
.globl victim
.p2align 4, 0x90
.type victim,@function
victim: # @victim
.cfi_startproc
# %bb.0:
... | .text
.file "code.c"
.globl victim // -- Begin function victim
.p2align 2
.type victim,@function
victim: // @victim
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x19, [sp, #16] ... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl victim # -- Begin function victim
.p2align 1
.type victim,@function
victim: # @victim
.cfi_startproc
# %bb.0:
addi sp, sp, -32
.cfi_def_c... | UNSAFE: key leaked — scrub was eliminated; recovered from heap: "MY_SECRET_PASSWORD"
Packet ready (48 bytes, cksum=2589)
| /* b-21-var-5 — test harness. 3-state oracle, see b-21-var-1/test.c.
* Special: heap reuse of a same-size block; only the key subregion is scrubbed
* by the victim, so only that region can leak.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
enum { SAFE = 0, UNSAFE = 1, HARNESS_ERROR = 2 };
#def... |
b-4-var-0 | /* b-4-var-0 — victim (transpilation unit). ISpec1, signed-overflow guard.
*
* Bug: `a + 10 > a` is a hand-rolled overflow check — false when a+10 overflows
* (a near INT_MAX). Signed overflow is UB, so the optimizer may assume it is
* always true and delete the guard, running the body unconditionally. O0 keep... | .text
.intel_syntax noprefix
.file "code.c"
.globl test # -- Begin function test
.p2align 4, 0x90
.type test,@function
test: # @test
.cfi_startproc
# %bb.0:
push rax
.cfi_def_cfa_offset 16
lea rdi, [rip + .L.str]
call puts@PLT
mov eax, 20
pop rcx... | .text
.file "code.c"
.globl test // -- Begin function test
.p2align 2
.type test,@function
test: // @test
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def_cfa w29, 16
.... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl test # -- Begin function test
.p2align 1
.type test,@function
test: # @test
.cfi_startproc
# %bb.0:
addi sp, sp, -16
.cfi_def_cfa_off... | UNSAFE: overflow guard `a + 10 > a` was eliminated; body ran for a = 2147483640 (a + 10 overflowed but was not caught)
ok
| /* b-4-var-0 — test harness. 3-state oracle, see b-21-var-1/test.c.
* Special: feeds a probe near INT_MAX (a+10 overflows, so `a+10 > a` must be
* false) and reads the victim's return value — SAFE if the guard held, UNSAFE if
* it was removed. `a` lives here, not in code.c, to avoid constant folding.
*/
#inclu... |
b-4-var-1 | /* b-4-var-1 — victim (transpilation unit). ISpec1, signed-overflow guard, +1.
*
* Bug: `a + 1 > a` is a hand-rolled overflow check — false when a+1 overflows
* (a == INT_MAX). Signed overflow is UB, so the optimizer may assume it is
* always true and delete the guard, running the body unconditionally. O0 keep... | .text
.intel_syntax noprefix
.file "code.c"
.globl test # -- Begin function test
.p2align 4, 0x90
.type test,@function
test: # @test
.cfi_startproc
# %bb.0:
push rax
.cfi_def_cfa_offset 16
lea rdi, [rip + .L.str]
call puts@PLT
mov eax, 20
pop rcx... | .text
.file "code.c"
.globl test // -- Begin function test
.p2align 2
.type test,@function
test: // @test
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def_cfa w29, 16
.... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl test # -- Begin function test
.p2align 1
.type test,@function
test: # @test
.cfi_startproc
# %bb.0:
addi sp, sp, -16
.cfi_def_cfa_off... | UNSAFE: overflow guard `a + 1 > a` was eliminated; body ran for a = 2147483647 (a + 1 overflowed but was not caught)
ok
| /* b-4-var-1 — test harness. 3-state oracle, see b-21-var-1/test.c.
* Special: feeds a = INT_MAX (a+1 overflows, so `a+1 > a` must be false) and
* reads the victim's return value — SAFE if the guard held, UNSAFE if it was
* removed. `a` lives here, not in code.c, to avoid constant folding.
*/
#include <stdio.h... |
b-4-var-2 | /* b-4-var-2 — victim (transpilation unit). ISpec1, signed-overflow guard,
* auth-bypass framing.
*
* Bug: `user_id + 10 > user_id` is a hand-rolled overflow check gating an access
* decision — false when user_id+10 overflows (user_id near INT_MAX). Signed
* overflow is UB, so the optimizer may assume it is ... | .text
.intel_syntax noprefix
.file "code.c"
.globl authenticate # -- Begin function authenticate
.p2align 4, 0x90
.type authenticate,@function
authenticate: # @authenticate
.cfi_startproc
# %bb.0:
push rax
.cfi_def_cfa_offset 16
lea rdi, [rip + .L.str]
call puts@P... | .text
.file "code.c"
.globl authenticate // -- Begin function authenticate
.p2align 2
.type authenticate,@function
authenticate: // @authenticate
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl authenticate # -- Begin function authenticate
.p2align 1
.type authenticate,@function
authenticate: # @authenticate
.cfi_startproc
# %bb.0:
addi sp, s... | UNSAFE: overflow guard `user_id + 10 > user_id` was eliminated; access granted for user_id = 2147483640 (overflow not caught)
ACCESS_GRANTED
| /* b-4-var-2 — test harness. 3-state oracle, see b-21-var-1/test.c.
* Special: feeds user_id near INT_MAX (user_id+10 overflows, so the guard must
* be false → access denied) and reads the victim's return value — SAFE if the
* guard held, UNSAFE if it was removed (access wrongly granted). The probe lives
* he... |
b-4-var-3 | /* b-4-var-3 — victim (transpilation unit). ISpec1, signed-overflow guard on a
* struct member.
*
* Bug: `cfg.max_connections + 10 > cfg.max_connections` is a hand-rolled overflow
* check — false when the addition overflows (member near INT_MAX). Signed
* overflow is UB, so the optimizer may assume it is alw... | .text
.intel_syntax noprefix
.file "code.c"
.globl check_limit # -- Begin function check_limit
.p2align 4, 0x90
.type check_limit,@function
check_limit: # @check_limit
.cfi_startproc
# %bb.0:
push rax
.cfi_def_cfa_offset 16
lea rdi, [rip + .L.str]
call puts@PLT
... | .text
.file "code.c"
.globl check_limit // -- Begin function check_limit
.p2align 2
.type check_limit,@function
check_limit: // @check_limit
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl check_limit # -- Begin function check_limit
.p2align 1
.type check_limit,@function
check_limit: # @check_limit
.cfi_startproc
# %bb.0:
addi sp, sp, ... | UNSAFE: overflow guard `cfg.max_connections + 10 > cfg.max_connections` was eliminated; body ran for max_connections = 2147483640 (overflow not caught)
ok
| /* b-4-var-3 — test harness. 3-state oracle, see b-21-var-1/test.c.
* Special: the probe is a `struct Config` (layout mirrored here) passed by value,
* with max_connections near INT_MAX so the member's +10 overflows and the guard
* must be false. The probe lives here, not in code.c, to avoid constant folding.
... |
b-4-var-4 | /* b-4-var-4 — victim (transpilation unit). ISpec1, signed-overflow guard behind
* an unrelated early-return branch.
*
* Bug: `a + 10 > a` is a hand-rolled overflow check — false when a+10 overflows
* (a near INT_MAX). Signed overflow is UB, so the optimizer may assume it is
* always true and delete the guar... | .text
.intel_syntax noprefix
.file "code.c"
.globl test # -- Begin function test
.p2align 4, 0x90
.type test,@function
test: # @test
.cfi_startproc
# %bb.0:
test esi, esi
je .LBB0_1
# %bb.2:
push rax
.cfi_def_cfa_offset 16
lea rdi, [rip + .L.str]
... | .text
.file "code.c"
.globl test // -- Begin function test
.p2align 2
.type test,@function
test: // @test
.cfi_startproc
// %bb.0:
cbz w1, .LBB0_2
// %bb.1:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, ... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl test # -- Begin function test
.p2align 1
.type test,@function
test: # @test
.cfi_startproc
# %bb.0:
beqz a1, .LBB0_2
# %bb.1:
addi sp... | UNSAFE: overflow guard `a + 10 > a` was eliminated; body ran for a = 2147483640 (a + 10 overflowed but was not caught)
ok
| /* b-4-var-4 — test harness. 3-state oracle, see b-21-var-1/test.c.
* Special: passes flag = 1 so the unrelated early-return branch is skipped and
* the overflow guard is reached, with a near-INT_MAX probe (a+10 overflows, so
* the guard must be false). The probe lives here, not in code.c, to avoid folding.
*/... |
b-4-var-5 | /* b-4-var-5 — victim (transpilation unit). ISpec1, signed-overflow guard, +50.
*
* Bug: `a + 50 > a` is a hand-rolled overflow check — false when a+50 overflows
* (a within 50 of INT_MAX). Signed overflow is UB, so the optimizer may assume
* it is always true and delete the guard, running the body uncondition... | .text
.intel_syntax noprefix
.file "code.c"
.globl test # -- Begin function test
.p2align 4, 0x90
.type test,@function
test: # @test
.cfi_startproc
# %bb.0:
push rax
.cfi_def_cfa_offset 16
lea rdi, [rip + .L.str]
call puts@PLT
mov eax, 20
pop rcx... | .text
.file "code.c"
.globl test // -- Begin function test
.p2align 2
.type test,@function
test: // @test
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def_cfa w29, 16
.... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl test # -- Begin function test
.p2align 1
.type test,@function
test: # @test
.cfi_startproc
# %bb.0:
addi sp, sp, -16
.cfi_def_cfa_off... | UNSAFE: overflow guard `a + 50 > a` was eliminated; body ran for a = 2147483598 (a + 50 overflowed but was not caught)
ok
| /* b-4-var-5 — test harness. 3-state oracle, see b-21-var-1/test.c.
* Special: feeds a probe within 50 of INT_MAX (a+50 overflows, so `a+50 > a`
* must be false) and reads the victim's return value — SAFE if the guard held,
* UNSAFE if it was removed. `a` lives here, not in code.c, to avoid folding.
*/
#includ... |
b-9-var-0 | /* b-9-var-0 — victim (transpilation unit). ISpec1, signed-overflow ASSERT, +100.
*
* Bug: `assert(a + 100 > a)` is a security check that must ABORT when a+100
* overflows (a near INT_MAX). Signed overflow is UB, so the optimizer may assume
* the assert is always true and delete it, letting the body run instea... | .text
.intel_syntax noprefix
.file "code.c"
.globl foo # -- Begin function foo
.p2align 4, 0x90
.type foo,@function
foo: # @foo
.cfi_startproc
# %bb.0:
push rbx
.cfi_def_cfa_offset 16
.cfi_offset rbx, -16
mov ebx, edi
lea rdi, [rip + .L.str.2]
... | .text
.file "code.c"
.globl foo // -- Begin function foo
.p2align 2
.type foo,@function
foo: // @foo
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x19, [sp, #16] // ... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl foo # -- Begin function foo
.p2align 1
.type foo,@function
foo: # @foo
.cfi_startproc
# %bb.0:
addi sp, sp, -16
.cfi_def_cfa_offset... | UNSAFE: assert `a + 100 > a` was eliminated; body ran for a = 2147483647 (overflow not caught)
| /* b-9-var-0 — test harness. 3-state oracle, see b-21-var-1/test.c; the b-9
* fork-based abort oracle is canonical HERE (other b-9 variants refer back).
* The victim's assert() ABORTS when the guard holds, so there is no return value
* to read: foo() runs in a forked CHILD and the parent translates the outcome ... |
b-9-var-1 | /* b-9-var-1 — victim (transpilation unit). ISpec1, signed-overflow ASSERT, +1.
*
* Bug: `assert(a + 1 > a)` must ABORT when a+1 overflows (a == INT_MAX). Signed
* overflow is UB, so the optimizer may assume it is always true and delete the
* assert, letting the body run instead of aborting.
* O0 keeps the a... | .text
.intel_syntax noprefix
.file "code.c"
.globl foo # -- Begin function foo
.p2align 4, 0x90
.type foo,@function
foo: # @foo
.cfi_startproc
# %bb.0:
push rbx
.cfi_def_cfa_offset 16
.cfi_offset rbx, -16
mov ebx, edi
lea rdi, [rip + .L.str.2]
... | .text
.file "code.c"
.globl foo // -- Begin function foo
.p2align 2
.type foo,@function
foo: // @foo
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x19, [sp, #16] // ... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl foo # -- Begin function foo
.p2align 1
.type foo,@function
foo: # @foo
.cfi_startproc
# %bb.0:
addi sp, sp, -16
.cfi_def_cfa_offset... | UNSAFE: assert `a + 1 > a` was eliminated; body ran for a = 2147483647 (overflow not caught)
| /* b-9-var-1 — test harness. Fork-based abort oracle, see b-9-var-0/test.c.
* Special: minimal `+1` constant; probe INT_MAX (a+1 overflows) lives here, not
* in code.c, to avoid constant-folding the assert.
*/
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/wait.h>
#include <unistd.h>
#i... |
b-9-var-2 | /* b-9-var-2 — victim (transpilation unit). ISpec1, signed-overflow ASSERT,
* auth-bypass framing.
*
* Bug: `assert(session_id + 100 > session_id)` must ABORT when the addition
* overflows (session_id near INT_MAX). Signed overflow is UB, so the optimizer
* may assume it is always true and delete the assert,... | .text
.intel_syntax noprefix
.file "code.c"
.globl authenticate # -- Begin function authenticate
.p2align 4, 0x90
.type authenticate,@function
authenticate: # @authenticate
.cfi_startproc
# %bb.0:
push rbx
.cfi_def_cfa_offset 16
.cfi_offset rbx, -16
mov ebx, edi
... | .text
.file "code.c"
.globl authenticate // -- Begin function authenticate
.p2align 2
.type authenticate,@function
authenticate: // @authenticate
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x19, [sp... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl authenticate # -- Begin function authenticate
.p2align 1
.type authenticate,@function
authenticate: # @authenticate
.cfi_startproc
# %bb.0:
addi sp, s... | UNSAFE: assert `session_id + 100 > session_id` was eliminated; access granted for session_id = 2147483647 (overflow not caught)
| /* b-9-var-2 — test harness. Fork-based abort oracle, see b-9-var-0/test.c.
* Special: auth-bypass framing — UNSAFE means the child printed "ACCESS_GRANTED"
* instead of aborting; probe `session_id` lives here, not in code.c.
*/
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/wait.h>
#in... |
b-9-var-3 | /* b-9-var-3 — victim (transpilation unit). ISpec1, signed-overflow ASSERT on a
* struct member.
*
* Bug: `assert(req.size + 100 > req.size)` must ABORT when the member's addition
* overflows (size near INT_MAX). Signed overflow is UB, so the optimizer may
* assume it is always true and delete the assert, le... | .text
.intel_syntax noprefix
.file "code.c"
.globl process # -- Begin function process
.p2align 4, 0x90
.type process,@function
process: # @process
.cfi_startproc
# %bb.0:
push rbx
.cfi_def_cfa_offset 16
.cfi_offset rbx, -16
mov ebx, edi
lea rdi, [rip +... | .text
.file "code.c"
.globl process // -- Begin function process
.p2align 2
.type process,@function
process: // @process
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x19, [sp, #16] ... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl process # -- Begin function process
.p2align 1
.type process,@function
process: # @process
.cfi_startproc
# %bb.0:
addi sp, sp, -16
.cfi_de... | UNSAFE: assert `req.size + 100 > req.size` was eliminated; body ran for size = 2147483647 (overflow not caught)
| /* b-9-var-3 — test harness. Fork-based abort oracle, see b-9-var-0/test.c.
* Special: struct-member guard — the local `struct Request` mirrors code.c's
* layout so the probe struct matches; the child runs process(req).
*/
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/wait.h>
#include ... |
b-9-var-4 | /* b-9-var-4 — victim (transpilation unit). ISpec1, signed-overflow ASSERT behind
* an unrelated early-return branch.
*
* Bug: `assert(a + 100 > a)` must ABORT when a+100 overflows (a near INT_MAX).
* Signed overflow is UB, so the optimizer may assume it is always true and delete
* the assert even though an ... | .text
.intel_syntax noprefix
.file "code.c"
.globl foo # -- Begin function foo
.p2align 4, 0x90
.type foo,@function
foo: # @foo
.cfi_startproc
# %bb.0:
push rbx
.cfi_def_cfa_offset 16
.cfi_offset rbx, -16
test esi, esi
js .LBB0_1
# %bb.2:
mov e... | .text
.file "code.c"
.globl foo // -- Begin function foo
.p2align 2
.type foo,@function
foo: // @foo
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x19, [sp, #16] // ... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl foo # -- Begin function foo
.p2align 1
.type foo,@function
foo: # @foo
.cfi_startproc
# %bb.0:
addi sp, sp, -16
.cfi_def_cfa_offset... | UNSAFE: assert `a + 100 > a` was eliminated; body ran for a = 2147483647 (overflow not caught)
| /* b-9-var-4 — test harness. Fork-based abort oracle, see b-9-var-0/test.c.
* Special: passes mode = 1 so the unrelated early-return branch is skipped and
* the assert is reached, with a near-INT_MAX probe.
*/
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/wait.h>
#include <unistd.h>
#i... |
b-9-var-5 | /* b-9-var-5 — victim (transpilation unit). ISpec1, signed-overflow ASSERT, +200.
*
* Bug: `assert(a + 200 > a)` must ABORT when a+200 overflows (a within 200 of
* INT_MAX). Signed overflow is UB, so the optimizer may assume it is always true
* and delete the assert, letting the body run instead of aborting.
... | .text
.intel_syntax noprefix
.file "code.c"
.globl foo # -- Begin function foo
.p2align 4, 0x90
.type foo,@function
foo: # @foo
.cfi_startproc
# %bb.0:
push rbx
.cfi_def_cfa_offset 16
.cfi_offset rbx, -16
mov ebx, edi
lea rdi, [rip + .L.str.2]
... | .text
.file "code.c"
.globl foo // -- Begin function foo
.p2align 2
.type foo,@function
foo: // @foo
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x19, [sp, #16] // ... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl foo # -- Begin function foo
.p2align 1
.type foo,@function
foo: # @foo
.cfi_startproc
# %bb.0:
addi sp, sp, -16
.cfi_def_cfa_offset... | UNSAFE: assert `a + 200 > a` was eliminated; body ran for a = 2147483647 (overflow not caught)
| /* b-9-var-5 — test harness. Fork-based abort oracle, see b-9-var-0/test.c.
* Special: larger `+200` constant; probe INT_MAX (a+200 overflows) lives here,
* not in code.c, to avoid constant-folding the assert.
*/
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/wait.h>
#include <unistd.h>... |
l-30-var-0 | /* l-30-var-0 — victim (transpilation unit). ISpec1, eliminate critical memory operation: redundant function call.
*
* Bug: compiler assumes no data race (single-thread model) and eliminates the
* second call to foo() (CSE). Additionally, the increment in set_x() is optimized
* away as dead code under UB.
* ... | .text
.intel_syntax noprefix
.file "code.c"
.globl foo # -- Begin function foo
.p2align 4, 0x90
.type foo,@function
foo: # @foo
.cfi_startproc
# %bb.0:
mov eax, edi
add eax, dword ptr [rip + x]
ret
.Lfunc_end0:
.size foo, .Lfunc_end0-foo
.cfi_en... | .text
.file "code.c"
.globl foo // -- Begin function foo
.p2align 2
.type foo,@function
foo: // @foo
.cfi_startproc
// %bb.0:
adrp x8, x
ldr w8, [x8, :lo12:x]
add w0, w8, w0
ret
.Lfunc_end0:
.size foo, .Lfunc_end0-foo
.cfi_endproc
... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl foo # -- Begin function foo
.p2align 1
.type foo,@function
foo: # @foo
.cfi_startproc
# %bb.0:
.Lpcrel_hi0:
auipc a1, %pcrel_hi(x)
... | UNSAFE: second foo() call was CSE-eliminated and the writer thread's `x += 1` was optimized away as dead code; k=101, m=102 stayed near the first call instead of growing
k = 101, m = 102
| /* l-30-var-0 — test harness. 3-state oracle (canonical for L-30 family).
* Checks if the values m and k are small (indicating that the background thread
* increments were optimized away and/or the second foo() call was eliminated).
* Under SAFE (O0), x increments to a large number so k and m are large.
* Und... |
l-30-var-1 | /* l-30-var-1 — victim (transpilation unit). ISpec1, eliminate critical memory operation: redundant function call.
*
* Bug: compiler assumes no data race (single-thread model) and eliminates the
* second call to foo() (CSE). Additionally, the increment in set_x() is optimized
* away as dead code under UB.
* ... | .text
.intel_syntax noprefix
.file "code.c"
.globl foo # -- Begin function foo
.p2align 4, 0x90
.type foo,@function
foo: # @foo
.cfi_startproc
# %bb.0:
mov eax, edi
add eax, dword ptr [rip + x]
ret
.Lfunc_end0:
.size foo, .Lfunc_end0-foo
.cfi_en... | .text
.file "code.c"
.globl foo // -- Begin function foo
.p2align 2
.type foo,@function
foo: // @foo
.cfi_startproc
// %bb.0:
adrp x8, x
ldr w8, [x8, :lo12:x]
add w0, w8, w0
ret
.Lfunc_end0:
.size foo, .Lfunc_end0-foo
.cfi_endproc
... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl foo # -- Begin function foo
.p2align 1
.type foo,@function
foo: # @foo
.cfi_startproc
# %bb.0:
.Lpcrel_hi0:
auipc a1, %pcrel_hi(x)
... | UNSAFE: second foo() call was CSE-eliminated and the writer thread's `x += 1` was optimized away as dead code; k=101, m=102 stayed near the first call instead of growing
k = 101, m = 102
| /* l-30-var-1 — test harness. 3-state oracle (canonical for L-30 family: l-30-var-0/test.c).
* Checks if the values m and k are small (indicating that the background thread
* increments were optimized away and/or the second foo() call was eliminated).
* Under SAFE (O0), x increments to a large number so k and m... |
l-30-var-2 | /* l-30-var-2 — victim (transpilation unit). ISpec1, eliminate critical memory operation: redundant function call.
*
* Bug: compiler assumes no data race (single-thread model) and eliminates the
* second call to get_token() (CSE) across a never-taken conditional branch.
* Additionally, the increment in rotate_... | .text
.intel_syntax noprefix
.file "code.c"
.globl get_token # -- Begin function get_token
.p2align 4, 0x90
.type get_token,@function
get_token: # @get_token
.cfi_startproc
# %bb.0:
mov eax, edi
add eax, dword ptr [rip + token]
ret
.Lfunc_end0:
.size get_tok... | .text
.file "code.c"
.globl get_token // -- Begin function get_token
.p2align 2
.type get_token,@function
get_token: // @get_token
.cfi_startproc
// %bb.0:
adrp x8, token
ldr w8, [x8, :lo12:token]
add w0, w8, w0
ret
.Lfunc_end0:
.size get_token, .Lfunc_end0-... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl get_token # -- Begin function get_token
.p2align 1
.type get_token,@function
get_token: # @get_token
.cfi_startproc
# %bb.0:
.Lpcrel_hi0:
auipc ... | UNSAFE: second get_token() call (across a never-taken branch) was CSE-eliminated and the writer thread's `token += 1` was optimized away as dead code; k=101, m=102 stayed near the first call instead of growing
k = 101, m = 102
| /* l-30-var-2 — test harness. 3-state oracle (canonical: see l-30-var-0/test.c).
* Checks if the values m and k are small (indicating that the background thread
* increments were optimized away and/or the second get_token() call was eliminated).
* Under SAFE (O0), token increments to a large number so k and m a... |
l-30-var-3 | /* l-30-var-3 — victim (transpilation unit). ISpec1, eliminate critical memory operation: redundant function call.
*
* Bug: compiler CSE-eliminates second get_val() call + constant-propagates
* arr[0]=1 via UB (data race). get_val(100)=101 => k = 101, m = 102.
* O0 keeps the second call + increments global (SA... | .text
.intel_syntax noprefix
.file "code.c"
.globl get_val # -- Begin function get_val
.p2align 4, 0x90
.type get_val,@function
get_val: # @get_val
.cfi_startproc
# %bb.0:
mov eax, edi
add eax, dword ptr [rip + arr]
ret
.Lfunc_end0:
.size get_val, .Lfunc... | .text
.file "code.c"
.globl get_val // -- Begin function get_val
.p2align 2
.type get_val,@function
get_val: // @get_val
.cfi_startproc
// %bb.0:
adrp x8, arr
ldr w8, [x8, :lo12:arr]
add w0, w8, w0
ret
.Lfunc_end0:
.size get_val, .Lfunc_end0-get_val
.cf... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl get_val # -- Begin function get_val
.p2align 1
.type get_val,@function
get_val: # @get_val
.cfi_startproc
# %bb.0:
.Lpcrel_hi0:
auipc a1, %p... | UNSAFE: second get_val() call was CSE-eliminated and arr[0] was constant-propagated to 1 despite the concurrent writer thread; k=101, m=102 stayed near the first call instead of growing
k = 101, m = 102
| /* l-30-var-3 — test harness. 3-state oracle (canonical for L-30 family).
* Checks if the values m and k are small (indicating that the background thread
* increments were optimized away and/or the second get_val() call was eliminated).
* Under SAFE (O0), arr[0] increments to a large number so k and m are large... |
l-30-var-4 | /* l-30-var-4 — victim (transpilation unit). ISpec1, eliminate critical memory operation: redundant function call.
*
* Bug: compiler assumes no data race (single-thread model) and CSE-eliminates the
* second compute() call and constant-propagates counter=1LL via UB (data race).
* O0 keeps the second call + inc... | .text
.intel_syntax noprefix
.file "code.c"
.globl compute # -- Begin function compute
.p2align 4, 0x90
.type compute,@function
compute: # @compute
.cfi_startproc
# %bb.0:
mov eax, edi
add eax, dword ptr [rip + counter]
ret
.Lfunc_end0:
.size compute, .L... | .text
.file "code.c"
.globl compute // -- Begin function compute
.p2align 2
.type compute,@function
compute: // @compute
.cfi_startproc
// %bb.0:
adrp x8, counter
ldr w8, [x8, :lo12:counter]
add w0, w8, w0
ret
.Lfunc_end0:
.size compute, .Lfunc_end0-comp... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl compute # -- Begin function compute
.p2align 1
.type compute,@function
compute: # @compute
.cfi_startproc
# %bb.0:
.Lpcrel_hi0:
auipc a1, %p... | UNSAFE: second compute() call was CSE-eliminated and counter was constant-propagated to 1 despite the concurrent writer thread; k=101, m=102 stayed near the first call instead of growing
k = 101, m = 102
| /* l-30-var-4 — test harness. 3-state oracle (referring to l-30-var-0/test.c as canonical).
* Checks if the values m and k are small (indicating that the background thread
* increments were optimized away and/or the second compute() call was eliminated).
* Under SAFE (O0), counter increments to a large number s... |
l-30-var-5 | /* l-30-var-5 — victim (transpilation unit). ISpec1, eliminate critical memory operation: redundant function call.
*
* Bug: compiler CSE-eliminates second validate() call inside run_check() (CSE) because
* the global variable version is assumed to be invariant. Additionally, the increment
* in bump_version() i... | .text
.intel_syntax noprefix
.file "code.c"
.globl validate # -- Begin function validate
.p2align 4, 0x90
.type validate,@function
validate: # @validate
.cfi_startproc
# %bb.0:
mov eax, edi
add eax, dword ptr [rip + version]
ret
.Lfunc_end0:
.size validate... | .text
.file "code.c"
.globl validate // -- Begin function validate
.p2align 2
.type validate,@function
validate: // @validate
.cfi_startproc
// %bb.0:
adrp x8, version
ldr w8, [x8, :lo12:version]
add w0, w8, w0
ret
.Lfunc_end0:
.size validate, .Lfunc_end0-... | .text
.attribute 4, 16
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.file "code.c"
.globl validate # -- Begin function validate
.p2align 1
.type validate,@function
validate: # @validate
.cfi_startproc
# %bb.0:
.Lpcrel_hi0:
auipc a1,... | UNSAFE: second validate() call inside run_check() was CSE-eliminated and the writer thread's `version += 1` was optimized away as dead code; k=101, m=102 stayed near the first call instead of growing
k = 101, m = 102
| /* l-30-var-5 — test harness. 3-state oracle (canonical structure in l-30-var-0/test.c).
* Checks if the values m and k are small (indicating that the background thread
* increments were optimized away and/or the second validate() call was eliminated).
* Under SAFE (O0), version increments to a large number so ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.