Page MenuHomeFreeBSD

syslogd: Use process descriptors
ClosedPublic

Authored by jfree on Aug 8 2023, 3:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 22 2024, 10:34 PM
Unknown Object (File)
Apr 22 2024, 8:23 PM
Unknown Object (File)
Apr 6 2024, 10:10 AM
Unknown Object (File)
Apr 4 2024, 12:01 AM
Unknown Object (File)
Apr 4 2024, 12:01 AM
Unknown Object (File)
Apr 4 2024, 12:01 AM
Unknown Object (File)
Jan 20 2024, 5:41 PM
Unknown Object (File)
Jan 9 2024, 12:01 AM
Subscribers

Details

Summary
Prepare for program Capsicumization by storing process descriptors
instead of pids. Signal delivery is not permitted in capability mode,
so we can use pdkill(2) to terminate child processes.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jfree requested review of this revision.Aug 8 2023, 3:33 PM
jfree added a child revision: D41370: syslogd: Merge loops.

Process descriptors for piped processes are registered with kevent() in this patch:

https://reviews.freebsd.org/D41389

This revision is now accepted and ready to land.Aug 9 2023, 7:36 PM
This revision now requires review to proceed.Aug 10 2023, 11:11 PM
usr.sbin/syslogd/syslogd.c
1958–1959

deadq_enter() saves the process descriptor in the entry, but the subsequent close_filed() call will close the process descriptor, so we're left with a dangling fd.

Move procdesc closure into deadq_remove() so we avoid dangling, invalid procdescs

deadq_enter() and close_filed() are now always called together. Should the latter call the former directly? If not, I'd suggest adding a comment to close_filed() explaining that the procdesc is closed elsewhere, otherwise it looks like it's being leaked.

This revision is now accepted and ready to land.Aug 14 2023, 2:21 PM

Move deadq_enter() into close_filed()

This revision now requires review to proceed.Aug 14 2023, 3:42 PM
This revision is now accepted and ready to land.Aug 16 2023, 8:47 PM
This revision was automatically updated to reflect the committed changes.