openbsd
7 years agoUse a const char * for "/etc/resolv.conf.tail" instead of repeating the
krw [Fri, 23 Jun 2017 16:09:38 +0000 (16:09 +0000)]
Use a const char * for "/etc/resolv.conf.tail" instead of repeating the
text in various forms in different error messages. Also makes the error
messages consistent by always displaying the full path name.

7 years agoTake reyk's imsg resolv.conf improvements of a while ago to their
krw [Fri, 23 Jun 2017 15:40:56 +0000 (15:40 +0000)]
Take reyk's imsg resolv.conf improvements of a while ago to their
logical conclusion.

Nuke _PATH_RESOLV_CONF since the value is only meant to be
known inside priv_write_resolv_conf(). Just use a local const char *.

Bring priv_write_resolv_conf() into line with other priv_ functions
invoked from the dispatch loop. i.e. don't pass it the imsg, just pass
a pointer to the data and a size after ensuring there is data to pass.

7 years agoAdd user-keys option to allow user-defined keys to be set, from Dan
nicm [Fri, 23 Jun 2017 15:36:52 +0000 (15:36 +0000)]
Add user-keys option to allow user-defined keys to be set, from Dan
Aloni.

7 years ago- Fix Tx queues to USB endpoints mapping and merge urtwn_r92c_dma_init()
kevlo [Fri, 23 Jun 2017 14:41:54 +0000 (14:41 +0000)]
- Fix Tx queues to USB endpoints mapping and merge urtwn_r92c_dma_init()
  and urtwn_r88e_dma_init() into one; from FreeBSD r291902.

- Change the way the number of pages for public queue is calculated;
  Based on the vendor driver's _InitQueueReservedPage(), the formula for
  calculation of the number of pages for public priority queue is as follows:

  if the device has 3 endpoints:
  PUBQ = total number of Tx pages - HQ - LQ - NQ

  if the device has 2 endpoints (i.e. has high and normal priority queues):
  PUBQ = total number of Tx pages - HQ - NQ

- Don't write MCS8..MCS15 Tx power if the WNIC is a 1-stream Tx;

- Set R88E_TX_PAGE_COUNT to a correct value;

- Minimal enhancement in urtwn_open_pipes() for upcoming rtl8192eu chipset
  support;

Tested with USB-N10 Nano (rtl8188cu), DWA-131 rev B (rtl8192cu), and
TL-WN725N v2 (rtl8188eu) on amd64.

ok stsp@

7 years agoRemove unused confirm() and datime() functions.
fcambus [Fri, 23 Jun 2017 12:56:25 +0000 (12:56 +0000)]
Remove unused confirm() and datime() functions.

Those functions are unused and have been compiled out since 1998,
it's time to let them go.

OK sthen@, tom@, mestre@

7 years agoAlways include Makefile.dep, conditionally including it based on the
jsg [Fri, 23 Jun 2017 11:54:22 +0000 (11:54 +0000)]
Always include Makefile.dep, conditionally including it based on the
existence of a .depend file can lead to various problems.

The logic before rev 1.15 resulted in Makefile.dep always being
included as DEPENDSFILE was never set so this returns to the old
behaviour.

ok espie@

7 years agoResetting the mbuf header in if_input_local() was stripping off the
bluhm [Fri, 23 Jun 2017 11:18:12 +0000 (11:18 +0000)]
Resetting the mbuf header in if_input_local() was stripping off the
M_LOOP flag.  This broke IPv6 multicast.  Always set M_LOOP when
going through if_input_local() and adjust the flag's comment.
report rzalamena@; OK mpi@

7 years agoUnbreak profiling assembly functions in userland by defining the
mpi [Fri, 23 Jun 2017 09:55:10 +0000 (09:55 +0000)]
Unbreak profiling assembly functions in userland by defining the
correct prologue if compiled with -DPROF.

ok deraadt@

7 years agoWhen using the escape sequence &~ the code path is client_loop() ->
mestre [Fri, 23 Jun 2017 07:24:48 +0000 (07:24 +0000)]
When using the escape sequence &~ the code path is client_loop() ->
client_simple_escape_filter() -> process_escapes() -> fork() and the pledge for
this path lacks the proc promise and therefore aborts the process.
The solution is to just add proc the promise to this specific pledge.

Reported by Gregoire Jadi gjadi ! omecha.info
Insight with tb@, OK jca@

7 years agoi didn't know we had clang-local until reminded by jsg.
tedu [Fri, 23 Jun 2017 06:07:51 +0000 (06:07 +0000)]
i didn't know we had clang-local until reminded by jsg.
mention the disabling of ident strings.

7 years agoImport regenerated moduli.
dtucker [Fri, 23 Jun 2017 03:30:42 +0000 (03:30 +0000)]
Import regenerated moduli.

7 years agoRun the screen twice so we end up with more candidate groups. ok djm@
dtucker [Fri, 23 Jun 2017 03:25:53 +0000 (03:25 +0000)]
Run the screen twice so we end up with more candidate groups.  ok djm@

7 years agoWrite text boxes as <mi>, <mn>, or <mo> as appropriate,
schwarze [Fri, 23 Jun 2017 02:31:39 +0000 (02:31 +0000)]
Write text boxes as <mi>, <mn>, or <mo> as appropriate,
and write fontstyle or fontweight attributes where required.
Missing features reported by bentley@.

7 years agoset the alignment of the per cpu cache structures to CACHELINESIZE.
dlg [Fri, 23 Jun 2017 01:21:55 +0000 (01:21 +0000)]
set the alignment of the per cpu cache structures to CACHELINESIZE.

hardcoding 64 is too optimistic.

7 years agochange the semantic for calculating when to grow the size of a cache list.
dlg [Fri, 23 Jun 2017 01:02:18 +0000 (01:02 +0000)]
change the semantic for calculating when to grow the size of a cache list.

previously it would figure out if there's enough items overall for
all the cpus to have full active an inactive free lists. this
included currently allocated items, which pools wont actually hold
on a free list and cannot predict when they will come back.

instead, see if there's enough items in the idle lists in the depot
that could instead go on all the free lists on the cpus. if there's
enough idle items, then we can grow.

tested by hrvoje popovski and amit kulkarni
ok visa@

7 years agoSimplify font handling:
schwarze [Fri, 23 Jun 2017 00:30:17 +0000 (00:30 +0000)]
Simplify font handling:
1. Inherit the font attribute from the parent box, such that iteration
is no longer required to find the current font.
2. For well-known function name tokens, do not insert an EQN_LISTONE
box into the AST; simply set the font attribute of the text box
itself that contains the name.

Also improve word splitting of unquoted strings in default font mode:
3. Split between numbers and punctuation because both will soon get
different HTML markup.
4. Do not split between letters.  With the newly ubiquitious font
attributes, all formatters will be able to figure out what to do
without putting each letter into a separate box.

7 years agoi386 uses a intentional fallthrough between appended code blocks in .init,
deraadt [Thu, 22 Jun 2017 21:26:54 +0000 (21:26 +0000)]
i386 uses a intentional fallthrough between appended code blocks in .init,
which we cannot TRAPSLED FILL.  This needs to be done a different way.
diagnosis with kettenis

7 years agoDo not interpret an empty path as current working directory "." when
benno [Thu, 22 Jun 2017 20:44:36 +0000 (20:44 +0000)]
Do not interpret an empty path as current working directory "." when
parsing LD_LIBRARY_PATH, and in DT_RPATH and DT_RUNPATH attributes and
in ld.so.hints.

ok deraadt@

7 years agoClose file descriptor on an exit path.
fcambus [Thu, 22 Jun 2017 20:38:32 +0000 (20:38 +0000)]
Close file descriptor on an exit path.

OK gsoares@

7 years agoPerl on 32 bit architectures does not support pack('Q'), replace
bluhm [Thu, 22 Jun 2017 20:17:22 +0000 (20:17 +0000)]
Perl on 32 bit architectures does not support pack('Q'), replace
it with 'NN'.

7 years agoGet the framework from relayd regress to start switchd on demand.
bluhm [Thu, 22 Jun 2017 20:06:14 +0000 (20:06 +0000)]
Get the framework from relayd regress to start switchd on demand.
This allows to run the test without manual setup.

7 years agoDo not skip any crypto tests. Remove useless make code, use defaults
bluhm [Thu, 22 Jun 2017 18:07:30 +0000 (18:07 +0000)]
Do not skip any crypto tests.  Remove useless make code, use defaults
where appropriate.
OK mikeb@

7 years agoMake sure to abort loops when pressing ^C in csh.
anton [Thu, 22 Jun 2017 18:05:31 +0000 (18:05 +0000)]
Make sure to abort loops when pressing ^C in csh.

Regression found by deraadt@

7 years agoUse the tls_password_cb() callback with all PEM_read_bio_*() calls, so that
jsing [Thu, 22 Jun 2017 18:03:57 +0000 (18:03 +0000)]
Use the tls_password_cb() callback with all PEM_read_bio_*() calls, so that
we can prevent libcrypto from going behind our back and trying to read
passwords from standard input (which we may not be permitted to do).

Found by jsg@ with httpd and password protected keys.

7 years agoFix incorrect indentation.
jsing [Thu, 22 Jun 2017 17:58:54 +0000 (17:58 +0000)]
Fix incorrect indentation.

7 years agoPlug a memory leak in tls_keypair_cert_hash(), introduced in r1.60.
jsing [Thu, 22 Jun 2017 17:55:48 +0000 (17:55 +0000)]
Plug a memory leak in tls_keypair_cert_hash(), introduced in r1.60.

7 years agoPick rijndael.c lost after backout; requested by bluhm@
mikeb [Thu, 22 Jun 2017 17:48:42 +0000 (17:48 +0000)]
Pick rijndael.c lost after backout; requested by bluhm@

7 years agoRemove dead code that has remained hiding since ressl.c r1.14!
jsing [Thu, 22 Jun 2017 17:47:56 +0000 (17:47 +0000)]
Remove dead code that has remained hiding since ressl.c r1.14!

7 years agoUse the standard `rv' idiom in tls_keypair_load_cert(), rather than
jsing [Thu, 22 Jun 2017 17:34:25 +0000 (17:34 +0000)]
Use the standard `rv' idiom in tls_keypair_load_cert(), rather than
duplicating clean up code.

7 years agoDistinguish between self-issued certificates and self-signed certificates.
jsing [Thu, 22 Jun 2017 17:28:00 +0000 (17:28 +0000)]
Distinguish between self-issued certificates and self-signed certificates.
The certificate verification code has special cases for self-signed
certificates and without this change, self-issued certificates (which it
seems are common place with openvpn/easyrsa) were also being included in
this category.

Based on BoringSSL.

Thanks to Dale Ghent <daleg at elemental dot org> for assisting in
identifying the issue and testing this fix.

ok inoguchi@

7 years agozap trailing spaces from the previous commits and also other trailing
espie [Thu, 22 Jun 2017 17:09:10 +0000 (17:09 +0000)]
zap trailing spaces from the previous commits and also other trailing
spaces

7 years agobetter display of cycles in -j mode.
espie [Thu, 22 Jun 2017 17:08:20 +0000 (17:08 +0000)]
better display of cycles in -j mode.
lots of tests by krw@
review and comments by pirofti@, more tweaks to come

7 years agoConvert shell script tests to regress make rules. Having only one
bluhm [Thu, 22 Jun 2017 16:10:34 +0000 (16:10 +0000)]
Convert shell script tests to regress make rules.  Having only one
tool and more verbosity allows better debugging.  Additional tests
check that gzip and gunzip preserve file permissions and ownership.

7 years agoAdjust relink procedure to use new targets. Better use semantics for
deraadt [Thu, 22 Jun 2017 16:03:36 +0000 (16:03 +0000)]
Adjust relink procedure to use new targets.  Better use semantics for
users and developers.
diff from rpe, ok tb

7 years agocompile.tgz no longer needs to contain machine/ subdir, instead it needs
deraadt [Thu, 22 Jun 2017 16:02:42 +0000 (16:02 +0000)]
compile.tgz no longer needs to contain machine/ subdir, instead it needs
makegap.sh
ok tb

7 years agoGenerate a gap.link script, and use that to generate gap.o. On multi-ABI
deraadt [Thu, 22 Jun 2017 16:01:45 +0000 (16:01 +0000)]
Generate a gap.link script, and use that to generate gap.o.  On multi-ABI
architectures we must also link against a gapdummy.o to repair the ABI
of the resulting .o file.  Woe is me.
Also repair install: target to update the linkkit & hash when a kernel
is installed.
ok rpe tb mlarkin and tested by others also

7 years agoGenerate the newbsd: and install-update: targets here, rather than
deraadt [Thu, 22 Jun 2017 15:57:16 +0000 (15:57 +0000)]
Generate the newbsd: and install-update: targets here, rather than
in the source Makefile.* files.
ok tb rpe mlarkin

7 years agocalculate a "sum" based upon pointers to functions all over the kernel,
deraadt [Thu, 22 Jun 2017 15:56:29 +0000 (15:56 +0000)]
calculate a "sum" based upon pointers to functions all over the kernel,
so that an unhibernate kernel can detect if it is running with the
kernel it booted.
ok mlarkin

7 years agoDrop support for old (>4yr) timestamp formats in leases
krw [Thu, 22 Jun 2017 15:08:53 +0000 (15:08 +0000)]
Drop support for old (>4yr) timestamp formats in leases
files.

ok tb@ millert@

7 years agoImprove the coalescing of instruction cache flushes on R8000 in order
visa [Thu, 22 Jun 2017 14:40:20 +0000 (14:40 +0000)]
Improve the coalescing of instruction cache flushes on R8000 in order
not to perform redundant work. There is no direct way to flush the
cache; rather, the kernel evicts unwanted bits from the cache by
executing a block of instructions, which is expensive.

With this diff, make build time decreases about 0.4%.

Diff from miod@

7 years agotypo; from jack burton
jmc [Thu, 22 Jun 2017 13:51:49 +0000 (13:51 +0000)]
typo; from jack burton

7 years agoTidy up comment about double load opcodes in m88k/eh_common.S (and fix ;; -> ||)
tom [Thu, 22 Jun 2017 13:21:10 +0000 (13:21 +0000)]
Tidy up comment about double load opcodes in m88k/eh_common.S (and fix ;; -> ||)

ok miod@

7 years agoFix the remaining ';;'s in sys/
tom [Thu, 22 Jun 2017 11:34:51 +0000 (11:34 +0000)]
Fix the remaining ';;'s in sys/

7 years agoAdd a hypervisor-specific function pointer in pvbus(4) that gets called during
jmatthew [Thu, 22 Jun 2017 06:21:12 +0000 (06:21 +0000)]
Add a hypervisor-specific function pointer in pvbus(4) that gets called during
cpu_hatch() on each cpu, allowing initialization of per-cpu features on each
cpu as it starts up.

input from reyk@ and mikeb@
ok mikeb@

7 years agoFix another ;; in sys/dev
tom [Thu, 22 Jun 2017 05:32:47 +0000 (05:32 +0000)]
Fix another ;; in sys/dev

7 years agodouble ;;. xhci one found by geoffhill
deraadt [Thu, 22 Jun 2017 02:44:37 +0000 (02:44 +0000)]
double ;;.  xhci one found by geoffhill

7 years agoitems get returns to pools with pool_put, not pool_get.
dlg [Thu, 22 Jun 2017 02:30:34 +0000 (02:30 +0000)]
items get returns to pools with pool_put, not pool_get.

7 years agoOnly print the magic '&' letter on a disk if the hibernate partition is
deraadt [Thu, 22 Jun 2017 01:26:28 +0000 (01:26 +0000)]
Only print the magic '&' letter on a disk if the hibernate partition is
valid.  This is an undocumented little debugging diagnostic, much like
the '*'.

7 years agoFix font selection for text boxes in the terminal formatter.
schwarze [Thu, 22 Jun 2017 00:30:06 +0000 (00:30 +0000)]
Fix font selection for text boxes in the terminal formatter.
Issue reported by bentley@.

The AST data structure is powerful enough that all required
information can easily be provided in the parser, and no change
of the formatting code is needed.

7 years ago/var/db/kernel.SHA256 contains the hash of the /bsd kernel. Upon
deraadt [Wed, 21 Jun 2017 23:54:19 +0000 (23:54 +0000)]
/var/db/kernel.SHA256 contains the hash of the /bsd kernel.  Upon
install or upgrade, set it correctly.
diff from rpe, also thanks tb for comments and review

7 years agoWhen building a snapshot, install the compile.tgz file to builder's
deraadt [Wed, 21 Jun 2017 23:52:55 +0000 (23:52 +0000)]
When building a snapshot, install the compile.tgz file to builder's
/usr/share/ so that next boot will find it and perhaps use it.
ok tb rpe

7 years agoBetter off padding with 0x0. 0x0 = "break 0,0".
deraadt [Wed, 21 Jun 2017 23:21:35 +0000 (23:21 +0000)]
Better off padding with 0x0.  0x0 = "break 0,0".

(BTW, the binutils disasm cannot handle that instruction with those
parameters, because the decoder logic is wrong..)

7 years agoOutside explicit font context, give every letter its own box.
schwarze [Wed, 21 Jun 2017 20:47:46 +0000 (20:47 +0000)]
Outside explicit font context, give every letter its own box.
The formatters need this to correctly select fonts.
Missing feature reported by bentley@.

7 years agoelf64_x86_64_plt0_entry had a hardcoded nop-sled, before the subsequent
deraadt [Wed, 21 Jun 2017 20:31:46 +0000 (20:31 +0000)]
elf64_x86_64_plt0_entry had a hardcoded nop-sled, before the subsequent
plt entry.  Since previous effective instruction is a a jmp, this can be
a sequence of traps.
ok mlarkin

7 years agoIntra-segment traps instead of nops. Similar to kernel change, further
deraadt [Wed, 21 Jun 2017 20:29:39 +0000 (20:29 +0000)]
Intra-segment traps instead of nops.  Similar to kernel change, further
reduction in nopsleds in code and data segments (if those data segments
ever become X, that is)
ok mlarkin

7 years agoFill space between sections with traps, rather than nops.
deraadt [Wed, 21 Jun 2017 20:08:53 +0000 (20:08 +0000)]
Fill space between sections with traps, rather than nops.

7 years agoMinor style(9) corrections and whitespace cleanup to csh.
anton [Wed, 21 Jun 2017 19:36:23 +0000 (19:36 +0000)]
Minor style(9) corrections and whitespace cleanup to csh.

ok deraadt@ tb@

7 years agoLarge nopsleds make it easier for ROP machinery to sloppily reach targets.
deraadt [Wed, 21 Jun 2017 19:23:12 +0000 (19:23 +0000)]
Large nopsleds make it easier for ROP machinery to sloppily reach targets.
Convert these to "trapsleds' instead.  Since these can occur inside
fall-through blocks of code (and gcc sure isn't helping us by identifying
those), convert most to "short jump over" followed a sequence of int3.
This works for sled sizes 3-15, for i386 and amd64.   Work by Todd Mortimer
ok mlarkin

7 years agoAdd regression tests for the filec feature in csh.
anton [Wed, 21 Jun 2017 19:03:30 +0000 (19:03 +0000)]
Add regression tests for the filec feature in csh.

7 years agoReplace usage of TIOCSTI in csh using a more common IO-loop where ICANON is
anton [Wed, 21 Jun 2017 18:55:15 +0000 (18:55 +0000)]
Replace usage of TIOCSTI in csh using a more common IO-loop where ICANON is
disabled and a single char of input is read at a time. This requires the line
editing capabilities provided when ICANON is enabled to be implemented.

With help and feedback from deraadt@

7 years agoquoted words are not parsed for defined keys
schwarze [Wed, 21 Jun 2017 18:37:38 +0000 (18:37 +0000)]
quoted words are not parsed for defined keys

7 years agoDon't confuse SCSI command status and transfer error code.
mikeb [Wed, 21 Jun 2017 18:18:08 +0000 (18:18 +0000)]
Don't confuse SCSI command status and transfer error code.
While here, make SCSI command completion routine more robust.

7 years agoRecognize well-known functions names (the same that Heirloom recognizes,
schwarze [Wed, 21 Jun 2017 18:03:50 +0000 (18:03 +0000)]
Recognize well-known functions names (the same that Heirloom recognizes,
which includes those recognized by groff) and wrap them in a roman box
unless they already are in roman context.
Missing feature reported by bentley@.

7 years agoPermit TIOCSTAT on a tty.
deraadt [Wed, 21 Jun 2017 17:13:20 +0000 (17:13 +0000)]
Permit TIOCSTAT on a tty.

7 years agoFor a decade or more, we've patched gcc to make -fno-ident the default.
tedu [Wed, 21 Jun 2017 16:51:07 +0000 (16:51 +0000)]
For a decade or more, we've patched gcc to make -fno-ident the default.
clang doesn't seem to have a command line option for the feature,
so just hard wire it off. We don't need advertisements in our binaries.
ok deraadt

7 years agoTeach get_recorded_lease() that static leases do not
krw [Wed, 21 Jun 2017 16:39:05 +0000 (16:39 +0000)]
Teach get_recorded_lease() that static leases do not
expire.

7 years agoReturn early from NVS command submission if no response is required
mikeb [Wed, 21 Jun 2017 16:37:48 +0000 (16:37 +0000)]
Return early from NVS command submission if no response is required

7 years agoNo need to manually check validity of ifi->active when
krw [Wed, 21 Jun 2017 15:49:27 +0000 (15:49 +0000)]
No need to manually check validity of ifi->active when
REBOOT'ing. It will be pointing to a recorded lease if
anything. So rely on get_recorded_lease() to return the
next valid candidate lease, which might be the lease
ifi->active was pointing at.

7 years agoFix kernel diagnostic assertion "(sk->inp == NULL) || (sk->inp->inp_pf_sk
bluhm [Wed, 21 Jun 2017 15:29:23 +0000 (15:29 +0000)]
Fix kernel diagnostic assertion "(sk->inp == NULL) || (sk->inp->inp_pf_sk
== NULL)".  The problem was that setting the inp pointer in the
statekey to NULL was delayed until the statekey refcounter reached
0.  So the inp could get linked to another statekey while an mbuf
in the socket buffer was keeping the refcounter at 1.  Set the
statekey inp pointer to NULL in pf_state_key_detach() immediately,
then the kassert can be even stricter.
OK sashan@

7 years agoConsistently use time(&var) idiom rather than tossing in a few
krw [Wed, 21 Jun 2017 15:24:34 +0000 (15:24 +0000)]
Consistently use time(&var) idiom rather than tossing in a few
var = time(NULL). Flip "struct interface *" to be the first
parameter in set_timeout(), as in other functions taking the
state info.

7 years agoAllow familiar idiom free_client_lease(NULL).
krw [Wed, 21 Jun 2017 12:37:24 +0000 (12:37 +0000)]
Allow familiar idiom free_client_lease(NULL).

7 years agoInclude the request id in the I/O debug output
mikeb [Wed, 21 Jun 2017 11:35:11 +0000 (11:35 +0000)]
Include the request id in the I/O debug output

7 years agoList all five devices, not just the first two.
akfaew [Wed, 21 Jun 2017 08:21:14 +0000 (08:21 +0000)]
List all five devices, not just the first two.

OK jmc@ sf@

7 years agosync
deraadt [Wed, 21 Jun 2017 06:24:28 +0000 (06:24 +0000)]
sync

7 years agoerror out if an exists condition tests an empty path, because that makes
espie [Wed, 21 Jun 2017 00:11:36 +0000 (00:11 +0000)]
error out if an exists condition tests an empty path, because that makes
zero sense.

this would have caught DEPENDSFILE in gnu/cc/cc_tools

okay guenther@,  also tested by krw@

7 years agoDEPENDSFILE comes from FreeBSD, we don't have it. replace it with its
espie [Wed, 21 Jun 2017 00:10:23 +0000 (00:10 +0000)]
DEPENDSFILE comes from FreeBSD, we don't have it. replace it with its
value .depend, so that the conditional is really used.

okay guenther@

7 years agouse [] instead of * for reaching regions to unmap, making this more
deraadt [Tue, 20 Jun 2017 21:05:46 +0000 (21:05 +0000)]
use [] instead of * for reaching regions to unmap, making this more
similar to smashing versions written by visa

7 years agoFix a path in Makequest and remove hack.sh (it never worked).
akfaew [Tue, 20 Jun 2017 20:40:54 +0000 (20:40 +0000)]
Fix a path in Makequest and remove hack.sh (it never worked).

OK tb@

7 years agoRemove locate.concatdb, it never worked.
akfaew [Tue, 20 Jun 2017 20:24:07 +0000 (20:24 +0000)]
Remove locate.concatdb, it never worked.

OK millert@

7 years agoSet SRCDIR according to build type and s/X11SRC/XSRCDIR
ajacoutot [Tue, 20 Jun 2017 18:32:26 +0000 (18:32 +0000)]
Set SRCDIR according to build type and s/X11SRC/XSRCDIR

ok robert@

7 years agotrim more error messages
espie [Tue, 20 Jun 2017 18:05:44 +0000 (18:05 +0000)]
trim more error messages
- if we can't retrieve the package, of course signify will say it's truncated
so that's redundant.
- if you give a full package name, can_be_empty should make directories
vanish.

(landry just discovered 6.1/packages-stable by accident, make it vanish
again so he can't find it back... :D )

7 years agodoas won't be configured after the first boot, so stop recommending
tj [Tue, 20 Jun 2017 18:02:26 +0000 (18:02 +0000)]
doas won't be configured after the first boot, so stop recommending
use of it to change root's password. remove a leftover sentence and
apply minor grammar tweaks while here.

ok deraadt

7 years ago'^T' is documented to be bounded to transpose-chars while in emacs
brynet [Tue, 20 Jun 2017 17:32:20 +0000 (17:32 +0000)]
'^T' is documented to be bounded to transpose-chars while in emacs
mode, not "stuff". While here, remove the poorly described "stuff"
and "stuff" bind functions as well..

In the unlikely event anyone has those in .kshrc, they'll need to
be removed.

ok anton@

7 years agoKNF: remove parentheses from switch case labels; no binary change
schwarze [Tue, 20 Jun 2017 17:24:09 +0000 (17:24 +0000)]
KNF: remove parentheses from switch case labels; no binary change

7 years agoIn ddb print socket bit field so_state in hex to match SS_ defines.
bluhm [Tue, 20 Jun 2017 17:13:21 +0000 (17:13 +0000)]
In ddb print socket bit field so_state in hex to match SS_ defines.

7 years agoFix EOL tests for ksh vi mode.
anton [Tue, 20 Jun 2017 16:46:51 +0000 (16:46 +0000)]
Fix EOL tests for ksh vi mode.

7 years agoDon't try to close every single file descriptor up to _SC_OPEN_MAX in csh.
anton [Tue, 20 Jun 2017 16:44:06 +0000 (16:44 +0000)]
Don't try to close every single file descriptor up to _SC_OPEN_MAX in csh.
Instead, close the fds that reside in between the gaps of used fds and once the
largest used fd is reached call closefrom().

ok deraadt@

7 years agoCheck the validity of the `qtd' pointer after each interrupt case
visa [Tue, 20 Jun 2017 15:49:00 +0000 (15:49 +0000)]
Check the validity of the `qtd' pointer after each interrupt case
and bail out if the pointer has become invalid. This prevents
use-after-free memory accesses that corrupted the dwc2qtd pool.

This fix improves stability on the Raspberry Pi 3.

From Linux commit dc8730846948e517169f630826cd2c97615f5ee8
OK kettenis@

7 years agoDo not touch file pointers for which FILE_IS_USABLE() is false.
gerhard [Tue, 20 Jun 2017 14:11:46 +0000 (14:11 +0000)]
Do not touch file pointers for which FILE_IS_USABLE() is false.
They're might not be fully constructed.

ok mpi@ deraadt@ bluhm@

7 years agoRemove the IWM_FLAG_HW_INITED flag from iwm(4). This flag was redundant.
stsp [Tue, 20 Jun 2017 13:52:40 +0000 (13:52 +0000)]
Remove the IWM_FLAG_HW_INITED flag from iwm(4). This flag was redundant.
The IFF_RUNNING flag in struct ifnet serves the same purpose.
ok mpi@ kettenis@ deraadt@

7 years agoInitialize the link state of a wireless interface to DOWN when the
stsp [Tue, 20 Jun 2017 13:51:46 +0000 (13:51 +0000)]
Initialize the link state of a wireless interface to DOWN when the
interface is attached to the net80211 layer. Prevents confusion
in cases where drivers forget to initialize the link state.
ok mpi@ kettenis@

7 years agoFix a couple of comment typos in amd64 and i386 biosvar.h
tom [Tue, 20 Jun 2017 12:39:20 +0000 (12:39 +0000)]
Fix a couple of comment typos in amd64 and i386 biosvar.h

7 years agoDo not use the interface pointer after if_put(). Rename ipip_input_gif()
bluhm [Tue, 20 Jun 2017 11:12:13 +0000 (11:12 +0000)]
Do not use the interface pointer after if_put().  Rename ipip_input_gif()
to ipip_input_if() and always pass the ifp.  Only dump the packet
to bpf if we are called with a gif(4) interface.
OK mpi@

7 years agoConvert sodidle() to timeout_set_proc(9), it needs a process context
mpi [Tue, 20 Jun 2017 09:10:04 +0000 (09:10 +0000)]
Convert sodidle() to timeout_set_proc(9), it needs a process context
to grab the rwlock.

Problem reported by Rivo Nurges.

ok bluhm@

7 years agoRemove KERNEL_LOCK() asserts.
mpi [Tue, 20 Jun 2017 09:03:39 +0000 (09:03 +0000)]
Remove KERNEL_LOCK() asserts.

pf table code iterates on a radix tree and currently relies on the
NET_LOCK() to do the serialization.

Found the hardway by jasper@

7 years agoBetter document the :s ex command and its variants.
bentley [Tue, 20 Jun 2017 07:32:56 +0000 (07:32 +0000)]
Better document the :s ex command and its variants.

ok jmc@

7 years agosync
jsg [Tue, 20 Jun 2017 06:37:30 +0000 (06:37 +0000)]
sync

7 years agoremove some magic numbers in the flush-by-asid code and check if the CPU
mlarkin [Tue, 20 Jun 2017 06:25:01 +0000 (06:25 +0000)]
remove some magic numbers in the flush-by-asid code and check if the CPU
supports that feature before we try to use it.

discussed with deraadt

7 years agoSVM: better cleanbits handling. Fixes an issue on Bulldozer CPUs causing
mlarkin [Tue, 20 Jun 2017 05:34:41 +0000 (05:34 +0000)]
SVM: better cleanbits handling. Fixes an issue on Bulldozer CPUs causing
#TF exceptions during guest VM boot

ok brynet

7 years agofix some nits
jmatthew [Tue, 20 Jun 2017 04:37:17 +0000 (04:37 +0000)]
fix some nits
ok dlg@