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@
kettenis [Thu, 13 May 2021 19:26:25 +0000 (19:26 +0000)]
Use intr_enable()/int_disable()/intr_restore() instead of
enable_interrupts()/disable_interrupts()/restore_interrupts() and remove
the latter interfaces.
ok mlarkin@, drahn@
mvs [Thu, 13 May 2021 18:06:54 +0000 (18:06 +0000)]
Use NULL instead of 0 for mbuf(9) pointers.
ok millert@
mvs [Thu, 13 May 2021 17:31:59 +0000 (17:31 +0000)]
Assign NULL instead of 0 to `control' within sendit(). It's mbuf(9)
pointer.
ok deraadt@
mvs [Thu, 13 May 2021 17:02:31 +0000 (17:02 +0000)]
Move ktrfds() below fdpunlock(). This fixes lock order issue between
vn_lock(9) and fdplock().
Reported-by: syzbot+2300a1bedc425f6f851e@syzkaller.appspotmail.com
ok visa@
kettenis [Thu, 13 May 2021 16:08:16 +0000 (16:08 +0000)]
Make memreg_add() a bit smarter and have it merge adjacent regions.
This should reduce the number of physical memory segments that we pass
to uvm reducing the chance that we run out of physical memory segments
and should make physical memory allocation a bit more efficient.
ok patrick@
tobhe [Thu, 13 May 2021 15:20:48 +0000 (15:20 +0000)]
Refactor iked process shutdown and cleanup. Remember configured
addresses and routes in iked_vroute_sc to not depend on ikev2
process for cleanup.
This makes sure that all flows, routes and addresses are deleted
no matter which process is killed first.
ok patrick@
tb [Thu, 13 May 2021 14:28:03 +0000 (14:28 +0000)]
Use field independent versions of {get,set}_coordinates()
ok tobhe
tb [Thu, 13 May 2021 14:01:35 +0000 (14:01 +0000)]
Use field independent version of {get,set}_affine_coordinates.
ok tobhe
florian [Thu, 13 May 2021 11:22:15 +0000 (11:22 +0000)]
RFC 4861 4.1 allows router solicitations from the unspecified address
(::). A short survey suggests that some systems respond with a
multicast router advertisement and other don't.
Andrew Forgue pointed out a usecase for this, booting a UEFI system
over http in an IPv6 network only. ("IPv6 support for UEFI IPv6
booting" on bugs@ a long time ago)
There is also no downside in allowing this, any host on the layer 2
network can solicit a router advertisement.
OK phessler
kettenis [Thu, 13 May 2021 09:32:00 +0000 (09:32 +0000)]
Run handlers with interrupts enabled.
ok jsg@
jsg [Thu, 13 May 2021 08:44:18 +0000 (08:44 +0000)]
change sig_atomic_t from long to int matching all the other archs
ok kettenis@
tb [Thu, 13 May 2021 07:10:57 +0000 (07:10 +0000)]
acme-client: use EC_POINT_{get,set}_affine_cooordinates()
The versions with _GFp() suffix only exist for historical reasons.
Now that we have EC_POINT_{get,set}_affine_coordinates(), we should
stop using the old ones as they provide no benefit.
ok florian
kettenis [Thu, 13 May 2021 06:45:23 +0000 (06:45 +0000)]
No need to disable interrupts before returning to userland.
The AST processing code will take care of doing that for us.
ok jsg@
kettenis [Thu, 13 May 2021 06:44:11 +0000 (06:44 +0000)]
When doing AST processing:
1) block interrupts, then check for ASTs
2) if no ASTs, return with interrupts blocked, so they can be re-enabled
ATOMICALLY in the return to userspace
3) if an AST happened, then re-enable interrupts, call ast(), then goto 1
ok jsg@
tb [Thu, 13 May 2021 06:00:53 +0000 (06:00 +0000)]
Add missing .Pp in HISTORY section.
tb [Thu, 13 May 2021 05:52:28 +0000 (05:52 +0000)]
Add missing .Pp
krw [Thu, 13 May 2021 02:22:33 +0000 (02:22 +0000)]
Whitespace fix for unintentional unindenting event in r1.260.
Reported by Ashton Fagg via tech@. Thanks!
yasuoka [Wed, 12 May 2021 23:17:30 +0000 (23:17 +0000)]
Remove about PACKET_TAG_PIPEX, it was replaced by ph_cookie.
deraadt [Wed, 12 May 2021 23:08:19 +0000 (23:08 +0000)]
print a newline after each instruction
ok kettenis
dv [Wed, 12 May 2021 20:13:00 +0000 (20:13 +0000)]
vmctl(8): remove unveil from disk image creation routines
James Cook reported an issue creating images from qcow2 disks that
contained base images. Initial approach suggested was to replace the
use of realpath(3), but since this is common code used in vmd(8) the
better option is to just remove the use of unveil(1) in vmctl. (It was
added very early in vmctl's development before support for disk
conversion was added.)
This does not change existing unveil usage in vmctl for things like the
control socket or the serial console. There's no change to vmd either.
Discussed with and OK from mlarkin@