diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-07-08 08:55:39 +0000 |
|---|---|---|
| committer | Christian Krinitsin <mail@krinitsin.com> | 2025-07-08 08:55:39 +0000 |
| commit | 1a3c4faf4e0a25ed0b86e8739d5319a634cb9112 (patch) | |
| tree | 90ceb50013ad28bab46e52731ec4ce1e70c32a57 /results/classifier/no-thinking-deepseek-r1:70b/output/syscall/1462640 | |
| parent | c50b0c4da17b6e83640e4ed2380fffb5f507c846 (diff) | |
| download | qemu-analysis-1a3c4faf4e0a25ed0b86e8739d5319a634cb9112.tar.gz qemu-analysis-1a3c4faf4e0a25ed0b86e8739d5319a634cb9112.zip | |
add deepseek 70b result
Diffstat (limited to 'results/classifier/no-thinking-deepseek-r1:70b/output/syscall/1462640')
| -rw-r--r-- | results/classifier/no-thinking-deepseek-r1:70b/output/syscall/1462640 | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/results/classifier/no-thinking-deepseek-r1:70b/output/syscall/1462640 b/results/classifier/no-thinking-deepseek-r1:70b/output/syscall/1462640 new file mode 100644 index 000000000..b4e114a60 --- /dev/null +++ b/results/classifier/no-thinking-deepseek-r1:70b/output/syscall/1462640 @@ -0,0 +1,38 @@ + + + +shmat fails on 32-to-64 setup + + +I am trying to run a guest mips32 program (user mode) on a x86_64 host. The program fails on a call to shmat() reproducibly. when digging into this problem, I could make a small guest POC that fails when compiled as i386 (-m32) running on a x86_64 host, but pass when compiled as 64bit. The problem has to do with mmap flags. + +From what I can understand, when running 32bits guests programs, qemu reserve the whole guest virtual space with an mmap call. That mmap call specifys MAP:PRIVATE flag. When shmat is called, it tries to make part of that region MAP_SHARED and that fails. + +As a possible fix, it looks like it is possible to first unmap the shm region before calling shmat. + +steps to reproduce: +1 - create a file shm.c with content below +2 - compile with: gcc -m32 shm.c -o shm32 +3 - run on a x86_64 host: qemu-i386 ./shm32 +4 - observe shmat fails, by returning ptr -1 + +5- compile without -m32: : gcc shm.c -o shm64 +6 - observe it pass: qemu-x84_64 ./shm64 + + + +#include <sys/ipc.h> +#include <sys/shm.h> +#include <sys/mman.h> +#include <stdio.h> + +int main() +{ + struct shmid_ds shm_desc; + int err = 0; + int id = shmget(IPC_PRIVATE, 688128, IPC_CREAT|IPC_EXCL|0666); + err = shmctl(id, IPC_STAT, &shm_desc); + const void *at = 0x7f7df38ea000; + void* ptr = shmat(id, at, 0); + printf( "got err %d, ptr %p\n", err, ptr ); +} \ No newline at end of file |