Re:Writing a Self-Mutating x86_64 C Program (2013)
by benj111 on Friday January 11, 2019 @07:23AM
(#18883027)
Would they not just write a new patched page, and swap out the original?
Seems less error prone?
Re:Writing a Self-Mutating x86_64 C Program (2013)
by nickpsecurity on Friday January 11, 2019 @11:58AM
(#18884838)
It's almost always a better idea to create something new, verify it was created successfully, do any syncing, switchover, optionally re-check for correct syncing, and then delete or take down original. That's pretty much how robust clustering works.
Re:Writing a Self-Mutating x86_64 C Program (2013)
by pantalaimon on Friday January 11, 2019 @11:33AM
(#18884620)
As I understand it they make the compiler add a few noops in the beginning of each non-static function.
Then to add tracing or change the behavior of the function, the noops are overwritten by a jump to the new code.
Kernel livepatching (and by that ftrace) would come to mind.