Hi,

With slurm 2.3.2 (or 2.3.3), I encounter the following error when
trying to launch as root a command attached to a running user's job
even if I use the --uid=<user> option :

sila@suse112:~> squeue
JOBID PARTITION NAME USER STATE TIME TIMELIMIT NODES CPUS NODELIST(REASON) 551 debug mysleep. sila RUNNING 0:02 UNLIMITED 1 1 n1

root@suse112:~ # srun --jobid=551 hostname
srun: error: Unable to create job step: Access/permission denied <--normal behaviour

root@suse112:~ # srun --jobid=551 --uid=sila hostname
srun: error: Unable to create job step: Invalid user id <--problem

By increasing slurmctld verbosity, the log files displays the follwing
error :

slurmctld: debug2: Processing RPC: REQUEST_JOB_ALLOCATION_INFO_LITE from uid=0 slurmctld: debug: _slurm_rpc_job_alloc_info_lite JobId=551 NodeList=n1 usec=1442
slurmctld: debug2: Processing RPC: REQUEST_JOB_STEP_CREATE from uid=0
slurmctld: error: Security violation, JOB_STEP_CREATE RPC from uid=0 to run as uid 1001

which occurs in function : _slurm_rpc_job_step_create (src/slurmctld/proc_req.c)

Here's my patch to prevent the command from failing (but I'm not sure
that there is no side effects) :

diff --git a/src/slurmctld/proc_req.c b/src/slurmctld/proc_req.c
index 8ab0ace..2b5c975 100644
--- a/src/slurmctld/proc_req.c
+++ b/src/slurmctld/proc_req.c
@@ -1639,7 +1639,7 @@ static void _slurm_rpc_job_step_create(slurm_msg_t * msg)
        debug2("Processing RPC: REQUEST_JOB_STEP_CREATE from uid=%d", uid);

        dump_step_desc(req_step_msg);
-       if (uid != req_step_msg->user_id) {
+       if (uid && uid != req_step_msg->user_id) {
error("Security violation, JOB_STEP_CREATE RPC from uid=%d "
                      "to run as uid %u",
                      uid, req_step_msg->user_id);



Regards,

Didier

Reply via email to