summary refs log tree commit diff stats
path: root/results/classifier/zero-shot-user-mode/instruction/1701808
blob: 7ab4775ab19e14fe0a6a3a8a3c11aada89815abb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
instruction: 0.632
runtime: 0.245
syscall: 0.124



stack smashing in or after recvmsg system call in aarch64 user mode

A program that invokes recvmsg aborts with "*** stack smashing detected ***" when run in qemu-aarch64 (user mode), but works fine when running on native aarch64 hardware.

How to reproduce:
$ aarch64-linux-gnu-gcc-5 -O -Wall /media/develdata/devel/qemu-bug/testpassfd.c -static -DEXTRA_SPACE=0
$ QEMU_LD_PREFIX=/usr/aarch64-linux-gnu ~/inst-qemu/2.9.0/bin/qemu-aarch64 ./a.out
*** stack smashing detected ***: ./a.out terminated
qemu: uncaught target signal 6 (Aborted) - core dumped

On native aarch64 hardware:
$ ./a.out 
$ echo $?
0

The parameter EXTRA_SPACE can be used to add additional space to the array that receives the recvmsg data. With -DEXTRA_SPACE=9 (or larger), the program runs fine. Which suggests that recvmsg is storing up to 9 bytes more than allowed in memory.