Commit Graph

303156 Commits

Author SHA1 Message Date
riastradh 5278b8e44d Makefile: Run `postinstall -d /', not `postinstall -d //'.
This happens when doing `build.sh install=/'.  The message is less
confusing and it makes postinstall's job simpler for detecting when
it's installing to / rather than somewhere else.
2023-09-08 12:01:56 +00:00
ad 70ddceb5d7 Fix a ~16 year old perf regression: when creating a socket, add a reference
to the caller's credentials rather than copying them.  On an 80486DX2/66 this
seems to ~halve the time taken to create a socket.
2023-09-07 20:12:33 +00:00
ad bab0f11529 Make the I2O management cdevs MPSAFE. 2023-09-07 20:07:03 +00:00
ad 8479531bde Remove dodgy and unused mutex_owner_running() & rw_owner_running(). 2023-09-07 20:05:41 +00:00
ad 875881b5f1 Add USB device TOPPING DX3 Pro. 2023-09-07 20:04:18 +00:00
ad 46e8a23a65 Remove unused I2O LAN class defs (the LAN driver was deleted years ago). 2023-09-07 20:03:25 +00:00
ad 587ba4d7aa Permit calling cv_signal()/cv_broadcast() after mutex release. 2023-09-07 20:01:43 +00:00
ad 340135473f raise() has understood threads for a long time, don't reimplment it. 2023-09-07 19:59:20 +00:00
riastradh b3b874d033 sysinst(1): Run `certctl rehash' on fresh installs.
It has come to my attention that sysinst does not, in fact, run
postinstall(8) post-install -- only post-upgrade.

Perhaps we should change this so that postinstall serves the purpose
it says on the box -- make postinstall mandatory for new
installations.

XXX pullup-10
2023-09-07 16:38:08 +00:00
skrll 2d3abdba8d Handle CAUSE_LOAD_PAGE_FAULT in trap_pagefault_fixup 2023-09-07 12:48:49 +00:00
riastradh 83df26257c pam_ksu(8): Allow homedir access during kuserok.
Otherwise, the default kuserok logic to look at ~targetuser/.k5login
would be blocked by the security measure to thwart NetBSD-SA2023-005.

(There are other ways, e.g. setting SYSTEM-K5LOGIN in /etc/krb5.conf
so the file is /etc/k5login.d/user instead of ~user/.k5login, but
that's not the default configuration and there are plenty of
deployments that rely on ~user/.k5login today.)

I reviewed libkrb5 for homedir access checks.  There are three:

1. krb5_config_parse_file_multi, called only by:
   - verify_krb5_conf -- not relevant
   - krb5_config_parse_file -- not used here as far as I can tell,
     only by libhdb ldap logic and test code in heimdal
   - krb5_set_config_files -- used here only via krb5_init_context,
     which is done at this point

2. plugin_get_hosts in krbhst.c, used to look up hosts for KDC I/O,
   which shouldn't be happening at this point, so this is almost
   certainly unreachable; also it only appears to control whether
   some old plugin API can be used, long after we have read the krb5
   config controlling which plugins are available, so this is
   probably harmless

3. krb5_kuserok, which is the one we want to allow

Note: This will have to be updated again in the next Heimdal update,
which eliminates the global homedir access flag in favour of making
the default per-context homedir access flag conditional on !issuid.

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-09-07 11:27:57 +00:00
shm 7c063803fb Fix memory leaks in bozo_cleanup 2023-09-07 06:40:56 +00:00
rillig 855fdcf693 tests/lint: allow lint libraries to be installed 2023-09-07 06:24:31 +00:00
rillig a5de335bf3 tests/lint: test case labels with out-of-bounds values 2023-09-07 06:17:35 +00:00
rillig db84d124cc tests/make: fix test for conditions of the form 'a > b' 2023-09-07 05:36:33 +00:00
riastradh 40ca0b4614 lib: Handle various external lib directories with build_install.
This way, update builds track shlib major bumps correctly.

For example, suppose you had built Heimdal's libkrb5.so.27 and
libgssapi.so.11 linked against it, and then you updated past the recent
shlib major bump raising them to libkrb5.so.28 and libgssapi.so.12.

Without this change, the build will make the following sequence of
targets (interleaved with some others):

1. make dependall in libkrb5
2. make dependall in libgssapi
3. make install in libkrb5
4. make install in libgssapi

The existing .WAIT tags in SUBDIR ensure that (1) happens before (2)
and (3) happens before (4).  Unfortunately, this sequence is wrong,
because it will produce the following effect:

1. make dependall in libkrb5 builds libkrb5.so.28
2. make dependall in libgssapi builds libgssapi.so.12, linked against
   libkrb5.so.27
3. make install in libkrb5 installs libkrb5.so.28
4. make install in libgssapi installs libgssapi.so.12

Why the out-of-date libkrb5.so.27 in step (2)?  Because we just pass
-L${DESTDIR}/usr/lib -lkrb5 to the linker (or the equivalent with
--sysroot and implied -L/usr/lib), and ${DESTDIR}/usr/lib still has
only libkrb5.so.27 by the time of step (2), not libkrb5.so.28.

Now any applications that link against libkrb5.so _and_ libgssapi.so
will get libkrb5.so.28 and libgssapi.so.12 -- but transitively, via
libgssapi.so.12, they will also get libkrb5.so.27, which is a recipe
for disaster.

Splicing the Heimdal library subdirectories into lib/Makefile, as
this does, ensures that we run make dependall _and_ make install in
libkrb5 _before_ make dependall in libgssapi, giving the following
correct sequence:

1. make dependall in libkrb5 builds libkrb5.so.28
2. make install in libkrb5 installs libkrb5.so.28
3. make dependall in libgssapi builds libgssapi.so.12, linked against
   libkrb5.so.28
4. make install in libgssapi installs libgssapi.so.12

Note that LIBDPLIBS isn't enough here, as implemented.  LIBDPLIBS
ensures that the incremental build will remake libgssapi.so.  But it
doesn't ensure that the new libkrb5.so.28 is available before then,
so it doesn't prevent this problem.

We use the same mechanism for crypto/external/bsd/openssl/lib
already; this just extends it to other external library collections.

As an alternative, in principle perhaps we could teach LIBDPLIBS to
ensure that libkrb5.so comes out of the libkrb5 objdir, and not out
of ${DESTDIR}/usr/lib.  But that requires some work to make happen,
and make it reliable, whereas this approach we've already confirmed
works without other adverse consequences (besides leaving
grody-looking mechanism lying around) for the libcrypto major bump
already.  We need to get this pulled up to the branch so all the
other major bumps it required are handled correctly by update builds.

XXX pullup-10
2023-09-06 23:44:42 +00:00
christos 400de0093c use the correct constant 2023-09-06 22:08:38 +00:00
christos 28be719b0f fix merge botch 2023-09-06 22:08:06 +00:00
ad 22b5550884 Node that aarch64 implements CAS. 2023-09-06 20:17:42 +00:00
christos 241ebc5aa7 KNF, clarify/provide warning messages, set rval to fail initially and only
set to success once everything works.
2023-09-06 20:16:04 +00:00
jschauma 514a75e0bc +DAE deterministic authenticated encryption 2023-09-06 19:56:57 +00:00
mrg 41aabe1d7a fix the example for container_of().
needs to be a pointer into the containing structure, not the
value of a pointer inside the structure.
2023-09-06 19:14:52 +00:00
riastradh 28d8079ef6 postinstall(8): Modify default certs.conf.
When manually configured /etc/openssl/certs is detected, just
uncomment the `#manual' line in the default certs.conf rather than
writing a new one.  That way, you can switch to certctl-managed and
still get the default path by just deleting /etc/openssl/certs and
re-commenting the `manual' line.
2023-09-06 13:38:54 +00:00
riastradh 4604ab506a */shlib_version: Ensure a boring line between RCS id and all else.
This makes cherry-picks easier by avoiding conflicts between the RCS
id and the interesting changes.
2023-09-06 12:48:15 +00:00
riastradh 56c9a6d008 libbozohttpd, libluabozohttpd: Bump major for libssl.so bump.
libluabozohttpd doesn't appear to be installed, but let's bump the
major just in case.

PR lib/57603

XXX pullup-10
2023-09-06 12:44:45 +00:00
riastradh 63318f4875 sys/param.h: Welcome to 10.99.8!
Courtesy of nestable heartbeat_suspend/resume, which changed struct
cpu_info.
2023-09-06 12:31:49 +00:00
riastradh 5c3232db9d heartbeat(9): Make heartbeat_suspend/resume nestable.
And make them bind to the CPU as a side effect, instead of requiring
the caller to have already done so.

This lets us eliminate the assertions so we can use them in ddb even
when things are going haywire and we just want to get diagnostics.

XXX kernel revbump -- struct cpu_info change
2023-09-06 12:29:14 +00:00
macallan 90f989771c yet another tsleep/wakeup -> cv_* 2023-09-06 08:14:42 +00:00
shm a31761d3ff - remove lock file on error
- clarify diagnostic messages
- initialize struct stat if lstat(2) failed (from mhal at rbox dot co)
- ensure appending to a regular file
2023-09-06 08:12:09 +00:00
christos 821c512655 we don't have/need limits.h 2023-09-05 22:15:46 +00:00
mrg 27c7635cf1 apply previous to just GCC. 2023-09-05 22:14:08 +00:00
riastradh b0fd4b4c1c drmkms: Fix module build. 2023-09-05 21:57:28 +00:00
mrg 8751b920d6 don't care about GCC 11 version (we've skipped it).
also, adjust version file path.
2023-09-05 21:22:57 +00:00
riastradh ee3f67d30d drm: Fix conditionals around drmkms_pci and agp.
Kernel should build now with all pci drm drivers stripped out but
DRM_LEGACY still enabled.  (Might not be very useful, but it'll
build.  Maybe we should also have DRM_LEGACY_PCI so those drivers can
be modloaded later.)
2023-09-05 20:15:10 +00:00
christos d853547a48 Add missing file 2023-09-05 14:49:46 +00:00
riastradh d946f6431e certctl(8): Fix permissions on ca-certificates.crt bundle: 0644.
While here, write it atomically: write to .tmp first, then rename
when done; this way applications never see a partially-written bundle
at /etc/openssl/certs/ca-certificates.crt.
2023-09-05 12:32:30 +00:00
riastradh aa907e4708 certctl(8): Test permissions of ca-certificates.crt.
Inadvertently created 0600 instead of 0644 due to copying file
created by mktemp(1) with cp(1).
2023-09-05 12:31:33 +00:00
mrg 0221302e0d match warnings with the module build, fixes i386 with GCC 12. 2023-09-05 06:08:02 +00:00
mrg 9b39f0e7ac panic on an condition that shouldn't be possible.
appease GCC 12.
2023-09-05 05:55:12 +00:00
mrg bd4c4b4eb0 apply -Wno-maybe-uninitialized to chacha_sse2.c.
there's a clearly initialised memory region that is claimed as
being maybe uninitialised, and this test-build version of it
triggers it while the normal build doesn't.
2023-09-05 04:22:44 +00:00
mrg 6180177c92 add description & deps for gpu-firmware-base set. 2023-09-05 04:19:04 +00:00
mrg 10030c0771 turn off -Walloc-size-larger-than for xinput.c
on 32-bit platforms, an expression claims the input can exceed 2G,
more than malloc() can take.  i'm pretty sure that the maximum is
actually quite a lot less (seems to be max 255*12 plus <100.)
2023-09-05 04:16:56 +00:00
mrg a75f04971b revive the ./usr/libdata/debug/usr/lib/libisns.so.0.0.debug entry
however, remove the 'obsolete' tag from it.

fixes the amd64 build (at least).
2023-09-05 03:41:49 +00:00
gutteridge a0a93cd257 ti_com.c: set sc_type to COM_TYPE_OMAP
Avoid a kernel hang reported by Brook Milligan in PR port-arm/57598.
Patch suggested by RVP, seems correct to several of us. (If this
introduces a regression with some board, sorry, mea culpa. But in
that case we should still be carrying this, just conditionalized.)
2023-09-05 02:59:07 +00:00
mrg c580d690fa apply -Wno-dangling-pointer to callcontext.c.
puffs_cc_getcc() uses a mask against a stack variable to find the
struct puffs_cc stashed below the stack, triggering the dangling
pointer problem.
2023-09-05 00:12:14 +00:00
christos eaa230d2aa fix the vax build. we could do better by choosing larger exponents. 2023-09-04 23:55:53 +00:00
mrg b1d228aa32 "make release" has included sanitizers with GCC 12 for a while. 2023-09-04 23:40:05 +00:00
christos 0e02ce2d42 more new man pages 2023-09-04 23:17:24 +00:00
mrg 407611763a apply ${CC_WNO_STRINGOP_OVERFLOW} for crypt.c.
init_perm() takes a larger array than IE3264[] is, but it doesn't use more
for this instance.
2023-09-04 23:00:48 +00:00
mrg a5e10da931 mask a value with the array size mask to avoid a GCC 12 warning.
i'm fairly sure this can't actually happen, but it likely avoids
any potential bug without real issue.
2023-09-04 21:54:41 +00:00