deraadt [Mon, 17 May 2021 15:06:09 +0000 (15:06 +0000)]
delete useless blank lines
bluhm [Mon, 17 May 2021 13:54:42 +0000 (13:54 +0000)]
Link fenv.S test program statically to avoid calling the dynamic
linker.
bluhm [Mon, 17 May 2021 13:13:27 +0000 (13:13 +0000)]
Skip sosplice loop test if Perl packages are not installed.
claudio [Mon, 17 May 2021 12:15:48 +0000 (12:15 +0000)]
Reshuffle if conditions to check for error first after the fstat() calls.
OK benno@
claudio [Mon, 17 May 2021 12:11:05 +0000 (12:11 +0000)]
Do not leak blk.blks in error condition.
Noticed by and OK benno@
claudio [Mon, 17 May 2021 12:04:38 +0000 (12:04 +0000)]
Adjust exit codes in the main program to follow the ones from
OK benno@
claudio [Mon, 17 May 2021 12:02:58 +0000 (12:02 +0000)]
Error out on memory failures in fargs_cmdline() and addargs() in both
cases it was impossible to start the remote rsync anyway. Also now
fargs_cmdline() can no longer fail. Add missing err(ERR_IPC, "pldege")
for the cases in socket.c
OK benno@
visa [Mon, 17 May 2021 11:59:53 +0000 (11:59 +0000)]
Fix mbuf leaks after reception error in re_rxeof().
Also, increment the error counter when an unexpected fragment is seen.
OK claudio@
claudio [Mon, 17 May 2021 11:59:09 +0000 (11:59 +0000)]
If pledge() or unveil() fails error out with ERR_IPC. Also error out in
the receiver when intial setup fails because of filesystem errors (unable
to open or create the base directory) or on memory failures.
OK benno@
claudio [Mon, 17 May 2021 11:54:14 +0000 (11:54 +0000)]
Introduce some error exit codes which are in sync with the ones from
proper rsync. This should help to make the tool behave more like the
real thing.
OK benno@
claudio [Mon, 17 May 2021 11:52:10 +0000 (11:52 +0000)]
Sync code with the original from mkdir(1).
OK benno@
claudio [Mon, 17 May 2021 11:49:01 +0000 (11:49 +0000)]
The openat() then fstat() pattern only works if one is sure the file being
opened is a regular file. In other cases this may block in openat() (since
the O_NONBLOCK flag removed). Switch to fstatat() and then openat() to
protect from involuntary side-effects (like opening a device node) and
possible hangs.
OK benno@
stsp [Mon, 17 May 2021 11:44:22 +0000 (11:44 +0000)]
put unused 802.11 fragmentation support code under #ifdef notyet
djm [Mon, 17 May 2021 11:43:16 +0000 (11:43 +0000)]
fix breakage of -W forwaring introduced in 1.554; reported by
naddy@ and sthen@, ok sthen@
claudio [Mon, 17 May 2021 10:47:07 +0000 (10:47 +0000)]
Limit the number of concurrent RTR connects to 32.
If the limit is hit the request will be dropped and the rtr process will
retry the connect after the retry timeout. Hopefully by then the number of
connections is down again.
OK deraadt@ benno@
claudio [Mon, 17 May 2021 10:09:53 +0000 (10:09 +0000)]
Stop setting IPV6_MINMTU in ip6_send() which is used by the ICMP code.
Because of this large ping packets where fragmented even if the MTU did
not indicate the need for it. This causes some trouble when system do
not expect to receive a fragmented answer from a system. One such case
is the automated link test from google routers before allowing to establish
a BGP peering session with them. In general PMTU problems should be an
issue from the past and if not it may be better to also break on ping
packets and not only for UDP and TCP. ICMP ping is normaly the first
tool in the admins toolbox to figure out network issues.
OK phessler@ florian@ bluhm@
florian [Mon, 17 May 2021 09:26:52 +0000 (09:26 +0000)]
Do not try to chunk encode an empty http body coming from an fcgi
upstream.
Found the hard way by Chris Narkiewicz who tracked failing uploads in
the nextcloud mobile app down to httpd(8) trying to chunk encode a
"204 No Content" resonse.
Testing by Steve Williams
Testing & OK stsp
tobhe [Mon, 17 May 2021 08:14:37 +0000 (08:14 +0000)]
Avoid calling ibuf_add() with NULL and zero length.
ok patrick@
stsp [Mon, 17 May 2021 08:02:20 +0000 (08:02 +0000)]
Prevent frame injection via forged 802.11n A-MSDUs.
This mitigates an attack where a single 802.11 frame is interpreted as an
A-MSDU because of a forged AMSDU-present bit in the 802.11 QoS frame header.
See https://papers.mathyvanhoef.com/usenix2021.pdf section 3.2.
MAC address validation is added as an additional measure to prevent hostap
clients from sending A-MSDU subframes with a spoofed source address.
An earlier version of this patch was reviewed by Mathy Vanhoef, who spotted
a bug in my original attempt at preventing spoofed addresses.
ok mpi@
dtucker [Mon, 17 May 2021 07:22:45 +0000 (07:22 +0000)]
Regenerate moduli.
jsg [Mon, 17 May 2021 02:18:07 +0000 (02:18 +0000)]
drm/radeon: fix copy of uninitialized variable back to userspace
From Colin Ian King
8dbc2ccac5a65c5b57e3070e36a3dc97c7970d96 in mainline linux
jsg [Mon, 17 May 2021 00:17:26 +0000 (00:17 +0000)]
return early if work is cancelled before being scheduled
cheloha@ noticed that task_del(9) was being called with a NULL taskq
from inteldrm(4), which was not noticed as the function returns early
from testing a flag in the task. This situation occurs when work is
cancelled before it is scheduled.
ok kettenis@ cheloha@
schwarze [Sun, 16 May 2021 23:16:22 +0000 (23:16 +0000)]
Implement the layout specification "a" (left justify with 1em indentation)
in HTML output mode; before this patch, the indentation was missing.
Terminal output already supported the "a" specifier since 2010.
Issue reported and patch tested by Oliver dot Corff at email dot de.
afresh1 [Sun, 16 May 2021 22:48:05 +0000 (22:48 +0000)]
Make all unicode Private Use areas SWIDTH1
Noticed by naddy@ due to a commit in nano.
There's no current mechanism to allow people who put codepoints in
these private use areas to specify their width, we can however guess
that people who put things there are most likely adding SWIDTH1
glyphs and making that the default will be most likely to do what
they want. In addition, that's apparently what other systems do
already.
Much feedback and OK schwarze@
afresh1 [Sun, 16 May 2021 22:38:31 +0000 (22:38 +0000)]
Update en_US.UTF-8.src to Unicode 13.0
This is what ships with the perl 5.32.1
OK schwarze@
schwarze [Sun, 16 May 2021 22:23:57 +0000 (22:23 +0000)]
test font modifiers in the layout; related to tbl_html.c rev. 1.29
schwarze [Sun, 16 May 2021 18:08:37 +0000 (18:08 +0000)]
implement the tbl(7) layout modifiers "b" (bold) and "i" (italic)
in HTML output mode, similar to tbl_term.c, function tbl_word();
issue reported by Oliver dot Corff at email dot de
kettenis [Sun, 16 May 2021 17:41:30 +0000 (17:41 +0000)]
Drop PTE check in pmap_fault_fixup(). Since pmap_enter() doesn't
add PTE's for pages that haven't been accessed yet, the check would
skip the fixup on such pages and force us to go through uvm_fault()
just for the sake of MOD/REF bit emulation. Since we already check
the PTE descriptor, dropping the check should be safe. Doing so
gives us a nice 10% performance gain when building a kernel.
ok patrick@, drahn@
drahn [Sun, 16 May 2021 16:00:50 +0000 (16:00 +0000)]
Correct problem in riscv64 dtors execution load the function pointer
correctly and do not overwrite it in csu.
allows most ld.so regressions to pass
confirmed by jsg@, ok kettenis
jsing [Sun, 16 May 2021 15:49:01 +0000 (15:49 +0000)]
Absorb SSL_AEAD_CTX into struct tls12_record_protection.
The information contained in SSL_AEAD_CTX really belongs in the
tls12_record_protection struct. Absorb SSL_AEAD_CTX, using more appropriate
types in the process.
ok tb@
jsing [Sun, 16 May 2021 15:21:10 +0000 (15:21 +0000)]
Zero the tls12_record_protection struct instead of individual fields.
In tls12_record_protection_clear(), rather than zeroing or NULLing
individual fields once a pointer has been freed, zero the entire struct once
the pointers have been dealt with.
ok tb@
deraadt [Sun, 16 May 2021 15:12:37 +0000 (15:12 +0000)]
panic does not require a \n at the end. When one is provided, it looks wrong.
deraadt [Sun, 16 May 2021 15:11:08 +0000 (15:11 +0000)]
hint that the panicstr should not contain \n, by saying one is printed.
deraadt [Sun, 16 May 2021 15:10:19 +0000 (15:10 +0000)]
panic does not require a \n at the end. When one is provided, it looks wrong.
jsing [Sun, 16 May 2021 14:20:29 +0000 (14:20 +0000)]
Avoid including tls13_internal.h in tls13_record.h.
While the implementation needs tls13_internal.h, consumers of
tls13_record.h should not.
jsing [Sun, 16 May 2021 14:19:04 +0000 (14:19 +0000)]
Avoid pulling ssl_locl.h into self-contained code.
jsing [Sun, 16 May 2021 14:10:43 +0000 (14:10 +0000)]
Make local header inclusion consistent.
Consistently include local headers in the same location, using the same
grouping/sorting across all files.
jsing [Sun, 16 May 2021 13:56:30 +0000 (13:56 +0000)]
Move DTLS structs/definitions/prototypes to dtls_locl.h.
Now that the DTLS structs are opaque, add a dtls_locl.h header and move
internal-only structs from dtls1.h, along with prototypes from ssl_locl.h.
Only pull this header in where DTLS code actually exists.
ok inoguchi@ tb@
jsing [Sun, 16 May 2021 13:39:07 +0000 (13:39 +0000)]
Add a missing space.
mvs [Sun, 16 May 2021 13:09:39 +0000 (13:09 +0000)]
In route detach we delete `rop_timeout' while `rop' is still linked to
`rtp_list' so it could be re-added by concurrent thread. Also
timeout_del(9) doesn't wait timeout proc to be finished and
timeout_del_barrier(9) should be used for that.
So use timeout_del_barrier(9) instead of timeout_del(9) and moved it
just after refcnt_finalize(9). This fixes potential use-after-free
issue in route_detach().
ok mpi@
jsing [Sun, 16 May 2021 10:58:27 +0000 (10:58 +0000)]
Fix formatting of multi-line license comment per style(9).
jsing [Sun, 16 May 2021 10:55:17 +0000 (10:55 +0000)]
Avoid pulling ssl_sigalgs.h in via ssl_locl.h.
Forward declare struct sigalg in ssl_locl.h and avoid including
ssl_sigalgs.h. Explicitly include ssl_sigalgs.h where it is needed.
jsg [Sun, 16 May 2021 10:40:24 +0000 (10:40 +0000)]
remove unneeded includes
jsg [Sun, 16 May 2021 10:39:22 +0000 (10:39 +0000)]
remove unneeded includes
kettenis [Sun, 16 May 2021 10:38:53 +0000 (10:38 +0000)]
Sync memreg_add() implementation with arm64 and powerpc64.
claudio [Sun, 16 May 2021 09:09:11 +0000 (09:09 +0000)]
Capabilities are only supported on a session when both sides announce
that capability. Change capa_neg_calc() to check always both the
ann(ounce) and peer capa struct to figure out what was negotiated.
This change affects route refersh and graceful restart (where before
setting the capability in the config to 'no' would not fully disable
the feature).
Also ignore and warn about unexpected route refresh messages.
OK benno@
jsg [Sun, 16 May 2021 08:50:59 +0000 (08:50 +0000)]
correct prototype of acpi gpio intr_establish functions
ok kettenis@
jsing [Sun, 16 May 2021 08:32:49 +0000 (08:32 +0000)]
Remove unnecessary includes from the bytestring APIs.
The bytestring APIs are self contained, hence including openssl headers
here is unnecessary.
jsing [Sun, 16 May 2021 08:24:21 +0000 (08:24 +0000)]
Explicitly include <openssl/opensslconf.h> in files using OPENSSL_NO_*
Where a file references to OPENSSL_NO_* conditions, ensure that we
explicitly include <openssl/opensslconf.h> before any references, rather
than relying on another header to pull this in.
paco [Sun, 16 May 2021 06:46:57 +0000 (06:46 +0000)]
mention apmd(8) in afterboot(8)
input and ok jmc@
jsg [Sun, 16 May 2021 06:20:28 +0000 (06:20 +0000)]
b_saveaddr has a type of void * use NULL not 0
jsg [Sun, 16 May 2021 04:51:00 +0000 (04:51 +0000)]
ansi
jsg [Sun, 16 May 2021 04:45:58 +0000 (04:45 +0000)]
deregister
jsg [Sun, 16 May 2021 04:34:47 +0000 (04:34 +0000)]
ansi
jsg [Sun, 16 May 2021 04:33:05 +0000 (04:33 +0000)]
remove prototype for cpu_adjust_tsc_freq()
a matching function was never committed
jsg [Sun, 16 May 2021 03:39:27 +0000 (03:39 +0000)]
ansi
jsg [Sun, 16 May 2021 03:30:33 +0000 (03:30 +0000)]
ansi
jsg [Sun, 16 May 2021 03:29:35 +0000 (03:29 +0000)]
ansi
deraadt [Sun, 16 May 2021 03:23:48 +0000 (03:23 +0000)]
add riscv asm for these two security-feature checking regress tests
with drahn
jsg [Sun, 16 May 2021 02:01:33 +0000 (02:01 +0000)]
remove unused pre efiboot targets
krw [Sat, 15 May 2021 22:06:43 +0000 (22:06 +0000)]
Nuke some Capt. Obvious and soon to be obsolete comments in
GPT_write().
Add local variables prigh and prigp, mirroring altgh and altp, to
GPT_write(), eliminating some magic numbers to make clear the
relationship between the various primary and alternative GPT lba
fields.
No intentional functional change.
kettenis [Sat, 15 May 2021 20:51:12 +0000 (20:51 +0000)]
Add back -mno-relax for now. Retain the -target option but put it on
a line of its own to improve diffability with other architectures.
ok drahn@
deraadt [Sat, 15 May 2021 20:20:35 +0000 (20:20 +0000)]
in kdata_abort, error must be initialized to 0 (like arm64)
spotted by drahn
deraadt [Sat, 15 May 2021 20:14:05 +0000 (20:14 +0000)]
In all the copyin family functions, must compare end-address against
VM_MAXUSER_ADDRESS with bgtu, signed comparison is incorrect. Now passes
regress/sys/copy
ok drahn kettenis
deraadt [Sat, 15 May 2021 20:12:24 +0000 (20:12 +0000)]
Reorganize kernel & user fault handling into seperate functions like on
other architectures. During refactoring, found missing calls to important
functions and incorrect parameter passing...
ok kettenis drahn
deraadt [Sat, 15 May 2021 20:05:05 +0000 (20:05 +0000)]
copyinout.S is not used
krw [Sat, 15 May 2021 19:44:15 +0000 (19:44 +0000)]
Keep internal representation of DOSPTYP_EFI partition sizes correct.
Translate to/from UINT32_MAX as required when translating between
on-disk MBR format and internal format.
No intentional functional change.
schwarze [Sat, 15 May 2021 17:16:38 +0000 (17:16 +0000)]
When looking for the last layout row used, we need to look at the layout
row used for the previous data line containing data, not at the previous
data line outright, which might be a horizontal ruler. If it is, do not
restart from the first layout row but still proceed to the next data row,
which may have been just read from T&.
Bug originally reported by Oliver dot Corff at email dot de
on groff at gnu dot org:
https://lists.gnu.org/archive/html/groff/2021-03/msg00003.html
and forwarded to me by bentley@.
Patch OK'ed by bentley@ back in April.
krw [Sat, 15 May 2021 15:59:15 +0000 (15:59 +0000)]
Add missing MBR_protective_mbr() check when writing edited GPT.
No intentional functional change.
krw [Sat, 15 May 2021 15:20:17 +0000 (15:20 +0000)]
Shuffle USER_print_disk() code into a more rational, clearer
structure.
No intentional functional change.
florian [Sat, 15 May 2021 15:08:31 +0000 (15:08 +0000)]
Remove outdated comment. We got all httpd headers from the fcgi server
at this point.
kettenis [Sat, 15 May 2021 14:20:11 +0000 (14:20 +0000)]
Remove OUTPUT_FORMAT and OUTPUT_ARCH from linker script. These are
no-ops for ld.lld.
ok deraadt@
deraadt [Sat, 15 May 2021 14:05:35 +0000 (14:05 +0000)]
pmap_fault_fixup() does not need "int user"
ok kettenis
deraadt [Sat, 15 May 2021 13:56:56 +0000 (13:56 +0000)]
improve comment regarding child_return() clearing errno-indicating flag
jan [Sat, 15 May 2021 13:37:43 +0000 (13:37 +0000)]
Add pledge for ftpd's user processes.
OK tobhe@
kettenis [Sat, 15 May 2021 11:30:27 +0000 (11:30 +0000)]
Use intr_enable()/int_disable()/intr_restore() instead of
enable_interrupts()/disable_interrupts()/restore_interrupts() and remove
the latter interfaces.
While there move a few malloc(9) and free(9) calls to run with interrupts
enabled.
ok patrick@
yasuoka [Sat, 15 May 2021 08:07:20 +0000 (08:07 +0000)]
Fix IPsec NAT-T to work with pipex(4). Introduce a new packet tag
PACKET_TAG_IPSEC_FLOWINFO to specify the IPsec flow.
ok mvs
drahn [Sat, 15 May 2021 00:04:32 +0000 (00:04 +0000)]
Load the fault handler into the correct register.
Having the onfault dance in a macro makes this almost unreadable.
Initial failure found by deraadt, cause finally found.
krw [Sat, 15 May 2021 00:01:21 +0000 (00:01 +0000)]
Shuffle GPT_read() code into a nice switch{}, eliminating
unnecesary read of primary GPT when only the secondary GPT
is requested.
No intentional functional change.
krw [Fri, 14 May 2021 21:11:15 +0000 (21:11 +0000)]
Whitespace tweaks and a couple of stray u_int* in gpt_chk_mbr().
No intentional functional change.
tb [Fri, 14 May 2021 18:03:42 +0000 (18:03 +0000)]
whitespace/KNF
cheloha [Fri, 14 May 2021 16:44:38 +0000 (16:44 +0000)]
amd64: specialreg.h: add MSR_TSC_ADJUST
Where available, the IA32_TSC_ADJUST MSR may be used to make race-free
relative adjustments to a logical CPU's TSC. The value in the
register is interpreted as a signed 64-bit offset and added to the
"real" value of the TSC whenever the TSC MSR is read. That is:
RDTSC = REAL_TSC + TSC_ADJUST
and:
RDMSR TSC = REAL_TSC + TSC_ADJUST
For example, if REAL_TSC=1 and TSC_ADJUST=1, then RDTSC would yield 2.
Or if REAL_TSC=10 and TSC_ADJUST=-5, then RDTSC would yield 5.
Writing TSC_ADJUST does not change the "real" underlying value of the
TSC. Said another way setting TSC_ADJUST to zero will always undo any
prior adjustment. This property may be useful in fixing desynchronized
TSCs. In particular, buggy firmware may erroneously desynchronize a
normally synchronized TSC. If this happens, in theory we can do:
wrmsr(MSR_TSC_ADJUST, 0);
and fix any desynchronization during boot/resume with no fuss.
ok mlarkin@
krw [Fri, 14 May 2021 15:31:01 +0000 (15:31 +0000)]
Tweak the two copies of gpt_chk_mbr() to return the index of the MBR
0xEE (DOSPTYP_EFI) partition, or -1 no usable such partition is found.
Adopt a consistent idiom to capture the index for future use.
Clean up the gpt_chk_mbr() logic to make it clearer what constraints
are being applied when looking for the DOSTYP_EFI partition.
No intentional functional change.
kn [Fri, 14 May 2021 13:10:20 +0000 (13:10 +0000)]
Properly refer to ioctl(2)
From Caspar Schutijser, thanks.
inoguchi [Fri, 14 May 2021 10:50:55 +0000 (10:50 +0000)]
Improve libcrypto obj_xref.h generator
Modify objxref.pl to output $OpenBSD$ header and
__BEGIN_HIDDEN_DECLS / __END_HIDDEN_DECLS .
ok and comment from tb@
jsg [Fri, 14 May 2021 08:10:39 +0000 (08:10 +0000)]
remove comment describing GENERIC
jsg [Fri, 14 May 2021 06:55:19 +0000 (06:55 +0000)]
add dwge(4) to RAMDISK as well
jsg [Fri, 14 May 2021 06:48:52 +0000 (06:48 +0000)]
remove uneeded includes
jsg [Fri, 14 May 2021 05:21:00 +0000 (05:21 +0000)]
move some files to match other archs
ok deraadt@ drahn@
djm [Fri, 14 May 2021 05:20:32 +0000 (05:20 +0000)]
fix previous: test saved no_shell_flag, not the one that just got
clobbered
drahn [Fri, 14 May 2021 03:49:18 +0000 (03:49 +0000)]
Riscv64 sets. Initial attempt.
djm [Fri, 14 May 2021 03:09:48 +0000 (03:09 +0000)]
Fix ssh started with ControlPersist incorrectly executing a shell
when the -N (no shell) option was specified. bz3290 reported by
Richard Schwab; patch from markus@ ok me
drahn [Fri, 14 May 2021 03:01:24 +0000 (03:01 +0000)]
Enable riscv64 native kernel builds.
remove extra targets
drahn [Fri, 14 May 2021 02:29:00 +0000 (02:29 +0000)]
On riscv64, dynamically linked clang binary fails with:
libc++abi: Pure virtual function called!
By statically linking clang (and *-tblgen) this problem is worked around
at least for now.
drahn [Fri, 14 May 2021 02:21:34 +0000 (02:21 +0000)]
Fix bootloader name and riscv64 doesn't have bsd.mp yet.
drahn [Fri, 14 May 2021 01:18:52 +0000 (01:18 +0000)]
Adjust ramdisk generation for self hosting, remove cross bits.
drahn [Fri, 14 May 2021 01:15:54 +0000 (01:15 +0000)]
Initial enablment of EMULTLS on RiscV
Uncertain if this is 100% correct, however this enables self hosting
using clang.
drahn [Fri, 14 May 2021 00:57:03 +0000 (00:57 +0000)]
Fix regression for _setjmp, fucntion does not use stack and adjusting
it causes restored stack to be incorrect.
kettenis [Thu, 13 May 2021 22:42:14 +0000 (22:42 +0000)]
Improve mereg_add() like I did on arm64.
mvs [Thu, 13 May 2021 19:43:11 +0000 (19:43 +0000)]
Do `so_rcv' cleanup with sblock() held.
solock() should be taken before sblock(). soreceive() grabs solock() and
then locks `so_rcv'. But later it releases solock() before call uimove(9).
So concurrent thread which performs soshutdown() could break sorecive()
loop. But `so_rcv' is still locked by sblock() so this soshutdown()
thread will sleep in sorflush() at sblock() call. soshutdown() thread
doesn't release solock() after sblock() call so it has no matter where to
release `so_rcv' - is will be locked until the solock() release.
That's why this strange looking code works fine. This sbunlock() movement
just after `so_rcv' cleanup affects nothing but makes the code
consistent and clean to understand.
ok mpi@