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

tetragon: another exit fix #1803

Merged
merged 2 commits into from
Nov 28, 2023
Merged

tetragon: another exit fix #1803

merged 2 commits into from
Nov 28, 2023

Conversation

olsajiri
Copy link
Contributor

backport of #1509

@kkourt kkourt mentioned this pull request Nov 28, 2023
[upstream commit 0c60ef2]

Djalal and Anastasios found another way we could race in exit
event hook, so we could receive multiple exit events with same
pid value.

Anastasios suggested to hook acct_process instead, which is
called only for the last task in the thread group.

The acct_process depends on CONFIG_BSD_PROCESS_ACCT config
option but it seems to be present on all supported kernels.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
[upstream commit 9a8f892]

The previous commit fixes the exit event race that might cause
tetragon to receive multiple exit events with same pid values.

The contrib/tester-progs/threads-exit program tries to exploit
this by creating multi threads and synchronize all their exit
calls so it's likely to hit the race window.

The TestEventExitThreads test itself spawn several executions of
threads-exit program (to push the luck a bit and hit the race
window at least once) and records their pid values and then check
we receive single exit event for any given pid value.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
@olsajiri olsajiri force-pushed the pr/olsajiri/another_exit_fix_0_9 branch from aab6d11 to 3f7ea00 Compare November 28, 2023 08:20
@kkourt kkourt marked this pull request as ready for review November 28, 2023 09:39
@kkourt kkourt requested a review from a team as a code owner November 28, 2023 09:39
@kkourt kkourt requested review from tpapagian and removed request for a team November 28, 2023 09:39
@kkourt kkourt merged commit 83dc734 into v0.9 Nov 28, 2023
15 checks passed
@kkourt kkourt deleted the pr/olsajiri/another_exit_fix_0_9 branch November 28, 2023 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants