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: use thread safe wrapper for ksyms table #3786

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

NDStrahilevitz
Copy link
Collaborator

@NDStrahilevitz NDStrahilevitz commented Dec 31, 2023

1. Explain what the PR does

commit 2ad320e

Author: Nadav Strahilevitz <nadav.strahilevitz@aquasec.com>
Date:   Sun Dec 31 13:42:23 2023 +0000

    fix: use thread safe wrapper for ksyms table
    
    Original implementations in libbpfgo helpers aren't thread safe, they
    include golang maps which may are accessed without a thread safety
    mechanism.
    
    Provide a wrapper in the utils package which adds a mutex on top of
    calling the original methods.

Fix #3785

2. Explain how to test it

No regressions in relevant e2es, should work the same as before.

Original implementations in libbpfgo helpers aren't thread safe, they
include golang maps which may are accessed without a thread safety
mechanism.

Provide a wrapper in the utils package which adds a mutex on top of
calling the original methods.
Copy link
Collaborator

@AlonZivony AlonZivony left a comment

Choose a reason for hiding this comment

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

LGTM

pkg/utils/ksyms/safe_ksym_table.go Show resolved Hide resolved
@NDStrahilevitz NDStrahilevitz merged commit 25dc7ea into aquasecurity:main Jan 4, 2024
31 checks passed
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.

Concurrent read and write in kernel symbols map
2 participants