Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
salsa20/salsa: fix amd64 assembly not to smash SP
**salsa20 is used by V1 protocol of DNSCrypt** golang/go#44269 quote: x/crypto/*.s masks and writes to SP during function execution. This is not allowed by the Go ABI. All SP modifications on goroutine stacks must be constant additions or subtractions, or else the garbage collector cannot unwind the stack from that location. Code used to get away with this due to cooperative scheduling, but now that we scan stacks preemptively, it is especially important that functions not do this. New code in Go 1.17 will stop stack traces in such functions, which will make programs crash more loudly. But they are still broken in earlier versions and may just cause silent memory corruption instead of loud crashes. hashBlocksSSE2 and hashBlocksSSSE3 should leave SP alone.
- Loading branch information