Discussion:
negative job array indices
David Singleton
2014-10-23 23:03:35 UTC
Permalink
We've seen slurmctld crashes due to negative job array indices. This
is a suggested
patch (against master 32a42a8) to catch them:

--- a/src/slurmctld/job_mgr.c
+++ b/src/slurmctld/job_mgr.c
@@ -5351,6 +5351,8 @@ static bool _parse_array_tok(char *tok, bitstr_t
*array_bitmap, uint32_t max)
int i, first, last, step = 1;

first = strtol(tok, &end_ptr, 10);
+ if (first < 0)
+ return false;
if (end_ptr[0] == '-') {
last = strtol(end_ptr + 1, &end_ptr, 10);
if (end_ptr[0] == ':') {

Cheers
David
j***@public.gmane.org
2014-10-23 23:21:40 UTC
Permalink
Perfect. Thanks!

I've committed this to the branch "slurm-14.03" and it will be
included in the version 14.03.10 release. The "master" branch is new
development for the 15.08 release.

Commit here:
https://github.com/SchedMD/slurm/commit/b02facfcf34f168888960174ac25e1ec84650774
Post by David Singleton
We've seen slurmctld crashes due to negative job array indices. This
is a suggested
--- a/src/slurmctld/job_mgr.c
+++ b/src/slurmctld/job_mgr.c
@@ -5351,6 +5351,8 @@ static bool _parse_array_tok(char *tok, bitstr_t
*array_bitmap, uint32_t max)
int i, first, last, step = 1;
first = strtol(tok, &end_ptr, 10);
+ if (first < 0)
+ return false;
if (end_ptr[0] == '-') {
last = strtol(end_ptr + 1, &end_ptr, 10);
if (end_ptr[0] == ':') {
Cheers
David
--
Morris "Moe" Jette
CTO, SchedMD LLC
Loading...