Skip to content

Commit 92ee6d3

Browse files
authored
fix: catch suid binary and low priv crashes (#553)
1 parent c51f3ef commit 92ee6d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/resources/source.d/40_mount_shared_dir.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ if [ ! -z "${SHARED_DIR}" ]; then
99
# This has to come before setting up the root shell,
1010
# because we want the `ulimit -c unlimited` to apply for programs run inside the root shell.
1111
/igloo/utils/busybox mkdir -p /igloo/shared/core_dumps
12+
/igloo/utils/busybox chmod -R 1777 /igloo/shared/core_dumps
1213
# Make sure the underlying file is overwritten and not a hyperfs pseudofile at that path.
1314
# One might want to make `/proc/sys/kernel/core_pattern` a pseudofile to prevent the guest from overwriting it.
1415
/igloo/utils/busybox echo '/igloo/shared/core_dumps/core_%e.%p' > /igloo/pfs/real/proc/sys/kernel/core_pattern
16+
# 2 all processes dump core when possible. The core dump is owned by the current user and no security is applied. This is intended for system debugging situations only. Ptrace is unchecked. This is insecure as it allows regular users to examine the memory contents of privileged processes.
17+
# https://sysctl-explorer.net/fs/suid_dumpable/
18+
/igloo/utils/busybox echo 2 > /igloo/pfs/real/proc/sys/fs/suid_dumpable
1519
ulimit -c unlimited
1620
fi

0 commit comments

Comments
 (0)