Page MenuHomeFreeBSD

diff: Fix pagination leak
ClosedPublic

Authored by des on Wed, Feb 4, 6:35 PM.
Tags
None
Referenced Files
F145337000: D55112.id171167.diff
Wed, Feb 18, 1:31 PM
F145336995: D55112.id171167.diff
Wed, Feb 18, 1:31 PM
Unknown Object (File)
Tue, Feb 17, 5:23 PM
Unknown Object (File)
Tue, Feb 17, 12:14 PM
Unknown Object (File)
Tue, Feb 17, 12:14 PM
Unknown Object (File)
Sun, Feb 15, 4:52 AM
Unknown Object (File)
Thu, Feb 12, 12:00 AM
Unknown Object (File)
Wed, Feb 11, 4:14 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.Thu, Feb 5, 1:40 PM
This revision was automatically updated to reflect the committed changes.