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

6211 fix jailbreak heap overhang #1043

Merged
merged 1 commit into from
Mar 17, 2021
Merged

Conversation

kstenerud
Copy link
Contributor

Goal

Blindly using memcmp to compare env variables to DYLD_INSERT_LIBRARIES was breaking when the address sanitizer was on because technically the comparison would run off the end of the array. This is technically not a problem since the ENV vars are all contiguous in memory and the small overhang can't cause real problems, but the address sanitizer IS correctly detecting the undefined behaviour.

Changeset

Check if the env var is smaller than DYLD_INSERT_LIBRARIES and short-circuit if so.

Testing

Manually ran the example app before to verify the problem, and afterwards to verify the fix.

@kstenerud kstenerud changed the base branch from master to next March 17, 2021 09:48
@github-actions
Copy link

Infer: No issues found 🎉

OCLint: No issues found 🎉

Bugsnag.framework binary size increased by 640 bytes from 1,084,896 to 1,085,536

Generated by 🚫 Danger

@nickdowell nickdowell merged commit 5287d5c into next Mar 17, 2021
@nickdowell nickdowell deleted the 6211-fix-jailbreak-heap-overhang branch March 17, 2021 16:40
nickdowell added a commit that referenced this pull request Mar 18, 2021
@nickdowell nickdowell mentioned this pull request Mar 24, 2021
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

Successfully merging this pull request may close these issues.

2 participants