diff options
| author | Theofilos Augoustis <37243696+taugoust@users.noreply.github.com> | 2025-11-07 09:54:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-07 09:54:27 +0100 |
| commit | a569419cf43d3c2a9cde150f46b6e30631fc6a5e (patch) | |
| tree | ee401db58089b13648d89e06fbb7f1ede1e0bf87 /reproducers/issue-1377.c | |
| parent | cfd9715eeff97c11ebc3f78288f9f516c79b0663 (diff) | |
| parent | 718d83441cb0039c18dad6d27ba8de39fd95a649 (diff) | |
| download | focaccia-a569419cf43d3c2a9cde150f46b6e30631fc6a5e.tar.gz focaccia-a569419cf43d3c2a9cde150f46b6e30631fc6a5e.zip | |
Merge pull request #21 from TUM-DSE/ck/reproducers
Add reproducers
Diffstat (limited to 'reproducers/issue-1377.c')
| -rw-r--r-- | reproducers/issue-1377.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/reproducers/issue-1377.c b/reproducers/issue-1377.c new file mode 100644 index 0000000..b6b1309 --- /dev/null +++ b/reproducers/issue-1377.c @@ -0,0 +1,30 @@ +#include<stdio.h> +#include<sys/mman.h> +__attribute__((naked,noinline)) void* f(void* dst, void* p) { + __asm__( + "\n pushq %rbp" + "\n movq %rsp, %rbp" + "\n movq %rdi, %rax" + "\n movq $0x0, (%rdi)" + "\n movl $0x140a, (%rdi) # imm = 0x140A" + "\n movb $0x4, 0x5(%rdi)" + "\n cvtps2pd (%rsi), %xmm0" + "\n movups %xmm0, 0x8(%rdi)" + "\n cvtps2pd 0x8(%rsi), %xmm0" + "\n movups %xmm0, 0x18(%rdi)" + "\n popq %rbp" + "\n retq" + ); +} +int main() { + char dst[1000]; + int page = 4096; + char* buf = mmap(NULL, page*2, PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + // mprotect(buf+page, page, 0); + + float* src = (float*)(buf+0x40); + printf("src: %p\n", src); + + void* r = f(dst, src); + printf("res: %p\n", r); +} |