Page MenuHomeFreeBSD

uefisign: fix handling of errors from child proc
ClosedPublic

Authored by vangyzen on Apr 6 2021, 2:53 PM.
Tags
None
Referenced Files
F81991888: D29605.diff
Wed, Apr 24, 6:33 AM
Unknown Object (File)
Tue, Apr 23, 4:17 PM
Unknown Object (File)
Fri, Apr 19, 3:23 PM
Unknown Object (File)
Thu, Mar 28, 11:27 PM
Unknown Object (File)
Mar 22 2024, 10:55 AM
Unknown Object (File)
Mar 22 2024, 10:02 AM
Unknown Object (File)
Mar 8 2024, 6:31 AM
Unknown Object (File)
Mar 8 2024, 6:19 AM
Subscribers

Details

Summary

Close the unused pipe file descriptors so the parent will notice if
the child exits prematurely. Previously, the parent would block
forever on a read from the pipe.

$ uefisign -c foo.cert -k foo.key -o loader.efi loader.efi.unsigned
uefisign: section points inside the headers
load: 0.06  cmd: uefisign 4502 [piperd] 7.25r 0.00u 0.00s 0% 5968k
... _sleep+0x1be pipe_read+0x3d6 kern_readv+0x8c sys_read+0x83 ...

Sponsored by: Dell EMC Isilon
MFC after: 1 week

Test Plan

It exits immediately in the above error case.

Diff Detail

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