CVS: cvs.openbsd.org: src

2022-01-21 Thread Andrew Fresh
CVSROOT:/cvs
Module name:src
Changes by: afre...@cvs.openbsd.org 2022/01/21 22:03:47

Modified files:
usr.sbin/fw_update: fw_update.sh 

Log message:
Support multiple -v as promised in the man page

There are now four levels of verbosity:
0. Prints only the summary
1. Prints a line when installing/removing
2. Uses the ftp(1) progress bar
3. Provides more details for debugging

With some excellent ksh knowledge provided by kn@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Damien Miller
CVSROOT:/cvs
Module name:src
Changes by: d...@cvs.openbsd.org2022/01/21 17:49:34

Modified files:
usr.bin/ssh: channels.h clientloop.c packet.c packet.h 
 serverloop.c 

Log message:
add a ssh_packet_process_read() function that reads from a fd
directly into the transport input buffer.

Use this in the client and server mainloops to avoid unnecessary
copying. It also lets us use a more greedy read size without penalty.

Yields a 2-3% performance gain on cipher-speed.sh (in a fairly
unscientific test tbf)

feedback dtucker@ ok markus@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Theo de Raadt
CVSROOT:/cvs
Module name:src
Changes by: dera...@cvs.openbsd.org 2022/01/21 17:49:40

Modified files:
distrib/sets/lists/base: mi 

Log message:
sync



CVS: cvs.openbsd.org: src

2022-01-21 Thread Damien Miller
CVSROOT:/cvs
Module name:src
Changes by: d...@cvs.openbsd.org2022/01/21 17:45:32

Modified files:
usr.bin/ssh: channels.c 

Log message:
Use sshbuf_read() to read directly into the channel input buffer
rather than into a stack buffer that needs to be copied again;
Improves performance by about 1% on cipher-speed.sh
feedback dtucker@ ok markus@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Inoguchi Kinichiro
CVSROOT:/cvs
Module name:src
Changes by: inogu...@cvs.openbsd.org2022/01/21 17:45:17

Modified files:
lib/libcrypto/modes: cbc128.c 

Log message:
Use memmove instead of memcpy for overlapping memory

CID 251047 251094

OK beck@ jsing@ millert@ tb@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Inoguchi Kinichiro
CVSROOT:/cvs
Module name:src
Changes by: inogu...@cvs.openbsd.org2022/01/21 17:43:41

Modified files:
lib/libcrypto/aes: aes_ige.c 

Log message:
Use memmove instead of memcpy for overlapping memory

CID 250936 251103

OK beck@ jsing@ millert@ tb@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Damien Miller
CVSROOT:/cvs
Module name:src
Changes by: d...@cvs.openbsd.org2022/01/21 17:43:43

Modified files:
usr.bin/ssh: sshbuf-misc.c sshbuf.h 

Log message:
Add a sshbuf_read() that attempts to read(2) directly in to a
sshbuf; ok markus@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Inoguchi Kinichiro
CVSROOT:/cvs
Module name:src
Changes by: inogu...@cvs.openbsd.org2022/01/21 17:36:46

Modified files:
lib/libcrypto/x509: x509_vfy.c 

Log message:
X509_GET_PUBKEY(3) return value check in libcrypto

CID 345116

ok beck@ tb@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Inoguchi Kinichiro
CVSROOT:/cvs
Module name:src
Changes by: inogu...@cvs.openbsd.org2022/01/21 17:34:48

Modified files:
lib/libcrypto/x509: x509_req.c 

Log message:
X509_GET_PUBKEY(3) return value check in libcrypto

CID 25131

ok beck@ tb@

suggest using X509_REQ_get0_pubkey() and remove the EVP_PKEY_free() from tb@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Inoguchi Kinichiro
CVSROOT:/cvs
Module name:src
Changes by: inogu...@cvs.openbsd.org2022/01/21 17:33:02

Modified files:
lib/libcrypto/ocsp: ocsp_vfy.c 

Log message:
X509_GET_PUBKEY(3) return value check in libcrypto

ok beck@ tb@

suggest using X509_get0_pubkey() and remove EVP_PKEY_free() from tb@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Inoguchi Kinichiro
CVSROOT:/cvs
Module name:src
Changes by: inogu...@cvs.openbsd.org2022/01/21 17:31:23

Modified files:
lib/libcrypto/ocsp: ocsp_lib.c 

Log message:
X509_GET_PUBKEY(3) return value check in libcrypto

ok beck@ tb@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Inoguchi Kinichiro
CVSROOT:/cvs
Module name:src
Changes by: inogu...@cvs.openbsd.org2022/01/21 17:29:59

Modified files:
lib/libcrypto/ct: ct_sct.c 

Log message:
X509_GET_PUBKEY(3) return value check in libcrypto

ok beck@ tb@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Jonathan Gray
CVSROOT:/cvs
Module name:src
Changes by: j...@cvs.openbsd.org2022/01/21 16:49:36

Modified files:
sys/dev/pci/drm: drm_linux.c 

Log message:
release mtx before pool_get() in __xa_alloc()/__xa_store() when
PR_WAITOK is used to not sleep with mtx held



CVS: cvs.openbsd.org: src

2022-01-21 Thread Todd C . Miller
CVSROOT:/cvs
Module name:src
Changes by: mill...@cvs.openbsd.org 2022/01/21 15:53:20

Modified files:
usr.sbin/cron  : cron.c 

Log message:
Treat ppoll(2) errors as fatal.  OK deraadt@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/01/21 11:49:44

Modified files:
usr.sbin/rpki-client: extern.h main.c mft.c parser.c validate.c 

Log message:
Add function to determine the file type from the file name extension

rpki-client uses the same idiom to determine the file type in too many
places. Use one function that determines the appropriate RTYPE from the
file name. Add that type to struct mftfile and use this new member to
simplify queue_add_from_mft*().

input/ok claudio



CVS: cvs.openbsd.org: src

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

Modified files:
usr.sbin/acme-client: acme-client.1 

Log message:
the wrapped cron line is going to lose people



CVS: cvs.openbsd.org: src

2022-01-21 Thread Marc Espie
CVSROOT:/cvs
Module name:src
Changes by: es...@cvs.openbsd.org   2022/01/21 10:41:41

Modified files:
usr.sbin/pkg_add: Makefile 
Added files:
usr.sbin/pkg_add/OpenBSD: BaseState.pm BaseState.pod 

Log message:
"move" part of the OpenBSD::State code into its own (stateless) class
so that it can be reused light-weight by portgen and the likes.

(the actual move will happen once the base sets all have the new files)



CVS: cvs.openbsd.org: src

2022-01-21 Thread Kenneth R Westerback
CVSROOT:/cvs
Module name:src
Changes by: k...@cvs.openbsd.org2022/01/21 10:29:24

Modified files:
sbin/fdisk : cmd.c mbr.c part.c part.h 

Log message:
Split PRT_print() into PRT_print_parthdr() and PRT_print_part()
to align with GPT functions. Simplifies logic and eliminates the
magic invocations to print the header.

No functional change.



CVS: cvs.openbsd.org: src

2022-01-21 Thread Visa Hankala
CVSROOT:/cvs
Module name:src
Changes by: v...@cvs.openbsd.org2022/01/21 09:39:56

Modified files:
sys/arch/mips64/mips64: trap.c 

Log message:
Limit unwinder symbol search to FUNC symbols

The prolog scanning has to locate the start of the subroutine, not some
local symbol in the middle.

This should reduce cases where unwinding goes astray.

OK miod@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Theo de Raadt
CVSROOT:/cvs
Module name:src
Changes by: dera...@cvs.openbsd.org 2022/01/21 09:18:16

Modified files:
lib/libc/sys   : select.2 

Log message:
In 1999 fd_set overflowing beyond FD_SETSIZE became enough of a problem that I
changed the entire tree to use fd_set allocation, and this manpage documented
the "calloc(howmany(max+1, NFDBITS), sizeof(fd_mask))" idiom.  Since then we
completed converting the entire tree to poll(2), for many reasons, even 
ssh/sshd.
Now the use of kernel-only sys/param.h-found howmany() and related macross grate
on me, so it is time to recommend use of poll(2) instead.  [On a related note,
MacOS poll(2) is been dangerously broken for many years; that is their problem 
to
handle as the whole ecosystem joins us in pivoting select -> poll)
ok millert



CVS: cvs.openbsd.org: src

2022-01-21 Thread Stefan Sperling
CVSROOT:/cvs
Module name:src
Changes by: s...@cvs.openbsd.org2022/01/21 08:51:03

Modified files:
sys/dev/pci: if_iwm.c if_iwx.c 
sys/net80211   : ieee80211_input.c ieee80211_var.h 

Log message:
Fix and re-enable active scans on iwm(4) and iwx(4).

Ensure that we supply the access point's DTIM period to firmware after
an active scan, as soon as the next beacon arrives. This prevents the
problems which prompted us to keep active scans disabled in our drivers.

Problem debugged and patch by zxystd from the OpenIntelWireless project.
I made some tweaks regarding TIM parsing, which were reviewed by zxystd.

Johannes Berg from Intel has confirmed to me via IRC that firmware
will misbehave if running with a zero DTIM period.

Tested:
8265: jca, stsp
9260: kettenis (possible fallout observed here; will keep an eye on it)
9650: stsp
ax200: zxystd, kevlo, stsp
ax201: stsp

ok kevlo@ kettenis@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Todd C . Miller
CVSROOT:/cvs
Module name:src
Changes by: mill...@cvs.openbsd.org 2022/01/21 08:23:36

Modified files:
lib/libc/sys   : poll.2 

Log message:
Document EAGAIN error return, as specified by POSIX.
Our poll does not use EAGAIN but code needs to handle it for portability.
OK deraadt@ visa@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Klemens Nanni
CVSROOT:/cvs
Module name:src
Changes by: k...@cvs.openbsd.org2022/01/21 08:05:01

Modified files:
sys/arch/macppc/conf: GENERIC 

Log message:
Enable dt(4)

This produces helpful flamegraphs on macppc.
With Andrew Krasavin .

OK mpi



CVS: cvs.openbsd.org: src

2022-01-21 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/01/21 07:08:33

Modified files:
usr.sbin/rpki-client: main.c parser.c 

Log message:
Avoid out-of-bounds accesses in case the filename is too showrt to
contain an extension of length four.

ok claudio



CVS: cvs.openbsd.org: src

2022-01-21 Thread Tobias Heider
CVSROOT:/cvs
Module name:src
Changes by: to...@cvs.openbsd.org   2022/01/21 07:07:06

Modified files:
sys/arch/powerpc/powerpc: trap.c 

Log message:
Fix NULL dereference which allows user programs to read parts
of the kernel memory.  Found with clang static analyzer.

Feedback and ok gkoehler@
ok bluhm@



CVS: cvs.openbsd.org: src

2022-01-21 Thread Jonathan Gray
CVSROOT:/cvs
Module name:src
Changes by: j...@cvs.openbsd.org2022/01/21 04:59:40

Modified files:
sys/dev/pci/drm/include/uapi/linux: kfd_ioctl.h 

Log message:
sync kfd_ioctl.h with linux 5.15



CVS: cvs.openbsd.org: src

2022-01-21 Thread Jonathan Gray
CVSROOT:/cvs
Module name:src
Changes by: j...@cvs.openbsd.org2022/01/21 04:37:53

Added files:
sys/dev/pci/drm/include/uapi/linux: media-bus-format.h 
Removed files:
sys/dev/pci/drm/include/linux: media-bus-format.h 

Log message:
move media-bus-format.h to match comment in drm_connector.c



CVS: cvs.openbsd.org: src

2022-01-21 Thread Marc Espie
CVSROOT:/cvs
Module name:src
Changes by: es...@cvs.openbsd.org   2022/01/21 02:06:38

Modified files:
share/man/man5 : bsd.port.mk.5 

Log message:
document show-list