flux-framework / flux-core

core services for the Flux resource management framework
GNU Lesser General Public License v3.0
167 stars 50 forks source link

job-exec: do not streq() an unbuffered string #6058

Closed chu11 closed 3 months ago

chu11 commented 3 months ago

Problem: The job-exec barrier protocol does a streq() string comparison on the data returned from a subprocess's stdout. When subprocesses began to use the new UNBUF flag, this data became non-NUL terminated. The streq() therefore became unsafe to use.

Update code to check data length and use strncmp() instead of streq().

Fixes #6057

chu11 commented 3 months ago

re-pushed with the obvious fix

codecov[bot] commented 5 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.35%. Comparing base (dd0f398) to head (1577438). Report is 499 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #6058 +/- ## ========================================== + Coverage 83.32% 83.35% +0.02% ========================================== Files 519 519 Lines 83817 83818 +1 ========================================== + Hits 69843 69864 +21 + Misses 13974 13954 -20 ``` | [Files with missing lines](https://app.codecov.io/gh/flux-framework/flux-core/pull/6058?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=flux-framework) | Coverage Δ | | |---|---|---| | [src/modules/job-exec/exec.c](https://app.codecov.io/gh/flux-framework/flux-core/pull/6058?src=pr&el=tree&filepath=src%2Fmodules%2Fjob-exec%2Fexec.c&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=flux-framework#diff-c3JjL21vZHVsZXMvam9iLWV4ZWMvZXhlYy5j) | `80.88% <100.00%> (+0.07%)` | :arrow_up: | ... and [15 files with indirect coverage changes](https://app.codecov.io/gh/flux-framework/flux-core/pull/6058/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=flux-framework)