-
Notifications
You must be signed in to change notification settings - Fork 165
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
refactor(userspace/libsinsp)!: file descriptor tables for better OOP design and extensibility #1637
Conversation
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
…apis Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
/milestone 0.15.0 |
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.
/approve
LGTM label has been added. Git tree hash: 000ed22edf971fe94b811bc409ec385812882a10
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP, gnosek, jasondellaluce The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Basically, `scap_get_fdlist()` called in the sinsp parsers loop to manage SCM_RIGHTS flag for recvmsg, updates the pointers in the thread fdtable. After #1637, doing so invalidates `event` m_fdinfo field, that is a pointer to a now freed data. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Basically, `scap_get_fdlist()` called in the sinsp parsers loop to manage SCM_RIGHTS flag for recvmsg, updates the pointers in the thread fdtable. After #1637, doing so invalidates `event` m_fdinfo field, that is a pointer to a now freed data. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Basically, `scap_get_fdlist()` called in the sinsp parsers loop to manage SCM_RIGHTS flag for recvmsg, updates the pointers in the thread fdtable. After #1637, doing so invalidates `event` m_fdinfo field, that is a pointer to a now freed data. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Basically, `scap_get_fdlist()` called in the sinsp parsers loop to manage SCM_RIGHTS flag for recvmsg, updates the pointers in the thread fdtable. After #1637, doing so invalidates `event` m_fdinfo field, that is a pointer to a now freed data. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Basically, `scap_get_fdlist()` called in the sinsp parsers loop to manage SCM_RIGHTS flag for recvmsg, updates the pointers in the thread fdtable. After #1637, doing so invalidates `event` m_fdinfo field, that is a pointer to a now freed data. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Basically, `scap_get_fdlist()` called in the sinsp parsers loop to manage SCM_RIGHTS flag for recvmsg, updates the pointers in the thread fdtable. After falcosecurity#1637, doing so invalidates `event` m_fdinfo field, that is a pointer to a now freed data. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
What type of PR is this?
/kind cleanup
/kind design
Any specific area of the project related to this PR?
/area libsinsp
Does this PR require a change in the driver versions?
What this PR does / why we need it:
This PR attempts refactoring the data structures related to file descriptor tables on the following points:
sinsp_fdinfo
class has fields and methods definitions mixed with no clarity about their order and visibility (what's public and what's not?). The class has been cleanup up with reasonable orderingsinsp_fdinfo
is currently a template for no good reason, if not the possibility of extending the class with a "sidecar" delegated object. This suboptimal for type safety and pollutes our headers for very little value, whereas the same can simply be attained through inheritance following well-known OOP principles. This also caused defining the type twice (assinsp_fdinfo_t
too), of which unification led to most of the LOC changes of this PRadd_fd
path drove me crazy in some paths understanding who owned memory. I've now switched to unique pointers wherever possible. More will come later, but this is a starter.Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?: