Datasets:
task_name stringlengths 14 17 | flag stringclasses 2
values | source_code stringlengths 371 1.7k | x86_64 stringlengths 658 8.71k | aarch64_linux stringlengths 781 5.46k | test_harness stringlengths 741 3.39k |
|---|---|---|---|---|---|
b-12-var-0-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | /* 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-0-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | /* 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-1-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | /* 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-2-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | /* 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-3-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | /* 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-4-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | /* 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-12-var-5-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.c... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_regis... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
... | /* 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-0-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_regis... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def... | /* 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-1-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, ... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa... | /* 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-2-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, ... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_regis... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
... | /* 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-3-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_regis... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_regis... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
... | /* 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-4-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_regis... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_regis... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
... | /* 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-14-var-5-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_regis... | .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:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cf... | .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] ... | /* 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-0-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cf... | .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] ... | /* 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-safe | safe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa... | .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... | /* 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-1-unsafe | unsafe | /* 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
.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:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa... | .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... | /* 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 ... |
End of preview. Expand in Data Studio
CISB-Bench LLVM-O2: Assembly Transpilation Benchmark
Overview
This dataset is derived from the Compiler-Introduced Security Bugs (CISB) benchmark, compiled with LLVM/Clang-17 at -O2 optimization level. It supports bidirectional assembly transpilation (x86-64 ↔ AArch64) and is designed for evaluating transpilation models on security-critical code.
Dataset Structure
| Column | Description |
|---|---|
task_name |
Full task identifier including flag (e.g., b-4-var-0-safe, b-4-var-0-unsafe) |
flag |
"safe" or "unsafe" — whether the assembly preserves the security check |
source_code |
Original C source from cisb-bench/<variant>/code.c (shared by safe/unsafe pairs) |
x86_64 |
x86-64 assembly (code.s from .build_x86/) |
aarch64_linux |
AArch64 assembly (code.s from .build_arm_linux/) |
test_harness |
C test harness (test.c) for correctness verification |
Statistics
- Total records: 72
- Safe records: 36
- Unsafe records: 36
Transpilation Directions
This dataset supports both directions:
- x86 → ARM: Use
x86_64as input,aarch64_linuxas target - ARM → x86: Use
aarch64_linuxas input,x86_64as target
Security Oracle
The test harness returns exit codes:
0→ SAFE (security check preserved)1→ UNSAFE (security check eliminated)2→ HARNESS_ERROR (transpilation error)>128→ CRASH
Usage
from datasets import load_dataset
ds = load_dataset("Akirayasha/cisb-bench-llvm-O2", split="test")
# Filter by flag
safe = ds.filter(lambda x: x["flag"] == "safe")
unsafe = ds.filter(lambda x: x["flag"] == "unsafe")
# x86 -> ARM transpilation
record = ds[0]
x86_input = record["x86_64"]
arm_target = record["aarch64_linux"]
# ARM -> x86 transpilation
arm_input = record["aarch64_linux"]
x86_target = record["x86_64"]
Citation
Part of the CISC-to-RISC transpilation research project at MBZUAI.
- Downloads last month
- 15