Avoid repeated ASLR re-exec attempts#2193
Conversation
|
|
||
| // Some security profiles clear ADDR_NO_RANDOMIZE across exec even though the | ||
| // personality appears updated here. Avoid re-entering forever in that case. | ||
| static const char kAslrReexecEnv[] = "BENCHMARK_ASLR_NO_REEXEC"; |
There was a problem hiding this comment.
Why is this an array of strings if we only need a single string?
a593ebd to
eacc9ca
Compare
|
Updated to use a constexpr const char* for the env var name. |
eacc9ca to
ae0da7c
Compare
|
Quick follow-up on this. I addressed the env-var naming feedback, but it looks non-mergeable now. Happy to refresh it against main if the approach looks okay. |
|
Still no real reply from devs on https://bugs.launchpad.net/bugs/2153650 :( |
|
Yeah, upstream sounds like the right next place to ask. If someone opens an issue there and links it back here, I can follow along from this PR. |
|
@kiwigitops and there's a response: https://gitlab.com/apparmor/apparmor/-/work_items/647#note_3475169287 |
|
Thanks for following up. I don't have access to comment on GitLab directly. If the relevant question or conclusion can be mirrored here, I can respond from this PR. |
|
|
I did a fresh local verification pass on this branch: CMake/Ninja build succeeds and For the AppArmor follow-up, the useful data point is the |
(Um, why does this look like LLM spew?) |
|
No, I do not have the requested Sorry, I wrote that badly. I checked the linked Launchpad/GitLab threads; they have the reproducer/environment details, but I do not see the I will hold off on further AppArmor claims until I can provide that host output. |
Sorry.
Just to be sure, you are trying to repro on a main branch, not on the fix branch, |
|
Good check. I tested current Results from a minimal
So I still cannot reproduce the original VS Code/AppArmor loop on that host. |
|
Hm, but did you try reproducing from within VSCode, where it initially happened? |
|
Fair point. I did not reproduce this from inside VS Code itself; the checks above were plain shell plus throwaway AppArmor profiles. I do not have the original VS Code/AppArmor environment locally, and I do not want to file a VS Code report from an unconfirmed repro. I am going to leave this PR open for now, but I am not going to chase the VS Code-specific path further without a local repro. |
Summary
Context
This addresses the AppArmor case from #2184 where
personality()reportsADDR_NO_RANDOMIZEas set beforeexecv(), but the new process image loses that flag and re-enters the same code path forever.Testing
git diff --checkI did not add a direct unit test because the behavior depends on Linux exec/personality interaction under an AppArmor-constrained process tree.