Page MenuHomeFreeBSD

diff: Fix pagination leak
ClosedPublic

Authored by des on Feb 4 2026, 6:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 14, 10:01 AM
Unknown Object (File)
Tue, Oct 13, 9:05 PM
Unknown Object (File)
Tue, Oct 13, 10:58 AM
Unknown Object (File)
Wed, Oct 7, 3:35 AM
Unknown Object (File)
Tue, Oct 6, 6:49 PM
Unknown Object (File)
Tue, Oct 6, 6:35 PM
Unknown Object (File)
Mon, Oct 5, 11:11 AM
Unknown Object (File)
Fri, Oct 2, 2:48 PM
Subscribers

Details

Summary
  • Drop an unnecessary variable and rename pidfd to procd.
  • Rewinding stdout serves no purpose, so stop doing it.
  • Don't bother freeing memory or setting the global status right before erroring out.
  • Error out if dup(2) or dup2(2) fail.
  • In the unlikely case that our pipe is equal to stdout, we need to record that information so we don't close it when cleaning up.
  • Don't bother closing a descriptor before dup2(2)ing to it.
  • Don't forget to close the the process descriptor after reaping the child process.

PR: 266592
MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

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

Event Timeline

This revision is now accepted and ready to land.Feb 5 2026, 1:40 PM
This revision was automatically updated to reflect the committed changes.