Skip to content

Cherry-pick #15771 to 7.x: Socket dataset: Workaround for bogus dereference in kernel 5.x#15791

Merged
adriansr merged 1 commit intoelastic:7.xfrom
adriansr:backport_15771_7.x
Jan 25, 2020
Merged

Cherry-pick #15771 to 7.x: Socket dataset: Workaround for bogus dereference in kernel 5.x#15791
adriansr merged 1 commit intoelastic:7.xfrom
adriansr:backport_15771_7.x

Conversation

@adriansr
Copy link
Copy Markdown
Contributor

Cherry-pick of PR #15771 to 7.x branch. Original message:

This is a tentative workaround for the problems in Auditbeat's system/socket dataset when run under 5.x kernels.

On older kernels, we could rely on dereferencing a NULL or invalid pointer returning zeroed memory. However, seems that in the tested 5.x kernels is not the case. Dereferencing a NULL pointer returns bogus memory, which causes some wrong codepaths to be taken in a couple of
kprobes defined by the dataset.

This so far seems only to affect udp_sendmsg and udpv6_sendmsg, which caused it to attribute traffic to bogus IP addresses. In turn this caused the test-connected-udp system tests to fail.


In parallel I'm trying to find the reason for this different behavior and ideally have the tracing subsystem behave like in previous versions, so this patch is not needed.

@adriansr adriansr requested a review from a team as a code owner January 23, 2020 20:26
…ic#15771)

This is a tentative workaround for the problems in Auditbeat's
system/socket dataset when run under 5.x kernels.

On older kernels, we could rely on dereferencing a NULL or invalid
pointer returning zeroed memory. However, seems that in the tested 5.x
kernels is not the case. Dereferencing a NULL pointer returns bogus
memory, which causes some wrong codepaths to be taken in a couple of
kprobes defined by the dataset.

This so far seems only to affect udp_sendmsg and udpv6_sendmsg, which
caused it to attribute traffic to bogus IP addresses. In turn this
caused the test-connected-udp system tests to fail.

(cherry picked from commit 0dab517)
@adriansr adriansr merged commit a72f6b2 into elastic:7.x Jan 25, 2020
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.

2 participants