openbsd
2 years agoalphabetical order is hard, tb...
tb [Fri, 17 Dec 2021 11:28:05 +0000 (11:28 +0000)]
alphabetical order is hard, tb...

2 years agofix indent
tb [Fri, 17 Dec 2021 11:25:22 +0000 (11:25 +0000)]
fix indent

2 years agoDocument the failure mode if size is too small and mention that
millert [Thu, 16 Dec 2021 19:15:29 +0000 (19:15 +0000)]
Document the failure mode if size is too small and mention that
allocating space when buf is NULL is an extension more prominently.
Clarify that getwd() is deprecated and should not be used.
Mention EFAULT errno value for invalid (non-NULL) buf.
OK deraadt@ jmc@

2 years agogetwd(3): don't malloc space for buf if it is NULL
millert [Thu, 16 Dec 2021 19:12:43 +0000 (19:12 +0000)]
getwd(3): don't malloc space for buf if it is NULL
The 4.3BSD getwd(3) did not malloc space, use __getcwd(2) directly
so the compat function doesn't either.  OK deraadt@

2 years agolibradius: convert to HMAC_CTX on the heap
tb [Thu, 16 Dec 2021 17:32:51 +0000 (17:32 +0000)]
libradius: convert to HMAC_CTX on the heap

This is another fairly mechanical conversion to prepare the switch
to opaque HMAC_CTX. It adds missing error checking for the HMAC API
and uses HMAC_Init_ex() instead of the deprecated HMAC_Init().

ok jsing

2 years agoarm64 can boot from softraid too; ok patrick
tj [Thu, 16 Dec 2021 17:07:56 +0000 (17:07 +0000)]
arm64 can boot from softraid too; ok patrick

2 years agodocument obj_cleanup_defer(3) and check_defer(3)
schwarze [Thu, 16 Dec 2021 16:36:16 +0000 (16:36 +0000)]
document obj_cleanup_defer(3) and check_defer(3)

2 years agoFix a tiny race in tdb_delete() between TDBF_DELETED, tdb_unlink()
bluhm [Thu, 16 Dec 2021 15:38:03 +0000 (15:38 +0000)]
Fix a tiny race in tdb_delete() between TDBF_DELETED, tdb_unlink()
and tdb_cleanspd().  gettdb...() can return a TDB before tdb_unlink().
Then ipsp_spd_lookup() could add it to tdb_policy_head after
tdb_cleanspd().  There it would stay until it hits the kassert in
tdb_free().
OK tobhe@

2 years agoTo ease maintenance, structure the lists of intentionally undocumented
schwarze [Thu, 16 Dec 2021 12:26:40 +0000 (12:26 +0000)]
To ease maintenance, structure the lists of intentionally undocumented
symbols according to the reason (internal, obsolete, postponed)
and according to the header file (asn1, objects, x509, ...).
Also, add some minor tweaks needed for <openssl/objects.h>.

2 years agoWhen adding the extra 10% of space to a needed sysctl buffer use math
claudio [Thu, 16 Dec 2021 09:33:56 +0000 (09:33 +0000)]
When adding the extra 10% of space to a needed sysctl buffer use math
that is less likely to overflow the int type used. A BGP fullfeed is
now so big that this calculation overflowed and then got sign extended.
The result was for example 'route -n show' failures.
Problem identified with deraadt@
OK deraadt@ (more cleanup needed but this fix is a good start)

2 years agoAttach com over acpi on amd64. Some hardware uses a different interrupt
anton [Thu, 16 Dec 2021 08:03:17 +0000 (08:03 +0000)]
Attach com over acpi on amd64. Some hardware uses a different interrupt
assignment compared to the the legacy one supported by com over isa.
This causes the console to halt once userland takes over as no
interrupts are received. The actual address and irq can be read from
ACPI, kettenis@ already added support for arm64 which paved the way for
amd64.

Some consoles that previously attached over isa are now expected to
attach over acpi.

Thanks to patrick@ for testing on arm64.

ok kettenis@

2 years agounifdef TLS13_USE_LEGACY_CLIENT_AUTH
tb [Thu, 16 Dec 2021 06:32:56 +0000 (06:32 +0000)]
unifdef TLS13_USE_LEGACY_CLIENT_AUTH

Before the TLSv1.3 stack grew client certificate support, it fell back
to the legacy stack. Proper client certificate support was added in a2k20
with a TLS13_USE_LEGACY_CLIENT_AUTH knob to provide an easy fallback in
case the new code should have a problem. This was never needed.

As ifdefed code is wont to do, this bitrotted a few months later when
the client and server methods were merged.

discussed with jsing

2 years agofix zero division found by syzkaller. The sanity checks in pf(4) ioctls
sashan [Thu, 16 Dec 2021 02:01:59 +0000 (02:01 +0000)]
fix zero division found by syzkaller. The sanity checks in pf(4) ioctls
are not powerful enough to detect invalid port ranges (or even invalid
rules). syzkaller does not use pfctl(8), it uses ioctl(2) to pass some
random chunk of memory as a rule to pf(4). Fix adds explicit check
for 0 divider to pf_get_transaddr(). It should make syzkaller happy
without disturbing anyone else.

OK gnezdo@

Reported-by: syzbot+d1f00da48fa717e171f3@syzkaller.appspotmail.com
2 years agopool_get w/ PR_ZERO is better than following with a bzero, because pools
deraadt [Thu, 16 Dec 2021 00:54:42 +0000 (00:54 +0000)]
pool_get w/ PR_ZERO is better than following with a bzero, because pools
hold dirty and clean memory, and can hand out the right time cheaper
ok dlg

2 years agosync
deraadt [Thu, 16 Dec 2021 00:44:21 +0000 (00:44 +0000)]
sync

2 years agoFix the argument passed to garbage collector enforce thread for
mvs [Wed, 15 Dec 2021 22:29:55 +0000 (22:29 +0000)]
Fix the argument passed to garbage collector enforce thread for
'unsopassgc' test. Also increase it's file descriptor limit.

2 years agodocument OBJ_new_nid(3), OBJ_add_object(3), and OBJ_create_objects(3);
schwarze [Wed, 15 Dec 2021 22:20:12 +0000 (22:20 +0000)]
document OBJ_new_nid(3), OBJ_add_object(3), and OBJ_create_objects(3);
mark OBJ_create_and_add_object() as intentionally undocumented

2 years agoFix whitespace.
bluhm [Wed, 15 Dec 2021 21:25:55 +0000 (21:25 +0000)]
Fix whitespace.

2 years agoIncrease file descriptor limit for undgram_conclose test.
bluhm [Wed, 15 Dec 2021 20:56:56 +0000 (20:56 +0000)]
Increase file descriptor limit for undgram_conclose test.
ok mvs@

2 years agoinclude unistd.h directly rather than pulling it in via zlib's zconf.h
tb [Wed, 15 Dec 2021 20:43:31 +0000 (20:43 +0000)]
include unistd.h directly rather than pulling it in via zlib's zconf.h
(needed for getdtablecount).

2 years agoFix compiler warning.
bluhm [Wed, 15 Dec 2021 20:41:28 +0000 (20:41 +0000)]
Fix compiler warning.
ok mvs@

2 years agoMove OBJ_create(3) into its own manual page
schwarze [Wed, 15 Dec 2021 20:07:51 +0000 (20:07 +0000)]
Move OBJ_create(3) into its own manual page
because OBJ_nid2obj(3) is already long and
more functions related to OBJ_create(3) have to be documented.

2 years agogrep: Add missing unistd.h and limits.h includes
tb [Wed, 15 Dec 2021 19:22:44 +0000 (19:22 +0000)]
grep: Add missing unistd.h and limits.h includes

Both binary.c and file.c currently pull in unistd.h via zlib's zconf.h.
binary.c uses SEEK_SET and file.c a bunch of things like close(), isatty(),
lseek(). In addition file.c needs limits.h for PATH_MAX.

ok deraadt

2 years agomore sys/signal.h before sys/proc.h
anton [Wed, 15 Dec 2021 18:42:38 +0000 (18:42 +0000)]
more sys/signal.h before sys/proc.h

2 years agoRename asn1_lib.c to asn1_old_lib.c
jsing [Wed, 15 Dec 2021 18:12:10 +0000 (18:12 +0000)]
Rename asn1_lib.c to asn1_old_lib.c

This will allow us to add a new asn1_lib.c while replacing the code that is
in currently in asn1_old_lib.c.

Discussed with tb@

2 years agoSync bytestring with libssl.
jsing [Wed, 15 Dec 2021 18:02:39 +0000 (18:02 +0000)]
Sync bytestring with libssl.

2 years agoConsolidate various ASN.1 code.
jsing [Wed, 15 Dec 2021 18:00:31 +0000 (18:00 +0000)]
Consolidate various ASN.1 code.

Rather than having multiple files per type (with minimal code per file),
use one file per type (a_<type>.c).

No functional change.

Discussed with tb@

2 years agoUse CBS_get_last_u8() to find the content type in TLSv1.3 records.
jsing [Wed, 15 Dec 2021 17:57:45 +0000 (17:57 +0000)]
Use CBS_get_last_u8() to find the content type in TLSv1.3 records.

ok tb@

2 years agounifdef -U CRYPTO_MDEBUG -m tasn_new.c
jsing [Wed, 15 Dec 2021 17:53:36 +0000 (17:53 +0000)]
unifdef -U CRYPTO_MDEBUG -m tasn_new.c

2 years agoAdd coverage for CBS additions.
jsing [Wed, 15 Dec 2021 17:37:42 +0000 (17:37 +0000)]
Add coverage for CBS additions.

2 years agoProvide various CBS_peek_* functions.
jsing [Wed, 15 Dec 2021 17:36:49 +0000 (17:36 +0000)]
Provide various CBS_peek_* functions.

These will be used in libcrypto.

With input from and ok tb@

2 years agoProvide CBS_get_u64().
jsing [Wed, 15 Dec 2021 17:30:20 +0000 (17:30 +0000)]
Provide CBS_get_u64().

This will be used in the libcrypto certificate transparency code.

ok tb@

2 years agoProvide CBS_get_last_u8().
jsing [Wed, 15 Dec 2021 17:23:34 +0000 (17:23 +0000)]
Provide CBS_get_last_u8().

This will be used in the TLSv1.3 record layer.

From BoringSSL.

ok tb@

2 years agostructure pads can leak uninitialized memory to userland via copyout,
deraadt [Wed, 15 Dec 2021 17:21:08 +0000 (17:21 +0000)]
structure pads can leak uninitialized memory to userland via copyout,
therefore the mandatory idiom is completely clearing structs before
building them for copyout -- that means ALMOST ALL STRUCTS, because
we never know when some architecture will pad a struct..  In two more
cases, the clearing wasn't performed.
from Reno Robert ZDI
ok millert bluhm

2 years agospamd: convert to opaque HMAC_CTX
tb [Wed, 15 Dec 2021 17:06:01 +0000 (17:06 +0000)]
spamd: convert to opaque HMAC_CTX

ok jsing

2 years agoSome more ASN.1 struct types that are postponed (because they are
schwarze [Wed, 15 Dec 2021 16:36:39 +0000 (16:36 +0000)]
Some more ASN.1 struct types that are postponed (because they are
related to templating macros) or intentionally undocumented.
Apart from NETSCAPE, PCTX, and low-level templating stuff,
all ASN.1 functions, types, and macros are now documented.

2 years agoThe PATH_MAX+1 bites. The PATH_MAX+1 bites. You die...
deraadt [Wed, 15 Dec 2021 16:29:29 +0000 (16:29 +0000)]
The PATH_MAX+1 bites.  The PATH_MAX+1 bites.  You die...
ok millert mlarkin

2 years agoSyzkaller found a dereference in igmp_leavegroup() where inm->inm_rti
bluhm [Wed, 15 Dec 2021 15:58:01 +0000 (15:58 +0000)]
Syzkaller found a dereference in igmp_leavegroup() where inm->inm_rti
is NULL.  It should be set in rti_fill(), but is not if malloc(9)
fails.  There is no rollback after malloc failure so the field stays
uninitialized.  The code is only called from ioctl, setsockopt or
a task.  Malloc should wait instead of failing, otherwise syscalls
would be unreliable.  While there also put an M_WAIT in the init
code.  During init malloc must not fail.
OK mvs@
Reported-by: syzbot+e22326057ccf34908d78@syzkaller.appspotmail.com
2 years agoAdjust pty and tty event filters
visa [Wed, 15 Dec 2021 15:30:47 +0000 (15:30 +0000)]
Adjust pty and tty event filters

* Implement EVFILT_EXCEPT for ttys for HUP condition detection.
  This filter is used when pollfd.events has no read/write events.

* Add HUP condition detection to filt_ptcwrite() and filt_ttywrite()
  to reflect ptcpoll() and ttpoll(). Only poll(2) and select(2) can
  utilize the code; kevent(2) should behave as before with EVFILT_WRITE.

* Clear EV_EOF and __EV_HUP if the EOF/HUP condition ends.

OK mpi@

2 years agoDocument i2c_ASN1_INTEGER(3).
schwarze [Wed, 15 Dec 2021 15:29:23 +0000 (15:29 +0000)]
Document i2c_ASN1_INTEGER(3).

While it was probably a mistake that steve@ made some i2c_*() and c2i_*()
functions public back in 2000 and while we would like to delete them from
the API, it may not be possible to delete this particular function because
in contrast to the others (which are already marked as intentionally
undocumented), this one is used by various real-world software, so for now,
explain what it does, just in case people find it in existing code.

While here, use the familiar term "byte" that we generally use
throughout all our manual pages, even though the ASN.1 standard
uses the term "octet" instead, which is more precise only in theory.

2 years agoUse a per-UVM object lock to serialize the lower part of the fault handler.
mpi [Wed, 15 Dec 2021 12:53:53 +0000 (12:53 +0000)]
Use a per-UVM object lock to serialize the lower part of the fault handler.

Like the per-amap lock the `vmobjlock' is principally used to serialized
access to objects in the fault handler to allow faults occurring on
different CPUs and different objects to be processed in parallel.

The fault handler now acquires the `vmobjlock' of a given UVM object as
soon as it finds one.  For now a write-lock is always acquired even if
some operations could use a read-lock.

Every pager, corresponding to a different kind of UVM object, now expect
the UVM object to be locked and some operations, like *_get() return it
unlocked.  This is enforced by assertions checking for rw_write_held().

The KERNEL_LOCK() is now pushed to the VFS boundary in the vnode pager.

To ensure the correct amap or object lock is held when modifying a page
many uvm_page* operations are now asserting for the "owner" lock.
However, fields of the "struct vm_page" are still being protected by the
global `pageqlock'.  To prevent lock ordering issues with the new
`vmobjlock' and to reduce differences with NetBSD this lock is now taken
and released for each page instead of around the whole loop.

This commit does not remove the KERNEL_LOCK/UNLOCK() dance.  Unlocking
will follow if there is no fallout.

Ported from NetBSD, tested by many, thanks!

ok kettenis@, kn@

2 years agoldapd always uses O_CREAT when reopening database files, so the database
jmatthew [Wed, 15 Dec 2021 11:36:40 +0000 (11:36 +0000)]
ldapd always uses O_CREAT when reopening database files, so the database
directory must be unveiled with "rwc" rather than just "rw".

ok deraadt@ mestre@

2 years agorestrict filesystem access with unveil(2).
mestre [Wed, 15 Dec 2021 11:23:09 +0000 (11:23 +0000)]
restrict filesystem access with unveil(2).

this one opens the default table file "/usr/share/misc/usb_hid_usages" through
hid_start(3) from libusbhid, then `dev' (will be the fd used on the ioctls)
and finally `conf' which is the file with the actions to be monitored. `conf'
needs to be unveil(2)ed with read perms since usbhidaction(1) can run as daemon
and this file will be re-read if a SIGHUP is catched.

looks good deraadt@

2 years agorestrict all filesystem access with unveil(2).
mestre [Wed, 15 Dec 2021 11:21:35 +0000 (11:21 +0000)]
restrict all filesystem access with unveil(2).

hid_start(3) opens `table' through libusbhid, then usbhidctl(1) itself opens
`dev', after that it's just performing ioctls on the fd left opened by the
latter so all fs access can be disabled.

2 years agoBump pkg-config version to 1.8.1
ratchov [Wed, 15 Dec 2021 08:30:34 +0000 (08:30 +0000)]
Bump pkg-config version to 1.8.1

2 years agogetcwd() operates on buffers of PATH_MAX including the NUL, and the +1
deraadt [Wed, 15 Dec 2021 04:01:52 +0000 (04:01 +0000)]
getcwd() operates on buffers of PATH_MAX including the NUL, and the +1
is not unneccesary. Different buffer sizes are actually dangerous, though
major problems are strangely rare.
ok millert

2 years agoPATH_MAX+1 rarely makes sense, and abort if this happens in the imsg.
deraadt [Wed, 15 Dec 2021 04:00:15 +0000 (04:00 +0000)]
PATH_MAX+1 rarely makes sense, and abort if this happens in the imsg.
ok jmatthew millert

2 years agotypo in previous
deraadt [Wed, 15 Dec 2021 00:37:21 +0000 (00:37 +0000)]
typo in previous

2 years agoCorrect value for IPTOS_DSCP_LE since it needs to allow for the preceeding
dtucker [Tue, 14 Dec 2021 23:47:36 +0000 (23:47 +0000)]
Correct value for IPTOS_DSCP_LE since it needs to allow for the preceeding
two ECN bits.  From daisuke.higashi at gmail.com via OpenSSH bz#3373,
ok claudio@, job@, djm@.

2 years agosys/param.h cleanup, mostly using MINIMUM() and <limits.h>
deraadt [Tue, 14 Dec 2021 21:25:27 +0000 (21:25 +0000)]
sys/param.h cleanup, mostly using MINIMUM() and <limits.h>
ok dtucker

2 years agosync
deraadt [Tue, 14 Dec 2021 20:52:47 +0000 (20:52 +0000)]
sync

2 years agotweak for the generated source
tb [Tue, 14 Dec 2021 20:37:24 +0000 (20:37 +0000)]
tweak for the generated source

2 years agomore symbols that are postponed or intentionally undocumented and
schwarze [Tue, 14 Dec 2021 20:21:45 +0000 (20:21 +0000)]
more symbols that are postponed or intentionally undocumented and
some regexp tweaks; the relevant parts of asn1.h are nearing completion

2 years agoforgotten .Dv macros in -column lists
schwarze [Tue, 14 Dec 2021 20:14:22 +0000 (20:14 +0000)]
forgotten .Dv macros in -column lists

2 years agoadd roff(7) comments listing some M_ASN1_* aliases
schwarze [Tue, 14 Dec 2021 19:36:18 +0000 (19:36 +0000)]
add roff(7) comments listing some M_ASN1_* aliases
that are intentionally undocumented

2 years agodelete incorrect comment about sys/cdefs.h
deraadt [Tue, 14 Dec 2021 18:16:14 +0000 (18:16 +0000)]
delete incorrect comment about sys/cdefs.h

2 years agoTo cache lookups, the policy ipo is linked to its SA tdb. There
bluhm [Tue, 14 Dec 2021 17:50:37 +0000 (17:50 +0000)]
To cache lookups, the policy ipo is linked to its SA tdb.  There
is also a list of SAs that belong to a policy.  To make it MP safe,
protect these pointers with a mutex.
tested by Hrvoje Popovski; OK mvs@

2 years agoConsolidate ASN.1 universal tag type data.
jsing [Tue, 14 Dec 2021 17:35:21 +0000 (17:35 +0000)]
Consolidate ASN.1 universal tag type data.

There are currently three different tables in three different files that
contain information about ASN.1 universal class tag types. Range checking
is also implemented in three different places (with different
implementations).

Consolidate all of this into a single table, provide a lookup function that
deals with the range checks and wrappers to deal with specific types.

ok inoguchi@ tb@

2 years agoAdd regress coverage for ASN1_get_object()
jsing [Tue, 14 Dec 2021 17:10:02 +0000 (17:10 +0000)]
Add regress coverage for ASN1_get_object()

2 years agoAdd regress for ASN1_tag2bit() and ASN1_tag2str()
jsing [Tue, 14 Dec 2021 17:07:57 +0000 (17:07 +0000)]
Add regress for ASN1_tag2bit() and ASN1_tag2str()

2 years agoAdd new 'unsopassgc' test. This test tries to beak unix(4) sockets garbage
mvs [Tue, 14 Dec 2021 16:12:48 +0000 (16:12 +0000)]
Add new 'unsopassgc' test. This test tries to beak unix(4) sockets garbage
collector and make it to clean `so_rcv' buffer of alive socket. Successful
breakage should produce kernel panic.

ok bluhm@ mpi@

2 years agoMove 'unixsock' test from regress/sys/kern/unixsock/ to
mvs [Tue, 14 Dec 2021 15:57:57 +0000 (15:57 +0000)]
Move 'unixsock' test from regress/sys/kern/unixsock/ to
regress/sys/kern/unixsockets/.

ok claudio@

2 years agoRemember to clear __EV_HUP when the other end of the FIFO has re-opened.
visa [Tue, 14 Dec 2021 15:53:42 +0000 (15:53 +0000)]
Remember to clear __EV_HUP when the other end of the FIFO has re-opened.

2 years agodocument the very quirky behaviour of the SMIME_OLDMIME flag
schwarze [Tue, 14 Dec 2021 15:46:48 +0000 (15:46 +0000)]
document the very quirky behaviour of the SMIME_OLDMIME flag

2 years agoCover all state checks and updates with spltty() in filt_ttyread().
visa [Tue, 14 Dec 2021 15:32:20 +0000 (15:32 +0000)]
Cover all state checks and updates with spltty() in filt_ttyread().

2 years agonew manual page SMIME_text(3)
schwarze [Tue, 14 Dec 2021 15:22:49 +0000 (15:22 +0000)]
new manual page SMIME_text(3)

2 years agonew manual page SMIME_read_ASN1(3)
schwarze [Tue, 14 Dec 2021 14:30:50 +0000 (14:30 +0000)]
new manual page SMIME_read_ASN1(3)
using parts of the text from SMIME_read_CMS(3) and SMIME_read_PKCS7(3)

2 years agoMove raw pubkey bytes to EVP_PKEY conversion to common function.
tobhe [Tue, 14 Dec 2021 13:44:36 +0000 (13:44 +0000)]
Move raw pubkey bytes to EVP_PKEY conversion to common function.

ok markus@

2 years agodrm/syncobj: Deal with signalled fences in drm_syncobj_find_fence.
jsg [Tue, 14 Dec 2021 13:32:09 +0000 (13:32 +0000)]
drm/syncobj: Deal with signalled fences in drm_syncobj_find_fence.

From Bas Nieuwenhuizen
2737d0bc21b6db199b4145e12b9f1745577d7944 in linux 5.10.y/5.10.85
b19926d4f3a660a8b76e5d989ffd1168e619a5c4 in mainline linux

2 years agodrm/amdkfd: fix boot failure when iommu is disabled in Picasso.
jsg [Tue, 14 Dec 2021 13:29:50 +0000 (13:29 +0000)]
drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

From Yifan Zhang
f3d9114ac99f4358809f44b390b304b8b53fb4a4 in linux 5.10.y/5.10.85
afd18180c07026f94a80ff024acef5f4159084a4 in mainline linux

2 years agodrm/amdgpu: init iommu after amdkfd device init
jsg [Tue, 14 Dec 2021 13:28:06 +0000 (13:28 +0000)]
drm/amdgpu: init iommu after amdkfd device init

From Yifan Zhang
7508a9aa65b959bbc6d9e42c9683520bddb7db0d in linux 5.10.y/5.10.85
714d9e4574d54596973ee3b0624ee4a16264d700 in mainline linux

2 years agodrm/amdgpu: move iommu_resume before ip init/resume
jsg [Tue, 14 Dec 2021 13:25:51 +0000 (13:25 +0000)]
drm/amdgpu: move iommu_resume before ip init/resume

From James Zhu
ac9db04ee32f007e48cb0763784ccfadd5a21342 in linux 5.10.y/5.10.85
f02abeb0779700c308e661a412451b38962b8a0b in mainline linux

2 years agodrm/amdgpu: add amdgpu_amdkfd_resume_iommu
jsg [Tue, 14 Dec 2021 13:24:12 +0000 (13:24 +0000)]
drm/amdgpu: add amdgpu_amdkfd_resume_iommu

From James Zhu
fe9dca7dda61f8f3b3000df2abe88c60d1bfab93 in linux 5.10.y/5.10.85
8066008482e533e91934bee49765bf8b4a7c40db in mainline linux

2 years agodrm/amdkfd: separate kfd_iommu_resume from kfd_resume
jsg [Tue, 14 Dec 2021 13:22:32 +0000 (13:22 +0000)]
drm/amdkfd: separate kfd_iommu_resume from kfd_resume

From James Zhu
5d191b0976b72af5f79cf217b9b7c2f20b522a2a in linux 5.10.y/5.10.85
fefc01f042f44ede373ee66773b8238dd8fdcb55 in mainline linux

2 years agodrm/amd/amdkfd: adjust dummy functions' placement
jsg [Tue, 14 Dec 2021 13:20:09 +0000 (13:20 +0000)]
drm/amd/amdkfd: adjust dummy functions' placement

From Lang Yu
46dcf66d6e7a64febe0575c62679287679dcb2b3 in linux 5.10.y/5.10.85
cd63989e0e6aa2eb66b461f2bae769e2550e47ac in mainline linux

2 years agouse bus_space_read_region_1() when reading bios from pci rom
jsg [Tue, 14 Dec 2021 12:48:15 +0000 (12:48 +0000)]
use bus_space_read_region_1() when reading bios from pci rom

Avoids 'BIOS signature incorrect 0 0' warning seen on sparc64
(where pci is mapped little endian) reported by Ted Bullock.

2 years agoIO::Socket::IP non-blocking connect works a bit differently than
bluhm [Tue, 14 Dec 2021 12:37:49 +0000 (12:37 +0000)]
IO::Socket::IP non-blocking connect works a bit differently than
IO::Socket::INET6.  Tweak the non-blocking for connect in the
sosplice scapy test.

2 years agoUse "rng-seed" and "kaslr-seed" properties from the device tree to mix in
kettenis [Tue, 14 Dec 2021 11:05:37 +0000 (11:05 +0000)]
Use "rng-seed" and "kaslr-seed" properties from the device tree to mix in
some extra entropy.

ok deraadt@

2 years agoDon't overwrite the Raspberry Pi config.txt if it already exists.
kettenis [Tue, 14 Dec 2021 11:01:58 +0000 (11:01 +0000)]
Don't overwrite the Raspberry Pi config.txt if it already exists.

ok sthen@, jsg@, deraadt@

2 years agoImplement support for selecting SGMII or SerDes mode depending on the
patrick [Tue, 14 Dec 2021 10:48:10 +0000 (10:48 +0000)]
Implement support for selecting SGMII or SerDes mode depending on the
plugged-in SFP transceiver and for reading out transceiver information
via ifconfig(8).  To read from the SFP, we need to let the card issue
I2C transfers.  Additionally we need I2C to read/write to the PHY when
MDIO is not available.  Depending on the SFP's supported media types
we can decide which mode to use.

This fixes hardware-initialization and link-up problems with some em(4)
Fiber NIC and SFP combinations.

Tested by dlg@ and been in snaps for quite a while
ok dlg@ jmatthew@

2 years agoA better approach is to defined __CONCAT locally
deraadt [Tue, 14 Dec 2021 07:20:16 +0000 (07:20 +0000)]
A better approach is to defined __CONCAT locally

2 years agosys/signal.h before sys/proc.h
deraadt [Tue, 14 Dec 2021 06:28:13 +0000 (06:28 +0000)]
sys/signal.h before sys/proc.h

2 years agoMINIMUM() because of no sys/param.h
deraadt [Tue, 14 Dec 2021 06:27:48 +0000 (06:27 +0000)]
MINIMUM() because of no sys/param.h

2 years agoadd missing sys/time.h include
anton [Tue, 14 Dec 2021 06:26:15 +0000 (06:26 +0000)]
add missing sys/time.h include

2 years agoSigh. This sys/cdefs.h is hiding use of __CONCAT in a non-C context.
deraadt [Tue, 14 Dec 2021 02:17:39 +0000 (02:17 +0000)]
Sigh.  This sys/cdefs.h is hiding use of __CONCAT in a non-C context.
Needs some other repairs first.

2 years agoadd pclk clock used by dwdog(4) on RK3399
chrisz [Mon, 13 Dec 2021 20:59:23 +0000 (20:59 +0000)]
add pclk clock used by dwdog(4) on RK3399

ok kettenis@

2 years agoFix asprintf() error check. Portable code should check the return
tb [Mon, 13 Dec 2021 19:47:40 +0000 (19:47 +0000)]
Fix asprintf() error check. Portable code should check the return
value for -1, not buf == NULL.

ok tobhe

2 years agoFix a few leaks due to X509_NAME_oneline(name, NULL, 0) dynamically
tb [Mon, 13 Dec 2021 19:46:22 +0000 (19:46 +0000)]
Fix a few leaks due to X509_NAME_oneline(name, NULL, 0) dynamically
allocating a buffer.

ok tobhe

2 years agonew manual page PEM_write_bio_ASN1_stream(3);
schwarze [Mon, 13 Dec 2021 18:55:22 +0000 (18:55 +0000)]
new manual page PEM_write_bio_ASN1_stream(3);
certainly not perfect, but arguably better than the even terser
PEM_write_bio_CMS_stream(3) and PEM_write_bio_PKCS7_stream(3)

2 years agosync
deraadt [Mon, 13 Dec 2021 18:55:03 +0000 (18:55 +0000)]
sync

2 years agotee(1): increase I/O buffer size from 8KB to 64KB
cheloha [Mon, 13 Dec 2021 18:33:23 +0000 (18:33 +0000)]
tee(1): increase I/O buffer size from 8KB to 64KB

64KB strikes a good balance between space and time on today's
machines.  Buffers smaller than 64KB waste more time in userspace
traveling to and from the kernel.  Buffers larger than 64KB do I/O a
bit faster, but the performance improvements rapidly diminish at a
steep memory cost.

Discussed with millert@ and deraadt@.  Positive feedback from Geoff
Steckel.

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

ok millert@ deraadt@

2 years agoincluding sys/cdefs.h manually started as a result of netbsd trying to
deraadt [Mon, 13 Dec 2021 18:28:39 +0000 (18:28 +0000)]
including sys/cdefs.h manually started as a result of netbsd trying to
macro-build a replacement for sccsid, and was done without any concern
for namespace damage.  Unfortunately this practice started infecting
other code as others were unaware they didn't need the file.
ok millert guenther

2 years agoAvoid a potential double free in group_free()
tb [Mon, 13 Dec 2021 18:06:56 +0000 (18:06 +0000)]
Avoid a potential double free in group_free()

In the unlikely event that EC_KEY_check_key() in ec_init() fails,
the group would be freed twice: once in ec_init(), and later in
group_free().

ok tobhe

2 years agoKill sys/cdefs.h includes, because overly complicated include+macro
deraadt [Mon, 13 Dec 2021 18:04:28 +0000 (18:04 +0000)]
Kill sys/cdefs.h includes, because overly complicated include+macro
for a sccsid replacement scheme which results an namespace damage
is an unfair trade
ok bluhm

2 years agoRemove the last internal use of d2i_ASN1_BOOLEAN.
tb [Mon, 13 Dec 2021 17:58:41 +0000 (17:58 +0000)]
Remove the last internal use of d2i_ASN1_BOOLEAN.

From Stephen Henson, OpenSSL 564df0dd

ok jsing

2 years agoClean up d2i_ASN1_BOOLEAN() and i2d_ASN1_BOOLEAN().
jsing [Mon, 13 Dec 2021 17:56:15 +0000 (17:56 +0000)]
Clean up d2i_ASN1_BOOLEAN() and i2d_ASN1_BOOLEAN().

Convert these to templated ASN.1, given we already have ASN1_BOOLEAN_it.

ok inoguchi@ tb@

2 years agothis file doesn't use anything from <stdio.h>;
schwarze [Mon, 13 Dec 2021 17:55:53 +0000 (17:55 +0000)]
this file doesn't use anything from <stdio.h>;
in particular, NULL is also in <stdlib.h> according to the C99 standard;
"free commit" tb@

2 years agoConvert asn1_d2i_ex_primitive()/asn1_collect() from BUF_MEM to CBB.
jsing [Mon, 13 Dec 2021 17:50:24 +0000 (17:50 +0000)]
Convert asn1_d2i_ex_primitive()/asn1_collect() from BUF_MEM to CBB.

With this we get simpler code, overflow checking and more sensible
memory ownership. Also switch the free_cont case to freezero() since this
could contain secrets.

ok inoguchi@ tb@

2 years agoCleanup libcrypto memory management. Remove redundant NULL checks
tobhe [Mon, 13 Dec 2021 17:35:34 +0000 (17:35 +0000)]
Cleanup libcrypto memory management.  Remove redundant NULL checks
before calling *_free() functions.  Use 'get0' functions where it
makes sense to avoid some frees.

Feedback and ok tb@

2 years agonew manual page SMIME_write_ASN1(3);
schwarze [Mon, 13 Dec 2021 17:24:39 +0000 (17:24 +0000)]
new manual page SMIME_write_ASN1(3);
still vague in various respects, but it's a start