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
We shouldn't have /nix/store/... paths in our ELFs. Our nix stores are not stable, we might garbage collect them at any point. This is largely separate from challenge authors compiling in the dojo and uploading the created files (we should find a smoother development process that sidesteps this entirely). Instead, this has to do with the idea that a user might compile a program in their home directory, and that program should continue to work in any challenge image. In this case, ldshould actually be from nix, since we have no idea if the challenge image will have an ld. We still might run into issues related to ld and the libraries changing (upgrading for example), but we can be way more stable than the current /nix/store/... references.
Currently:
hacker@paths~the-root:~$ echo 'int main() { }' > test.c
hacker@paths~the-root:~$ gcc test.c -o test
hacker@paths~the-root:~$ ldd test
linux-vdso.so.1 (0x00007ffc6f3ed000)
libc.so.6 => /nix/store/r8qsxm85rlxzdac7988psm7gimg4dl3q-glibc-2.39-52/lib/libc.so.6 (0x00007c13a6b52000)
/nix/store/r8qsxm85rlxzdac7988psm7gimg4dl3q-glibc-2.39-52/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007c13a6d41000)
hacker@paths~the-root:~$ readelf -a test | grep nix
[Requesting program interpreter: /nix/store/r8qsxm85rlxzdac7988psm7gimg4dl3q-glibc-2.39-52/lib/ld-linux-x86-64.so.2]
0x000000000000001d (RUNPATH) Library runpath: [/nix/store/r8qsxm85rlxzdac7988psm7gimg4dl3q-glibc-2.39-52/lib:/nix/store/qksd2mz9f5iasbsh398akdb58fx9kx6d-gcc-13.2.0-lib/lib]
hacker@paths~the-root:~$ strings test | grep nix
/nix/store/r8qsxm85rlxzdac7988psm7gimg4dl3q-glibc-2.39-52/lib/ld-linux-x86-64.so.2
/nix/store/r8qsxm85rlxzdac7988psm7gimg4dl3q-glibc-2.39-52/lib:/nix/store/qksd2mz9f5iasbsh398akdb58fx9kx6d-gcc-13.2.0-lib/lib
If we need an absolute path to ld for the interpreter (probably we do, that would make sense?) it should be something like /run/dojo/lib/ld-linux-x86-64.so.2 (on ubuntu:24.04 I see /lib64/ld-linux-x86-64.so.2). We can make sure libc and friends end up in /run/dojo/lib and point RUNPATH there.
The text was updated successfully, but these errors were encountered:
We shouldn't have
/nix/store/...
paths in our ELFs. Our nix stores are not stable, we might garbage collect them at any point. This is largely separate from challenge authors compiling in the dojo and uploading the created files (we should find a smoother development process that sidesteps this entirely). Instead, this has to do with the idea that a user might compile a program in their home directory, and that program should continue to work in any challenge image. In this case,ld
should actually be from nix, since we have no idea if the challenge image will have anld
. We still might run into issues related told
and the libraries changing (upgrading for example), but we can be way more stable than the current/nix/store/...
references.Currently:
If we need an absolute path to ld for the interpreter (probably we do, that would make sense?) it should be something like
/run/dojo/lib/ld-linux-x86-64.so.2
(on ubuntu:24.04 I see/lib64/ld-linux-x86-64.so.2
). We can make sure libc and friends end up in/run/dojo/lib
and pointRUNPATH
there.The text was updated successfully, but these errors were encountered: