]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
uefisign: fix handling of errors from child proc
authorEric van Gyzen <vangyzen@FreeBSD.org>
Tue, 6 Apr 2021 14:36:52 +0000 (09:36 -0500)
committerEric van Gyzen <vangyzen@FreeBSD.org>
Tue, 6 Apr 2021 17:13:59 +0000 (12:13 -0500)
commit9e6158d274829249322efb3767e6ac2e690cc4a9
treee1cc2f614f6b0a6a70c84fa0ac8c4f23789d79e8
parent9857e00a528bb230c8935ded5f118a7374bf808b
uefisign: fix handling of errors from child proc

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 ...

Reviewed by: trasz
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D29605
usr.sbin/uefisign/uefisign.c