• Michael Pratt's avatar
    runtime: use tgkill for raise · 43f54c8d
    Michael Pratt authored
    raise uses tkill to send a signal to the current thread. For this use,
    tgkill is functionally equivalent to tkill expect that it also takes the
    pid as the first argument.
    
    Using tgkill makes it simpler to run a Go program in a strict sandbox.
    With kill and tgkill, the sandbox policy (e.g., seccomp) can prevent the
    program from sending signals to other processes by checking that the
    first argument == getpid().
    
    With tkill, the policy must whitelist all tids in the process, which is
    effectively impossible given Go's dynamic thread creation.
    
    Fixes #27548
    
    Change-Id: I8ed282ef1f7215b02ef46de144493e36454029ea
    Reviewed-on: https://go-review.googlesource.com/133975
    Run-TryBot: Michael Pratt <mpratt@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    43f54c8d
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...