]> Cypherpunks repositories - gostls13.git/commit
syscall: in linux/arm Syscall, zero R3, R4, R5
authorRuss Cox <rsc@golang.org>
Fri, 5 Sep 2014 03:12:10 +0000 (23:12 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 5 Sep 2014 03:12:10 +0000 (23:12 -0400)
commit83824639c3ae9f357daf7ac2f8590b46d167296b
tree35096643096759f982e3374d2c0a1934c4eb051d
parentcb040d59b945437cdca8c8cff525ebbb7261a217
syscall: in linux/arm Syscall, zero R3, R4, R5

The general kernel system call interface
takes 6 arguments: R0, R1, R2, R3, R4, R5.

Syscall is for calls that only need 3.
The amd64 and 386 versions zero the extra arg registers,
but the arm version does not.

func utimensat calls Syscall with 3 arguments.
The kernel expects a 4th argument.
That turns out to be whatever is in R3 at the time of the call.
CL 137160043 changed various pieces of code and apparently
changed the value left in R3 at the time of utimensat's Syscall.
This causes the kernel to return EINVAL.

Change linux/arm Syscall to zero R3, R4, R5, so that calls will
behave deterministically, even if they pass too few arguments.

Arguably, utimensat could be fixed too, but the predictable
zeroing is certainly worth doing, and once done utimensat's
use of Syscall is fine.

Fixes arm build.

TBR=bradfitz
CC=golang-codereviews
https://golang.org/cl/141080043
src/pkg/syscall/asm_linux_arm.s