openbsd
7 years agoadd code to provide simple wait condition handling.
dlg [Thu, 14 Dec 2017 00:41:58 +0000 (00:41 +0000)]
add code to provide simple wait condition handling.

this will be used to replace the bare sleep_state handling in a
bunch of places, starting with the barriers.

7 years agoFix whitespace botch that snuck in.
krw [Wed, 13 Dec 2017 18:53:04 +0000 (18:53 +0000)]
Fix whitespace botch that snuck in.

7 years agoSimplifiy parser by not worrying about nesting 'interface <if> {}'
krw [Wed, 13 Dec 2017 18:45:08 +0000 (18:45 +0000)]
Simplifiy parser by not worrying about nesting 'interface <if> {}'
statements. They are silly but harmless and work fine.

7 years agoFix a softdep bug exposed by our recent changes to make reboot drop to read-only
beck [Wed, 13 Dec 2017 16:38:34 +0000 (16:38 +0000)]
Fix a softdep bug exposed by our recent changes to make reboot drop to read-only

The deadlock happens when softdep gets the same buffer in the BMSAFEMAP case
that it already called getdirtybuf() on and made busy at the top of the loop.
when this is the case, skip the BMSAFEMAP case and simply write the buffer
out at the bottom of the loop as always. This avoids calling getdirtybuf()
a second time on the same buffer we already took for exclusive use ourself
and have not yet written out.

While I'm in here add a KASSERT for the similar case above, which I don't
think can happen but we would deadlock in the same way if it does.

testing by and ok bluhm@

7 years agoFix array index by signed char; from martijn@
millert [Wed, 13 Dec 2017 16:07:54 +0000 (16:07 +0000)]
Fix array index by signed char; from martijn@

7 years agoFix sign compare warnings; OK martijn@
millert [Wed, 13 Dec 2017 16:06:34 +0000 (16:06 +0000)]
Fix sign compare warnings; OK martijn@

7 years agoEnable compiler warnings; OK martijn@
millert [Wed, 13 Dec 2017 16:06:05 +0000 (16:06 +0000)]
Enable compiler warnings; OK martijn@

7 years agoAdd support for the -d (-o debug) option to libfuse. Currently works for FUSE
helg [Wed, 13 Dec 2017 12:30:18 +0000 (12:30 +0000)]
Add support for the -d (-o debug) option to libfuse. Currently works for FUSE
file systems that call fuse_parse_cmdline(3), fuse_main(3) or
fuse_setup(3).

ok mpi@, jca@

7 years agoIf the list of templates 'o' passed to fuse_opt_parse(3) is NULL then
helg [Wed, 13 Dec 2017 12:23:48 +0000 (12:23 +0000)]
If the list of templates 'o' passed to fuse_opt_parse(3) is NULL then
the processing function should be called in the same way as if no match
was found.

ok mpi@

7 years agoFix stray return; hopefully this makes the internal PHY actually work now.
kettenis [Wed, 13 Dec 2017 10:38:06 +0000 (10:38 +0000)]
Fix stray return; hopefully this makes the internal PHY actually work now.

7 years agoSpacing from kshe59@zoho.eu.
mpi [Wed, 13 Dec 2017 08:59:02 +0000 (08:59 +0000)]
Spacing from kshe59@zoho.eu.

7 years agoSizes for free in route_output().
mpi [Wed, 13 Dec 2017 08:54:59 +0000 (08:54 +0000)]
Sizes for free in route_output().

From kshe59@zoho.eu.

7 years agoAdd 'bt' an alias for 'trace'.
mpi [Wed, 13 Dec 2017 08:34:04 +0000 (08:34 +0000)]
Add 'bt' an alias for 'trace'.

ok pirofti@

7 years agogetsockname(2) needs to be passed the length of the input struct.
patrick [Wed, 13 Dec 2017 08:27:06 +0000 (08:27 +0000)]
getsockname(2) needs to be passed the length of the input struct.

ok jca@

7 years agoreport Oracle as the vendor is the produce starts with ORCL,
dlg [Wed, 13 Dec 2017 00:12:03 +0000 (00:12 +0000)]
report Oracle as the vendor is the produce starts with ORCL,

makes it consistent with reporting Sun or Fujitsu based on produce
prefixes.

ok kettenis@

7 years agoAdd more Allwinner A80 clocks.
kettenis [Tue, 12 Dec 2017 22:31:44 +0000 (22:31 +0000)]
Add more Allwinner A80 clocks.

7 years agoFix pfloadanchors tests when running with obj directory.
bluhm [Tue, 12 Dec 2017 19:49:19 +0000 (19:49 +0000)]
Fix pfloadanchors tests when running with obj directory.
Remove unused file.

7 years agoUse bn_checkp() always; from kshe
otto [Tue, 12 Dec 2017 19:08:57 +0000 (19:08 +0000)]
Use bn_checkp() always; from kshe

7 years agoMinor cleanup from kshe
otto [Tue, 12 Dec 2017 19:07:10 +0000 (19:07 +0000)]
Minor cleanup from kshe

7 years agooptimize add, sub and mul; from kshe; ok tom@
otto [Tue, 12 Dec 2017 18:58:59 +0000 (18:58 +0000)]
optimize add, sub and mul; from kshe; ok tom@

7 years agoConsistently use .Va for "errno";
schwarze [Tue, 12 Dec 2017 18:41:44 +0000 (18:41 +0000)]
Consistently use .Va for "errno";
patch from Jan Stary <hans at stare dot cz>;
"I think it makes sense to speak about errno as a variable (.Va)" jca@.

7 years agoOnly trigger background scans while we are in RUN state, and do not update
stsp [Tue, 12 Dec 2017 15:57:11 +0000 (15:57 +0000)]
Only trigger background scans while we are in RUN state, and do not update
a node's RSSI info while we are still in INIT state.

ok phessler@

7 years agoMake ieee80211_chan2ieee() panic if a bogus channel pointer is detected.
stsp [Tue, 12 Dec 2017 15:52:49 +0000 (15:52 +0000)]
Make ieee80211_chan2ieee() panic if a bogus channel pointer is detected.
ok patrick@

7 years agoMake IEEE80211_CHAN_ANYC be a NULL pointer instead of a pointer to 0xffff.
stsp [Tue, 12 Dec 2017 15:50:39 +0000 (15:50 +0000)]
Make IEEE80211_CHAN_ANYC be a NULL pointer instead of a pointer to 0xffff.
Should speed up debugging.
ok phessler patrick

7 years agold.so's syscall _dl_* API/ABI doesn't reurn errno, but -errno.
deraadt [Tue, 12 Dec 2017 15:33:34 +0000 (15:33 +0000)]
ld.so's syscall _dl_* API/ABI doesn't reurn errno, but -errno.
Reviewing behaviour artifacts with pledge, I discover a close(-ENOSYS)..
ok guenther

7 years agoCreate a persistent umac128.c source file: #define the output size and
naddy [Tue, 12 Dec 2017 15:06:12 +0000 (15:06 +0000)]
Create a persistent umac128.c source file: #define the output size and
the name of the entry points for UMAC-128 before including umac.c.
Idea from FreeBSD.
ok dtucker@

7 years agoDon't dereference IEEE80211_CHAN_ANYC pointer in ieee80211_node_checkrssi().
stsp [Tue, 12 Dec 2017 13:58:19 +0000 (13:58 +0000)]
Don't dereference IEEE80211_CHAN_ANYC pointer in ieee80211_node_checkrssi().

Problem reported by Gregoire Jadi on bugs@

7 years agoAllow interfaces that aren't SCANNALLBAND drivers to benefit from the
phessler [Tue, 12 Dec 2017 13:38:10 +0000 (13:38 +0000)]
Allow interfaces that aren't SCANNALLBAND drivers to benefit from the
strongest received signal.

OK stsp@

7 years agoFix 2 bugs introduced by previous.
martijn [Tue, 12 Dec 2017 12:52:01 +0000 (12:52 +0000)]
Fix 2 bugs introduced by previous.
Pointed out by kshe59 <at> zoho <dot> eu

OK millert@

7 years agoNuke some forward-only struct's and functions and functions thereby
krw [Tue, 12 Dec 2017 12:33:36 +0000 (12:33 +0000)]
Nuke some forward-only struct's and functions and functions thereby
made empty. Found by new ctfconv(1) feature and validated by clang.

ok mpi@

7 years agoDocument change in the default shell prompts.
tb [Tue, 12 Dec 2017 11:34:38 +0000 (11:34 +0000)]
Document change in the default shell prompts.

Discussed with and ok jmc

7 years agoRemove unused variable defined with an unexisting type.
mpi [Tue, 12 Dec 2017 11:18:32 +0000 (11:18 +0000)]
Remove unused variable defined with an unexisting type.

Found with ctfconv(1).

ok jsg@, dlg@

7 years agospace required between macro arg and punctuation;
jmc [Tue, 12 Dec 2017 11:11:18 +0000 (11:11 +0000)]
space required between macro arg and punctuation;

7 years agoFix typo. Unbreaks building a kernel on arm64/clang.
kettenis [Tue, 12 Dec 2017 10:25:39 +0000 (10:25 +0000)]
Fix typo.  Unbreaks building a kernel on arm64/clang.

7 years agoAvoid undefined behaviour in rorate_left() macro. From NetBSD via FreeBSD.
kettenis [Tue, 12 Dec 2017 10:06:45 +0000 (10:06 +0000)]
Avoid undefined behaviour in rorate_left() macro.  From NetBSD via FreeBSD.
Makes gas work when compiled with clang.

ok patrick@, millert@

7 years agostray , snuck in
deraadt [Tue, 12 Dec 2017 07:55:36 +0000 (07:55 +0000)]
stray , snuck in

7 years agospacing
deraadt [Tue, 12 Dec 2017 07:47:58 +0000 (07:47 +0000)]
spacing

7 years agosync
deraadt [Tue, 12 Dec 2017 01:13:14 +0000 (01:13 +0000)]
sync

7 years agopledge()'s 2nd argument becomes char *execpromises, which becomes the
deraadt [Tue, 12 Dec 2017 01:12:34 +0000 (01:12 +0000)]
pledge()'s 2nd argument becomes char *execpromises, which becomes the
pledge for a new execve image immediately upon start.  Also introduces
"error" which makes violations return -1 ENOSYS instead of killing the
program ("error" may not be handed to a setuid/setgid program, which
may be missing/ignoring syscall return values and would continue with
inconsistant state)
Discussion with many
florian has used this to improve the strictness of a daemon

7 years agoFix the behavior of preferring weaker-but-still-good 5Ghz APs over
jcs [Tue, 12 Dec 2017 00:24:21 +0000 (00:24 +0000)]
Fix the behavior of preferring weaker-but-still-good 5Ghz APs over
2Ghz APs because the 5Ghz band is generally less saturated.

The previous implementation was dependent upon the order of walking
APs.

ok stsp

7 years agoInclude hostname in shell prompts by default
tb [Tue, 12 Dec 2017 00:18:58 +0000 (00:18 +0000)]
Include hostname in shell prompts by default

With tmux, ssh and vmd, we tend to open shells on many different hosts
simultaneously and the default prompts '$ ' and '# ' for {,k}sh as well
as  '% ' and '# ' for csh become dangerous: it's very easy to issue a
command on the wrong host.

This can easily be avoided by displaying the hostname in the prompt.
Everything beyond "hostname{$,#,%} " is going to be a matter of taste,
so we left it at that. If you use an FQDN, only the first part (the
output of 'hostname -s') will be printed.

requested by and ok deraadt; mostly positive feedback many
ok anton, brynet, bcallah and others

7 years agoThe code can be simplified by using clock_gettime(2)'s CLOCK_REALTIME
tb [Mon, 11 Dec 2017 23:33:44 +0000 (23:33 +0000)]
The code can be simplified by using clock_gettime(2)'s CLOCK_REALTIME
instead of gettimeofday(2).

From Scott Cheloha, ok jca

7 years agoProper do {} while (0) idiom in TIMESPEC_TO_TIMEVAL/TIMEVAL_TO_TIMESPEC
jca [Mon, 11 Dec 2017 23:31:16 +0000 (23:31 +0000)]
Proper do {} while (0) idiom in TIMESPEC_TO_TIMEVAL/TIMEVAL_TO_TIMESPEC

From Scott Cheloha, ok tb@

7 years agoImplement support for the "next-generation" clock bindings for the
kettenis [Mon, 11 Dec 2017 23:24:58 +0000 (23:24 +0000)]
Implement support for the "next-generation" clock bindings for the
Allwinner A80.

7 years agoOmit the PMKID count field from RSN information elements (IE) if the PMKID
stsp [Mon, 11 Dec 2017 22:23:00 +0000 (22:23 +0000)]
Omit the PMKID count field from RSN information elements (IE) if the PMKID
list has zero elements and PMKID would be the last field in the RSN IE.

This is correct as per 802.11-2012 8.4.2.27.1 and aligns net80211 code with
behaviour of bwfm(4) firmware, unblocking further progress in that driver.

ok patrick@ phessler@

7 years agoDisable DIOCCACHESYNC code, which I believe does the opposite
deraadt [Mon, 11 Dec 2017 17:13:34 +0000 (17:13 +0000)]
Disable DIOCCACHESYNC code, which I believe does the opposite
and can cause pending IO's on wd(4) to be thrown away.  Still
trying to find a solution.

7 years agoFormat the vnode lists of ddb show mount properly in columns.
bluhm [Mon, 11 Dec 2017 14:11:22 +0000 (14:11 +0000)]
Format the vnode lists of ddb show mount properly in columns.
OK krw@

7 years agoFix and change y command in the following ways:
martijn [Mon, 11 Dec 2017 13:25:57 +0000 (13:25 +0000)]
Fix and change y command in the following ways:
- When 'n' is used as a delimiter escaping 'n' will remain a newline
  instead of becoming a 'n' character. This is how POSIX specifies how this
  should work. Other implementations tested also do this wrong.
- '[' and maybe other characters are not special during the parsing of the
  y command and don't need to be matched or treated special in any way.
- POSIX specifies that a backslash followed by anything other than the
  delimiter, 'n', and another backslash, as well as repeating characters in
  string1 are unspecified. Since the various implementations handle these
  situations in opposing ways choose to error out on them to prevent people
  falling into the pitfall of expecting identical behaviour on various
  implementations.

Inspired by the sed.1 patch by kshe59 <at> zoho <dot> eu
Feedback and OK millert@
Manpage bits OK jmc@

7 years agosscanf(3) is now used to parse templates that contain format specifiers
helg [Mon, 11 Dec 2017 12:38:54 +0000 (12:38 +0000)]
sscanf(3) is now used to parse templates that contain format specifiers
(e.g. %u, %o) other than %s. This aligns libfuse with the Linux reference
implementation.

ok mpi@

7 years agoUpdate to fuse_opt_parse(3) so that all option templates are now matched for
helg [Mon, 11 Dec 2017 12:31:00 +0000 (12:31 +0000)]
Update to fuse_opt_parse(3) so that all option templates are now matched for
the supplied option. This allows the following templates to be supplied to set
multiple members of a struct at the same time. e.g.

#define FUSE_LIB_OPT(t, p, v) { t, offsetof(struct fuse_config, p), v }

static const struct fuse_opt fuse_lib_opts[] = {
      FUSE_LIB_OPT("gid=",      set_gid, 1),
      FUSE_LIB_OPT("gid=%u",        gid, 0),
      FUSE_OPT_END
};

If "-ogid=1000" is passed to fuse_opt_parse(3) it will set both:

fuse_config.set_gid=1
fuse_config.gid=1000

ok mpi@

7 years agoThe fuse_opt_match(3) library function does not match options correctly.
helg [Mon, 11 Dec 2017 12:01:55 +0000 (12:01 +0000)]
The fuse_opt_match(3) library function does not match options correctly.
libfuse supports option templates of the following form that can be used
to automatically parse arguments supplied on the command line.

"-p "       argument that takes an option e.g -p 22 or -p22
"-p %x"     argument that takes an option parsed like sscanf(3)
"cache=yes" matches -ocache=yes or -o cache=yes
"cache=%s"  matches -ocache=<string> or -o cache=<string>
"cache="    matches same as above but value is passed to option proc
"noatime"   matches -onoatime or -o atime

For example, it does not match options of the form "-p 22" or
"cache=yes" to the corresponding templates "-p " and "cache=yes".  This
patch fixes that and updates the regression tests accordingly.

ok mpi@

7 years agouse cmp in a loop instead of diff -N to compare directories. The former
dtucker [Mon, 11 Dec 2017 11:41:56 +0000 (11:41 +0000)]
use cmp in a loop instead of diff -N to compare directories. The former
works on more platforms for Portable.

7 years agobump to 2.7.0
bcook [Mon, 11 Dec 2017 11:04:04 +0000 (11:04 +0000)]
bump to 2.7.0

7 years agofix the description of delete-non-matching-lines;
jmc [Mon, 11 Dec 2017 07:27:07 +0000 (07:27 +0000)]
fix the description of delete-non-matching-lines;
from mazocomp

7 years agohttp://repzret.org/p/repzret/
deraadt [Mon, 11 Dec 2017 05:48:01 +0000 (05:48 +0000)]
http://repzret.org/p/repzret/
My read of this:  Long time ago (Think Conan, not dinasaurs) during the race
to make speedier processors, a cpu vendor built a pipeline with a bad stall,
and proposed a tremendously hasky workaround.  A wizard adopted this into his
perl scroll, and failed to reflect later when no compiler adopted the practice.
This relic remains at the tail end of some functions in OpenSSL as
".byte 0xf3,0xc3".  Banish it straight to hell.
ok mlarkin, others also stared blankly

7 years agoIn uvm Chuck decided backing store would not be allocated proactively
deraadt [Mon, 11 Dec 2017 05:27:40 +0000 (05:27 +0000)]
In uvm Chuck decided backing store would not be allocated proactively
for blocks re-fetchable from the filesystem.  However at reboot time,
filesystems are unmounted, and since processes lack backing store they
are killed. Since the scheduler is still running, in some cases init is
killed... which drops us to ddb [noted by bluhm].  Solution is to convert
filesystems to read-only [proposed by kettenis]. The tale follows:
sys_reboot() should pass proc * to MD boot() to vfs_shutdown() which
completes current IO with vfs_busy VB_WRITE|VB_WAIT, then calls VFS_MOUNT()
with MNT_UPDATE | MNT_RDONLY, soon teaching us that *fs_mount() calls a
copyin() late... so store the sizes in vfsconflist[] and move the copyin()
to sys_mount()... and notice nfs_mount copyin() is size-variant, so kill
legacy struct nfs_args3.  Next we learn ffs_mount()'s MNT_UPDATE code is
sharp and rusty especially wrt softdep, so fix some bugs adn add
~MNT_SOFTDEP to the downgrade.  Some vnodes need a little more help,
so tie them to &dead_vnops.

ffs_mount calling DIOCCACHESYNC is causing a bit of grief still but
this issue is seperate and will be dealt with in time.
couple hundred reboots by bluhm and myself, advice from guenther and
others at the hut

7 years agoSergey Bronnikov's code coverage analysis shows that a few more code paths
tb [Mon, 11 Dec 2017 01:11:12 +0000 (01:11 +0000)]
Sergey Bronnikov's code coverage analysis shows that a few more code paths
could be exercised. Add a few tests to do just that. The wDn test is
currently disabled, as it will only pass after a commit to jot.c.

7 years agoUse correct mask to derive portid from "reg" property in cpu_match.
kettenis [Mon, 11 Dec 2017 00:15:50 +0000 (00:15 +0000)]
Use correct mask to derive portid from "reg" property in cpu_match.
Use cpu_myid() since it makes the coe more obvious.

7 years agomore 0xcc, in data. There are i386 machines without NX, so this change
deraadt [Sun, 10 Dec 2017 21:44:07 +0000 (21:44 +0000)]
more 0xcc, in data. There are i386 machines without NX, so this change
isn't a no-op
ok mlarkin

7 years agoStop running iwm(4) devices in "continuous active mode (CAM)".
stsp [Sun, 10 Dec 2017 20:34:41 +0000 (20:34 +0000)]
Stop running iwm(4) devices in "continuous active mode (CAM)".

Instead, enable device-level power saving which apparently allows
Tx/Rx RF circuitry to be switched off while inactive to save some power.
Turns out CAM is meant for debugging purposes, not normal operation.

NB: This has nothing to do with 802.11 power saving.

Tested by myself and phessler. There is no visible behaviour change.
ok deraadt@ phessler@

7 years agossh/lib hasn't worked towards our code-sharing goals for a quit while,
deraadt [Sun, 10 Dec 2017 19:37:57 +0000 (19:37 +0000)]
ssh/lib hasn't worked towards our code-sharing goals for a quit while,
perhaps it is too verbose?  Change each */Makefile to specifying exactly
what sources that program requires, compiling it seperate.  Maybe we'll
iterate by sorting those into seperatable chunks, splitting up files
which contain common code + server/client specific code, or whatnot. But
this isn't one step, or we'd have done it a long time ago..
ok dtucker markus djm

7 years agoadd #ifndef SMALL to slaacd.c as needed to fix 'make release'
stsp [Sun, 10 Dec 2017 17:34:05 +0000 (17:34 +0000)]
add #ifndef SMALL to slaacd.c as needed to fix 'make release'

7 years agoAdd support for the internal PHY on the Allwinner H3. From Stephen Graf.
kettenis [Sun, 10 Dec 2017 12:28:37 +0000 (12:28 +0000)]
Add support for the internal PHY on the Allwinner H3.  From Stephen Graf.

7 years agoFix MDIO_CMD register bit definitions. From Stepen Graf.
kettenis [Sun, 10 Dec 2017 11:58:15 +0000 (11:58 +0000)]
Fix MDIO_CMD register bit definitions.  From Stepen Graf.

7 years agoMove SB_SPLICE, SB_WAIT and SB_SEL to `sb_flags', serialized by solock().
mpi [Sun, 10 Dec 2017 11:31:54 +0000 (11:31 +0000)]
Move SB_SPLICE, SB_WAIT and SB_SEL to `sb_flags', serialized by solock().

SB_KNOTE remains the only bit set on `sb_flagsintr' as it is set/unset in
contexts related to kqueue(2) where we'd like to avoid grabbing solock().

While here add some KERNEL_LOCK()/UNLOCK() dances around selwakeup() and
csignal() to mark which remaining functions need to be addressed in the
socket layer.

ok visa@, bluhm@

7 years agoRemove outdated comment and trailing spaces.
mpi [Sun, 10 Dec 2017 11:25:18 +0000 (11:25 +0000)]
Remove outdated comment and trailing spaces.

From kshe59@zoho.eu

7 years agoMove privileged initialization from frontend to main process.
florian [Sun, 10 Dec 2017 10:07:54 +0000 (10:07 +0000)]
Move privileged initialization from frontend to main process.
Needed for future work where we will spin up children via
fork - privdrop - exec. Child processes will no longer come
up with root privileges.

7 years ago- add max-count to SYNOPSIS
jmc [Sun, 10 Dec 2017 09:17:24 +0000 (09:17 +0000)]
- add max-count to SYNOPSIS
- list long options with short, where they have an equivalent
- sync usage()
- minor tweaks

7 years agoadd the zte mf831; from christoph r. murauer
jmc [Sun, 10 Dec 2017 07:40:04 +0000 (07:40 +0000)]
add the zte mf831; from christoph r. murauer
while here, a little less capitalisation

7 years agosort -r in the description list, and make its grammar match those
jmc [Sun, 10 Dec 2017 07:34:38 +0000 (07:34 +0000)]
sort -r in the description list, and make its grammar match those
of the other options in this page;

7 years agoPut remote client info back into the ClientAlive connection termination
dtucker [Sun, 10 Dec 2017 05:55:29 +0000 (05:55 +0000)]
Put remote client info back into the ClientAlive connection termination
message.  Based in part on diff from  lars.nooden at gmail, ok djm

7 years agoEnable the phy-supply regulator if present and use the phy id specified
jsg [Sun, 10 Dec 2017 04:21:55 +0000 (04:21 +0000)]
Enable the phy-supply regulator if present and use the phy id specified
in the device tree.

Patch from Artturi Alm who tested on a Miniand Hackberry.

7 years ago-r restricted mode blocks certain operations as ~ operations.
deraadt [Sun, 10 Dec 2017 01:03:46 +0000 (01:03 +0000)]
-r restricted mode blocks certain operations as ~ operations.
from Jan Klemkow
ok nicm

7 years agoAdd support for the non-standard grep -m extension.
pirofti [Sat, 9 Dec 2017 18:38:37 +0000 (18:38 +0000)]
Add support for the non-standard grep -m extension.

grep -m num stops after a maximum of num matches are found.
We support -m0 to match GNU behaviour, but we do not allow negative
numbers.

Manpage help from jmc@, OK deraadt@.

7 years agoMake tls_config_parse_protocols() work correctly when passed a NULL pointer
jsing [Sat, 9 Dec 2017 16:46:08 +0000 (16:46 +0000)]
Make tls_config_parse_protocols() work correctly when passed a NULL pointer
for a protocol string.

Issue found by semarie@, who also provided the diff.

7 years agoAdd a regress test for tls_config_parse_protocols().
jsing [Sat, 9 Dec 2017 16:43:09 +0000 (16:43 +0000)]
Add a regress test for tls_config_parse_protocols().

7 years agoAdd sizes for free() in the AMD PowerNow! K8 driver.
fcambus [Sat, 9 Dec 2017 16:39:54 +0000 (16:39 +0000)]
Add sizes for free() in the AMD PowerNow! K8 driver.

OK deraadt@, sthen@, visa@

7 years agoAdd ACTION_IGNORE and nuke ignored_options, ignored_option_count fields
krw [Sat, 9 Dec 2017 15:48:04 +0000 (15:48 +0000)]
Add ACTION_IGNORE and nuke ignored_options, ignored_option_count fields
in struct client_config.

7 years agoUse a test value that fits into a long on both 32-bit and 64-bit
jsing [Sat, 9 Dec 2017 14:34:09 +0000 (14:34 +0000)]
Use a test value that fits into a long on both 32-bit and 64-bit
architectures, so that the regress passes on both.

7 years agoNo need for the txb_used flag anymore
mikeb [Sat, 9 Dec 2017 14:00:21 +0000 (14:00 +0000)]
No need for the txb_used flag anymore

7 years agoIn the middle of CRYPTO_gcm128_finish() there is a complicated #ifdef
deraadt [Sat, 9 Dec 2017 07:16:51 +0000 (07:16 +0000)]
In the middle of CRYPTO_gcm128_finish() there is a complicated #ifdef
block which defines a variable late, after code.  Place this chunk into
a { subblock } to satisfy old compilers and old eyes.

7 years agoPlease variable decl before code.
deraadt [Sat, 9 Dec 2017 07:09:25 +0000 (07:09 +0000)]
Please variable decl before code.

7 years agoMore precision in pledge sysctl report
deraadt [Sat, 9 Dec 2017 06:50:32 +0000 (06:50 +0000)]
More precision in pledge sysctl report

7 years agorecognize .openbsd.randomdata section and indicate it roughly, so
deraadt [Sat, 9 Dec 2017 06:39:04 +0000 (06:39 +0000)]
recognize .openbsd.randomdata section and indicate it roughly, so
that objects within it are identified as being in read-only space.
ok guenther

7 years agoAdd a #define for the name of the .openbsd.randomdata section.
deraadt [Sat, 9 Dec 2017 06:35:08 +0000 (06:35 +0000)]
Add a #define for the name of the .openbsd.randomdata section.
ok guenther

7 years agoPullup the mbuf before accessing the version field in the IP header.
bluhm [Fri, 8 Dec 2017 22:10:34 +0000 (22:10 +0000)]
Pullup the mbuf before accessing the version field in the IP header.
Fix the pullup length of the shim header in mpls_do_error().
issue reported by Maxime Villard; OK deraadt@ claudio@

7 years agoUse m_freem() in error case. Found by Maxime Villard
claudio [Fri, 8 Dec 2017 21:59:05 +0000 (21:59 +0000)]
Use m_freem() in error case. Found by Maxime Villard
OK bluhm@

7 years agoThe adjttl functions use m_pullup(). In some cases m_pullup() can return
claudio [Fri, 8 Dec 2017 21:56:22 +0000 (21:56 +0000)]
The adjttl functions use m_pullup(). In some cases m_pullup() can return
a new mbuf chain and this chain needs to be returned to the caller else
a use after free may happen.
Issue reported by Maxime Villard
OK bluhm@ deraadt@

7 years agompls_shim_pop() can return NULL. Check it else we end up dereferencing NULL.
claudio [Fri, 8 Dec 2017 21:52:49 +0000 (21:52 +0000)]
mpls_shim_pop() can return NULL. Check it else we end up dereferencing NULL.
Issue reported by Maxime Villard
OK bluhm@ deraadt@

7 years agoAdd support for background scanning to net80211 and iwm(4).
stsp [Fri, 8 Dec 2017 21:16:01 +0000 (21:16 +0000)]
Add support for background scanning to net80211 and iwm(4).

The iwm(4) driver will now roam between access points which share an SSID.
Use 'ifconfig iwm0 debug' and 'tail -f /var/log/messages' to watch it do so.

Tested by several people in various iterations.
As usual, let me know if you run into issues.

ok phessler deraadt

7 years agoThe per-interface mpls flag should also also be tested on input before
deraadt [Fri, 8 Dec 2017 21:08:35 +0000 (21:08 +0000)]
The per-interface mpls flag should also also be tested on input before
proceeding, as described in ifconfig documentation.  Discussion with claudio.
Related to a report from maxime.
ok claudio bluhm

7 years agoMake iwm(4) restore the ic_bss channel after tweaking this channel as part
stsp [Fri, 8 Dec 2017 20:55:46 +0000 (20:55 +0000)]
Make iwm(4) restore the ic_bss channel after tweaking this channel as part
of passing the frame to ieee80211_input(). Fixes a race where auth frames
would be sent on the wrong channel during association.
Problem reported by florian@
ok deraadt@

7 years agoWhen accepting a BOOTP lease, do not leak offered values of lease
krw [Fri, 8 Dec 2017 20:17:28 +0000 (20:17 +0000)]
When accepting a BOOTP lease, do not leak offered values of lease
time, renewal time, rebinding time. Use the ACTION_DEFAULT mechanism
to set the default expiry time for any lease so gauche as to not
provide one. Use the DHCP default lease times for BOOTP leases instead
of, bizarrely, shorter times.

7 years agoMake sure we don't match (and attach) more than the maximum number of
kettenis [Fri, 8 Dec 2017 19:05:33 +0000 (19:05 +0000)]
Make sure we don't match (and attach) more than the maximum number of
supported CPUs.

7 years agoMake the r command filename obligatory, similar to what FreeBSD and NetBSD
martijn [Fri, 8 Dec 2017 18:41:59 +0000 (18:41 +0000)]
Make the r command filename obligatory, similar to what FreeBSD and NetBSD
do for several years.
While here make corresponding error message for missing read and write file
consistent between commands/flag, and shrink the the code of the w flag of
the s command by making it use the same code as the w command.

Prompted by a larger diff by kshe59 <at> zoho <dot> eu
OK millert@

7 years agorepair columns; from kshe59@zohu.eu
deraadt [Fri, 8 Dec 2017 17:51:26 +0000 (17:51 +0000)]
repair columns; from kshe59@zohu.eu

7 years agoAdd missing length checks to make sure we don't dereference a pointer
millert [Fri, 8 Dec 2017 17:26:42 +0000 (17:26 +0000)]
Add missing length checks to make sure we don't dereference a pointer
past the mmap(2)'d buffer.  Otherwise, locate will read a single
byte past the end of the buffer.  This is often harmless, but if
the length of the buffer is an even multiple of the page size,
locate will crash.  OK tb@ espie@ deraadt@

7 years agoConvert snprintf+write into dprintf. It is simply easier to read, and
deraadt [Fri, 8 Dec 2017 17:04:14 +0000 (17:04 +0000)]
Convert snprintf+write into dprintf.  It is simply easier to read, and
provides retry on short-write file descriptors.
ok florian, previous versions seen by millert

7 years agoremove description of 'at' field which was removed from vmstat.c -r1.21
jasper [Fri, 8 Dec 2017 09:45:05 +0000 (09:45 +0000)]
remove description of 'at' field which was removed from vmstat.c -r1.21

7 years agoDisable SMAP temporarily to display userland traces.
mpi [Fri, 8 Dec 2017 08:54:03 +0000 (08:54 +0000)]
Disable SMAP temporarily to display userland traces.

ok visa@, deraadt@, mlarkin@, jasper@