Use _exit in forked children after exec failure#538
Merged
Conversation
sergio-correia
marked this pull request as draft
July 15, 2026 20:39
sergio-correia
marked this pull request as ready for review
July 15, 2026 20:50
Contributor
|
The filter plugin needs the same treatment. Otherwise looks good. |
Forked children that called exit() after a failed execve() would run the parent's atexit handlers. In auditd the clean_exit() handler calls audit_set_pid(fd, 0), which deregisters the daemon from the kernel, and unlinks the PID file. When the real parent keeps running it silently stops receiving audit events. The same class of problem was fixed for the sendmail helper in 7965bc1 ("Use _exit after sendmail exec failure") and for the dispatcher in 7ee8c56. Apply the identical fix to every remaining site: - common/common.c change_runlevel() child - audisp/plugins/ids/reactions.c safe_exec() child - audisp/plugins/remote/audisp-remote.c safe_exec() child - audisp/plugins/filter/audisp-filter.c execve() child Assisted-by: Claude Opus 4.6 Signed-off-by: Sergio Correia <scorreia@redhat.com>
Contributor
Author
Updated, thanks for the review. |
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forked children that called exit() after a failed execve() would run the parent's atexit handlers. In auditd the clean_exit() handler calls audit_set_pid(fd, 0), which deregisters the daemon from the kernel, and unlinks the PID file. When the real parent keeps running it silently stops receiving audit events.
The same class of problem was fixed for the sendmail helper in 7965bc1 ("Use _exit after sendmail exec failure"). Apply the identical fix to every remaining site: