about summary refs log tree commit diff
path: root/src/linux/flock.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2020-12-04 17:01:05 -0500
committerRich Felker <dalias@aerifal.cx>2020-12-04 17:01:05 -0500
commit50c7935cd21f33f42013447d57bc19d2e6318aae (patch)
tree77c81294fe005821d1b5e0ccbeced6e401d6b022 /src/linux/flock.c
parent738c4e945c1218559d36b83cbaba11459fad89c9 (diff)
downloadmusl-50c7935cd21f33f42013447d57bc19d2e6318aae.tar.gz
musl-50c7935cd21f33f42013447d57bc19d2e6318aae.tar.xz
musl-50c7935cd21f33f42013447d57bc19d2e6318aae.zip
fix failure to preserve r6 in s390x asm; per ABI it is call-saved
both __clone and __syscall_cp_asm failed to restore the original value
of r6 after using it as a syscall argument register. the extent of
breakage is not known, and in some cases may be mitigated by the only
callers being internal to libc; if they used r6 but no longer needed
its value after the call, they may not have noticed the problem.
however at least posix_spawn (which uses __clone) was observed
returning to the application with the wrong value in r6, leading to
crash.

since the call frame ABI already provides a place to spill registers,
fixing this is just a matter of using it. in __clone, we also
spuriously restore r6 in the child, since the parent branch directly
returns to the caller. this takes the value from an uninitialized slot
of the child's stack, but is harmless since there is no caller to
return to in the child.
Diffstat (limited to 'src/linux/flock.c')
0 files changed, 0 insertions, 0 deletions