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

fix: print_mem_dump fails on missing symbol #3384

Conversation

NDStrahilevitz
Copy link
Collaborator

Fix #3382
commit cbac404

Date:   Sun Aug 13 12:38:37 2023 +0000

    fix: non-nil empty ksymbols dependency
    
    The events group refactor (commit aa3fd66) changed the semantics of
    ksymbols dependency so that kernel symbols would only be loaded if a
    specific list was set.
    This broke several events which require kernel symbols in general, but
    not any specifically (being set through argument "parameter" lists).
    Fix this by bringing back previous semantics.

Fix #3383
commit b573317

Date:   Sun Aug 13 12:41:05 2023 +0000

    fix: print_mem_dump fail on missing symbol
    
    print_mem_dump trigger currently fails when failing to query a symbol.
    However print_mem_dump can potentially include many symbols in its
    parameters, and shouldn't fail the whole trigger based on one symbol.
    Skip the error return when a symbol query fails and log a WARN level
    message instead.

The events group refactor (commit aa3fd66) changed the semantics of
ksymbols dependency so that kernel symbols would only be loaded if a
specific list was set.
This broke several events which require kernel symbols in general, but
not any specifically (being set through argument "parameter" lists).
Fix this by bringing back previous semantics.
print_mem_dump trigger currently fails when failing to query a symbol.
However print_mem_dump can potentially include many symbols in its
parameters, and shouldn't fail the whole trigger based on one symbol.
Skip the error return when a symbol query fails and log a WARN level
message instead.
@@ -1700,7 +1700,8 @@ func (t *Tracee) triggerMemDump(event trace.Event) error {
}
}
if err != nil {
return errfmt.WrapError(err)
logger.Warnw("print_mem_dump: failed to get symbol info", "symbol", name)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe this should be DEBUG level instead?

@NDStrahilevitz NDStrahilevitz changed the title [FIX] print_mem_dump fails on missing symbol fix: print_mem_dump fails on missing symbol Aug 13, 2023
Copy link
Collaborator

@yanivagman yanivagman left a comment

Choose a reason for hiding this comment

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

LGTM

@yanivagman yanivagman merged commit 1a47a4e into aquasecurity:main Sep 4, 2023
27 checks passed
geyslan added a commit to geyslan/tracee that referenced this pull request Sep 4, 2023
AlonZivony added a commit to AlonZivony/tracee that referenced this pull request Sep 5, 2023
This reverts commit 1a47a4e.
This is done because the commit cause the "symbols_loaded" event to
file and also cause many error messages that weren't seen before.
AlonZivony added a commit to AlonZivony/tracee that referenced this pull request Sep 5, 2023
This reverts commit 1a47a4e.
This is done because the commit cause the "symbols_loaded" event to
fail and also cause many error messages that weren't seen before.
rafaeldtinoco added a commit to rafaeldtinoco/tracee that referenced this pull request Sep 5, 2023
Commit 1a47a4e ("fix: print_mem_dump fails on missing symbol (aquasecurity#3384)")
tried to fix the changes made in event definitions, specifically in the
ksymbol dependencies, but that caused regressions in e2e testing.

This commit deals with the corner case event PrintMemDump by adding a
dummy ksymbol just so the ksymbol logic can be activated if that is the
only event being traced.
rafaeldtinoco added a commit to rafaeldtinoco/tracee that referenced this pull request Sep 5, 2023
rafaeldtinoco added a commit to rafaeldtinoco/tracee that referenced this pull request Sep 5, 2023
rafaeldtinoco pushed a commit that referenced this pull request Sep 5, 2023
This reverts commit 1a47a4e.

This is done because the commit cause the "symbols_loaded" event to
fail and also cause many error messages that weren't seen before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

print_mem_dump fails when one symbol doesn't exist on system Old kernel symbols dependency semantics broken
2 participants