vmd: fix pty and file leaks in vm creation path.
1. During vm creation, vmd duplicates the pty fd to let the privileged
process handle cleanup after vm termination. This dup'd fd should
be closed in the error path otherwise it leaks.
2. The combination of `vmctl reload` with a vm using a bios or
kernel boot image will leak a file descriptor to the image file.
This was a regression caused by fixing a related problem. Mischa
Peters reported vmd reporting EMFILE errors and it turns out the
priv process was keeping the file open, but reload was overwriting
the variable with the fd number so teardown wasn't closing it.
There's no need to keep it open, so rewrite to not dup(2) and don't
have the priv process keep a copy of the fd number (the source of
the previous issue related to a race between close(2) on cleanup
and the imsg sending the fd to the vmm process.)
ok hshoexer@
Import libfprint2-1.94.100
libfprint is an open source software library designed to make it easy for
application developers to add support for consumer fingerprint readers to
their software.
This is a rewrite and continuation of security/libfprint (which we keep for
sysutils/login_fingerprint).
Both are installable alongside each other.
ok robert@
rpki-client: remove the BN_CTX from the parser
Before threads were added to the parser, having a global BN_CTX was easy
enough. While it saves many small allocations, I don't think it's worth
the complexity.
A bignum is a struct containing a pointer to an array of words and then
four ints. Sequence numbers are at most 20 octets (fitting into 3 8-bit
words on 64 bits), so each seqnum requires at most 48 bytes. We can check
with two bignums instead of three without loss of clarity, so ultimately
we have all this complexity to avoid allocations of at most 96 bytes.
ok claudio job