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

system/socket: Add ip_local_out alternative #22787

Merged
merged 1 commit into from
Dec 2, 2020

Conversation

adriansr
Copy link
Contributor

@adriansr adriansr commented Nov 30, 2020

What does this PR do?

This PR adds a new function alternative, __ip_local_out for selecting a proper ip_local_out function, and fixes guess_ip_local_out logic in order to account for this new function.

The new order of precedence is:

  • ip_local_out_sk (kernels before 3.16)
  • __ip_local_out (for kernels where ip_local_out calls are inlined)
  • ip_local_out (all others).

Why is it important?

In some systems, the socket dataset won't start with an error:

unable to guess one or more required parameters: guess_ip_local_out failed: timeout while waiting for event

This is caused by Auditbeat expecting a kprobe set to ip_local_out to trigger, but it never does. The reason is that calls to this function might have been inlined. In those cases we need to attach the kprobe to __ip_local_out instead.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

Relates #18755

This commit adds a new function alternative, `__ip_local_out` for selecting
a proper ip_local_out function, and fixes `guess_ip_local_out` logic in
order to account for this new function.

The new order of precedence is:
- ip_local_out_sk (kernels before 3.16)
- __ip_local_out (for kernels where ip_local_out calls are inlined)
- ip_local_out (all others).

Relates elastic#18755
@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Nov 30, 2020
@adriansr adriansr requested review from a team and removed request for a team November 30, 2020 12:44
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #22787 opened

  • Start Time: 2020-11-30T12:44:58.218+0000

  • Duration: 21 min 21 sec

Test stats 🧪

Test Results
Failed 0
Passed 228
Skipped 33
Total 261

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 228
Skipped 33
Total 261

@111andre111
Copy link
Contributor

Confirmed from my side that it is working with this fix under Archlinux.

Copy link
Contributor

@andrewstucki andrewstucki left a comment

Choose a reason for hiding this comment

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

Code looks fine to me, but wondering if the change in order precedence matters at all?

@adriansr adriansr merged commit b627fb7 into elastic:master Dec 2, 2020
@adriansr adriansr deleted the ab_socket_ip_local_out branch December 2, 2020 19:09
@adriansr adriansr added the needs_backport PR is waiting to be backported to other branches. label Dec 2, 2020
adriansr added a commit to adriansr/beats that referenced this pull request Dec 2, 2020
This commit adds a new function alternative, `__ip_local_out` for selecting
a proper ip_local_out function, and fixes `guess_ip_local_out` logic in
order to account for this new function.

The new order of precedence is:
- ip_local_out_sk (kernels before 3.16)
- __ip_local_out (for kernels where ip_local_out calls are inlined)
- ip_local_out (all others).

Relates elastic#18755

(cherry picked from commit b627fb7)
@adriansr adriansr added v7.11.0 and removed needs_backport PR is waiting to be backported to other branches. labels Dec 2, 2020
adriansr added a commit to adriansr/beats that referenced this pull request Dec 2, 2020
This commit adds a new function alternative, `__ip_local_out` for selecting
a proper ip_local_out function, and fixes `guess_ip_local_out` logic in
order to account for this new function.

The new order of precedence is:
- ip_local_out_sk (kernels before 3.16)
- __ip_local_out (for kernels where ip_local_out calls are inlined)
- ip_local_out (all others).

Relates elastic#18755

(cherry picked from commit b627fb7)
adriansr added a commit that referenced this pull request Dec 3, 2020
#22869)

* system/socket: Add ip_local_out alternative (#22787)

This commit adds a new function alternative, `__ip_local_out` for selecting
a proper ip_local_out function, and fixes `guess_ip_local_out` logic in
order to account for this new function.

The new order of precedence is:
- ip_local_out_sk (kernels before 3.16)
- __ip_local_out (for kernels where ip_local_out calls are inlined)
- ip_local_out (all others).

Relates #18755

(cherry picked from commit b627fb7)
adriansr added a commit that referenced this pull request Dec 3, 2020
…ve (#22870)

* system/socket: Add ip_local_out alternative (#22787)

This commit adds a new function alternative, `__ip_local_out` for selecting
a proper ip_local_out function, and fixes `guess_ip_local_out` logic in
order to account for this new function.

The new order of precedence is:
- ip_local_out_sk (kernels before 3.16)
- __ip_local_out (for kernels where ip_local_out calls are inlined)
- ip_local_out (all others).

Relates #18755

(cherry picked from commit b627fb7)

* Changelog entry
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.

4 participants