Skip to content
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

openbsd: don't reallocate a guard page on the stack. #102854

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

semarie
Copy link
Contributor

@semarie semarie commented Oct 9, 2022

the kernel currently enforce that a stack is immutable. calling mmap(2) or mprotect(2) to change it will result in EPERM, which generate a panic!().

so just do like for Linux, and trust the kernel to do the right thing.

the kernel currently enforce that a stack is immutable. calling mmap(2) or 
mprotect(2) to change it will result in EPERM, which generate a panic!().

so just do like for Linux, and trust the kernel to do the right thing.
@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 9, 2022
@rust-highfive
Copy link
Collaborator

r? @m-ou-se

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 9, 2022
@m-ou-se
Copy link
Member

m-ou-se commented Oct 11, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Oct 11, 2022

📌 Commit b3c21ef has been approved by m-ou-se

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 11, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 11, 2022
…m-ou-se

openbsd: don't reallocate a guard page on the stack.

the kernel currently enforce that a stack is immutable. calling mmap(2) or  mprotect(2) to change it will result in EPERM, which generate a panic!().

so just do like for Linux, and trust the kernel to do the right thing.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2022
Rollup of 6 pull requests

Successful merges:

 - rust-lang#102765 (Suggest `==` to the first expr which has `ExprKind::Assign` kind)
 - rust-lang#102854 (openbsd: don't reallocate a guard page on the stack.)
 - rust-lang#102904 (Print return-position `impl Trait` in trait verbosely if `-Zverbose`)
 - rust-lang#102947 (Sort elaborated existential predicates in `object_ty_for_trait`)
 - rust-lang#102956 (Use `full_res` instead of `expect_full_res`)
 - rust-lang#102999 (Delay `is_intrinsic` query until after we've determined the callee is a function)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 376c81c into rust-lang:master Oct 13, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 13, 2022
@semarie semarie deleted the openbsd-immutablestack branch October 13, 2022 18:45
@igor-petruk
Copy link

Hi,

Thanks you very much for the fix!

I have just upgrade my OpenBSD (from github master) and now my Rust application is broken. Surprisingly - only my app. But other Rust tools like alacritty work fine. So what is the way to trigger this issue? Is there anything specific that the Rust app should be doing, that I can temporarily avoid doing?

The current version of OpenBSD is 1.64, but the fix will only reach in 1.66, so I just wanted to know what causes the app to cause this.

Thank you,
Igor.

@semarie
Copy link
Contributor Author

semarie commented Nov 1, 2022

The fix has been backported downstream to lang/rust port (which follow stable). You need to rebuild your application with it (at least rustc-1.64.0p0) in order to have the updated code (from std library) in your application.

Rust programs from ports tree has already been rebuilt with it, so there are running with a fixed std library.

@igor-petruk
Copy link

igor-petruk commented Nov 1, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants