1. 23 Dec, 2014 4 commits
    • Austin Clements's avatar
      runtime: run libc SIGSETXID and SIGCANCEL handlers on signal stack · 675eb72c
      Austin Clements authored
      These signals are used by glibc to broadcast setuid/setgid to all
      threads and to send pthread cancellations.  Unlike other signals, the
      Go runtime does not intercept these because they must invoke the libc
      handlers (see issues #3871 and #6997).  However, because 1) these
      signals may be issued asynchronously by a thread running C code to
      another thread running Go code and 2) glibc does not set SA_ONSTACK
      for its handlers, glibc's signal handler may be run on a Go stack.
      Signal frames range from 1.5K on amd64 to many kilobytes on ppc64, so
      this may overflow the Go stack and corrupt heap (or other stack) data.
      
      Fix this by ensuring that these signal handlers have the SA_ONSTACK
      flag (but not otherwise taking over the handler).
      
      This has been a problem since Go 1.1, but it's likely that people
      haven't encountered it because it only affects setuid/setgid and
      pthread_cancel.
      
      Fixes #9600.
      
      Change-Id: I6cf5f5c2d3aa48998d632f61f1ddc2778dcfd300
      Reviewed-on: https://go-review.googlesource.com/1887Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      675eb72c
    • George Shammas's avatar
      net/http/cgi: Correctly pass down the REMOTE_PORT value for CGI requests. · 3ffc9756
      George Shammas authored
      Currently when we get a CGI or FCGI request, the remote port of the client
      is hard coded to zero, despite nearly every webserver passing down the
      REMOTE_PORT variable.
      
      This was likely originally excluded because the CGI RFC (rfc3875) does not
      mention anything about the remote port of the client. However every webserver
      tested does pass REMOTE_PORT down. This includes Apache 2.2, Apache 2.4,
      nginx and lighttpd.
      
      Fixes #8351
      
      Change-Id: I4c6366cb39f0ccc05e038bd31d85f93b76e8d0c8
      Reviewed-on: https://go-review.googlesource.com/1750Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      3ffc9756
    • Josh Bleecher Snyder's avatar
      test: fix windows build · 209dd4cd
      Josh Bleecher Snyder authored
      Broken by e7173dfd
      
      Fix by simply disabling the relevant tests.
      
      * bug248 and bug345 require errchk, but we can't
        rely on perl being available.
      * bug369 is disabled anyway.
      
      Change-Id: Idf73ebccb066943e3fe17c2f662b37238ec74dfe
      Reviewed-on: https://go-review.googlesource.com/2052Reviewed-by: default avatarAlex Brainman <alex.brainman@gmail.com>
      209dd4cd
    • Keith Randall's avatar
      runtime: make stack frames fixed size by modifying goproc/deferproc. · 53c5226f
      Keith Randall authored
      Calls to goproc/deferproc used to push & pop two extra arguments,
      the argument size and the function to call.  Now, we allocate space
      for those arguments in the outargs section so we don't have to
      modify the SP.
      
      Defers now use the stack pointer (instead of the argument pointer)
      to identify which frame they are associated with.
      
      A followon CL might simplify funcspdelta and some of the stack
      walking code.
      
      Fixes issue #8641
      
      Change-Id: I835ec2f42f0392c5dec7cb0fe6bba6f2aed1dad8
      Reviewed-on: https://go-review.googlesource.com/1601Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      53c5226f
  2. 22 Dec, 2014 27 commits
  3. 21 Dec, 2014 2 commits
  4. 20 Dec, 2014 7 commits