Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Ability to patch all loaded object files #9

Merged
merged 4 commits into from
Jun 1, 2017

Conversation

GBuella
Copy link
Contributor

@GBuella GBuella commented May 21, 2017

#7


This change is Reviewable

Ref: pmem#7

While executing ASAN builds, some unexpected syscalls are observed. These
can not be predicted, so this patch attempts to filter them out.
Also, the return value of the function named hook in test/hook_test_preload.c
is changed to 7 from 99. This also helps with ASAN builds: ASAN reads
the buffers passed write syscalls, after they return. Due to this, an ASAN
error was triggered every time it tried to read dummy_data buffer's contents,
which has fewer than 99 bytes.
@GBuella GBuella force-pushed the patch_em_all branch 2 times, most recently from 4b3a677 to 280abb2 Compare May 21, 2017 20:16
GBuella added 3 commits May 21, 2017 22:23
When the INTERCEPT_ALL_OBJS environment variable is set (to any value),
libsyscall_intercept attempts to patch all objects it finds. This is
not (yet) documented, as it is only meant to be used for a few testing
scenarios.
It also has caveats: the objects to be patched are filter based on their
names, thus if one libsyscall_intercept itself is not in loaded as a
library called libsyscall_intercept.so, it will try to intercept itself.
This can happen when it statically linked into some other object file.
@krzycz
Copy link
Contributor

krzycz commented May 22, 2017

Reviewed 19 of 20 files at r1.
Review status: 18 of 19 files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@GBuella
Copy link
Contributor Author

GBuella commented May 22, 2017

For those who feel like some more explanation would be appropriate, it is going on in this PR is coming soon:

https://github.com/GBuella/syscall_intercept/blob/patch_all_objs_2/hacking.md

That hacking.md is going to describe things in greater detail, but it still needs some days to be written, so I plan to add it in another PR.

@krzycz
Copy link
Contributor

krzycz commented May 25, 2017

Reviewed 1 of 20 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@krzycz
Copy link
Contributor

krzycz commented May 25, 2017

:lgtm:


Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from Reviewable

@sarahjelinek
Copy link
Contributor

sarahjelinek commented Jun 1, 2017

LGTM

Reviewed 20 of 20 files at r1.
Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from Reviewable

@sarahjelinek sarahjelinek merged commit 06b9c8e into pmem:master Jun 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants