affinity: handle NULL set name from --set affinity path - #16096
Closed
victorjulien wants to merge 1 commit into
Closed
affinity: handle NULL set name from --set affinity path#16096victorjulien wants to merge 1 commit into
victorjulien wants to merge 1 commit into
Conversation
Setting a cpu-affinity path with --set, like --set threading.cpu-affinity.worker-cpu-set.threads=28 creates an intermediate node under cpu-affinity whose val is NULL. With a legacy list format cpu-affinity, AffinitySetupLoadFromConfig() red the set name from the node val and passed it to GetAffinitySetName(), which then dereferenced the NULL pointer. Address it by simply checking for the NULL. Ticket: OISF#6735.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16096 +/- ##
==========================================
- Coverage 83.05% 83.02% -0.04%
==========================================
Files 1004 1004
Lines 277359 277361 +2
==========================================
- Hits 230370 230273 -97
- Misses 46989 47088 +99
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Information: QA ran without warnings. Pipeline = 33273 |
victorjulien
marked this pull request as ready for review
August 25, 2026 05:32
lukashino
reviewed
Aug 25, 2026
| */ | ||
| static const char *GetAffinitySetName(const char *val) | ||
| { | ||
| if (val == NULL) { |
Contributor
There was a problem hiding this comment.
With a legacy list format cpu-affinity
so, this might not be needed if we remove the legacy format in 9?
related ticket: https://redmine.openinfosecfoundation.org/issues/7721
Contributor
There was a problem hiding this comment.
Could be potentially directly merged to main-8 branch though
Member
Author
There was a problem hiding this comment.
Might as well fix it while it isn't removed yet.
lukashino
approved these changes
Aug 25, 2026
Member
Author
|
@lukashino please check the SV test as well. |
Merged
Member
Author
|
Merged in #16118, thanks! |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setting a cpu-affinity path with --set, like
--set threading.cpu-affinity.worker-cpu-set.threads=28
creates an intermediate node under cpu-affinity whose val is NULL.
With a legacy list format cpu-affinity, AffinitySetupLoadFromConfig() red the set name from the node val and passed it to GetAffinitySetName(), which then dereferenced the NULL pointer.
Address it by simply checking for the NULL.
Ticket: #6735.
SV_BRANCH=OISF/suricata-verify#3310