suricata icon indicating copy to clipboard operation
suricata copied to clipboard

Clean shorterintegers v2

Open catenacyber opened this issue 2 years ago • 7 comments

Link to redmine ticket: TODO

Describe changes:

  • Use shorter integers for array accesses

As found by CodeQL with https://github.com/github/codeql/pull/8994

This was inspired by 2d765d6c686449e78e29759b07c4852ebab3c46e where one of the root cause for the buffer overflow in SetupU8Hash was that we were using an int as an index to an array of size 256

Running CI and looking at what is remaining...

Follows #7409

catenacyber avatar Jun 20 '22 11:06 catenacyber

ERROR:

ERROR: QA failed on ips_afp_drop_chk.

Pipeline 7954

suricata-qa avatar Jun 20 '22 13:06 suricata-qa

Force-pushing to get a greener CI, and then looking at what is remaining

catenacyber avatar Jun 21 '22 07:06 catenacyber

Codecov Report

Merging #7562 (f00a384) into master (a898409) will decrease coverage by 0.04%. The diff coverage is 90.00%.

@@            Coverage Diff             @@
##           master    #7562      +/-   ##
==========================================
- Coverage   75.80%   75.75%   -0.05%     
==========================================
  Files         658      658              
  Lines      186526   186525       -1     
==========================================
- Hits       141399   141311      -88     
- Misses      45127    45214      +87     
Flag Coverage Δ
fuzzcorpus 59.89% <74.60%> (-0.06%) :arrow_down:
suricata-verify 52.36% <86.66%> (-0.06%) :arrow_down:
unittests 60.71% <81.33%> (-0.01%) :arrow_down:

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

codecov[bot] avatar Jun 21 '22 07:06 codecov[bot]

ERROR:

ERROR: QA failed on ips_afp_drop_chk.

Pipeline 7959

suricata-qa avatar Jun 21 '22 09:06 suricata-qa

This draft is ready for review.

I think that the remaining CodeQL notes should not be eliminated (and so the rule should not be added to CI)

catenacyber avatar Jun 21 '22 13:06 catenacyber

WARNING:

field test baseline %
build_asan

Pipeline 7961

suricata-qa avatar Jun 21 '22 13:06 suricata-qa

ERROR:

ERROR: QA failed on ips_afp_drop_chk.

Pipeline 7963

suricata-qa avatar Jun 21 '22 17:06 suricata-qa

ERROR:

ERROR: QA failed on ips_afp_drop_chk.

Pipeline 7963

suricata-qa avatar Sep 25 '22 13:09 suricata-qa

Is there an interest for this ?

catenacyber avatar Nov 03 '22 13:11 catenacyber

Closing

catenacyber avatar Nov 21 '22 13:11 catenacyber