Skip to content

Comments

debug: fix list-x command line options with debug#8956

Closed
catenacyber wants to merge 1 commit intoOISF:masterfrom
catenacyber:debug-fuzz-list-6089-v3
Closed

debug: fix list-x command line options with debug#8956
catenacyber wants to merge 1 commit intoOISF:masterfrom
catenacyber:debug-fuzz-list-6089-v3

Conversation

@catenacyber
Copy link
Contributor

Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/6089

Steps to reproduce :

  • build with ./src/tests/fuzz/oss-fuzz-configure.sh
  • run ./src/suricata --list-keywords or ./src/suricata --list-app-layer-protos

This fails with stack trace

Assertion failed: (!((g_engine_mode == ENGINE_MODE_UNKNOWN))), function EngineModeIsIPS, file suricata.c, line 224.
Abort trap: 6
    #2 0x10b15e236 in EngineModeIsIPS suricata.c:224
    #3 0x10b1a76c3 in ExceptionPolicyParse util-exception-policy.c:215
    #4 0x10ae3aff1 in AppLayerParserRegisterProtocolParsers app-layer-parser.c:1743
    #5 0x10ad79df8 in AppLayerSetup app-layer.c:973
    #6 0x10b1faffa in ListKeywords util-running-modes.c:37
    #7 0x10b16615c in SuricataMain suricata.c:2918

This hinders oss-fuzz which relies on these commands

Describe changes:

  • Adds a new engine mode to prevent the assertion to trigger

Another fix could just be to EngineModeSetIDS in ListKeywords

Modifies #8921 with fix suggested by @lukashino

Debug validation checks that engine is either IPS or IDS.
But listing keywords does not care.
So, setting ids mode

Ticket: OISF#6089
@codecov
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Merging #8956 (f8d5267) into master (5b160d2) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8956   +/-   ##
=======================================
  Coverage   82.39%   82.39%           
=======================================
  Files         969      969           
  Lines      273558   273560    +2     
=======================================
+ Hits       225404   225413    +9     
+ Misses      48154    48147    -7     
Flag Coverage Δ
fuzzcorpus 64.87% <0.00%> (+0.01%) ⬆️
suricata-verify 60.48% <0.00%> (+<0.01%) ⬆️
unittests 62.92% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 14217

Copy link
Contributor

@lukashino lukashino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@victorjulien victorjulien mentioned this pull request Jun 5, 2023
@victorjulien
Copy link
Member

Merged in #8965, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants