Skip to content

runtime: don't crash if vsyscall and vdso are disabled on x86_64 #41681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

avagin
Copy link
Contributor

@avagin avagin commented Sep 28, 2020

If vdso is disabled, the goruntime calls gettimeofday from vsyscall,
but if vsyscall is disabled too, all golang binaries crash:

SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xffffffffff600000} ---
killed by SIGSEGV (core dumped) ++

vsyscall doesn't work as it was designed for a long time due to security
reasons and now vsyscall is a little more expensive than real syscalls:
torvalds/linux@5cec93c216db

This patch reworks the code to call syscalls if the vdso library isn't
available.

@googlebot googlebot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Sep 28, 2020
@gopherbot
Copy link
Contributor

This PR (HEAD: 1764124) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/257982 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Michael Pratt:

Patch Set 2: Run-TryBot+1 Code-Review+1 Trust+1

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 2:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=9681add4


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 2:

Build is still in progress...
This change failed on windows-386-2008:
See https://storage.googleapis.com/go-build-log/9681add4/windows-386-2008_02b833f3.log

Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 2: TryBot-Result-1

1 of 20 TryBots failed:
Failed on windows-386-2008: https://storage.googleapis.com/go-build-log/9681add4/windows-386-2008_02b833f3.log

Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: d662e13) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/257982 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: 3ee50a5) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/257982 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: 32a7301) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/257982 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Andrei Vagin:

Patch Set 5:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Michael Pratt:

Patch Set 6: Run-TryBot+1 Code-Review+2

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 6:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=f9a55a90


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 6: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 098fd23) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/257982 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@avagin avagin changed the title x86: Don't crash if vsyscall and vdso are disabled runtime: Don't crash if vsyscall and vdso are disabled on x86_64 Sep 28, 2020
@gopherbot
Copy link
Contributor

This PR (HEAD: 7846e34) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/257982 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Andrei Vagin:

Patch Set 8:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 8:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

If vdso is disabled, the goruntime calls gettimeofday from vsyscall.
But if vsyscall is disabled too, all golang binaries crash:

SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xffffffffff600000} ---
killed by SIGSEGV (core dumped) ++

vsyscall doesn't work as it was designed for a long time due to security
reasons and now vsyscall is a little more expensive than real syscalls:
torvalds/linux@5cec93c216db

This patch reworks the code to call syscalls if the vdso library isn't
available.

Signed-off-by: Andrei Vagin <[email protected]>
@avagin avagin changed the title runtime: Don't crash if vsyscall and vdso are disabled on x86_64 runtime: don't crash if vsyscall and vdso are disabled on x86_64 Sep 29, 2020
@gopherbot
Copy link
Contributor

This PR (HEAD: 1d133cd) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/257982 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Andrei Vagin:

Patch Set 9:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tobias Klauser:

Patch Set 9: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 9:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=3f69a3dc


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 9: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/257982.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Sep 30, 2020
If vdso is disabled, the goruntime calls gettimeofday from vsyscall,
but if vsyscall is disabled too, all golang binaries crash:

SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xffffffffff600000} ---
killed by SIGSEGV (core dumped) ++

vsyscall doesn't work as it was designed for a long time due to security
reasons and now vsyscall is a little more expensive than real syscalls:
torvalds/linux@5cec93c216db

This patch reworks the code to call syscalls if the vdso library isn't
available.

Change-Id: I16cbf3f49871bea91e26af1f49aa0ae2fbd3a01d
GitHub-Last-Rev: 1d133cd
GitHub-Pull-Request: #41681
Reviewed-on: https://go-review.googlesource.com/c/go/+/257982
Run-TryBot: Tobias Klauser <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Reviewed-by: Michael Pratt <[email protected]>
Trust: Michael Pratt <[email protected]>
@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/257982 has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants