darling
darling copied to clipboard
`darling shell` not loading
Expected Result
Expected for darling shell to load into a shell
Actual Result
No output. Just frozen blank.

Steps To Reproduce
- Build darling and lkm
strace Output
Run sudo strace -f -u $USER darling shell, what is the output?
execve("/usr/local/bin/darling", ["darling", "shell"], 0x7ffe62ea4160 /* 68 vars */) = 0
access("/etc/suid-debug", F_OK) = -1 ENOENT (No such file or directory)
brk(NULL) = 0x1903000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffdd9ae77c0) = -1 EINVAL (Invalid argument)
fcntl(0, F_GETFD) = 0
fcntl(1, F_GETFD) = 0
fcntl(2, F_GETFD) = 0
access("/etc/suid-debug", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = 0
openat(AT_FDCWD, "/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
close(3) = 0
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=123711, ...}) = 0
mmap(NULL, 123711, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f38a484d000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libutil.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\23\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=14848, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f38a484b000
mmap(NULL, 16656, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f38a4846000
mmap(0x7f38a4847000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f38a4847000
mmap(0x7f38a4848000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f38a4848000
mmap(0x7f38a4849000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f38a4849000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360q\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\t\233\222%\274\260\320\31\331\326\10\204\276X>\263"..., 68, 880) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=2029224, ...}) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\t\233\222%\274\260\320\31\331\326\10\204\276X>\263"..., 68, 880) = 68
mmap(NULL, 2036952, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f38a4654000
mprotect(0x7f38a4679000, 1847296, PROT_NONE) = 0
mmap(0x7f38a4679000, 1540096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f38a4679000
mmap(0x7f38a47f1000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19d000) = 0x7f38a47f1000
mmap(0x7f38a483c000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f38a483c000
mmap(0x7f38a4842000, 13528, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f38a4842000
close(3) = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f38a4651000
arch_prctl(ARCH_SET_FS, 0x7f38a4651740) = 0
mprotect(0x7f38a483c000, 12288, PROT_READ) = 0
mprotect(0x7f38a4849000, 4096, PROT_READ) = 0
mprotect(0x408000, 4096, PROT_READ) = 0
mprotect(0x7f38a4899000, 4096, PROT_READ) = 0
munmap(0x7f38a484d000, 123711) = 0
geteuid() = 1000
readlink("/proc/self/exe", "/usr/local/bin/darling", 4095) = 22
write(2, "Sorry, the `/usr/local/bin/darli"..., 83Sorry, the `/usr/local/bin/darling' binary is not setuid root, which is mandatory.
) = 83
write(2, "Darling needs this in order to c"..., 86Darling needs this in order to create mount and PID namespaces and to perform mounts.
dmesg Output
Run dmesg | grep 'overlay\|darling'
[ 3819.103048] Darling TID 89711 (PID 89711) says: darling_sigexc_self()
[ 3819.108081] Darling TID 89711 (PID 89711) says: darling_sigexc_self()
[ 3822.090086] Darling TID 89714 (PID 89714) says: execve expand /bin/ls -> /root/.darling/bin/ls, ret 0
[ 3822.090543] env var: SUDO_COMMAND=/usr/local/bin/darling shell
[ 3822.090756] Darling TID 89714 (PID 89714) says: darling_sigexc_self()
[ 3822.095835] Darling TID 89714 (PID 89714) says: darling_sigexc_self()
[ 3965.008096] Darling TID 90008 (PID 90008) says: execve expand /bin/bash -> /home/ac/.darling/bin/bash, ret 0
[ 3965.008588] env var: PWD=/home/ac/dependencies/darling/build
[ 3965.008591] env var: _=/usr/local/bin/darling
[ 3965.008886] Darling TID 90008 (PID 90008) says: darling_sigexc_self()
[ 3965.014628] Darling TID 90008 (PID 90008) says: darling_sigexc_self()
System Information OS: Ubuntu 20.04.3 LTS x86_64 Host: MacBookPro15,2 1.0 Kernel: 5.16.2-t2 Uptime: 1 hour, 22 mins Packages: 2796 (dpkg), 41 (brew), 5 (flatpak), 12 (snap) Shell: zsh 5.8 CPU: Intel i5-8279U (8) @ 4.100GHz GPU: Intel Iris Plus Graphics 655 Memory: 3100MiB / 7801MiB
| Software | Version |
|---|---|
| Linux Kernel | 5.16.2-t2 |
| Darling | 597325bc702e7b0893ade8272000a4086b23f121 |
When it works:
- When using
sudo - First run after
sudo make install
Possible causes unrelated to darling:
- Not exiting the gnome-termimal properly (Perhaps something to do with Oh-my-zsh)
- Non-standard kernel: 5.16.2-t2 (Running on MacBook Pro 2019 with T2 chip)
- Something wrong with the permissions for folder
/usr/local/bin
Current mitigations:
- Always use
exitcommand to quit terminal. Don't usecontrol + shift + worcontrol + shift + q