Repository navigation
[clustermgtd] Fix an issue where the Slurm node Comment and Extra fields could alter the node information read by ParallelCluster. - #741
Conversation
…m nodes and the Comment field of Slurm reservations could alter the node and reservation information read by ParallelCluster.
66b4292 to
e46f472
Compare
|
Great job @gmarciani ! Does this PR cover injection in multi-line comments? |
| # Fields matched up to the end of the line and discarded, to prevent their free-text content from being parsed as fields | ||
| SCONTROL_DISCARDED_FIELDS = ("Comment", "Extra") |
There was a problem hiding this comment.
Minor: what's the issue if we do not discard them? It would be cleaner if we don't add another global variable.
This is a minor style comment
There was a problem hiding this comment.
If we do not discard them we would have two problems:
- we would have data around that we do not need, bad practice in general
- we need further code changes to handle them
Since the issue with having a new constant is code style, I suggest to keep the change as is.
Nope (added to description). the only way to fix the multine comment "attack" is moving from free text parsing to JSON, which is not an option due to memory and latency issues at scale. |
Description of changes
Fix an issue where the Slurm node Comment and Extra fields could alter the node information read by ParallelCluster.
FAQ
scontrol show --json, which is not an option due to memory and latency issues at scale.Reproducer
Node is healthy idle
Then I set a comment with offending substring
State=DOWN+DRAINOn the next clustermgtd cycle, clustermgtd reads the state from the Comment field (
State=DOWN+DRAIN) rather than the expected fieldState=IDLE+CLOUDand trigger an unintentional replacement.Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.