linux: implement SO_PASSRIGHTS
We have a native version now, plumb it through to the Linuxolator.
Reviewed by: glebius, markj
Differential Revision: https://reviews.freebsd.org/D57427
tests: unix: pull a recvfd_payload_cmsg out of recvfd_payload
This is almost a trivial factoring, but it's still a bit of boilerplate
that we don't care to rewrite- the SO_PASSRIGHTS test will still receive
some data, so the iovec construction still saves us a few lines.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D57544
tests: unix: add SCM_RIGHTS tests for SO_PASSRIGHTS
We test both the standard case where we want to reject any SCM_RIGHTS
message, as well as the case where the kernel discards the unwanted file
upon receipt.
Reviewed by: glebius (previous version), markj
Differential Revision: https://reviews.freebsd.org/D57426
sockets: plumb SO_PASSRIGHTS into *sockopt(2)
This is a little different than the others in that it's not valid for
anything but unix(4) sockets. New cases were added that jump into the
more standard case out of a light preference for not taking advantage of
case FALLTHROUGH with the additional logic- it doesn't scale very well
for new cases added that might be slightly special, so we might as well
just add the labels up-front.
Reviewed by: glebius, markj
Differential Revision: https://reviews.freebsd.org/D57424
socket: remove tautological condition in so_unsplice()
so2rele was introduced in 1000cc4a0d3 and it was necessary there, but
the cleanup in a837d1fe49e0255 rendered it redundant if our own KASSERT
is to be believed: we've asserted that `so2->so_splice_back == sp` and
`sp` has been dereferenced above, so there's no condition left where
we shouldn't release the socket reference at the end. Indeed, the
change in so_splice() to NULL out sp->dst removes that possible state of
a partially constructed splice: if sp->dst is set, it has been ref'd.
Reviewed by: gallatin, markj
Differential Revision: https://reviews.freebsd.org/D57558
unix: implement basic SO_PASSRIGHTS functionality
With exception to sockopt functionality, implement the so_options flag
in unix(4) itself. The general argument for the flag is that SCM_RIGHTS
can be used maliciously for, e.g., a DoS that the receiving side can't
avoid if it is expecting other control messages.
This option gives the receiver a way to disable SCM_RIGHTS on the
sender-side, surfacing an EPERM to them instead. This seems to match
the semantics that Linux offers.
If an SCM_RIGHTS was already sent before we disabled SO_PASSRIGHTS, then
a subsequent recvmsg(2) will silently discard any in-flight files. This
has the downside of punting a file with the potential to hang over to
the deferred-close task, but perhaps usage of the option would
discourage folks from attempting to take advantage of that possibility
anyways.
Various manpages updated to describe the new behavior.
[10 lines not shown]
[orc-rt] Fix assertion, add fail-to-connect unit test. (#204720)
If a ControllerAccess object's connect method calls notifyDisconnected
then by the time we return to Connect we may have completed the detach,
in which case TargetState will be None, and CurrentState will be >=
Detached. This case was not covered by the assert after the return from
connect, leading to assertions when connect failed.
This commit relaxes the assertion to include the case above, and adds a
unit test to cover it.
[NFC] LowerCommentStringPass: remove unused #include (#204719)
This pass was added in a64928f267f3aeeb3571bfc7de92c432126d74e9 but does
not actually use PassBuilder
[BPF] Fix erroneous removal of non-jump-table globals (#204594)
Jump tables are supported only for cpu v4. After lowering them into
.jumptables entries, BPFAsmPrinter::doFinalization() removes the private
constant arrays that backed the jump tables. But the below 'for' loop is
actually a no-op.
for (unsigned i = 1, e = CA->getNumOperands(); i != e; ++i) {
if (!dyn_cast<BlockAddress>(CA->getOperand(i)))
continue;
}
Targets.push_back(&Global);
With current implementation, 'Global' will be added to 'Targets' and
later in doFinalization(), 'Global' will be removed. But it is possible
in 'Global' there exists non BlockAddress which are used in later code.
This will cause the problem like:
error: Undefined temporary symbol .L__const.select_fn.fns
[24 lines not shown]
devel/p5-CLI-Simple: Add port: Minimalist object oriented base class for CLI applications
Tired of writing the same 'ol boilerplate code for command line scripts?
Want a standard, simple way to create a Perl script that takes options
and commands? CLI::Simple makes it easy to create scripts that take
options, commands and arguments.
CLI::Simple is designed around the modulino pattern - Perl modules that
can be executed directly as scripts.
WWW: https://metacpan.org/pod/CLI::Simple
PR: 295931
Reported by: Einar Bjarni Halldórsson <einar at isnic.is> (new maintainer)