openbsd
9 months agoapldcp(4) and apldrm(4)
kettenis [Mon, 22 Jan 2024 18:56:18 +0000 (18:56 +0000)]
apldcp(4) and apldrm(4)

9 months agoAdd apldcp(4) and apldrm(4). Together these drivers provide KMS
kettenis [Mon, 22 Jan 2024 18:54:01 +0000 (18:54 +0000)]
Add apldcp(4) and apldrm(4).  Together these drivers provide KMS
functionality on Apple Silicom machines.  At this point the drivers
provide significant power savings when the display is blanked (and
during suspend) and backlight control.  Some support for HDMI output
is also included, but for now only when HDMI is used as the primary output.
In the future this should also provide displayport support.

This is a port of the the Asahi Linux drivers which can be found at

  https://github.com/AsahiLinux/linux/tree/asahi-wip

Note that this branch gets rebased from time to time.

These drivers do *not* bring us GPU accelerated graphics.  But there
are reports that things run "smoother".

There are some known bugs with backlight control: the backlight level
may not be restored properly after the display has been blanked, and
changing the backlight quickly un succession may break the backlight
control.

ok jsg@

9 months agoSimilar to getpwnam(3) and getnetgrent(3), it is better to call
deraadt [Mon, 22 Jan 2024 17:22:58 +0000 (17:22 +0000)]
Similar to getpwnam(3) and getnetgrent(3), it is better to call
libc-private __hash_open() than the generic dbopen(3) which pulls
in all 3 database backends.
ok millert

9 months agogetpwnam(3) uses dbopen(3), which pulls all 3 database backends into
deraadt [Mon, 22 Jan 2024 17:21:52 +0000 (17:21 +0000)]
getpwnam(3) uses dbopen(3), which pulls all 3 database backends into
static binaries.  If we call libc-private __hash_open() instead, it
results in a ~40K reduction in many static binaries.
ok millert

9 months agoIncrease buffer size to avoid truncating styles, GitHub issue 3809 from
nicm [Mon, 22 Jan 2024 16:34:46 +0000 (16:34 +0000)]
Increase buffer size to avoid truncating styles, GitHub issue 3809 from
Ricardo Bittencourt.

9 months agoWhen getpwnam(3) reaches out to YP, it calls clntudp_create(3) with a
deraadt [Mon, 22 Jan 2024 16:18:06 +0000 (16:18 +0000)]
When getpwnam(3) reaches out to YP, it calls clntudp_create(3) with a
pre-initialized ypconnect(2) socket.  That calls clntudp_bufcreate(),
which contains code checking if the socket and address are configured..
If not, socket(2) is called, or an address allocation is performed via
the portmapper (which calls a whole lot more code).

Split clnt_udp.c into two .c files (which will compile as seperate .o
files), and create a new libc-private clntudp_bufcreate_simple() function
which skips the socket and address work.

Result: In most static binaries, this reduces the text segment by
~100K, and removes 5-7 system call stubs -- which might matter for
non-pledged binaries with otherwise lack socket(2).
ok millert jmatthew

9 months agoLink CMS_signed_add1_attr(3) to tree structure of crypto(3) manuals and
tb [Mon, 22 Jan 2024 14:00:13 +0000 (14:00 +0000)]
Link CMS_signed_add1_attr(3) to tree structure of crypto(3) manuals and
add a back reference from CMS_get0_SignerInfos(3).

9 months agoSimplify history section to match what other manuals do
tb [Mon, 22 Jan 2024 13:54:46 +0000 (13:54 +0000)]
Simplify history section to match what other manuals do

9 months agosync
tb [Mon, 22 Jan 2024 13:47:50 +0000 (13:47 +0000)]
sync

9 months agoDocument various CMS_{signed,unsigned}_* functions
job [Mon, 22 Jan 2024 13:44:59 +0000 (13:44 +0000)]
Document various CMS_{signed,unsigned}_* functions

These functions change signed & unsigned attributes of a CMS SignerInfo object

With & OK tb@

9 months agomake a note about when to remove overly verbose logging for pinsyscall violations
deraadt [Mon, 22 Jan 2024 04:38:32 +0000 (04:38 +0000)]
make a note about when to remove overly verbose logging for pinsyscall violations

9 months agodrm/amd/display: Pass pwrseq inst for backlight and ABM
jsg [Mon, 22 Jan 2024 03:20:08 +0000 (03:20 +0000)]
drm/amd/display: Pass pwrseq inst for backlight and ABM

From Lewis Huang
71be0f674070a5ad54a1c4fb112bb2923b28ea50 in linux-6.6.y/6.6.13
b17ef04bf3a4346d66404454d6a646343ddc9749 in mainline linux

9 months agodrm/crtc: fix uninitialized variable use
jsg [Mon, 22 Jan 2024 03:16:43 +0000 (03:16 +0000)]
drm/crtc: fix uninitialized variable use

From Jani Nikula
7e881af7fb3c2ddc0c29b249250606fbe004f353 in linux-6.6.y/6.6.13
6e455f5dcdd15fa28edf0ffb5b44d3508512dccf in mainline linux

9 months agodrm/amd/display: get dprefclk ss info from integration info table
jsg [Mon, 22 Jan 2024 03:15:16 +0000 (03:15 +0000)]
drm/amd/display: get dprefclk ss info from integration info table

From Charlene Liu
a5ba95c226b5c25cd5c8b9df29a1953c85a1531e in linux-6.6.y/6.6.13
51e7b64690776a9981355428b537af9048308a95 in mainline linux

9 months agodrm/amd/display: Add case for dcn35 to support usb4 dmub hpd event
jsg [Mon, 22 Jan 2024 03:12:06 +0000 (03:12 +0000)]
drm/amd/display: Add case for dcn35 to support usb4 dmub hpd event

From Wayne Lin
18562b1691e2280858f291d00678468cf70bda5a in linux-6.6.y/6.6.13
989824589f793120833bef13aa4e21f5a836a707 in mainline linux

9 months agodrm/amdkfd: svm range always mapped flag not working on APU
jsg [Mon, 22 Jan 2024 03:09:50 +0000 (03:09 +0000)]
drm/amdkfd: svm range always mapped flag not working on APU

From Philip Yang
bd443910debf71a1c0140c148ffb4f048fff3c2b in linux-6.6.y/6.6.13
ebab8c3eb6a6515dc14cd93fc29dd287709da6d3 in mainline linux

9 months agodrm/crtc: Fix uninit-value bug in drm_mode_setcrtc
jsg [Mon, 22 Jan 2024 03:07:51 +0000 (03:07 +0000)]
drm/crtc: Fix uninit-value bug in drm_mode_setcrtc

From Ziqi Zhao
ff89e507b231a3afbddc2972a850947b73247a3b in linux-6.6.y/6.6.13
3823119b9c2b5f9e9b760336f75bc989b805cde6 in mainline linux

9 months agodrm/amdgpu: Add NULL checks for function pointers
jsg [Mon, 22 Jan 2024 03:05:55 +0000 (03:05 +0000)]
drm/amdgpu: Add NULL checks for function pointers

From Lijo Lazar
fb26de4a86e19711880e7e845505505f01d2eb82 in linux-6.6.y/6.6.13
81577503efb49f4ad76af22f9941d72900ef4aab in mainline linux

9 months agodrm/amd/display: Add monitor patch for specific eDP
jsg [Mon, 22 Jan 2024 03:03:39 +0000 (03:03 +0000)]
drm/amd/display: Add monitor patch for specific eDP

From Ivan Lipski
7fc3d8ea1a675eae9ee57dca894a9c4fb0e0d8b5 in linux-6.6.y/6.6.13
3d71a8726e05a35beb9de394e86ce896d69e563f in mainline linux

9 months agoRevert "drm/prime: Unexport helpers for fd/handle conversion"
jsg [Mon, 22 Jan 2024 03:01:25 +0000 (03:01 +0000)]
Revert "drm/prime: Unexport helpers for fd/handle conversion"

From Felix Kuehling
379af079c42738fa3f33de5912931a7865887c62 in linux-6.6.y/6.6.13
0514f63cfff38a0dcb7ba9c5f245827edc0c5107 in mainline linux

9 months agodrm/amdgpu: Use another offset for GC 9.4.3 remap
jsg [Mon, 22 Jan 2024 02:57:26 +0000 (02:57 +0000)]
drm/amdgpu: Use another offset for GC 9.4.3 remap

From Lijo Lazar
941887dc5ed4ef85ad06f3e76bcd444d9d5bc839 in linux-6.6.y/6.6.13
ed6e4f0a27ebafffbd12bf3878ab004787685d8a in mainline linux

9 months agodrm/amdkfd: Free gang_ctx_bo and wptr_bo in pqm_uninit
jsg [Mon, 22 Jan 2024 02:55:58 +0000 (02:55 +0000)]
drm/amdkfd: Free gang_ctx_bo and wptr_bo in pqm_uninit

From ZhenGuo Yin
ccba042816400a82ed5d3d2f7b4ed79403d20c4c in linux-6.6.y/6.6.13
72838777aa38352e20301e123b97110c456cd38e in mainline linux

9 months agodrm/amdgpu: Fix cat debugfs amdgpu_regs_didt causes kernel null pointer
jsg [Mon, 22 Jan 2024 02:54:33 +0000 (02:54 +0000)]
drm/amdgpu: Fix cat debugfs amdgpu_regs_didt causes kernel null pointer

From Lu Yao
61dfdb779048332546358ac1847f0bbb07367162 in linux-6.6.y/6.6.13
2161e09cd05a50d80736fe397145340d2e8f6c05 in mainline linux

9 months agodrm/amd/display: update dcn315 lpddr pstate latency
jsg [Mon, 22 Jan 2024 02:52:31 +0000 (02:52 +0000)]
drm/amd/display: update dcn315 lpddr pstate latency

From Dmytro Laktyushkin
6396b551f28668aa376e281993ff0790bc8e7b9e in linux-6.6.y/6.6.13
c92da0403d373c03ea5c65c0260c7db6762013b0 in mainline linux

9 months agodrm/amdkfd: Use common function for IP version check
jsg [Mon, 22 Jan 2024 02:50:19 +0000 (02:50 +0000)]
drm/amdkfd: Use common function for IP version check

From Mukul Joshi
867ecd8970d33ae4e269a7f24d037c35dcc79290 in linux-6.6.y/6.6.13
2f86bf79b63dbe6963ebc647b77a5f576a906b40 in mainline linux

9 months agodrm/amdgpu: Do not issue gpu reset from nbio v7_9 bif interrupt
jsg [Mon, 22 Jan 2024 02:48:42 +0000 (02:48 +0000)]
drm/amdgpu: Do not issue gpu reset from nbio v7_9 bif interrupt

From Hawking Zhang
541cb7618a15674ccad4d6878f65fa3241009cb6 in linux-6.6.y/6.6.13
884e9b0827e889a8742e203ccd052101fb0b945d in mainline linux

9 months agougly whitespaces
deraadt [Mon, 22 Jan 2024 02:08:31 +0000 (02:08 +0000)]
ugly whitespaces

9 months agoReplace more occurrences of OBJ_NAME_do_all_sorted() with
tb [Sun, 21 Jan 2024 19:08:59 +0000 (19:08 +0000)]
Replace more occurrences of OBJ_NAME_do_all_sorted() with
OBJ_NAME_do_all()

9 months agoupdate docs on madvise/msync/minherit behaviour in relation to immutable memory;...
deraadt [Sun, 21 Jan 2024 17:46:03 +0000 (17:46 +0000)]
update docs on madvise/msync/minherit behaviour in relation to immutable memory; ok kettenis

9 months agoworkaround for the static non-PIE instbin "instbin" program on the install
deraadt [Sun, 21 Jan 2024 17:21:55 +0000 (17:21 +0000)]
workaround for the static non-PIE instbin "instbin" program on the install
media is no longer needed, due to fix in libc/dlfcn/init.c
thanks kettenis and gkoehler

9 months agoStatic non-PIE binaries always have a base address of 0 (even if the ELF
kettenis [Sun, 21 Jan 2024 17:18:13 +0000 (17:18 +0000)]
Static non-PIE binaries always have a base address of 0 (even if the ELF
headers start at a higher address).  Using the wrong base address meant
that we were protecting the wrong address range for the malloc internals
which made the code error out now that mimmutable(2) no longer allows an
RW->R transition.  Issue found by gkoehler@ who got most of the way
towards a proper fix.

ok deraadt@

9 months agoAdd Xr mimmutable to manual pages which discuss immutable memory.
deraadt [Sun, 21 Jan 2024 17:00:42 +0000 (17:00 +0000)]
Add Xr mimmutable to manual pages which discuss immutable memory.
prodding from kettenis

9 months agoFor minherit(MAP_INHERIT_ZERO) upon readonly memory return EPERM.
deraadt [Sun, 21 Jan 2024 16:59:15 +0000 (16:59 +0000)]
For minherit(MAP_INHERIT_ZERO) upon readonly memory return EPERM.
ok kettenis

9 months agomadvise(2) and msync(2) have some memory/mapping destructive ops which should
deraadt [Sun, 21 Jan 2024 16:57:06 +0000 (16:57 +0000)]
madvise(2) and msync(2) have some memory/mapping destructive ops which should
not be allowed upon immutable memory, instead return EPERM.
Some of these ops are not destructive in OpenBSD, but they are destructive
on other systems, so we take the "all ops" are illegal approach.

Related to this, it should not be allowed to minherit(MAP_INHERIT_ZERO)
immutable regions, or vice versa, calling mimmutable() upon MAP_INHERIT_ZERO
regions, because such a range will be zero'd post-fork in the child.
These now also return EPERM.

Adjusting the madvise / msync behaviour upon immutable memory brings us
closer to the behaviour of the mimmutable clone "mseal" being proposed by
google for inclusion in Linux.
ok kettenis

9 months agoAdd support for multiple matches in the component code.
kettenis [Sun, 21 Jan 2024 13:36:40 +0000 (13:36 +0000)]
Add support for multiple matches in the component code.

ok jsg@

9 months agosync with userland
tb [Sun, 21 Jan 2024 07:46:55 +0000 (07:46 +0000)]
sync with userland

9 months agoSync with upstream as of Jan 20
tb [Sun, 21 Jan 2024 07:46:16 +0000 (07:46 +0000)]
Sync with upstream as of Jan 20

No change of compiled code: the bug fix in check_match() affects ZLIB_DEBUG
builds only and the Z_ARG macro is unused.

9 months agosync with userland
tb [Sun, 21 Jan 2024 07:35:28 +0000 (07:35 +0000)]
sync with userland

9 months agolibz: sync with upstream's develop branch as of Jan 18
tb [Sun, 21 Jan 2024 07:34:39 +0000 (07:34 +0000)]
libz: sync with upstream's develop branch as of Jan 18

9 months agoDefine HAVE_HIDDEN for libz
tb [Sun, 21 Jan 2024 07:33:46 +0000 (07:33 +0000)]
Define HAVE_HIDDEN for libz

This adds the hidden visibility attribute to functions that are needed in
multiple source files of the library but not part of the public API. This
is technically a major bump, but that decided to be overkill.

discussed with deraadt and millert

9 months agoPrint raw battery information if KB3310_DEBUG, not DEBUG. NFC
miod [Sun, 21 Jan 2024 07:17:06 +0000 (07:17 +0000)]
Print raw battery information if KB3310_DEBUG, not DEBUG. NFC

9 months agoAssert that inpcb table has correct address family.
bluhm [Sun, 21 Jan 2024 01:17:20 +0000 (01:17 +0000)]
Assert that inpcb table has correct address family.

Since inpcb tables for UDP and Raw IP have been split into IPv4 and
IPv6, assert that INP_IPV6 flag is correct instead of checking it.
While there, give the table variable a nicer name.

OK sashan@ mvs@

9 months agooops, brain scrambled trying to squeeze the ifdef into bad place
deraadt [Sun, 21 Jan 2024 00:26:14 +0000 (00:26 +0000)]
oops, brain scrambled trying to squeeze the ifdef into bad place

9 months agosome bizzare glitch related to ramdisk instbin static binaries, their
deraadt [Sun, 21 Jan 2024 00:23:29 +0000 (00:23 +0000)]
some bizzare glitch related to ramdisk instbin static binaries, their
mutable mapping is not working right, so temporarily bring back the
RW -> R *only* for ramdisk kernels

9 months agovmm(4)/vmd(8)/vmctl(8): increase max VM mem size.
mlarkin [Sat, 20 Jan 2024 20:11:24 +0000 (20:11 +0000)]
vmm(4)/vmd(8)/vmctl(8): increase max VM mem size.

MAXDSIZ was cranked to 128GB back in April 2023, but vmd(8) was limiting
VM RAM size to the old value (32GB).

9 months agoBetter formatting for pax extended header times
jca [Sat, 20 Jan 2024 17:34:50 +0000 (17:34 +0000)]
Better formatting for pax extended header times

As specified, don't include the subsecond part if zero and drop trailing
zeros in the subsecond part.  ok millert@

9 months agoEarly during mimmutable(2) development, we had a big problem with the
deraadt [Sat, 20 Jan 2024 13:19:37 +0000 (13:19 +0000)]
Early during mimmutable(2) development, we had a big problem with the
chrome v8_flags variable's placement in bss, and as a workaround made
it possible to demote a mimmutable mapping's permissions from RW to R.
Further mimmutable-related work in libc's malloc created the same
problem, which led to a better design: objects could be placed into
.openbsd.mutable region, and then at runtime their permission and
immutability could be manipulated better.  So the RW to R demotion
logic is no longer being used, and now this semantic is being deleted.
ok kettenis

9 months agoAEXECVE can be removed, because pinsyscall SYS_execve detection has
deraadt [Sat, 20 Jan 2024 12:16:55 +0000 (12:16 +0000)]
AEXECVE can be removed, because pinsyscall SYS_execve detection has
been deleted.

9 months agolink the infcover test statically in preparation of zlib changes
tb [Sat, 20 Jan 2024 11:29:40 +0000 (11:29 +0000)]
link the infcover test statically in preparation of zlib changes

9 months agoThere are several DART variants; print some more details such that we can
kettenis [Sat, 20 Jan 2024 11:22:46 +0000 (11:22 +0000)]
There are several DART variants; print some more details such that we can
distinguish between them.  Pay attention to the apple,dma-range property
that tells us the desired DVA window.  Add support for a new BUS_DMA_FIXED
that allows use of bus_dmamap_load_raw(9) to map things at a pre-determined
DVA.  This last change is needed for the upcoming Apple KMS driver.
Hopefully that is the only driver that will need this, so don't attempt to
turn this into an MI feature.

ok patrick@

9 months agoMerge docs of crc32_combine_{gen,op} from zlib.h
tb [Sat, 20 Jan 2024 11:16:27 +0000 (11:16 +0000)]
Merge docs of crc32_combine_{gen,op} from zlib.h

Also add two 'len2 must be non-negative.'

from upstream
looks good to jmc

9 months agoUse imsg_get_fd() to access the fd passed via imsgs.
claudio [Sat, 20 Jan 2024 09:01:03 +0000 (09:01 +0000)]
Use imsg_get_fd() to access the fd passed via imsgs.

Most of the conversion is simple there is just log_imsg() that can
no longer display the fd since imsg_get_fd() can only be called once.
OK op@

9 months agoFetch touchpad dimensions from firmware here as well.
kettenis [Sat, 20 Jan 2024 08:00:59 +0000 (08:00 +0000)]
Fetch touchpad dimensions from firmware here as well.

ok mlarkin@, tobhe@

9 months agoImplement extent_alloc_region_with_descr(9) which is the equivalent of
kettenis [Fri, 19 Jan 2024 22:12:24 +0000 (22:12 +0000)]
Implement extent_alloc_region_with_descr(9) which is the equivalent of
extent_alloc_region(9) that uses a pre-allocated region descriptor.

ok patrick@

9 months agoremove the guts of pinsyscall(2), it just returns 0 now.
deraadt [Fri, 19 Jan 2024 21:20:35 +0000 (21:20 +0000)]
remove the guts of pinsyscall(2), it just returns 0 now.
It has been made redundant by the introduction of pinsyscalls(2) which
handles all system calls, rather than just 1.

9 months agoMore files to be blessed by the clean target.
miod [Fri, 19 Jan 2024 20:06:00 +0000 (20:06 +0000)]
More files to be blessed by the clean target.

9 months agoMake our mktemp(3) callback-driven and split into multiple files.
millert [Fri, 19 Jan 2024 19:45:02 +0000 (19:45 +0000)]
Make our mktemp(3) callback-driven and split into multiple files.
Previously, calling any of the mktemp(3) family would pull in
lstat(2), open(2) and mkdir(2).  Now, only the necessary system
calls will be reachable from the binary.  OK deraadt@ guenther@

9 months agougly whitespace
deraadt [Fri, 19 Jan 2024 18:58:17 +0000 (18:58 +0000)]
ugly whitespace

9 months agoImplement Multiple Message MSI support on amd64. This is experimental code
kettenis [Fri, 19 Jan 2024 18:38:16 +0000 (18:38 +0000)]
Implement Multiple Message MSI support on amd64.  This is experimental code
to assist qwx(4) development.  We may remove this code again at some point
in the future.

Multiple Message MSI has some serious design flaws, especially when
combined with the APIC interrupt controller architecture.  It was
superseded by MSI-X.  Unfortunately qwx(4) does not implement MSI-X.

ok stsp@, deraadt@

9 months agoRename WSDISPLAY_TYPE_RKDRM to WSDISPLAY_TYPE_KMS such that we can use it
kettenis [Fri, 19 Jan 2024 17:51:15 +0000 (17:51 +0000)]
Rename WSDISPLAY_TYPE_RKDRM to WSDISPLAY_TYPE_KMS such that we can use it
for other generic KMS drivers.

ok jsg@, matthieu@

9 months ago_execvesize.c is no longer generated to support pinsyscall(SYS_execve
deraadt [Fri, 19 Jan 2024 17:02:28 +0000 (17:02 +0000)]
_execvesize.c is no longer generated to support pinsyscall(SYS_execve

9 months agoMove mktemp.c to stdlib where it belongs.
millert [Fri, 19 Jan 2024 16:30:28 +0000 (16:30 +0000)]
Move mktemp.c to stdlib where it belongs.
OK deraadt@

9 months agosync
deraadt [Fri, 19 Jan 2024 16:14:58 +0000 (16:14 +0000)]
sync

9 months agoM_PINSYSCALL is for pinsyscalls(2), not pinsyscall(2)
deraadt [Fri, 19 Jan 2024 15:10:27 +0000 (15:10 +0000)]
M_PINSYSCALL is for pinsyscalls(2), not pinsyscall(2)

9 months agopinsyscall(SYS_execve) will soon go away, so the sys/acct.h bit AEXECVE
deraadt [Fri, 19 Jan 2024 14:25:03 +0000 (14:25 +0000)]
pinsyscall(SYS_execve) will soon go away, so the sys/acct.h bit AEXECVE
can also be remove.  Delete the code using it from the one program that
inspects it.

9 months agoStop initializing pinsyscall(SYS_execve in dynamic binaries that contain
deraadt [Fri, 19 Jan 2024 14:16:41 +0000 (14:16 +0000)]
Stop initializing pinsyscall(SYS_execve in dynamic binaries that contain
a reference reaching the execve(2) stub.  The new pinsyscalls(2) that
applies to all system calls has made this redundant.

9 months agoStop initializing pinsyscall(SYS_execve in static binaries that contain
deraadt [Fri, 19 Jan 2024 14:15:51 +0000 (14:15 +0000)]
Stop initializing pinsyscall(SYS_execve in static binaries that contain
an execve(2) stub.  The new pinsyscalls(2) that applies to all system
calls has made this redundant.

9 months agoEnable shutdown regress test.
jsing [Fri, 19 Jan 2024 08:29:26 +0000 (08:29 +0000)]
Enable shutdown regress test.

9 months agoAdd regress test coverage for SSL_shutdown().
jsing [Fri, 19 Jan 2024 08:29:08 +0000 (08:29 +0000)]
Add regress test coverage for SSL_shutdown().

This tests and codifies the behaviour of SSL_shutdown() with respect to
SSL_quiet_shutdown() and SSL_set_shutdown(). For now, only the legacy stack
(TLSv1.2) is tested, as there are currently some subtle differences with
the TLSv1.3 stack.

9 months agoadd iwn(4) to arm64 GENERIC
mlarkin [Fri, 19 Jan 2024 06:59:10 +0000 (06:59 +0000)]
add iwn(4) to arm64 GENERIC

ok kettenis

9 months agoDefine the IPv6 related attributes from RFC 2865.
yasuoka [Fri, 19 Jan 2024 06:32:28 +0000 (06:32 +0000)]
Define the IPv6 related attributes from RFC 2865.

9 months agoconsolidate pci and cardbus detach code, and have it detach kstats.
dlg [Fri, 19 Jan 2024 03:46:14 +0000 (03:46 +0000)]
consolidate pci and cardbus detach code, and have it detach kstats.

this solves one probably with an re(4) going away.

9 months agoAdd TSO support. Previous commit fixed up a bug that could only be
jmatthew [Fri, 19 Jan 2024 03:25:13 +0000 (03:25 +0000)]
Add TSO support.  Previous commit fixed up a bug that could only be
triggered with TCP socket splicing and TSO, and with that fixed, it
works reliably.

tested by hrvoje, jan@, mbuhl@, bluhm@, feedback from jan@ and bluhm@,
ok jan@ mbuhl@ bluhm@

9 months agoUnify inpcb API for inet and inet6.
bluhm [Fri, 19 Jan 2024 02:24:07 +0000 (02:24 +0000)]
Unify inpcb API for inet and inet6.

Many functions for IPv4 call their IPv6 counterpart if INP_IPV6 is
set at the socket's pcb.  By using the generic API consistently,
the logic is not in the caller it gets more readable.

OK mvs@

9 months agoBackout priterator() for walking allprocess list.
bluhm [Fri, 19 Jan 2024 01:43:26 +0000 (01:43 +0000)]
Backout priterator() for walking allprocess list.

This approach does not work as LIST_NEXT() of a removed element
does not return NULL.  I causes a crash in syzcaller and triggers
kernel diagnostic assertion "vp->v_uvcount == 0" in sys/kern/kern_unveil.c
line 845 during reboot.  Unfortunately the backout brings back the
race in fill_file() and fstat(1) may crash the kernel.

Reported-by: syzbot+54fba1c004d7383d5e85@syzkaller.appspotmail.com
9 months agothe warning about syscall going away is a bit dated now.
deraadt [Thu, 18 Jan 2024 19:00:11 +0000 (19:00 +0000)]
the warning about syscall going away is a bit dated now.
ok miod tb

9 months agoec_point_conversion: zap an empty line
tb [Thu, 18 Jan 2024 16:49:40 +0000 (16:49 +0000)]
ec_point_conversion: zap an empty line

9 months agoSwitch from EVP_CIPHER_type() to EVP_CIPHER_nid()
tb [Thu, 18 Jan 2024 16:30:43 +0000 (16:30 +0000)]
Switch from EVP_CIPHER_type() to EVP_CIPHER_nid()

EVP_CIPHER_type() will never return NID_gost89_cnt since it has no
associated ASN1_OBJECT. Switching to EVP_CIPHER_nid() has a slight
chance of working. Do that before beck applies the flensing knife.

ok beck

9 months agofix macro to look more like a function, remove extraneous ;
espie [Thu, 18 Jan 2024 15:34:29 +0000 (15:34 +0000)]
fix macro to look more like a function, remove extraneous ;
(clang's -Weverything would correctly warn about the resulting empty
statement)

No generated code change

9 months agoConvert IMSG_UPDATE and session_update() to new imsg API and ibufs.
claudio [Thu, 18 Jan 2024 14:56:44 +0000 (14:56 +0000)]
Convert IMSG_UPDATE and session_update() to new imsg API and ibufs.
OK tb@

9 months agoUse imsg_get_fd() in vmd.
claudio [Thu, 18 Jan 2024 14:49:59 +0000 (14:49 +0000)]
Use imsg_get_fd() in vmd.

vmd uses a lot of fd passing and does it sometimes via extra abstraction
so this just tries to convert the code without any optimisations.

ok dv@

9 months agoConvert the simple imsgs to use imsg_get_data().
claudio [Thu, 18 Jan 2024 14:46:21 +0000 (14:46 +0000)]
Convert the simple imsgs to use imsg_get_data().
OK tb@

9 months agoThe CRL's purported signing time actually is called thisUpdate, not lastUpdate
job [Thu, 18 Jan 2024 14:34:26 +0000 (14:34 +0000)]
The CRL's purported signing time actually is called thisUpdate, not lastUpdate

OK tb@ claudio@

9 months agoMove the rtable_exists() check into in_pcbset_rtableid().
claudio [Thu, 18 Jan 2024 11:03:16 +0000 (11:03 +0000)]
Move the rtable_exists() check into in_pcbset_rtableid().
OK bluhm@ mvs@

9 months agoConvert privsep imsg code to use imsg_get_fd().
claudio [Thu, 18 Jan 2024 09:58:23 +0000 (09:58 +0000)]
Convert privsep imsg code to use imsg_get_fd().

ok yasuoka

9 months agoFix IMSG_RECONF_ASPA handling. The rde did not expect what the rtr process
claudio [Thu, 18 Jan 2024 09:39:36 +0000 (09:39 +0000)]
Fix IMSG_RECONF_ASPA handling. The rde did not expect what the rtr process
was sending and hit the error path because of that. Since the encoding
as two uint32_t in rtr.c is awkward use the same way that the parent is
sending the aspa sets. This uses a local copy so that the included expire
filed is forced to 0 (the RDE does not use that field).
OK tb@

9 months agoreduce diff to linux
jsg [Thu, 18 Jan 2024 08:50:27 +0000 (08:50 +0000)]
reduce diff to linux

9 months agoUse solock() instead of netlock within fill_file(). This makes all
mvs [Thu, 18 Jan 2024 08:48:32 +0000 (08:48 +0000)]
Use solock() instead of netlock within fill_file(). This makes all
socket types protected. The netlock is still used while fill_file()
called through *table.inpt_queue walkthroughs, but this is the inet
sockets case.

ok bluhm

9 months agoUse `nowake' as tsleep_nsec(9) ident. It has no corresponding wakeup(9).
mvs [Thu, 18 Jan 2024 08:46:41 +0000 (08:46 +0000)]
Use `nowake' as tsleep_nsec(9) ident. It has no corresponding wakeup(9).

ok bluhm

9 months agoremove duplicate defines, merge error from local patches
jsg [Thu, 18 Jan 2024 07:52:37 +0000 (07:52 +0000)]
remove duplicate defines, merge error from local patches

9 months agoremove duplicate steam deck block, merge error from local patches
jsg [Thu, 18 Jan 2024 06:24:03 +0000 (06:24 +0000)]
remove duplicate steam deck block, merge error from local patches

9 months agoInstead of skipping the call to hdcp_destroy(), use NULL for the kobject
jsg [Thu, 18 Jan 2024 05:01:52 +0000 (05:01 +0000)]
Instead of skipping the call to hdcp_destroy(), use NULL for the kobject
argument.  Unused in the function itself as we define away
sysfs_remove_bin_file().

9 months agoFix core file writing when a file map into memory has later been truncated
kurt [Wed, 17 Jan 2024 22:22:25 +0000 (22:22 +0000)]
Fix core file writing when a file map into memory has later been truncated
to be smaller than the mapping. Record which memory segments are backed by
vnodes while walking the uvm map and later suppress EFAULT errors caused
by the underlying file being truncated. okay miod@

9 months agoSince pinsyscalls(2) applies to all system calls and does a more precise
deraadt [Wed, 17 Jan 2024 18:56:13 +0000 (18:56 +0000)]
Since pinsyscalls(2) applies to all system calls and does a more precise
check earlier, the pinsyscall(SYS_execve mechanism has become redundant.
It needs to be removed delicately since ld.so and static binaries use it.
As a first step, neuter the checking code in sys_execve().  Further steps
will follow slowly.
ok kettenis

9 months agovery ugly whitespaces
deraadt [Wed, 17 Jan 2024 13:00:05 +0000 (13:00 +0000)]
very ugly whitespaces

9 months agoUse imsg_get_fd()
claudio [Wed, 17 Jan 2024 10:01:24 +0000 (10:01 +0000)]
Use imsg_get_fd()

As usual proc_forward_imsg() is never forwarding a file descriptor so
just use -1 there. This should be replaced by imsg_forward().
All other changes are simple conversions.

OK tb@

9 months agoUse imsg_get_fd() and a local variable.
claudio [Wed, 17 Jan 2024 08:28:15 +0000 (08:28 +0000)]
Use imsg_get_fd() and a local variable.
OK florian@

9 months agoZap trailing space.
ajacoutot [Wed, 17 Jan 2024 08:26:06 +0000 (08:26 +0000)]
Zap trailing space.

from Kirill Miazine, thanks.

9 months agoConvert to use imsg_get_fd()
claudio [Wed, 17 Jan 2024 08:25:02 +0000 (08:25 +0000)]
Convert to use imsg_get_fd()

proc_forward_imsg() does not need to forward file descriptors so just use
-1 there. In other places shuffle debug messages around or use a helper
variable since imsg_get_fd() can only be called once.

OK tb@ tobhe@

9 months agoConvert to use imsg_get_fd() since proc_forward_imsg() never forwards a
claudio [Wed, 17 Jan 2024 08:22:40 +0000 (08:22 +0000)]
Convert to use imsg_get_fd() since proc_forward_imsg() never forwards a
file descriptor just use -1 there.
OK tb@