stack smashing in or after recvmsg system call in aarch64 user mode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
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-
$ QEMU_LD_
*** 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.
Likewise for 32-bit arm: qemu/2. 9.0/bin/ qemu-arm ./a.arm
$ ~/inst-
*** stack smashing detected ***: ./a.arm terminated
qemu: uncaught target signal 6 (Aborted) - core dumped