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

filestore: do not try to store a file set to nostore #9996

Closed

Conversation

catenacyber
Copy link
Contributor

@catenacyber catenacyber commented Dec 7, 2023

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

Describe changes:

  • filestore: do not try to store a file set to nostore

use of keyword filestore:both,flow may try to store a file that has already been opened (in the other direction) and set to nostore...

SV_BRANCH=pr/1524

OISF/suricata-verify#1524

Ticket: 6390

This can happen with keyword filestore:both,flow
If one direction does not have a signature group with a filestore,
the file is set to nostore on opening, until a signature in
the other direction tries to set it to store.
Subsequent files will be stored in both directions as flow flags
are now set.
Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Merging #9996 (2d3d5ae) into master (bdec2d8) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9996   +/-   ##
=======================================
  Coverage   82.47%   82.47%           
=======================================
  Files         970      970           
  Lines      271355   271357    +2     
=======================================
+ Hits       223798   223801    +3     
+ Misses      47557    47556    -1     
Flag Coverage Δ
fuzzcorpus 64.59% <50.00%> (+0.01%) ⬆️
suricata-verify 61.32% <100.00%> (-0.03%) ⬇️
unittests 62.88% <0.00%> (-0.01%) ⬇️

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

@catenacyber
Copy link
Contributor Author

Red CI : need to fix SV test so that it does not use not command (sic)

/bin/sh: not: command not found

Comment on lines +300 to +304
// May happen with keyword filestore:both,flow :
// There may be one opened unclosed file in one direction without filestore
// As such it has file->flags & FILE_NOSTORE
// But a new file in the other direction may trigger filestore:both,flow
// And thus set txd->file_flags & FILE_STORE
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we store file flags per direction?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like this was removed by 79499e4, so this should be another bug/ticket...

Copy link
Member

Choose a reason for hiding this comment

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

I created this: https://redmine.openinfosecfoundation.org/issues/6617
Please set the version, assignee etc as you see fit. Thank you :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reworded the title.
Would you want to create a S-V test for it ?
using filestore:to_server,flow; and checking that files to_client do not get stored ?

Copy link
Member

Choose a reason for hiding this comment

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

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 16953

@catenacyber
Copy link
Contributor Author

Rebased in #10372

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