CVS: cvs.openbsd.org: src

2022-03-28 Thread Theo de Raadt
CVSROOT:/cvs
Module name:src
Changes by: dera...@cvs.openbsd.org 2022/03/28 21:11:18

Modified files:
sys/conf   : newvers.sh 

Log message:
close enough to release, we drop -beta



CVS: cvs.openbsd.org: src

2022-03-28 Thread Jonathan Gray
CVSROOT:/cvs
Module name:src
Changes by: j...@cvs.openbsd.org2022/03/28 20:15:51

Modified files:
sys/dev/pci/drm/amd/amdgpu: amdgpu_gmc.c 

Log message:
bring back getting framebuffer size from efifb (rev 1.3)

avoids the following on BESSTAR TECH HM90 with Ryzen 9 4900H (renoir)
reported by Fredrik Engberg

drm:pid0:gmc_v9_0_process_interrupt *ERROR* [mmhub0] no-retry page fault 
(src_id:0 ring:158 vmid:0 pasid:0, for process  pid 0 thread pid 0)
drm:pid0:gmc_v9_0_process_interrupt *ERROR*   in page starting at address 
0x00561000 from IH client 0x12 (VMC)
drm:pid0:gmc_v9_0_process_interrupt *ERROR* 
VM_L2_PROTECTION_FAULT_STATUS:0x3B3C
drm:pid0:gmc_v9_0_process_interrupt *ERROR* Faulty UTCL2 client ID: VCNU (0x1d)
drm:pid0:gmc_v9_0_process_interrupt *ERROR* MORE_FAULTS: 0x0
drm:pid0:gmc_v9_0_process_interrupt *ERROR* WALKER_ERROR: 0x6
drm:pid0:gmc_v9_0_process_interrupt *ERROR* PERMISSION_FAULTS: 0x3
drm:pid0:gmc_v9_0_process_interrupt *ERROR* MAPPING_ERROR: 0x1
drm:pid0:gmc_v9_0_process_interrupt *ERROR* RW: 0x0
[drm] *ERROR* ring vcn_dec test failed (-60)
[drm] *ERROR* hw_init of IP block  failed -60
drm:pid0:amdgpu_device_init *ERROR* amdgpu_device_ip_init failed
drm:pid0:amdgpu_attachhook *ERROR* Fatal error during GPU init



CVS: cvs.openbsd.org: src

2022-03-28 Thread Ingo Schwarze
CVSROOT:/cvs
Module name:src
Changes by: schwa...@cvs.openbsd.org2022/03/28 19:26:08

Modified files:
lib/libc/locale: mbrlen.3 

Log message:
Basic copy editing:
Eliminate weasel words and needless parentheses, reduce "will" and
"shall" and "may", add more precision, some grammar fixes, shorten
and improve wordings, add some missing macros.
Triggered by a question from naddy@.



CVS: cvs.openbsd.org: src

2022-03-28 Thread Mark Kettenis
CVSROOT:/cvs
Module name:src
Changes by: kette...@cvs.openbsd.org2022/03/28 12:53:40

Modified files:
distrib/miniroot: install.sub 
distrib/arm64/ramdisk: install.md 

Log message:
Running getty(8) on /dev/console when using a glass console interferes with
running Xorg in a way that isn't fully understood.  So change the arm64
install.md to munge /etc/ttys to enable the ttyC0 entry if we detect that
wsdisplay0 is the console and make sure the code in install.sub that
does the actual munging disables the console entry before enabling another
entry to prevent running two getty(8) processes on (effectively) the same
device.

ok deraadt@



CVS: cvs.openbsd.org: src

2022-03-28 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:src
Changes by: bl...@cvs.openbsd.org   2022/03/28 10:31:26

Modified files:
sys/netinet: igmp.c igmp_var.h in.c 

Log message:
if_detach() does if_remove(ifp); NET_LOCK(); rti_delete().  New
igmp groups may join while sleeping in interface destruction.  In
this case if_get() in igmp_joingroup() fails and rti_fill() is not
called.  Then inm->inm_rti may be NULL.  This is the condition when
syzkaller crashes in igmp_leavegroup().
Pass the ifp the current CPU is already holding down to igmp_joingroup()
and igmp_leavegroup() to avoid half constructed igmp groups.  Calling
if_get() in caller and callee makes no sense anyway.
Reported-by: syzbot+146823a676b7bea83...@syzkaller.appspotmail.com
OK denis@



CVS: cvs.openbsd.org: src

2022-03-28 Thread Kenneth R Westerback
CVSROOT:/cvs
Module name:src
Changes by: k...@cvs.openbsd.org2022/03/28 09:47:11

Modified files:
sys/scsi   : scsiconf.c 

Log message:
Only SLIST_REMOVE() a link when the link is on the list.

Avoids a potential panic.



CVS: cvs.openbsd.org: src

2022-03-28 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2022/03/28 07:04:01

Modified files:
usr.sbin/rpki-client: cms.c 

Log message:
Compare the SKI of the embedded EE certificate of the CMS message with the
SID of the Signer Info structure. RFC6488 mandates this.
OK job@ tb@



Re: CVS: cvs.openbsd.org: src

2022-03-28 Thread Dave Voutila


Theo Buehler  writes:

> On Mon, Mar 28, 2022 at 07:47:45AM +0200, Anton Lindqvist wrote:
>> On Sun, Mar 27, 2022 at 06:22:20PM -0600, Dave Voutila wrote:
>> > CVSROOT:   /cvs
>> > Module name:   src
>> > Changes by:d...@cvs.openbsd.org2022/03/27 18:22:20
>> >
>> > Modified files:
>> >sys/arch/amd64/amd64: vmm.c
>> >
>> > Log message:
>> > vmm(4): add quiesce/wakeup hooks to sync vcpu state.
>> >
>> > If a host suspends or hibernates, a task in the middle of using
>> > vcpu state may be rescheduled to another cpu. This is primarily a
>> > problem for Intel hosts as vcpu state is kept local to the physical
>> > cpu and must be flushed back to physical memory before another cpu
>> > can issue certain vmx instructions.
>> >
>> > This change ensures no tasks are actively using the vmm device,
>> > flushes all vcpu state (if Intel hardware), and turns off virtualization
>> > mode on the host cpus. Upon wakeup, we reverse the process.
>> >
>> > Reported on bugs@ by mpi@. OK mlarkin@
>>
>> This broke kernel compilation on syzkaller.
>>
>> sys/arch/amd64/amd64/vmm.c:499:11: error: implicit declaration of function 
>> 'vmx_remote_vmclear' is invalid in C99 
>> [-Werror,-Wimplicit-function-declaration]
>>
>> https://syzkaller.appspot.com/bug?id=c58155e5ad57153055f3b4db9d86234cd086fe3b
>
> Just ran into this as well. The below fixes 'make release'. Does this
> look right?
>

I believe this was committed, but yes, this is correct. Thanks for the
assist, tb.

> Index: arch/amd64/amd64/vmm.c
> ===
> RCS file: /cvs/src/sys/arch/amd64/amd64/vmm.c,v
> retrieving revision 1.304
> diff -u -p -r1.304 vmm.c
> --- arch/amd64/amd64/vmm.c28 Mar 2022 00:22:20 -  1.304
> +++ arch/amd64/amd64/vmm.c28 Mar 2022 05:52:33 -
> @@ -494,6 +494,7 @@ vmm_quiesce_vmx(void)
>   continue;
>   }
>
> +#ifdef MULTIPROCESSOR
>   if (vcpu->vc_last_pcpu != curcpu()) {
>   /* Remote cpu vmclear via ipi. */
>   err = vmx_remote_vmclear(vcpu->vc_last_pcpu,
> @@ -502,7 +503,9 @@ vmm_quiesce_vmx(void)
>   printf("%s: failed to remote vmclear "
>   "vcpu %d of vm %d\n", __func__,
>   vcpu->vc_id, vm->vm_id);
> - } else {
> + } else
> +#endif
> + {
>   /* Local cpu vmclear instruction. */
>   if ((err = vmclear(>vc_control_pa)))
>   printf("%s: failed to locally vmclear "



CVS: cvs.openbsd.org: src

2022-03-28 Thread Inoguchi Kinichiro
CVSROOT:/cvs
Module name:src
Changes by: inogu...@cvs.openbsd.org2022/03/28 05:02:49

Modified files:
usr.bin/openssl: pkcs12.c 

Log message:
Change internal functions to static in openssl(1) pkcs12

ok tb@



CVS: cvs.openbsd.org: src

2022-03-28 Thread Inoguchi Kinichiro
CVSROOT:/cvs
Module name:src
Changes by: inogu...@cvs.openbsd.org2022/03/28 04:56:26

Modified files:
usr.bin/openssl: pkcs12.c 

Log message:
Remove unused function cert_load in openssl(1) pkcs12

ok tb@



CVS: cvs.openbsd.org: src

2022-03-28 Thread Anthony J . Bentley
CVSROOT:/cvs
Module name:src
Changes by: bent...@cvs.openbsd.org 2022/03/28 04:29:44

Modified files:
share/misc : zipcodes 

Log message:
Fix misspelled NM town names, from personal knowledge, checked against USPS.



CVS: cvs.openbsd.org: src

2022-03-28 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/03/28 02:19:15

Modified files:
usr.sbin/rpki-client: cms.c 

Log message:
Fix error check of CMS_unsigned_get_addr_count()

According to RFC 5652, unsignedAttrs are a SET OF at least one member,
however the CMS code doesn't actually check for this. Since SET OF may
contain zero members in general, an empty set of unsignedAttrs would
be accepted. Catch this by explicitly checking for a -1 return value.

ok claudio



CVS: cvs.openbsd.org: src

2022-03-28 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2022/03/28 02:18:13

Modified files:
lib/libcrypto/man: X509at_get_attr.3 

Log message:
Remove extra 'or'
OK tb@



CVS: cvs.openbsd.org: src

2022-03-28 Thread Claudio Jeker
CVSROOT:/cvs
Module name:src
Changes by: clau...@cvs.openbsd.org 2022/03/28 02:11:36

Modified files:
regress/usr.sbin/rpki-client: Makefile.inc 

Log message:
Print OK after all of the RRDP related tests. To make it clear that
the regress test was successful.



CVS: cvs.openbsd.org: src

2022-03-28 Thread Nicholas Marriott
CVSROOT:/cvs
Module name:src
Changes by: n...@cvs.openbsd.org2022/03/28 01:40:57

Modified files:
usr.bin/tmux   : server.c 

Log message:
Report error if creating socket fails with -D.



CVS: cvs.openbsd.org: src

2022-03-28 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/03/28 00:28:47

Modified files:
sys/arch/amd64/amd64: vmm.c 

Log message:
Put call to vmx_remote_vmclear() under #ifdef MULTIPROCESSOR
to unbreak build of amd64 GENERIC

makes sense to jsing



Re: CVS: cvs.openbsd.org: src

2022-03-28 Thread Theo Buehler
On Mon, Mar 28, 2022 at 07:47:45AM +0200, Anton Lindqvist wrote:
> On Sun, Mar 27, 2022 at 06:22:20PM -0600, Dave Voutila wrote:
> > CVSROOT:/cvs
> > Module name:src
> > Changes by: d...@cvs.openbsd.org2022/03/27 18:22:20
> > 
> > Modified files:
> > sys/arch/amd64/amd64: vmm.c 
> > 
> > Log message:
> > vmm(4): add quiesce/wakeup hooks to sync vcpu state.
> > 
> > If a host suspends or hibernates, a task in the middle of using
> > vcpu state may be rescheduled to another cpu. This is primarily a
> > problem for Intel hosts as vcpu state is kept local to the physical
> > cpu and must be flushed back to physical memory before another cpu
> > can issue certain vmx instructions.
> > 
> > This change ensures no tasks are actively using the vmm device,
> > flushes all vcpu state (if Intel hardware), and turns off virtualization
> > mode on the host cpus. Upon wakeup, we reverse the process.
> > 
> > Reported on bugs@ by mpi@. OK mlarkin@
> 
> This broke kernel compilation on syzkaller.
> 
> sys/arch/amd64/amd64/vmm.c:499:11: error: implicit declaration of function 
> 'vmx_remote_vmclear' is invalid in C99 
> [-Werror,-Wimplicit-function-declaration]
> 
> https://syzkaller.appspot.com/bug?id=c58155e5ad57153055f3b4db9d86234cd086fe3b

Just ran into this as well. The below fixes 'make release'. Does this
look right?

Index: arch/amd64/amd64/vmm.c
===
RCS file: /cvs/src/sys/arch/amd64/amd64/vmm.c,v
retrieving revision 1.304
diff -u -p -r1.304 vmm.c
--- arch/amd64/amd64/vmm.c  28 Mar 2022 00:22:20 -  1.304
+++ arch/amd64/amd64/vmm.c  28 Mar 2022 05:52:33 -
@@ -494,6 +494,7 @@ vmm_quiesce_vmx(void)
continue;
}
 
+#ifdef MULTIPROCESSOR
if (vcpu->vc_last_pcpu != curcpu()) {
/* Remote cpu vmclear via ipi. */
err = vmx_remote_vmclear(vcpu->vc_last_pcpu,
@@ -502,7 +503,9 @@ vmm_quiesce_vmx(void)
printf("%s: failed to remote vmclear "
"vcpu %d of vm %d\n", __func__,
vcpu->vc_id, vm->vm_id);
-   } else {
+   } else
+#endif
+   {
/* Local cpu vmclear instruction. */
if ((err = vmclear(>vc_control_pa)))
printf("%s: failed to locally vmclear "