-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
Fix trace mode on arm64 #354
Open
neverpanic
wants to merge
5
commits into
macports:master
Choose a base branch
from
neverpanic:cal-fix-arm64-tracmode
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Actually, this code should probably be updated with bounds checks for all the access into the |
neverpanic
force-pushed
the
cal-fix-arm64-tracmode
branch
from
November 4, 2024 20:28
c97822d
to
e0fe665
Compare
Done. |
neverpanic
force-pushed
the
cal-fix-arm64-tracmode
branch
3 times, most recently
from
November 4, 2024 22:33
3e7b15e
to
84c5efd
Compare
neverpanic
force-pushed
the
cal-fix-arm64-tracmode
branch
from
November 15, 2024 10:43
84c5efd
to
aa3125f
Compare
Access would previously be allowed, too, because these files are not installed by a MacPorts port. They did generate a warning, though, which is not necessary. Adding an explicit whitelist entry silences them.
When we modify the copying algorithm for the trace mode SIP workaround, re-copy the files if the mtime didn't change since they were initially copied, but their ctime is older than that of the Pextlib.dylib (or darwintrace.dylib) that contains the copying code. This allows us to modify the copying algorithm, which will then cause all previously copied files to be considered outdated.
Fix trace mode on arm64 by stripping the CPU subtype that enables pointer authentication in the Mach-O headers of Apple's binaries. Closes: https://trac.macports.org/ticket/66358
Relax the path check in sipp_copy_proc.c so that it also passes in the build tree, not only in the install location.
Invoking [setup] enables the tracing sandbox, which means that binaries started after that must be started via system or must not be arm64e system binaries (which are untraceable unmodified and will crash with DYLD_INSERT_LIBRARIES set). The reverse applies for [expect] in the cleanup phase. Use system for invocations of system utilities that should be traced when invoked after [setup]. Move invocations that don't need to be traced after [expect] in cleanup. Add infrastructure required to use system (e.g., allow access to the shell and provide `ui_info` and `ui_debug`).
neverpanic
force-pushed
the
cal-fix-arm64-tracmode
branch
from
November 15, 2024 10:44
aa3125f
to
3eb7733
Compare
Thanks for this. I'll try to review it before too long. |
Note that this doesn't correctly work on macOS 14 yet. See the discussion in the ticket. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix trace mode on arm64 by stripping the CPU subtype that enables pointer authentication in the Mach-O headers of Apple's binaries.
Re-enable darwintrace proc tests on arm64.