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

Basic tracing does not appear to work on macOS Monterey Version 12.5.1 #49

Open
mdittmer opened this issue Aug 24, 2022 · 3 comments
Open

Comments

@mdittmer
Copy link

I tried what I thought would be the simplest possible example trace on Mac (with SIP turned off; see below), but I only saw a read of the binary I used, not any read/write events associated with the arguments.

 $ csrutil status
System Integrity Protection status: disabled.
 $ cd $(mktemp -d)
 $ touch test_file
 $ fsatrace vrwmd - -- cp test_file test_file.copy
argv[0]=cp
argv[1]=test_file
argv[2]=test_file.copy
r|/bin/cp
 $ 
@jacereda
Copy link
Owner

Hi,

IIRC macOS doesn't allow intercepting system binaries. Try copying the cp binary to /tmp/ and run that one instead. At some point there was a horrible workaround in Shake:

https://github.com/ndmitchell/shake/pull/448/files

@mdittmer
Copy link
Author

mdittmer commented Sep 6, 2022

This does not appear to be related to the location of the binary:

 $ csrutil status
System Integrity Protection status: disabled.
 $ cd $(mktemp -d)
 $ touch test_file
 $ cp /bin/cp ./cp
 $ fsatrace vrwmd - -- ./cp test_file test_file.copy
argv[0]=./cp
argv[1]=test_file
argv[2]=test_file.copy
r|/path/to/tmp/dir/cp
 $ ls
cp		test_file	test_file.copy
 $ 

@jacereda
Copy link
Owner

jacereda commented Sep 7, 2022

In that case, they probably added some other function to libc that isn't intercepted, the output of nm for libSystem (or whatever has the open wrappers, IIRC they splitted libSystem at some point) might help figuring out the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants