intptr7.c
up: index
prev: intptr4.c
next: intptr7a.c
#include <stdint.h>
#include <stdio.h>
#include <limits.h>
#include "capprint.h"
int main()
{
int x[2]={42,43};
intptr_t ip = (intptr_t)&x;
fprintf(stderr,"original %" PTR_FMT "\n", sptr((void*)ip));
intptr_t ip1 = ip & ip;
fprintf(stderr,"cap&cap %" PTR_FMT "\n", sptr((void*)ip1));
intptr_t ip2 = ip & INT_MAX;
fprintf(stderr,"cap&int %" PTR_FMT "\n", sptr((void*)ip2)); //non-representable?
intptr_t ip3 = LONG_MAX & ip;
fprintf(stderr,"long&cap %" PTR_FMT "\n", sptr((void*)ip3));
intptr_t ip4 = ip & LONG_MAX;
fprintf(stderr,"cap&long %" PTR_FMT "\n", sptr((void*)ip4));
}
Experimental data (what does this mean?)
cerberus-cheri-no-pnvi
cerberus-cheri-revocation-no-pnvi
cerberus-cheri-cornucopia-no-pnvi original (@disabled, 0xffffe6ec [rwRW,0xffffe6ec-0xffffe6f4])
cap&cap (@disabled, 0xffffe6ec [rwRW,0xffffe6ec-0xffffe6f4])
cap&int (@disabled, 0x7fffe6ec [?-?] (notag))
long&cap (@disabled, 0xffffe6ec [rwRW,0xffffe6ec-0xffffe6f4])
cap&long (@disabled, 0xffffe6ec [rwRW,0xffffe6ec-0xffffe6f4])
cerberus-cheri
cerberus-cheri-revocation
cerberus-cheri-cornucopia original (@84, 0xffffe6ec [rwRW,0xffffe6ec-0xffffe6f4])
cap&cap (@84, 0xffffe6ec [rwRW,0xffffe6ec-0xffffe6f4])
cap&int (@empty, 0x7fffe6ec [?-?] (notag))
long&cap (@84, 0xffffe6ec [rwRW,0xffffe6ec-0xffffe6f4])
cap&long (@84, 0xffffe6ec [rwRW,0xffffe6ec-0xffffe6f4])
clang-riscv-O3-bounds-conservative
clang-riscv-O3-bounds-subobject-safe tests/cheri/intptr7.c:12:23: warning: binary expression on capability types 'intptr_t' (aka '__intcap') and 'intptr_t'; it is not clear which should be used as the source of provenance; currently provenance is inherited from the left-hand side [-Wcheri-provenance]
intptr_t ip1 = ip & ip;
~~ ^ ~~
1 warning generated.
original 0x3fffdfff18 [rwRW,0x3fffdfff18-0x3fffdfff20]
cap&cap 0x3fffdfff18 [rwRW,0x3fffdfff18-0x3fffdfff20]
cap&int 0x7fdfff18 [rwRW,0x7fdfff18-0x7fdfff20] (invalid)
long&cap 0x3fffdfff18 [rwRW,0x3fffdfff18-0x3fffdfff20]
cap&long 0x3fffdfff18 [rwRW,0x3fffdfff18-0x3fffdfff20]
clang-riscv-O0-bounds-conservative
clang-riscv-O0-bounds-references-only
clang-riscv-O0-bounds-subobject-safe
clang-riscv-O0-bounds-aggressive
clang-riscv-O0-bounds-very-aggressive
clang-riscv-O0-bounds-everywhere-unsafe tests/cheri/intptr7.c:12:23: warning: binary expression on capability types 'intptr_t' (aka '__intcap') and 'intptr_t'; it is not clear which should be used as the source of provenance; currently provenance is inherited from the left-hand side [-Wcheri-provenance]
intptr_t ip1 = ip & ip;
~~ ^ ~~
1 warning generated.
original 0x3fffdfff68 [rwRW,0x3fffdfff68-0x3fffdfff70]
cap&cap 0x3fffdfff68 [rwRW,0x3fffdfff68-0x3fffdfff70]
cap&int 0x7fdfff68 [rwRW,0x7fdfff68-0x7fdfff70] (invalid)
long&cap 0x3fffdfff68 [rwRW,0x3fffdfff68-0x3fffdfff70]
cap&long 0x3fffdfff68 [rwRW,0x3fffdfff68-0x3fffdfff70]
clang-morello-O3-bounds-subobject-safe tests/cheri/intptr7.c:12:23: warning: binary expression on capability types 'intptr_t' (aka '__intcap') and 'intptr_t'; it is not clear which should be used as the source of provenance; currently provenance is inherited from the left-hand side [-Wcheri-provenance]
intptr_t ip1 = ip & ip;
~~ ^ ~~
1 warning generated.
original 0xfffffff7fef8 [rwRW,0xfffffff7fef8-0xfffffff7ff00]
cap&cap 0xfffffff7fef8 [rwRW,0xfffffff7fef8-0xfffffff7ff00]
cap&int 0x7ff7fef8 [rwRW,0x7ff7fef8-0x7ff7ff00] (invalid)
long&cap 0xfffffff7fef8 [rwRW,0xfffffff7fef8-0xfffffff7ff00]
cap&long 0xfffffff7fef8 [rwRW,0xfffffff7fef8-0xfffffff7ff00]
clang-morello-O3-bounds-conservative tests/cheri/intptr7.c:12:23: warning: binary expression on capability types 'intptr_t' (aka '__intcap') and 'intptr_t'; it is not clear which should be used as the source of provenance; currently provenance is inherited from the left-hand side [-Wcheri-provenance]
intptr_t ip1 = ip & ip;
~~ ^ ~~
1 warning generated.
original 0xfffffff7ff18 [rwRW,0xfffffff7ff18-0xfffffff7ff20]
cap&cap 0xfffffff7ff18 [rwRW,0xfffffff7ff18-0xfffffff7ff20]
cap&int 0x7ff7ff18 [rwRW,0x7ff7ff18-0x7ff7ff20] (invalid)
long&cap 0xfffffff7ff18 [rwRW,0xfffffff7ff18-0xfffffff7ff20]
cap&long 0xfffffff7ff18 [rwRW,0xfffffff7ff18-0xfffffff7ff20]
clang-morello-O0-bounds-conservative
clang-morello-O0-bounds-references-only
clang-morello-O0-bounds-subobject-safe
clang-morello-O0-bounds-aggressive
clang-morello-O0-bounds-very-aggressive
clang-morello-O0-bounds-everywhere-unsafe tests/cheri/intptr7.c:12:23: warning: binary expression on capability types 'intptr_t' (aka '__intcap') and 'intptr_t'; it is not clear which should be used as the source of provenance; currently provenance is inherited from the left-hand side [-Wcheri-provenance]
intptr_t ip1 = ip & ip;
~~ ^ ~~
1 warning generated.
original 0xfffffff7ff48 [rwRW,0xfffffff7ff48-0xfffffff7ff50]
cap&cap 0xfffffff7ff48 [rwRW,0xfffffff7ff48-0xfffffff7ff50]
cap&int 0x7ff7ff48 [rwRW,0x7ff7ff48-0x7ff7ff50] (invalid)
long&cap 0xfffffff7ff48 [rwRW,0xfffffff7ff48-0xfffffff7ff50]
cap&long 0xfffffff7ff48 [rwRW,0xfffffff7ff48-0xfffffff7ff50]
gcc-morello-O3 tests/cheri/intptr7.c: In function 'main':
tests/cheri/intptr7.c:12:23: warning: binary expression on capability types 'intptr_t' {aka '__intcap'} and 'intptr_t' {aka '__intcap'}; it is not clear which should be used as the source of provenance; currently provenance is inherited from the left-hand side [-Wcheri-provenance]
12 | intptr_t ip1 = ip & ip;
| ^
original 0x7fffffd8 [rwRW,0x7fffffd8-0x7fffffe0]
cap&cap 0x7fffffd8 [rwRW,0x7fffffd8-0x7fffffe0]
cap&int 0x7fffffd8 [rwRW,0x7fffffd8-0x7fffffe0]
long&cap 0x7fffffd8 [rwRW,0x7fffffd8-0x7fffffe0]
cap&long 0x7fffffd8 [rwRW,0x7fffffd8-0x7fffffe0]
gcc-morello-O0 tests/cheri/intptr7.c: In function 'main':
tests/cheri/intptr7.c:12:23: warning: binary expression on capability types 'intptr_t' {aka '__intcap'} and 'intptr_t' {aka '__intcap'}; it is not clear which should be used as the source of provenance; currently provenance is inherited from the left-hand side [-Wcheri-provenance]
12 | intptr_t ip1 = ip & ip;
| ^
original 0x7fffff88 [rwRW,0x7fffff88-0x7fffff90]
cap&cap 0x7fffff88 [rwRW,0x7fffff88-0x7fffff90]
cap&int 0x7fffff88 [rwRW,0x7fffff88-0x7fffff90]
long&cap 0x7fffff88 [rwRW,0x7fffff88-0x7fffff90]
cap&long 0x7fffff88 [rwRW,0x7fffff88-0x7fffff90]