Example: intr7.c

up: index
prev: intr6.c
next: ptraddr0.c

    #include <stdio.h>
    #include <cheriintrin.h>
    
    int main()
    {
        int x = 0;
        int *p = &x;
        p = cheri_tag_clear(p);
        fprintf(stderr,"%d\n", *p);
    }

Experimental data (what does this mean?)

cerberus-cheri
cerberus-cheri-no-pnvi
cerberus-cheri-revocation
cerberus-cheri-revocation-no-pnvi
cerberus-cheri-cornucopia
cerberus-cheri-cornucopia-no-pnvi
 exit codes: compile 0 / execute 1 Undefined {ub: "UB_CHERI_InvalidCap", loc: "<9:30--9:32>"}
 
clang-riscv-O3-bounds-subobject-safe exit codes: compile 0 / execute 1
Program received signal SIGPROT, CHERI protection violation.
Capability tag fault caused by register ca1.
0x00000000001017c2 in main () at tests/cheri/intr7.c:9
9 fprintf(stderr,"%d\n", *p);
#0 0x00000000001017c2 in main () at tests/cheri/intr7.c:9
x = <optimized out>
p = <optimized out>


 
clang-riscv-O0-bounds-subobject-safe
clang-riscv-O0-bounds-aggressive
clang-riscv-O0-bounds-very-aggressive
clang-riscv-O0-bounds-everywhere-unsafe
 exit codes: compile 0 / execute 1
Program received signal SIGPROT, CHERI protection violation.
Capability tag fault caused by register ca2.
0x00000000001017ee in main () at tests/cheri/intr7.c:9
9 fprintf(stderr,"%d\n", *p);
#0 0x00000000001017ee in main () at tests/cheri/intr7.c:9
x = 0
p = 0x3fffdfff6c [rwRW,0x3fffdfff6c-0x3fffdfff70] (invalid)


 
clang-riscv-O3-bounds-conservative exit codes: compile 0 / execute 1
Program received signal SIGPROT, CHERI protection violation.
Capability tag fault caused by register ca2.
0x00000000001017ba in main () at tests/cheri/intr7.c:9
9 fprintf(stderr,"%d\n", *p);
#0 0x00000000001017ba in main () at tests/cheri/intr7.c:9
x = 0
p = 0x3fffdfff7c [rwRW,0x3fffdfff7c-0x3fffdfff80] (invalid)


 
clang-riscv-O0-bounds-conservative
clang-riscv-O0-bounds-references-only
 exit codes: compile 0 / execute 1
Program received signal SIGPROT, CHERI protection violation.
Capability tag fault caused by register ca1.
0x00000000001017de in main () at tests/cheri/intr7.c:9
9 fprintf(stderr,"%d\n", *p);
#0 0x00000000001017de in main () at tests/cheri/intr7.c:9
x = 0
p = 0x3fffdfff6c [rwRW,0x3fffdfff6c-0x3fffdfff70] (invalid)


 
clang-morello-O3-bounds-subobject-safe exit codes: compile 0 / execute 1
Program received signal SIGPROT, CHERI protection violation.
Capability tag fault.
0x000000000011078c in main () at tests/cheri/intr7.c:9
9 fprintf(stderr,"%d\n", *p);
#0 0x000000000011078c in main () at tests/cheri/intr7.c:9
x = 0
p = 0xfffffff7ff5c [rwRW,0xfffffff7ff5c-0xfffffff7ff60] (invalid)


 
clang-morello-O0-bounds-subobject-safe
clang-morello-O0-bounds-aggressive
clang-morello-O0-bounds-very-aggressive
clang-morello-O0-bounds-everywhere-unsafe
 exit codes: compile 0 / execute 1
Program received signal SIGPROT, CHERI protection violation.
Capability tag fault.
0x00000000001107b0 in main () at tests/cheri/intr7.c:9
9 fprintf(stderr,"%d\n", *p);
#0 0x00000000001107b0 in main () at tests/cheri/intr7.c:9
x = 0
p = 0xfffffff7ff5c [rwRW,0xfffffff7ff5c-0xfffffff7ff60] (invalid)


 
clang-morello-O3-bounds-conservative exit codes: compile 0 / execute 1
Program received signal SIGPROT, CHERI protection violation.
Capability tag fault.
main () at tests/cheri/intr7.c:9
9 fprintf(stderr,"%d\n", *p);
#0 main () at tests/cheri/intr7.c:9
p = 0xfffffff7ff5c [rwRW,0xfffffff7ff5c-0xfffffff7ff60] (invalid)
x = 0


 
clang-morello-O0-bounds-conservative
clang-morello-O0-bounds-references-only
 exit codes: compile 0 / execute 1
Program received signal SIGPROT, CHERI protection violation.
Capability tag fault.
0x00000000001107a0 in main () at tests/cheri/intr7.c:9
9 fprintf(stderr,"%d\n", *p);
#0 0x00000000001107a0 in main () at tests/cheri/intr7.c:9
x = 0
p = 0xfffffff7ff5c [rwRW,0xfffffff7ff5c-0xfffffff7ff60] (invalid)


 
gcc-morello-O0
gcc-morello-O3
 exit codes: compile 0 / execute 137