serenity
serenity copied to clipboard
Kernel+DynamicLoader: Allow syscalls from dynamic loader more often
Previously, if DynamicLoader were invoked directly, it wasn't able to perform syscalls after the point just before the call to the main executable entry. This made dlopen to crash if it were called from within an executable that was itself executed using /usr/lib/Loader.so <executable>
.
Commit message nitpicks:
if DynamicLoader were invoked directly
=> if DynamicLoader was invoked directly
it wasn't able to perform syscalls
=> it wouldn't be able to perform syscalls
to crash if it were called from
=> to crash if it was called from
Can we split the kernel change and userspace change as well into 2 separate commits?
Also, do you have an example of such program being run with /usr/lib/Loader.so
?
Seems like was/were after "if" somehow depends on the factuality of the clause (https://ell.stackexchange.com/a/127747), though I cannot decide whether "if DynamicLoader were invoked directly" is a fact or an imaginary statement in this context.
Also, do you have an example of such program being run with /usr/lib/Loader.so?
Yes! cd /usr/Tests/LibELF; /usr/lib/Loader.so /usr/Tests/LibELF/TestDlOpen
crashes on master and works with this PR.
Seems like was/were after "if" somehow depends on the factuality of the clause (https://ell.stackexchange.com/a/127747), though I cannot decide whether "if DynamicLoader were invoked directly" is a fact or an imaginary statement in this context.
I don't know, to me it sounds incorrect to use were
here, but again, it's more a nitpick than an actual problem. I see that you changed it anyway, so it looks good to me :)
Also, do you have an example of such program being run with /usr/lib/Loader.so?
Yes!
cd /usr/Tests/LibELF; /usr/lib/Loader.so /usr/Tests/LibELF/TestDlOpen
crashes on master and works with this PR.
Nice! Can you include this in the commit message? I was not aware that we have such test unit, and surely by looking into the commit message one could tell how to test this easily :)