-
Notifications
You must be signed in to change notification settings - Fork 100
fix: if missing thread_entry, don't attempt to dereference it (iss-1076) #1112
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
Conversation
|
Welcome @arirubinstein! It looks like this is your first PR to falcosecurity/plugins 🎉 |
irozzo-1A
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@deepskyblue86 do you agree?
|
LGTM label has been added. DetailsGit tree hash: 05f71f486cff83c1be06949cd9fed1bb7c1600bb |
No, not really. I'm not convinced.
And those fields won't use |
|
I'll try to get a reproduction on another machine - is the order of these fields guaranteed from the socket? |
|
I think I see the issue now, it's not |
Actually the API of the extract SDK is not very clear to me, but after checking returning |
@arirubinstein Yes, This analysis seems correct to me and agrees with the stack trace. Thanks! |
3d46be8 to
fd915b5
Compare
5a42f6c to
6c80cc9
Compare
Same for me, so yesterday I searched for the code: https://github.com/falcosecurity/plugin-sdk-cpp/blob/main/include/falcosecurity/internal/plugin_mixin_extraction.h#L115-L146 |
irozzo-1A
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this @arirubinstein , LGTM overall, I just proposed some small changes.
Rules files suggestions |
Good point @deepskyblue86 |
6c80cc9 to
a6caef1
Compare
a6caef1 to
c63d3b7
Compare
c63d3b7 to
e511c4a
Compare
Rules files suggestions |
e511c4a to
7f6a031
Compare
Rules files suggestions |
|
LGTM @arirubinstein, just fix the formatting issue and it's ready to go 😉 |
|
If you didn't setup pre-commit, the patch is as simple as that: diff --git a/plugins/container/src/caps/extract/extract.cpp b/plugins/container/src/caps/extract/extract.cpp
index e6d2a00f..0c81c2ac 100644
--- a/plugins/container/src/caps/extract/extract.cpp
+++ b/plugins/container/src/caps/extract/extract.cpp
@@ -576,7 +576,8 @@ bool my_plugin::extract(const falcosecurity::extract_fields_input &in)
// Retrieve the thread entry associated with this thread id
thread_entry = m_threads_table.get_entry(tr, thread_id);
// Retrieve container_id from the entry
- m_container_id_field.read_value(tr, thread_entry.value(), container_id);
+ m_container_id_field.read_value(tr, thread_entry.value(),
+ container_id);
}
catch(const std::exception &e)
{If you did set it up but after the commit ⇒ |
Signed-off-by: Ari Rubinstein <arirubinstein@users.noreply.github.com>
7f6a031 to
a11b106
Compare
|
formatting fixed |
|
I just realized I have no power here [cit.] 😅 (and that there's no OWNERS file for the container plugin...) |
ekoops
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks!
/approve
|
LGTM label has been added. DetailsGit tree hash: e52445b799dba5db1c40002cb72a587821f5c810 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: arirubinstein, ekoops, irozzo-1A The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Rules files suggestions |
What type of PR is this?
/kind bug
Any specific area of the project related to this PR?
/area plugins
What this PR does / why we need it:
Addresses attempted cinfo NPE
Which issue(s) this PR fixes:
Fixes #1076
Special notes for your reviewer: