diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-11-06 23:47:59 +0100 |
|---|---|---|
| committer | Christian Krinitsin <mail@krinitsin.com> | 2025-11-06 23:47:59 +0100 |
| commit | 718d83441cb0039c18dad6d27ba8de39fd95a649 (patch) | |
| tree | 4ed22749650807a87f19dd70279699348fd418b1 /reproducers/issue-1377.c | |
| parent | 5f2fbf712e222258d5e939dcf474e8039a93fa87 (diff) | |
| download | focaccia-718d83441cb0039c18dad6d27ba8de39fd95a649.tar.gz focaccia-718d83441cb0039c18dad6d27ba8de39fd95a649.zip | |
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); +} |