]> git.lizzy.rs Git - plan9front.git/commit
acid: fix sysr1() stack corruption
authorcinap_lenrek <cinap_lenrek@felloff.net>
Mon, 22 Sep 2014 21:07:59 +0000 (23:07 +0200)
committercinap_lenrek <cinap_lenrek@felloff.net>
Mon, 22 Sep 2014 21:07:59 +0000 (23:07 +0200)
commit4cb032442a1598611c684ca16f58950358502935
tree98d0808011cfc37a5557ab6e5e715012f5bb0c6c
parent84c40fb226e374efe05bb7d7eaa4f43f713f4929
acid: fix sysr1() stack corruption

the syscall stubs (for amd64) currently have a unconditional
spill of the first (register) argument to the stack.

sysr1 (and _nsec) are exceptional in that they do not
take any arguments, so the stub is writing unconditionally
to ther first argument slot on the stack.

i could avoid emiting the spill in the syscall stubs for
sysr1 but that would also break truss which assumes fixed
instruction sequence from stub start to the syscall number.

i'm not going to complicate the syscall stubs just for
sysr1 (_nsec is not used in 9front), but just add a dummy
argument to sysr1 definition that can receive the bogus
argument spill.
sys/src/cmd/acid/builtin.c