Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

var: Use 16-bit container for type #12348

Closed
wants to merge 1 commit into from
Closed

Conversation

jlucovsky
Copy link
Contributor

@jlucovsky jlucovsky commented Jan 7, 2025

Continuation of #12281

Issue: 6855: Match sigmatch type field in var and bit structs

Align the size and datatype of type, idx, and next members across:

  • FlowVarThreshold
  • FlowBit
  • FlowVar
  • GenericVar
  • XBit

Note that the FlowVar structure has been intentionally constrained to match the structure size prior to this commit. To achieve this, the keylen member was restricted to 8 bits after it was confirmed its value is checked against a max of 0xff.

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

Describe changes:

  • Increase type in flowbit, flowvar and generic var
  • Ensure type, idx, and next pointers align on each struct.

Updates:

  • Decreased FlowVar size to match master
  • Rebase

Provide values to any of the below to override the defaults.

  • To use an LibHTP, Suricata-Verify or Suricata-Update pull request,
    link to the pull request in the respective _BRANCH variable.
  • Leave unused overrides blank or remove.

SV_REPO=
SV_BRANCH=
SU_REPO=
SU_BRANCH=
LIBHTP_REPO=
LIBHTP_BRANCH=

Issue: 6855: Match sigmatch type field in var and bit structs

Align the size and datatype of type, idx, and next members across:
- FlowVarThreshold
- FlowBit
- FlowVar
- GenericVar
- XBit

Note that the FlowVar structure has been intentionally constrained to
match the structure size prior to this commit. To achieve this, the
keylen member was restricted to 8 bits after it was confirmed its value
is checked against a max of 0xff.
Copy link
Member

@victorjulien victorjulien left a comment

Choose a reason for hiding this comment

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

see inline

Also, I think it would be good to update DetectVarStoreMatchKeyValue and DetectVarList as well to use the correct types.

src/flow-var.h Show resolved Hide resolved
src/detect-lua-extensions.c Show resolved Hide resolved
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 83.23%. Comparing base (def22fa) to head (d61e85a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12348   +/-   ##
=======================================
  Coverage   83.23%   83.23%           
=======================================
  Files         912      912           
  Lines      257647   257647           
=======================================
+ Hits       214450   214463   +13     
+ Misses      43197    43184   -13     
Flag Coverage Δ
fuzzcorpus 61.20% <0.00%> (-0.02%) ⬇️
livemode 19.39% <0.00%> (-0.01%) ⬇️
pcap 44.42% <0.00%> (+0.02%) ⬆️
suricata-verify 62.86% <0.00%> (+<0.01%) ⬆️
unittests 59.18% <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 24109

@jlucovsky
Copy link
Contributor Author

Continued in #12356

1 similar comment
@jlucovsky
Copy link
Contributor Author

Continued in #12356

@jlucovsky jlucovsky closed this Jan 8, 2025
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.

3 participants