openbsd
6 years agoFor correctness, do not read struct servent if getservbyname_r() failed.
eric [Sat, 3 Nov 2018 09:13:24 +0000 (09:13 +0000)]
For correctness, do not read struct servent if getservbyname_r() failed.
Also simplify code.

6 years agoremove log_debug
gilles [Sat, 3 Nov 2018 08:59:54 +0000 (08:59 +0000)]
remove log_debug

6 years agoRevert previous, it broke my Anker USB device
jcs [Fri, 2 Nov 2018 21:32:30 +0000 (21:32 +0000)]
Revert previous, it broke my Anker USB device

ok patrick

6 years agoreport rDNS in link connect event
gilles [Fri, 2 Nov 2018 17:20:22 +0000 (17:20 +0000)]
report rDNS in link connect event

6 years agosmtp_report_link_connect() should be called from smtp_connected()
gilles [Fri, 2 Nov 2018 17:16:30 +0000 (17:16 +0000)]
smtp_report_link_connect() should be called from smtp_connected()

6 years agowhen reporting smtp-in link-connect event, report src and dest port too
gilles [Fri, 2 Nov 2018 17:03:17 +0000 (17:03 +0000)]
when reporting smtp-in link-connect event, report src and dest port too

6 years agopass struct sockaddr_storage instead of ss_to_text() in reporting
gilles [Fri, 2 Nov 2018 16:50:23 +0000 (16:50 +0000)]
pass struct sockaddr_storage instead of ss_to_text() in reporting

6 years agoWhen reacting to SIGHUP, i.e. trying to restart, ignore incoming
krw [Fri, 2 Nov 2018 16:15:55 +0000 (16:15 +0000)]
When reacting to SIGHUP, i.e. trying to restart, ignore incoming
packets, routing socket messages and cancel any pending protocol
timeout.

Since >1 packet can be received from bpf at a time, don't process any
further buffered packets after one triggers a decision to exit or
a signal is received.

6 years agoreport connection event earlier
gilles [Fri, 2 Nov 2018 16:09:57 +0000 (16:09 +0000)]
report connection event earlier

6 years agoin-smtp -> smtp-in in reporting protocol
gilles [Fri, 2 Nov 2018 15:56:47 +0000 (15:56 +0000)]
in-smtp -> smtp-in in reporting protocol

6 years agoRemove 'reused group key update received' printfs.
stsp [Fri, 2 Nov 2018 14:40:24 +0000 (14:40 +0000)]
Remove 'reused group key update received' printfs.
These have served no useful purpose in practice; all reported instances were
legitimate group key retransmissions by the AP, e.g. after laptop suspend.
We fixed KRACK long ago; re-used group key messages are nothing to worry about.

6 years agoadd REG_NOSUB to flags in regcompile
gilles [Fri, 2 Nov 2018 13:45:59 +0000 (13:45 +0000)]
add REG_NOSUB to flags in regcompile

suggested by jung@

6 years agomove X509_get0_serialNumber where it belongs
tb [Fri, 2 Nov 2018 13:38:01 +0000 (13:38 +0000)]
move X509_get0_serialNumber where it belongs

6 years agoAccept numeric user IDs
kn [Fri, 2 Nov 2018 12:46:10 +0000 (12:46 +0000)]
Accept numeric user IDs

This makes `top -U 0' and "u-1000" work.

Feedback and "that looks right" tedu, OK millert, manual bits and OK jmc

6 years agoPrefer user names over numeric user IDs
kn [Fri, 2 Nov 2018 10:21:29 +0000 (10:21 +0000)]
Prefer user names over numeric user IDs

Behave like chown(8) to prevent clobbering user names which are numbers.

Prompted by and "this is how it should be" tedu, OK millert

6 years agoRemove unnecessary if/else block, both branches are identical. We can
fcambus [Fri, 2 Nov 2018 09:59:36 +0000 (09:59 +0000)]
Remove unnecessary if/else block, both branches are identical. We can
in fact use the ATA_DELAY macro directly.

Coverity CID 1453008.

OK sthen@, kn@

6 years agohelp landry
espie [Fri, 2 Nov 2018 08:11:43 +0000 (08:11 +0000)]
help landry

6 years agold.so's malloc has no runtime option processing, so remove the
otto [Fri, 2 Nov 2018 07:26:25 +0000 (07:26 +0000)]
ld.so's malloc has no runtime option processing, so remove the
setting flags and replace them by constants. ok deraadt@ guenther@

6 years agomake debug flags continuous
anton [Fri, 2 Nov 2018 07:17:34 +0000 (07:17 +0000)]
make debug flags continuous

6 years agodisable LOCKF_DIAGNOSTIC
anton [Fri, 2 Nov 2018 07:15:03 +0000 (07:15 +0000)]
disable LOCKF_DIAGNOSTIC

6 years agowhitespace
tb [Fri, 2 Nov 2018 05:30:41 +0000 (05:30 +0000)]
whitespace

6 years agoMerge duplicate code into helper functions
kn [Thu, 1 Nov 2018 18:04:13 +0000 (18:04 +0000)]
Merge duplicate code into helper functions

This introduces filteruser() and filterpid(), where the first one can now
easily be extended to support matching numeric UIDs. The latter one is now
used by the `highlight` command as well.

No change in behaviour or output.

Feedback and OK millert

6 years agolog_warn() -> log_warnx() and only display warning that running commands
gilles [Thu, 1 Nov 2018 18:01:51 +0000 (18:01 +0000)]
log_warn() -> log_warnx() and only display warning that running commands
from aliases is dangerous if expand node is EXPAND_FILTER

6 years agoupdate currency exchange rates;
jmc [Thu, 1 Nov 2018 16:07:00 +0000 (16:07 +0000)]
update currency exchange rates;
the economist has no data for hungary, iceland, ukraine, or vietnam this month
(actually their whole section has been reformatted in a way that less information
is given, and it is poorer for it);

6 years agoteach smtp process how to report smtp events to lka and teach lka how to
gilles [Thu, 1 Nov 2018 14:48:49 +0000 (14:48 +0000)]
teach smtp process how to report smtp events to lka and teach lka how to
report these events to a proc

ok millert@

6 years agoMake this compile again by defining struct rde_memstats rdemem; in the tests.
claudio [Thu, 1 Nov 2018 14:20:41 +0000 (14:20 +0000)]
Make this compile again by defining struct rde_memstats rdemem; in the tests.

6 years agointroduce K_REGEX table type and table_regex_match(), unused for now
gilles [Thu, 1 Nov 2018 10:47:46 +0000 (10:47 +0000)]
introduce K_REGEX table type and table_regex_match(), unused for now

ok eric@

6 years agoAdd SPDX-License-Identifier tag from drm-intel-next-queued to
jsg [Thu, 1 Nov 2018 10:44:27 +0000 (10:44 +0000)]
Add SPDX-License-Identifier tag from drm-intel-next-queued to
intel_ringbuffer.h which previously had no license text.

6 years agoAdd SPDX-License-Identifier tags from linux git master to drm files
jsg [Thu, 1 Nov 2018 10:35:08 +0000 (10:35 +0000)]
Add SPDX-License-Identifier tags from linux git master to drm files
which previously had no license text.

6 years agoallow smtpd to fork processes at startup and maintain a socketpair with
gilles [Thu, 1 Nov 2018 10:13:25 +0000 (10:13 +0000)]
allow smtpd to fork processes at startup and maintain a socketpair with
them.

ok jung@, eric@

6 years agofix typos
denis [Thu, 1 Nov 2018 10:09:52 +0000 (10:09 +0000)]
fix typos

Noticed by David Higgs, thanks.

OK claudio@

6 years agoMake the documentation of -conv_form match reality. It defaults
tb [Thu, 1 Nov 2018 07:01:42 +0000 (07:01 +0000)]
Make the documentation of -conv_form match reality. It defaults
to uncompressed rather than compressed.

From Jacqueline Jolicoeur

6 years ago- odd condition/test in PF lexer
sashan [Thu, 1 Nov 2018 00:18:44 +0000 (00:18 +0000)]
- odd condition/test in PF lexer
  (and other lexers too)

This commit rectifies earlier change:

    in the lex... even inside quotes, a \ followed by space or tab should
    expand to space or tab, and a \ followed by newline should be ignored
    (as a line continuation).  compatible with the needs of hoststated
    (which has the most strict quoted string requirements), and ifstated
    (where one commonly does line continuations in strings).

OK deraadt@, OK millert@

6 years agoAdd comment to remind people to bump libc++.
kettenis [Wed, 31 Oct 2018 23:10:24 +0000 (23:10 +0000)]
Add comment to remind people to bump libc++.

6 years agoadd missing echo call to cleanup target for consistency
anton [Wed, 31 Oct 2018 19:59:37 +0000 (19:59 +0000)]
add missing echo call to cleanup target for consistency

6 years agotypo; fix from hiltjo posthuma
deraadt [Wed, 31 Oct 2018 17:05:54 +0000 (17:05 +0000)]
typo; fix from hiltjo posthuma

6 years agosmtp_tx_mail_from() and smtp_tx_rcpt_to() should take a const char *line
gilles [Wed, 31 Oct 2018 16:45:24 +0000 (16:45 +0000)]
smtp_tx_mail_from() and smtp_tx_rcpt_to() should take a const char *line

6 years agoset a banner_sent flag in a session when banner was sent, this is noop as
gilles [Wed, 31 Oct 2018 16:40:35 +0000 (16:40 +0000)]
set a banner_sent flag in a session when banner was sent, this is noop as
of now but will reduce an upcoming diff

6 years agoadd helper valid_smtp_response() to be used in upcoming commits
gilles [Wed, 31 Oct 2018 16:32:12 +0000 (16:32 +0000)]
add helper valid_smtp_response() to be used in upcoming commits

6 years agoin rule_to_text(), use "tls" not "starttls"
gilles [Wed, 31 Oct 2018 15:14:21 +0000 (15:14 +0000)]
in rule_to_text(), use "tls" not "starttls"

6 years agolog tls events as "tls" not "starttls" it has confused people
gilles [Wed, 31 Oct 2018 15:13:21 +0000 (15:13 +0000)]
log tls events as "tls" not "starttls" it has confused people

6 years agoRemove extra ,
claudio [Wed, 31 Oct 2018 14:58:59 +0000 (14:58 +0000)]
Remove extra ,
Noticed by denis@

6 years agoShow the number of references hold by struct rde_aspath objects (which should
claudio [Wed, 31 Oct 2018 14:51:12 +0000 (14:51 +0000)]
Show the number of references hold by struct rde_aspath objects (which should
be the same as the number of prefixes for now).
OK denis@

6 years agoRemove tail queues which link peer, aspath and prefix together. These
claudio [Wed, 31 Oct 2018 14:50:07 +0000 (14:50 +0000)]
Remove tail queues which link peer, aspath and prefix together. These
lists are no longer needed and make it possible to share rde_aspath between
peers & prefixes. Instead of the lists the rde_aspath is now reference counted.
With this struct prefix is now the central place where everything is connected
to making the RIB a bit easier to handle.
With input and OK denis@

6 years agoNever remove the default RIBs from the RDE.
claudio [Wed, 31 Oct 2018 14:45:36 +0000 (14:45 +0000)]
Never remove the default RIBs from the RDE.
OK denis@

6 years agoIncrease max frame size and hard MTU so that we can use VLANs and
patrick [Wed, 31 Oct 2018 14:18:09 +0000 (14:18 +0000)]
Increase max frame size and hard MTU so that we can use VLANs and
Jumbo frames on ure(4).

ok kevlo@

6 years agoImport new moduli.
dtucker [Wed, 31 Oct 2018 11:20:04 +0000 (11:20 +0000)]
Import new moduli.

6 years agoUsePrivilegeSeparation no is deprecated, test "yes" and "sandbox".
dtucker [Wed, 31 Oct 2018 11:09:27 +0000 (11:09 +0000)]
UsePrivilegeSeparation no is deprecated, test "yes" and "sandbox".
rCVS: ----------------------------------------------------------------------

6 years agoadd simple implementation of intel trace files which just define away
jsg [Wed, 31 Oct 2018 10:35:27 +0000 (10:35 +0000)]
add simple implementation of intel trace files which just define away
functions

ok kettenis@

6 years agoBring over gapdummy.c changes from amd64/amr64/armv7/i386.
kettenis [Wed, 31 Oct 2018 10:15:47 +0000 (10:15 +0000)]
Bring over gapdummy.c changes from amd64/amr64/armv7/i386.

ok deraadt@, mortimer@, visa@

6 years agoremove a guard in mio_read(), mio_write, sio_read() & sio_write() for a
miko [Wed, 31 Oct 2018 10:06:54 +0000 (10:06 +0000)]
remove a guard in mio_read(), mio_write, sio_read() & sio_write() for a
zero length request. return value of zero is preserved in this case.

OK ratchov@

6 years agoReset all flags in screen_write_reset, reported by Benjamin Poirier.
nicm [Wed, 31 Oct 2018 10:05:47 +0000 (10:05 +0000)]
Reset all flags in screen_write_reset, reported by Benjamin Poirier.

6 years agozap return keyword to clarify umidi_flush() returns no value; ok ratchov@
miko [Wed, 31 Oct 2018 09:50:24 +0000 (09:50 +0000)]
zap return keyword to clarify umidi_flush() returns no value; ok ratchov@

6 years agoAdd support to uvm to establish write-combining mappings. Use this in the
kettenis [Wed, 31 Oct 2018 08:50:25 +0000 (08:50 +0000)]
Add support to uvm to establish write-combining mappings.  Use this in the
inteldrm driver to add support for the I915_MMAP_WC flag.

ok deraadt@, jsg@

6 years agoifstated(8) needs to load configfile from within the main loop, but also to
mestre [Wed, 31 Oct 2018 07:39:13 +0000 (07:39 +0000)]
ifstated(8) needs to load configfile from within the main loop, but also to
reload it on SIGHUP so unveil(2) it with read permissions. Additionally all
commands are exec'ed through /bin/sh instead of directly so we can just
unveil(2) /bin/sh with x perms.

OK deraadt@

6 years agohtpasswd(1) when in batch mode (-I) and 1 argument is used, or when not in
mestre [Wed, 31 Oct 2018 07:39:10 +0000 (07:39 +0000)]
htpasswd(1) when in batch mode (-I) and 1 argument is used, or when not in
batch mode and 2 arguments are used we know we have to access argv[0] with rwc
permissions and also to rwc a temporary file in /tmp so we can unveil(2) both
argv[0] and /tmp with rwc permissions. In order to avoid adding "unveil" to
pledge(2), just call it after getopt(3).

Remaining code paths already have fs access disabled via pledge(2).

OK florian@ deraadt@

6 years agosc argument of start_output, start_input, trigger_output and trigger_input
miko [Wed, 31 Oct 2018 02:25:26 +0000 (02:25 +0000)]
sc argument of start_output, start_input, trigger_output and trigger_input
is void* so no need to cast; ok ratchov@

6 years agouse Mdocdate;
jmc [Tue, 30 Oct 2018 22:31:45 +0000 (22:31 +0000)]
use Mdocdate;

6 years agoReplace with minimal version written from scratch that just defines the data
kettenis [Tue, 30 Oct 2018 19:53:51 +0000 (19:53 +0000)]
Replace with minimal version written from scratch that just defines the data
structures and function prototypes that we need.  The original file doesn't
even a suitable license even though the associated drm_mipi_dsi.c file is
MIT-licensed.  Probably a mistake upstream, but better safe than sorry.

ok deraadt@

6 years agosync
deraadt [Tue, 30 Oct 2018 18:08:56 +0000 (18:08 +0000)]
sync

6 years agoadd missing Pf macro; ok jmc@
anton [Tue, 30 Oct 2018 17:56:54 +0000 (17:56 +0000)]
add missing Pf macro; ok jmc@

6 years agoospf6d does not support reloading so its parent proc does not need
remi [Tue, 30 Oct 2018 16:52:19 +0000 (16:52 +0000)]
ospf6d does not support reloading so its parent proc does not need
filesystem access with the exception of the control socket cleanup on
exit.

ok florian@

6 years agoAdd C11's timespec_get(3); minor bump for libc.
guenther [Tue, 30 Oct 2018 16:28:42 +0000 (16:28 +0000)]
Add C11's timespec_get(3); minor bump for libc.

Tweaked diff from brad@
manpage tweaks florian@ and jmc@
ok deraadt@ millert@

6 years agoin mda.c, when reading the last line of an mda, we should never have a \n
gilles [Tue, 30 Oct 2018 14:17:17 +0000 (14:17 +0000)]
in mda.c, when reading the last line of an mda, we should never have a \n
in the buffer, however better be safe than sorry, add VIS_NL to strnvis()
flags because a \n would corrupt an envelope.

while debugging an issue from Jason Donenfeld, this appears as a safety-net

ok eric@

6 years agoThe way we currently generate gap.o using a linker script results in .rodata
kettenis [Tue, 30 Oct 2018 11:10:03 +0000 (11:10 +0000)]
The way we currently generate gap.o using a linker script results in .rodata
and .data segments that have the X (executable) flag set when using lld.
This doesn't result in those sections being mapped executable in the bsd
kernel, but it does result in the X flag being set on those sections in
the final kernel binary, which confuses some scanning tools for (ROP)
gadgets.

Fix this by tweaking the generated gapdummy.c file that is used for
building gap.o.  It now defines the .rodata section using inline asm.
This also fixes .data as it will inherit its flags from .rodata.

ok deraadt@, mortimer@

6 years agoThe way we currently generate gap.o using a linker script results in .rodata
kettenis [Tue, 30 Oct 2018 11:08:30 +0000 (11:08 +0000)]
The way we currently generate gap.o using a linker script results in .rodata
and .data segments that have the X (executable) flag set when using lld.
This doesn't result in those sections being mapped executable in the bsd
kernel, but it does result in the X flag being set on those sections in
the final kernel binary, which confuses some scanning tools for (ROP)
gadgets.

Fix this by tweaking the generated gapdummy.c file that is used for
building gap.o.  It now defines the .rodata section using inline asm.
This also fixes .data as it will inherit its flags from .rodata.

ok deraadt@, mortimer@

6 years agoMissed that SUBDIR remnant in previous.
ajacoutot [Tue, 30 Oct 2018 10:22:16 +0000 (10:22 +0000)]
Missed that SUBDIR remnant in previous.

prodded by a mail from "multiplexd"
ok robert@

6 years agotypo; from bryan stenson
jmc [Tue, 30 Oct 2018 07:25:57 +0000 (07:25 +0000)]
typo; from bryan stenson

6 years agoIf we execute a #!shell binary, the shell is an integral part of the
deraadt [Tue, 30 Oct 2018 03:27:45 +0000 (03:27 +0000)]
If we execute a #!shell binary, the shell is an integral part of the
binary so it should bypass unveil restrictions.  This is similar
(but different...) to how the ELF linker (ld.so) is loaded (after
unveils get dropped).  Discovered in doas, due to more accurate unveil
semantics.
ok guenther tedu beck

6 years agoThe parent process of ospfd is not supposed to write or execute files.
remi [Mon, 29 Oct 2018 22:13:33 +0000 (22:13 +0000)]
The parent process of ospfd is not supposed to write or execute files.
Unveil "/" readonly and allow to cleanup the control socket on exit.

Just unveiling ospfd.conf is not possible since it can contain an arbitrary
number of includes.

ok benno@

6 years agoSupport _ISOC11_SOURCE for forcing C11 feature visibility. Change the
guenther [Mon, 29 Oct 2018 17:10:40 +0000 (17:10 +0000)]
Support _ISOC11_SOURCE for forcing C11 feature visibility.  Change the
default when no feature test defines are given to be C11 instead of C99
headers.

ok kettenis@ millert@
naddy@ doesn't think ports needs any pretesting for this

6 years agoirrelevant part snuck into previous commit; from semarie
deraadt [Mon, 29 Oct 2018 14:29:44 +0000 (14:29 +0000)]
irrelevant part snuck into previous commit; from semarie

6 years agoNow that most archs have better NMBCLUSTERS defaults it is possible to bring
claudio [Mon, 29 Oct 2018 12:12:27 +0000 (12:12 +0000)]
Now that most archs have better NMBCLUSTERS defaults it is possible to bring
back rev 1.90.
----
mbufs and mbuf clusters are now backed by large pools. Because of this
we can relax the oversubscribe limit of socketbuffers a fair bit.
Instead of maxing out as sb_max * 1.125 or 2 * sb_hiwat the maximum is
increased to 8 * sb_hiwat -- which seems to be a good compromise between
memory waste and better socket buffer usage.
OK deraadt@
----
ok benno@

6 years agouse the tunnelttl in the ip6 encap too, not ip6_defhlim.
dlg [Mon, 29 Oct 2018 09:51:20 +0000 (09:51 +0000)]
use the tunnelttl in the ip6 encap too, not ip6_defhlim.

6 years agoReplace some walkers using the aspath/prefix lists with a rib_dump walker.
claudio [Mon, 29 Oct 2018 09:28:31 +0000 (09:28 +0000)]
Replace some walkers using the aspath/prefix lists with a rib_dump walker.
network_flush() is now using rib_dump_new to walk the Adj-RIB-In and
remove all dynamically added announcements. peer_flush() got generalized
and is now used also in peer_down(). It also uses a walker to remove all
prefixes of a peer but does it in a synchronous way for now.
OK benno@

6 years agoFix route-collector mode by allowing the RDE to disable the decision process
claudio [Mon, 29 Oct 2018 09:22:48 +0000 (09:22 +0000)]
Fix route-collector mode by allowing the RDE to disable the decision process
on reload but after that not allowing it to be re-enabled. So now it is
possible to enable route-collector mode again but it is still not possible
to turn it of via reload. Problem reported by Aaron A. Glenn.
OK benno@

6 years agoRevert previous (for now).
ajacoutot [Mon, 29 Oct 2018 07:55:40 +0000 (07:55 +0000)]
Revert previous (for now).
semarie found a few regressions with daemon that will fail if cwd is not
accessible.

6 years agoneeds sys/lock.h
deraadt [Mon, 29 Oct 2018 00:11:37 +0000 (00:11 +0000)]
needs sys/lock.h

6 years agoCorrectly deal with upper level unveil's by keeping track of the covering
beck [Sun, 28 Oct 2018 22:42:33 +0000 (22:42 +0000)]
Correctly deal with upper level unveil's by keeping track of the covering
unveil for each unveil in the process at unveil() time, and refactoring the
handling of current directory and ISDOTDOT to be much more sensible.
Worked out at ns2k18 with guenther@.
ok deraadt@

6 years agoDo not printf NULL.
nicm [Sun, 28 Oct 2018 16:10:02 +0000 (16:10 +0000)]
Do not printf NULL.

6 years agoDo not check for a key again without an escape if only \033 is present.
nicm [Sun, 28 Oct 2018 15:34:27 +0000 (15:34 +0000)]
Do not check for a key again without an escape if only \033 is present.

6 years agolld generates DT_RUNPATH elements instead of the older DT_RPATH.
naddy [Sun, 28 Oct 2018 15:21:49 +0000 (15:21 +0000)]
lld generates DT_RUNPATH elements instead of the older DT_RPATH.
Handle both.  From semarie@, tweaked by espie@
ok phessler@ espie@

6 years agoProperly handle symlinks.
ajacoutot [Sun, 28 Oct 2018 09:00:07 +0000 (09:00 +0000)]
Properly handle symlinks.

6 years agoUpdate to tzdata2018g from ftp.iana.org
millert [Sat, 27 Oct 2018 17:03:33 +0000 (17:03 +0000)]
Update to tzdata2018g from ftp.iana.org

6 years agoSUBDIR is a remnant of the past.
ajacoutot [Sat, 27 Oct 2018 16:49:16 +0000 (16:49 +0000)]
SUBDIR is a remnant of the past.

ok robert@

6 years agopass around the ess and ni structures we plan to use directly, instead
phessler [Sat, 27 Oct 2018 10:02:47 +0000 (10:02 +0000)]
pass around the ess and ni structures we plan to use directly, instead
of rediscovering them (possibly badly).

OK stsp@

6 years agoclean up accounting of the AUTO_JOIN flag by making sure it is set or cleared
phessler [Sat, 27 Oct 2018 09:55:26 +0000 (09:55 +0000)]
clean up accounting of the AUTO_JOIN flag by making sure it is set or cleared
based on the state of the joinlist

OK stsp@

6 years agodon't join to a network where we expect cleartext, and the AP is using crypto
phessler [Sat, 27 Oct 2018 09:47:36 +0000 (09:47 +0000)]
don't join to a network where we expect cleartext, and the AP is using crypto

OK stsp@

6 years agoTemporarily enable LOCKF_DIAGNOSTIC in order to catch potential bugs.
anton [Sat, 27 Oct 2018 08:53:35 +0000 (08:53 +0000)]
Temporarily enable LOCKF_DIAGNOSTIC in order to catch potential bugs.

ok deraadt@ visa@ (as part of a larger diff)

6 years agoAdd assertions for lockf list manipulation, hidden behind LOCKF_DIAGNOSTIC.
anton [Sat, 27 Oct 2018 08:51:13 +0000 (08:51 +0000)]
Add assertions for lockf list manipulation, hidden behind LOCKF_DIAGNOSTIC.
While here, improve existing lockf debug routines and sprinkle some more logging
related to list manipulation.

ok deraadt@ visa@ (as part of a larger diff)

6 years agoRework previous lockf fix; bluhm@ noticed a regress failure during consecutive
anton [Sat, 27 Oct 2018 08:47:09 +0000 (08:47 +0000)]
Rework previous lockf fix; bluhm@ noticed a regress failure during consecutive
runs. This is a second attempt in which the lockf structure is turned into a
doubly linked list which makes it easier to ensure correctness during list
insertion and deletion.

ok deraadt@ visa@

6 years agosize for free(); ok ratchov@
miko [Sat, 27 Oct 2018 01:01:34 +0000 (01:01 +0000)]
size for free(); ok ratchov@

6 years agoUse EFI memory map to determine what memory regions are availble just like
kettenis [Fri, 26 Oct 2018 20:28:40 +0000 (20:28 +0000)]
Use EFI memory map to determine what memory regions are availble just like
we already do on arm64.  Prevents using the framebuffer on the cubox-i as
regular memory for example.

6 years agoAdd acpipci(4) on amd64. For now this only calls the PCI-specific _OSC
kettenis [Fri, 26 Oct 2018 20:26:19 +0000 (20:26 +0000)]
Add acpipci(4) on amd64.  For now this only calls the PCI-specific _OSC
method to let the ACPI implementation know what features we support.

6 years agoIf we pass `file' via args then we need to unveil(2) it with read permission,
mestre [Fri, 26 Oct 2018 17:11:33 +0000 (17:11 +0000)]
If we pass `file' via args then we need to unveil(2) it with read permission,
otherwise if omitted we need to unveil(2) both _PATH_UNIX and _PATH_KSYMS with
same permissions.

Unconditionally we need to also unveil(2) dbdir, which by default is
_PATH_VARDB but can be changed via args (-o directory), with read/write/create
permissions. There are a couple of temp files that will be created but it's
inside dbdir so there's no need to unveil(2) them individually.

Since we already call pledge(2) before, twice, we need to add "unveil" promise
to both of them, and finally call pledge(2) once again with the needed promises
except "unveil".

OK millert@

6 years agoThe code path were we pass `pathname' in the arguments is already limited
mestre [Fri, 26 Oct 2018 17:11:32 +0000 (17:11 +0000)]
The code path were we pass `pathname' in the arguments is already limited
with pledge(2), but since we know exactly what it is then we can go further and
also unveil(2) it with read permissions.

OK millert@ deraadt@

6 years agoShow how much memory is used for *-sets.
claudio [Fri, 26 Oct 2018 16:54:53 +0000 (16:54 +0000)]
Show how much memory is used for *-sets.
OK deraadt@

6 years agoTrack the amount of memory used for sets and tries (aka anything-set)
claudio [Fri, 26 Oct 2018 16:53:55 +0000 (16:53 +0000)]
Track the amount of memory used for sets and tries (aka anything-set)
OK deraadt@

6 years agoUpdate for default ruby version switch from 2.4 to 2.5.
jeremy [Fri, 26 Oct 2018 16:20:59 +0000 (16:20 +0000)]
Update for default ruby version switch from 2.4 to 2.5.

6 years agoWith lld the calculation of the entry point was wrong since
naddy [Fri, 26 Oct 2018 15:00:54 +0000 (15:00 +0000)]
With lld the calculation of the entry point was wrong since
LOADADDR(.text) is only available after the description of the text
section.  Instead simply use ENTRY(start) like we do on amd64.  The
bootloader strips the high bits from the entry point address already,
so using the virtual address as the entry point address works.

with/ok kettenis@