| Scott Lurndal 2005-05-12, 2:59 am |
| Izo <I@siol.net> writes:
>Kernel 2.4.x, 2.6.x
>
>The behaviour seems slightly confusing for me. Why ? The file system /
>kernel allows the shared object rewrite / replace without complaint and
>it harms the program run-time behaviour while it blocks the program's
>binary replacement while such action (in contrary to shared object
>replacement) does not harm the program's operation.
>
>What is the reason for such behaviour (program crash etc.) anyway ?
When the kernel pages out a code page, it just discards it, since it
can always reload it directly from the object itself (e.g. executable
or shared object). So, while some of the code pages will be
in memory when you overwrite the .so, not all will be. When the next
code page is paged in from the new shared object, the function calls
from the old code pages will call incorrect addresses in the new
code pages and will cause arbitrary random code to be executed which
will quickly cause a system fault.
scott
>
>Izo
|