Page MenuHomeFreeBSD

syslogd: Use process descriptors
ClosedPublic

Authored by jfree on Aug 8 2023, 3:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 2, 3:45 PM
Unknown Object (File)
Nov 21 2024, 7:49 AM
Unknown Object (File)
Nov 7 2024, 5:50 AM
Unknown Object (File)
Nov 7 2024, 5:33 AM
Unknown Object (File)
Nov 7 2024, 2:42 AM
Unknown Object (File)
Nov 1 2024, 3:40 AM
Unknown Object (File)
Oct 21 2024, 5:25 AM
Unknown Object (File)
Oct 21 2024, 5:25 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 Skipped
Unit
Tests Skipped

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
1929–1930

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.