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: Hook exit sensor on acct_process #1509

Merged
merged 2 commits into from
Sep 28, 2023

Commits on Sep 27, 2023

  1. tetragon: Hook exit sensor on acct_process

    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>
    olsajiri committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    68035a9 View commit details
    Browse the repository at this point in the history
  2. tetragon: Add test for exit events race

    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 committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    233e626 View commit details
    Browse the repository at this point in the history