You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IIUC 17d4a60 modified ptrace_writemem to expect the size of its input to be word-aligned. It did this by pushing the alignment adjustment outwards into ptrace_writemem's callers. However, the new alignment adjustment is not equivalent. In particular, prior to this commit the size would not be adjusted if it was already word-aligned. Following this commit a word-aligned size is incremented by another word. I'm unsure if this was intentional or not, but it looks to me as if this extra word is unnecessary and goes unused. If you agree with this assessment and are happy to take a pull request, I can have a go at changing this to only increase the size when it's not already word-aligned. Thanks!
The text was updated successfully, but these errors were encountered:
You're right, it would add an extra word if the payload length was already word-aligned. Since the newly allocated payload buffer is filled with NOPs before the shellcode is copied into it, it shouldn't affect the functionality. But for the sake of code cleanliness, I'm happy to accept a pull request that fixes this. Thanks for pointing it out.
Smattr
added a commit
to Smattr/linux-injector
that referenced
this issue
Jul 29, 2016
Prior to this commit, a word-aligned payload would result in an allocation that
was one word larger than required. This commit modifies the rounding logic so we
only round up if the payload is not already word-aligned.
Closesdismantl#2
IIUC 17d4a60 modified
ptrace_writemem
to expect the size of its input to be word-aligned. It did this by pushing the alignment adjustment outwards intoptrace_writemem
's callers. However, the new alignment adjustment is not equivalent. In particular, prior to this commit the size would not be adjusted if it was already word-aligned. Following this commit a word-aligned size is incremented by another word. I'm unsure if this was intentional or not, but it looks to me as if this extra word is unnecessary and goes unused. If you agree with this assessment and are happy to take a pull request, I can have a go at changing this to only increase the size when it's not already word-aligned. Thanks!The text was updated successfully, but these errors were encountered: