openbsd
2 years agoRemove some stale comments.
tb [Thu, 3 Feb 2022 17:42:54 +0000 (17:42 +0000)]
Remove some stale comments.

ok jsing

2 years agoTime for rpki-client 7.6
claudio [Thu, 3 Feb 2022 17:26:17 +0000 (17:26 +0000)]
Time for rpki-client 7.6
OK benno@

2 years agoOn i386 run-regress-ungc fails with EINVAL. It passes uninitialized
bluhm [Thu, 3 Feb 2022 17:22:01 +0000 (17:22 +0000)]
On i386 run-regress-ungc fails with EINVAL.  It passes uninitialized
data from struct msghdr to system call sendmsg(2).  Fix the controllen
and make error messages unique.
OK mvs@

2 years agoDelete unused/obsolete M_* type values.
guenther [Thu, 3 Feb 2022 17:18:22 +0000 (17:18 +0000)]
Delete unused/obsolete M_* type values.

ok miod@ mpi@

2 years agoUse UVM_KMF_TRYLOCK for consistency
kn [Thu, 3 Feb 2022 17:06:09 +0000 (17:06 +0000)]
Use UVM_KMF_TRYLOCK for consistency

No object change.
OK millert

2 years agoCleanup/simplify ssl_cert_type()
jsing [Thu, 3 Feb 2022 16:33:12 +0000 (16:33 +0000)]
Cleanup/simplify ssl_cert_type()

Remove the X509 argument as it is unused - this was passed so that
ssl_cert_type() can get the public key from the X509 object if the
EVP_PKEY argument is NULL, however this is never the case.

ok tb@

2 years agofdisk(8): Make -A preserve BIOS boot partition
visa [Thu, 3 Feb 2022 13:24:04 +0000 (13:24 +0000)]
fdisk(8): Make -A preserve BIOS boot partition

On PolarFire SoC, the HSS firmware loads HSS payload from BIOS boot
partition. Typically the payload carries second-stage low-level boot
code, such as U-Boot. If the payload is missing, the SoC is not able
to boot normally. Hence automatic disk formatting should not delete
the partition.

OK krw@

2 years agoAdjust size given to resize-pane for pane status line, GitHub issue
nicm [Thu, 3 Feb 2022 11:06:11 +0000 (11:06 +0000)]
Adjust size given to resize-pane for pane status line, GitHub issue
3050.

2 years agoUse installboot(8) in install.md of riscv64.
visa [Thu, 3 Feb 2022 10:27:33 +0000 (10:27 +0000)]
Use installboot(8) in install.md of riscv64.

OK kettenis@ deraadt@

2 years agoinstallboot(8): Adjustments for EFI platforms
visa [Thu, 3 Feb 2022 10:25:14 +0000 (10:25 +0000)]
installboot(8): Adjustments for EFI platforms

Reduce #ifdef'ing within the control logic to make it clearer that there
are no essential differences in behaviour between the platforms.

Make installboot(8) write startup.nsh to enable simpler and more consistent
code in install.md.

Input and OK kettenis@ deraadt@

2 years agoRename armv7_installboot.c to efi_installboot.c.
visa [Thu, 3 Feb 2022 10:21:13 +0000 (10:21 +0000)]
Rename armv7_installboot.c to efi_installboot.c.

The code is common to EFI platforms, not specific to armv7.

Suggested by kettenis@

2 years agoUse format_draw for command prompt prefix to allow styles, GitHub issue
nicm [Thu, 3 Feb 2022 10:07:11 +0000 (10:07 +0000)]
Use format_draw for command prompt prefix to allow styles, GitHub issue
3054.

2 years agoUpdate focus when active pane changes after pane destroyed.
nicm [Thu, 3 Feb 2022 07:38:17 +0000 (07:38 +0000)]
Update focus when active pane changes after pane destroyed.

2 years agoAdd a key in copy mode to toggle position indicator.
nicm [Thu, 3 Feb 2022 07:26:43 +0000 (07:26 +0000)]
Add a key in copy mode to toggle position indicator.

2 years agointeldrm now requires ttm
jsg [Thu, 3 Feb 2022 04:45:01 +0000 (04:45 +0000)]
inteldrm now requires ttm

2 years agosync list of amdgpu files built with -msse -msse2 with linux 5.15.y
jsg [Thu, 3 Feb 2022 02:39:45 +0000 (02:39 +0000)]
sync list of amdgpu files built with -msse -msse2 with linux 5.15.y

2 years agoAdd apldma(4), a driver for the DMA controller found on Apple SoCs.
kettenis [Wed, 2 Feb 2022 22:55:57 +0000 (22:55 +0000)]
Add apldma(4), a driver for the DMA controller found on Apple SoCs.
This driver implements an interface for using DMA for audio output.

ok ratchov@

2 years agoGet the pci bus number from the bus-range property when available, rather
miod [Wed, 2 Feb 2022 17:11:36 +0000 (17:11 +0000)]
Get the pci bus number from the bus-range property when available, rather
than assuming it will always be zero.

ok kettenis@

2 years agoWhen a RRDP fetch failed not only clear the filesystem but also flush
claudio [Wed, 2 Feb 2022 15:13:00 +0000 (15:13 +0000)]
When a RRDP fetch failed not only clear the filesystem but also flush
the to delete list stored this RRDP node.
Noticed by Job on console.rpki-client.org with the help of idnic.net
OK tb@

2 years agoAdd missing mode argument to open(2) with O_CREAT.
visa [Wed, 2 Feb 2022 13:22:10 +0000 (13:22 +0000)]
Add missing mode argument to open(2) with O_CREAT.

2 years agotypo
tb [Wed, 2 Feb 2022 12:10:40 +0000 (12:10 +0000)]
typo

2 years agoacpi_addtask() calls malloc() w/ M_NOWAIT (because some calls come from
deraadt [Wed, 2 Feb 2022 04:05:16 +0000 (04:05 +0000)]
acpi_addtask() calls malloc() w/ M_NOWAIT (because some calls come from
interrupt context), this however means occasional resource shortage will
result in callbacks registration failing, and unknown consequences for
the task-submitting caller.
Changing this to use pools with a low water mark, decreases the odds
of that problem occuring.
ok kettenis

2 years agounifdef __OpenBSD__
jsg [Wed, 2 Feb 2022 03:55:29 +0000 (03:55 +0000)]
unifdef __OpenBSD__

2 years agounifdef __NetBSD_Version__
jsg [Wed, 2 Feb 2022 03:48:48 +0000 (03:48 +0000)]
unifdef __NetBSD_Version__

2 years agodrm/amd/display: Fix FP start/end for dcn30_internal_validate_bw.
jsg [Wed, 2 Feb 2022 02:56:36 +0000 (02:56 +0000)]
drm/amd/display: Fix FP start/end for dcn30_internal_validate_bw.

From Bas Nieuwenhuizen
548f20b39ec91fdd97194a84a0d9b2f68715762a in linux 5.15.y/5.15.19
72a8d87b87270bff0c0b2fed4d59c48d0dd840d7 in mainline linux

2 years agodrm/atomic: Add the crtc to affected crtc only if uapi.enable = true
jsg [Wed, 2 Feb 2022 02:51:53 +0000 (02:51 +0000)]
drm/atomic: Add the crtc to affected crtc only if uapi.enable = true

From Manasi Navare
73740f948252e424a01465155d8737bceae23653 in linux 5.15.y/5.15.19
5ec1cebd59300ddd26dbaa96c17c508764eef911 in mainline linux

2 years agotest 'ssh-keygen -Y find-principals' with wildcard principals;
djm [Tue, 1 Feb 2022 23:37:15 +0000 (23:37 +0000)]
test 'ssh-keygen -Y find-principals' with wildcard principals;
from Fabian Stelzer

2 years agoallow 'ssh-keygen -Y find-principals' to match wildcard principals
djm [Tue, 1 Feb 2022 23:34:47 +0000 (23:34 +0000)]
allow 'ssh-keygen -Y find-principals' to match wildcard principals
in allowed_signers files; from Fabian Stelzer

2 years agomark const string array contents const too, i.e.
djm [Tue, 1 Feb 2022 23:32:51 +0000 (23:32 +0000)]
mark const string array contents const too, i.e.
static const char *array => static const char * const array
from Mike Frysinger

2 years agocall intel_init_stolen_res() lost in drm 5.7 update
jsg [Tue, 1 Feb 2022 23:29:07 +0000 (23:29 +0000)]
call intel_init_stolen_res() lost in drm 5.7 update

2 years agoget stolen memory base and size for gen 12
jsg [Tue, 1 Feb 2022 23:26:27 +0000 (23:26 +0000)]
get stolen memory base and size for gen 12

2 years agobetter match legacy scp behaviour: show un-expanded paths in error
djm [Tue, 1 Feb 2022 23:11:11 +0000 (23:11 +0000)]
better match legacy scp behaviour: show un-expanded paths in error
messages. Spotted by and ok tb@

2 years agoAn old hack skips use of memory regions < 1MB size, because some machines
deraadt [Tue, 1 Feb 2022 20:29:53 +0000 (20:29 +0000)]
An old hack skips use of memory regions < 1MB size, because some machines
put BIOS objects into there, and rely upon them.  We are shocked, SHOCKED,
to find a machine that does so in a large object (Supermicro 5019D-FTN4).
So now we need to ignore memory regions < 32MB in size.  If we put this
memory into use, the zerothread will soon clear it, and on this particular
case the machine resets because something in AML or SMI gets unhappy.
Other machines with similar problems may exhibit other misbehaviours, so
this could fix heisenbugs.  Sadly I expect products to get worse.
ok kettenis, miod

2 years agoMake sure we always pass a page-aligned address to pmap_grow_map().
kettenis [Tue, 1 Feb 2022 19:57:28 +0000 (19:57 +0000)]
Make sure we always pass a page-aligned address to pmap_grow_map().
Fixes an issue uncovered by the recent change to enlarge kva space where
an unaligned address was passed resulting in memset() writing past the
end of the newly allocated page.

ok miod@

2 years agoA menu must be shown on a client, so always give the client when adding
nicm [Tue, 1 Feb 2022 18:12:20 +0000 (18:12 +0000)]
A menu must be shown on a client, so always give the client when adding
the items. Also fix mode menus.

2 years agoGPE_DIRECT is calling the AML parser from interrupt context, which is
deraadt [Tue, 1 Feb 2022 18:09:00 +0000 (18:09 +0000)]
GPE_DIRECT is calling the AML parser from interrupt context, which is
not permitted.  Luckily nothing is using GPE_DIRECT anymore, so this code
can be deleted.
ok kettenis

2 years agoUse TLS_PADDING_* defines.
jsing [Tue, 1 Feb 2022 17:19:16 +0000 (17:19 +0000)]
Use TLS_PADDING_* defines.

2 years agoProvide our own signature padding defines.
jsing [Tue, 1 Feb 2022 17:18:38 +0000 (17:18 +0000)]
Provide our own signature padding defines.

Rather than leaking libcrypto defines through the tls_sign_cb and
tls_signer_sign() interfaces, provide and use our own TLS_PADDING_*
defines.

ok inoguchi@ tb@

2 years agoRevise/simplify for signer interface change.
jsing [Tue, 1 Feb 2022 17:13:52 +0000 (17:13 +0000)]
Revise/simplify for signer interface change.

2 years agoRevise signer callback interface.
jsing [Tue, 1 Feb 2022 17:13:10 +0000 (17:13 +0000)]
Revise signer callback interface.

The current design of tls_sign_cb provides a pointer to a buffer where the
signature needs to be copied, however it fails to provide a length which
could result in buffer overwrites. Furthermore, tls_signer_sign() is
designed such that it allocates and returns ownership to the caller.

Revise tls_sign_cb so that the called function is expected to allocate a
buffer, returning ownership of the buffer (along with its length) to the
caller of the callback. This makes it far easier (and safer) to implement
a tls_sign_cb callback, plus tls_signer_sign can be directly plugged in
(with an appropriate cast).

While here, rename and reorder some arguments - while we will normally
sign a digest, there is no requirement for this to be the case hence use
'input' and 'input_len'. Move padding (an input) before the outputs and
add some additional bounds/return value checks.

This is technically an API/ABI break that would need a libtls major bump,
however since nothing is using the signer interface (outside of regress),
we'll ride the original minor bump.

With input from tb@

ok inoguchi@ tb@

2 years agopkg_delete(1): print usage when args aren't supplied.
dv [Tue, 1 Feb 2022 16:54:09 +0000 (16:54 +0000)]
pkg_delete(1): print usage when args aren't supplied.

OK espie@

2 years agoWhen a struct ipovly needs to be computed and checksummed in in4_cksum(),
miod [Tue, 1 Feb 2022 15:30:10 +0000 (15:30 +0000)]
When a struct ipovly needs to be computed and checksummed in in4_cksum(),
do not bother operating on its first 8 bytes, which will always be zero.

ok visa@

2 years agoAdd option to show arrows for active pane indicator, GitHub issue 3022
nicm [Tue, 1 Feb 2022 14:46:41 +0000 (14:46 +0000)]
Add option to show arrows for active pane indicator, GitHub issue 3022
from Marcel Partap.

2 years agoMention that if-shell and #() use /bin/sh.
nicm [Tue, 1 Feb 2022 12:05:42 +0000 (12:05 +0000)]
Mention that if-shell and #() use /bin/sh.

2 years agoDo not overflow width when not enough space.
nicm [Tue, 1 Feb 2022 11:52:08 +0000 (11:52 +0000)]
Do not overflow width when not enough space.

2 years agoAttempt to guarantee that on copy-on-write faulting, the new copy
guenther [Tue, 1 Feb 2022 08:38:53 +0000 (08:38 +0000)]
Attempt to guarantee that on copy-on-write faulting, the new copy
can't be written to while any thread can see the original version
of the page via a not-yet-flushed stale TLB entry: pmaps can indicate
they do this correctly by defining __HAVE_PMAP_MPSAFE_ENTER_COW;
uvm will force the initial CoW fault to be read-only otherwise.

Set that on amd64 and fix the problem case in pmap_enter() by putting
a read-only mapping in place, shooting the TLB entry, then fixing
it to the final read-write entry so this thread can continue without
re-faulting.

reported by jsing@ from https://github.com/golang/go/issues/34988
assisted by discussion in https://reviews.freebsd.org/D14347
tweaks from jsing@ and kettenis@

ok jsing@ mpi@ kettenis@

2 years agoRemove explicit kill of privsep preauth child's PID in SIGALRM handler.
dtucker [Tue, 1 Feb 2022 07:57:32 +0000 (07:57 +0000)]
Remove explicit kill of privsep preauth child's PID in SIGALRM handler.
It's no longer needed since the child will get terminated by the SIGTERM
to the process group that cleans up any auth helpers, it simplifies
the signal handler and removes the risk of a race when updating the PID.
Based on analysis by HerrSpace in github PR#289, ok djm@

2 years agouse unsigned long for length argument of linux copyin/copyout equivalents
jsg [Tue, 1 Feb 2022 04:09:14 +0000 (04:09 +0000)]
use unsigned long for length argument of linux copyin/copyout equivalents

2 years agoIn isakmpd's pf_key_v2_enable_sa(), check if proto is NULL and if so,
sthen [Mon, 31 Jan 2022 23:51:15 +0000 (23:51 +0000)]
In isakmpd's pf_key_v2_enable_sa(), check if proto is NULL and if so,
log a warning rather than attempting to dereference it. Check suggested by
millert@, ok "your fix shouldn't hurt" mpi@

This isn't fixing the root cause but I don't have a better idea and I'm
hitting problems on several systems as I upgrade them, and I think in this
case logging rather than dumping core is more helpful.

Without this, in recent OpenBSD versions (I have seen it in since at least
the snapshot from June 14 2021) I am often seeing isakmpd crashes after
SAs come in shortly after isakmpd starts with my usual flags, although
they don't seem to occur if I raise logs to heavy debug levels (-DA=90).

With this, those connections will fail but isakmpd will stay running and
after usually one retry things will be ok.

Usually, perhaps always, seen associated with "responder_recv_HASH_SA_NONCE:
KEY_EXCH payload without a group desc. attribute" logged previously.
Pcap written by isakmpd -L shows a normal-looking proposal though, with
proto/ids/group description set, yet printing *isa at the point that message
is logged shows zeros in sport/dport/group_desc/etc.

(I can give more info and/or test if someone has a better idea!)

2 years agotcpdump: fix -Wunused-but-set-variable warning
naddy [Mon, 31 Jan 2022 19:08:29 +0000 (19:08 +0000)]
tcpdump: fix -Wunused-but-set-variable warning

All "infile" handling was moved into priv_exec() when tcpdump was
privilege separated.  The options are scanned both in priv_exec()
and in main(), so the empty case needs to remain in the latter.

ok deraadt@

2 years agoadd kstat_remove to NAME and CONTEXT; ok dlg
jmc [Mon, 31 Jan 2022 12:07:12 +0000 (12:07 +0000)]
add kstat_remove to NAME and CONTEXT; ok dlg

2 years agoenable the movntdqa version of drm_memcpy_from_wc()
jsg [Mon, 31 Jan 2022 08:47:03 +0000 (08:47 +0000)]
enable the movntdqa version of drm_memcpy_from_wc()
only caller is ttm_move_memcpy()
inteldrm has equivalent bits in i915_memcpy.c

2 years agodefine CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND to reduce diff to linux
jsg [Mon, 31 Jan 2022 06:00:48 +0000 (06:00 +0000)]
define CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND to reduce diff to linux

2 years agoNothing depends on archdep.h pulling in other #includes anymore,
guenther [Mon, 31 Jan 2022 05:44:13 +0000 (05:44 +0000)]
Nothing depends on archdep.h pulling in other #includes anymore,
so delete the #includes and hide the RELOC_* functions that are
only used by lib/csu behind "#ifdef RCRT0"

matches the others and it's hard to see how it will fail

2 years agoInline RELOC_* into boot_md.c and simplify the code based on what
guenther [Mon, 31 Jan 2022 05:43:22 +0000 (05:43 +0000)]
Inline RELOC_* into boot_md.c and simplify the code based on what
we can verify at build time.  Track dt_pltgot as an Elf_Addr instead
of an Elf_Addr* to eliminat casts on both setting and using.  Set
RELATIVE_RELOC so the ld.so Makefile can verify that it has just
the relocation types we expect.

Nothing depends on archdep.h pulling in other #includes anymore, so delete
the #includes and hide the RELOC_* functions that are only used by lib/csu
behind "#ifdef RCRT0"

Tested with full build.

2 years ago+kstat_destroy
dlg [Mon, 31 Jan 2022 05:29:22 +0000 (05:29 +0000)]
+kstat_destroy

2 years agoadd kstat_remove so you can tear the struct apart before kstat_destroy
dlg [Mon, 31 Jan 2022 05:09:17 +0000 (05:09 +0000)]
add kstat_remove so you can tear the struct apart before kstat_destroy

2 years agorevert fb size workaround from amdgpu_gmc.c rev 1.3
jsg [Mon, 31 Jan 2022 05:04:23 +0000 (05:04 +0000)]
revert fb size workaround from amdgpu_gmc.c rev 1.3

djm@ confirms the recently committed 5.5.18 change
'drm/amdgpu: Use correct VIEWPORT_DIMENSION for DCN2'
to use the right register for GMC9 DCN2 (RENOIR, GREEN_SARDINE) is
enough on t14 gen 2 amd.

2 years agounstub append_oa_sample()
jsg [Mon, 31 Jan 2022 02:21:36 +0000 (02:21 +0000)]
unstub append_oa_sample()

2 years agoUpdate libexpat to 2.4.4. This fixes CVE-2022-23852 and CVE-2022-23990.
bluhm [Mon, 31 Jan 2022 00:21:53 +0000 (00:21 +0000)]
Update libexpat to 2.4.4.  This fixes CVE-2022-23852 and CVE-2022-23990.
Relevant for OpenBSD are security fixes #550 #551 and other changes
#553 (missing in change log).  No library bump necessary.
OK millert@

2 years agounstub intel_gt_get_awake_time()
jsg [Sun, 30 Jan 2022 23:19:26 +0000 (23:19 +0000)]
unstub intel_gt_get_awake_time()

2 years agopush stub down in __await_execution()
jsg [Sun, 30 Jan 2022 23:18:20 +0000 (23:18 +0000)]
push stub down in __await_execution()

functions in this file want to reach into the implementation of
irq work which for us isn't a llist but rather a task

2 years agoAdd aplnco(4), a driver for the Numerically-controlled oscillator (NCO)
kettenis [Sun, 30 Jan 2022 22:24:41 +0000 (22:24 +0000)]
Add aplnco(4), a driver for the Numerically-controlled oscillator (NCO)
clock that drives the audio clocks on Apple silicon.

ok patrick@

2 years agoAdd tascodec(4), a driver for the TI TAS2770/TAS5770 digital audio
kettenis [Sun, 30 Jan 2022 21:40:50 +0000 (21:40 +0000)]
Add tascodec(4), a driver for the TI TAS2770/TAS5770 digital audio
amplifier codec found on Apple M1 Macs.

ok patrick@, ratchov@

2 years agoAdd test coverage for tls_signer when used with a TLS server.
jsing [Sun, 30 Jan 2022 18:44:45 +0000 (18:44 +0000)]
Add test coverage for tls_signer when used with a TLS server.

In this configuration the tls_signer is provided with the server
certificate and private key, while the TLS server is configured with a
sign callback and is only provided with the certificate.

2 years agoAdd initial regress for tls_signer.
jsing [Sun, 30 Jan 2022 18:38:41 +0000 (18:38 +0000)]
Add initial regress for tls_signer.

2 years agoAdd missing NULL check.
martijn [Sun, 30 Jan 2022 13:27:39 +0000 (13:27 +0000)]
Add missing NULL check.

OK benno@

2 years agoWhen walking a pf table, we only are supposed to return IPv4 addresses.
martijn [Sun, 30 Jan 2022 13:26:14 +0000 (13:26 +0000)]
When walking a pf table, we only are supposed to return IPv4 addresses.
If a table has mixed IPv4 and IPv6 addresses and we walk over it an IPv6
address could be returned if it followed an IPv4 address, causing an
error.

Found by florian@
OK florian@ millert@

2 years agoLocalize variables used only in functions
afresh1 [Sun, 30 Jan 2022 02:39:19 +0000 (02:39 +0000)]
Localize variables used only in functions

Somehow I missed some

2 years agoClean up exit codes
afresh1 [Sat, 29 Jan 2022 22:43:50 +0000 (22:43 +0000)]
Clean up exit codes

Being different didn't help me figure out what was going wrong anyway.

Suggested by deraadt@

2 years agortwn and urtwn firmware got better licenses and moved to base
afresh1 [Sat, 29 Jan 2022 22:33:43 +0000 (22:33 +0000)]
rtwn and urtwn firmware got better licenses and moved to base

2 years ago"Unregister" installed firmware that isn't in the SHA256.sig
afresh1 [Sat, 29 Jan 2022 22:32:02 +0000 (22:32 +0000)]
"Unregister" installed firmware that isn't in the SHA256.sig

We assume in this case that the firmware's license was improved and
it moved to be distributed in the base system.  If we find that situation
remove the package registration but leave the firmware files.

2 years agoftplist management moves to a different IP. It would be nice if this
deraadt [Sat, 29 Jan 2022 20:17:58 +0000 (20:17 +0000)]
ftplist management moves to a different IP.  It would be nice if this
could operate in parallel to a few different IPs, but such code has
not been written yet.

2 years agoPut the leaf and subleaf input values (from rax/rcx) into local variables,
guenther [Sat, 29 Jan 2022 19:23:02 +0000 (19:23 +0000)]
Put the leaf and subleaf input values (from rax/rcx) into local variables,
truncating them to 32bit as documented by the SDM and verified on an Intel
CPU in a Lenovo T510.  Use that in the clamping logic and all the tests,
adjusting DPRINTF() format strings to match.

ok mlarkin@

2 years agodrm/amdgpu: Use correct VIEWPORT_DIMENSION for DCN2
jsg [Sat, 29 Jan 2022 12:43:21 +0000 (12:43 +0000)]
drm/amdgpu: Use correct VIEWPORT_DIMENSION for DCN2

From Harry Wentland
7b6577cf9fe48d24d82df9362a077396a9d5cb27 in linux 5.15.y/5.15.18
dc5d4aff2e99c312df8abbe1ee9a731d2913bc1b in mainline linux

2 years agodrm/amd/display: reset dcn31 SMU mailbox on failures
jsg [Sat, 29 Jan 2022 12:40:27 +0000 (12:40 +0000)]
drm/amd/display: reset dcn31 SMU mailbox on failures

From Mario Limonciello
f71c91ed1d4b4bfbbb55327b04dcc32b2d970f62 in linux 5.15.y/5.15.18
83293f7f3d15fc56e86bd5067a2c88b6b233ac3a in mainline linux

2 years agodrm/i915: Flush TLBs before releasing backing store
jsg [Sat, 29 Jan 2022 12:37:08 +0000 (12:37 +0000)]
drm/i915: Flush TLBs before releasing backing store

From Tvrtko Ursulin
8a17a077e7e9ecce25c95dbdb27843d2d6c2f0f7 in linux 5.15.y/5.15.18
7938d61591d33394a21bdd7797a245b65428f44c in mainline linux

2 years agoFix macro name in comment.
aoyama [Sat, 29 Jan 2022 06:25:33 +0000 (06:25 +0000)]
Fix macro name in comment.

ok visa@

2 years agoUse local symbols in libkern mips64 assembly routines.
visa [Sat, 29 Jan 2022 05:47:36 +0000 (05:47 +0000)]
Use local symbols in libkern mips64 assembly routines.

OK miod@

2 years agoAdd limits.h for INT_MAX in tls_signer.c
inoguchi [Sat, 29 Jan 2022 02:03:19 +0000 (02:03 +0000)]
Add limits.h for INT_MAX in tls_signer.c

ok jsing@ tb@

2 years agohead(1): refactor main loop
cheloha [Sat, 29 Jan 2022 00:19:04 +0000 (00:19 +0000)]
head(1): refactor main loop

The main loop here is horribly obfuscated.  In particular, the path
through the loop to exit(3) is very complex.

Refactor the open/read/write/close portions of the loop out of main()
into a separate function, head_file().

The result is a lot easier to understand at a glance.  In particular,
the path to the end of main() is now dead simple.

Thread: https://marc.info/?l=openbsd-tech&m=164325900400701&w=2

ok millert@

2 years agorev(1): refactor main loop
cheloha [Sat, 29 Jan 2022 00:11:54 +0000 (00:11 +0000)]
rev(1): refactor main loop

The main loop here is obfuscated.

Refactor the open/read/write/close portion of the loop out of main ()
and into a new function, rev_file().  Move "multibyte" out into global
storage.

The result is much easier to understand at a glance.

Thread: https://marc.info/?l=openbsd-tech&m=164329515201417&w=2

ok millert@

2 years agotouch(1): don't leak file descriptor if futimens(2) fails
cheloha [Sat, 29 Jan 2022 00:06:26 +0000 (00:06 +0000)]
touch(1): don't leak file descriptor if futimens(2) fails

This conditional chain short-circuits if futimens(2) fails, leaving the
file descriptor open.  We need to evaluate each system call in the chain
separately to ensure we attempt to close(2) the descriptor.

With input from guenther@ and millert@.

Thread: https://marc.info/?l=openbsd-tech&m=164332809900558&w=2

ok millert@, probably ok guenther@

2 years agoGive ddb more access to registers on macppc, powerpc64
gkoehler [Fri, 28 Jan 2022 18:37:40 +0000 (18:37 +0000)]
Give ddb more access to registers on macppc, powerpc64

Edit db_regs[] in db_trace.c on both powerpc and powerpc64, so ddb can
access $r14, $r15, $r16, $dar, $dsisr.

Only for powerpc: change db_trap_glue to copy all registers to and
from ddb_regs (it was skipping some); change db_set_single_step and
db_clear_single_step to flip the correct bit of srr1; delete
FIXUP_PC_AFTER_BREAK, which was off by 1 instruction.

"ddb{1}> s" on my PowerMac7,3 (dual G5 at 2700 MHz) began to panic
like, "*cpu0: mutex 0xa7d0a0 not held in tc_update_timekeep".  Add an
arbitrary delay(100) after sending PPC_IPI_DDB; I want cpu0 to get the
ipi before it can see db_active == 1 and skip acquiring a mutex.

ok kettenis@

2 years agoRemove unused guarded read and write routines.
visa [Fri, 28 Jan 2022 16:20:09 +0000 (16:20 +0000)]
Remove unused guarded read and write routines.

No objection from miod@

2 years agoProperly handle .mft files as intended by the RFC. Instead of always
claudio [Fri, 28 Jan 2022 15:30:23 +0000 (15:30 +0000)]
Properly handle .mft files as intended by the RFC. Instead of always
selecting the newest file this opens both the new (from rrdp or rsync)
and old (valid) MFT. It then compares the manifest number and based on
that the 'newer' MFT is selected.
The MFT file and hash check is also changed to always try both locations
and selecting whatever matches up with the hash. The selction is passed
back to the the main process and used later on to open exactly the same
file as was checked against the hash.
The MFT parsing code has been split up into multiple steps so that the
files can be parsed, compared and then fully validated.
In most cases this makes no difference but it prevents replay attacks
using old but still valid files.
With and OK tb@

2 years agoDo not skip .rrdp cache cleanup if rrdp is off (option -R). The sync
claudio [Fri, 28 Jan 2022 14:11:27 +0000 (14:11 +0000)]
Do not skip .rrdp cache cleanup if rrdp is off (option -R). The sync
via rsync alters the cache and rrdp can only recover by downloading
a snapshot. By doing the cleanup here it will make sure this happens.
Noticed by job@
OK tb@

2 years agoError check for sk_push in libssl
inoguchi [Fri, 28 Jan 2022 13:14:48 +0000 (13:14 +0000)]
Error check for sk_push in libssl

CID 118976 118979

ok tb@

2 years agoError check for sk_push in libssl
inoguchi [Fri, 28 Jan 2022 13:11:56 +0000 (13:11 +0000)]
Error check for sk_push in libssl

CID 24838

comment and ok tb@

2 years agoOnly memcpy() into imsg->data if datalen is not 0. Passing a NULL pointer
claudio [Fri, 28 Jan 2022 10:41:44 +0000 (10:41 +0000)]
Only memcpy() into imsg->data if datalen is not 0. Passing a NULL pointer
to memcpy() is UB no matter if len is 0.
Reported by fouzhe on openbgpd-portable github page.
OK tb@

2 years agoMust use unsigned 1 here since modern compilers can't shift a signed 1 by 31.
claudio [Fri, 28 Jan 2022 10:37:23 +0000 (10:37 +0000)]
Must use unsigned 1 here since modern compilers can't shift a signed 1 by 31.
OK tb@ kettenis@

2 years agoWhen it's the possessive of 'it', it's spelled "its", without the
guenther [Fri, 28 Jan 2022 07:11:14 +0000 (07:11 +0000)]
When it's the possessive of 'it', it's spelled "its", without the
apostrophe.

2 years agoWhen it's the possessive of 'it', it's spelled "its", without the
guenther [Fri, 28 Jan 2022 06:33:26 +0000 (06:33 +0000)]
When it's the possessive of 'it', it's spelled "its", without the
apostrophe.

2 years agoWhen it's the possessive of 'it', it's spelled "its", without the
guenther [Fri, 28 Jan 2022 06:18:41 +0000 (06:18 +0000)]
When it's the possessive of 'it', it's spelled "its", without the
apostrophe.

2 years agoWhen it's the possessive of 'it', it's spelled "its", without the
guenther [Fri, 28 Jan 2022 05:54:02 +0000 (05:54 +0000)]
When it's the possessive of 'it', it's spelled "its", without the
apostrophe.

2 years agoWhen it's the possessive of 'it', it's spelled "its", without the
guenther [Fri, 28 Jan 2022 05:24:15 +0000 (05:24 +0000)]
When it's the possessive of 'it', it's spelled "its", without the
apostrophe.

2 years agoWhen it's the possessive of 'it', it's spelled "its", without the
guenther [Fri, 28 Jan 2022 05:15:05 +0000 (05:15 +0000)]
When it's the possessive of 'it', it's spelled "its", without the
apostrophe.

2 years agoUpdate comment: struct link_map is defined in <link_elf.h>
guenther [Fri, 28 Jan 2022 05:01:28 +0000 (05:01 +0000)]
Update comment: struct link_map is defined in <link_elf.h>

noted by miod

2 years agoWhen it's the possessive of 'it', it's spelled "its", without the
guenther [Fri, 28 Jan 2022 04:59:15 +0000 (04:59 +0000)]
When it's the possessive of 'it', it's spelled "its", without the
apostrophe.

one from miod, other by "never just one" vibe

2 years agoExpose tls_signer_error()
jsing [Fri, 28 Jan 2022 03:46:46 +0000 (03:46 +0000)]
Expose tls_signer_error()

Add tls_signer_error to Symbols.list - this was missed during the last
libtls minor bump and can ride along.

ok deraadt@