From 44dec253dc1df0f68f5cf7cc609c89eb93803be3 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Mon, 17 Aug 2026 11:32:11 +0200 Subject: [PATCH] mxqd: Disable core dumps for jobs, not just lower the soft limit exec_reaper() means to switch core dumps off for a job, but assigns rlim_cur twice instead of assigning rlim_max once: rlim.rlim_cur = 0; rlim.rlim_cur = 0; if (setrlimit(RLIMIT_CORE, &rlim) == -1) rlim_max is therefore still the value left over from the RLIMIT_DATA call three lines above, so the hard limit becomes the job's booked memory instead of zero. A job can raise its soft limit again and dump a core of that size into the working directory, which is the opposite of what the code intends. Replicating the sequence for a job booked with 4096 MiB: inherited RLIMIT_CORE soft=0 hard=42949672960 current: RLIMIT_CORE soft=0 hard=4294967296 fixed: RLIMIT_CORE soft=0 hard=0 Assign rlim_max, so that the limit is irrevocable for the job. Fixes: 511439f3915 ("mxqd: Enforce limits using setrlimit()") Assisted-by: Claude Opus 5 (claude-opus-5) --- mxqd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mxqd.c b/mxqd.c index 3f572a8..3dbb6d8 100644 --- a/mxqd.c +++ b/mxqd.c @@ -1013,7 +1013,7 @@ static void exec_reaper(struct mxq_server *server,struct mxq_group_list *glist, group->user_name, group->user_uid, group->group_id, job->job_id); rlim.rlim_cur = 0; - rlim.rlim_cur = 0; + rlim.rlim_max = 0; if (setrlimit(RLIMIT_CORE, &rlim) == -1) mx_log_err("job=%s(%d):%lu:%lu setrlimit(RLIMIT_CORE, ...) failed: %m", group->user_name, group->user_uid, group->group_id, job->job_id);