Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (2h)  netbsd-8 (5d)  netbsd-10 (5d)  netbsd-9 (11d)  thorpej-ifq (175d)  thorpej-altq-separation (178d) 

2024-05-10 06:24:35 UTC Now

2023-09-16 18:56:40 UTC MAIN commitmail json YAML

sh3/sci(4): replace undefined scistatus with DPRINTF.

Fixes the build with SCI_DEBUG enabled.

(andvar)

2023-09-16 18:41:57 UTC MAIN commitmail json YAML

2023-09-16 18:40:26 UTC MAIN commitmail json YAML

Update tzcode from 2022g to 2023c:

Release 2023c - 2023-03-28 12:42:14 -0700

Release 2023b - 2023-03-23 19:50:38 -0700

Release 2023a - 2023-03-22 12:39:33 -0700

  Changes to code

    You can now tell tzselect local time, to simplify later choices.
    Select the 'time' option in its first prompt.

    You can now compile with -DTZNAME_MAXIMUM=N to limit time zone
    abbreviations to N bytes (default 255).  The reference runtime
    library now rejects POSIX-style TZ strings that contain longer
    abbreviations, treating them as UTC.  Previously the limit was
    platform dependent and abbreviations were silently truncated to
    16 bytes even when the limit was greater than 16.

    The code by default is now designed for C99 or later.  To build in
    a C89 environment, compile with -DPORT_TO_C89.  To support C89
    callers of the tzcode library, compile with -DSUPPORT_C89.  The
    two new macros are transitional aids planned to be removed in a
    future version, when C99 or later will be required.

    The code now builds again on pre-C99 platforms, if you compile
    with -DPORT_TO_C89.  This fixes a bug introduced in 2022f.

    On C23-compatible platforms tzcode no longer uses syntax like
    'static [[noreturn]] void usage(void);'.  Instead, it uses
    '[[noreturn]] static void usage(void);' as strict C23 requires.
    (Problem reported by Houge Langley.)

    The code's functions now constrain their arguments with the C
    'restrict' keyword consistently with their documentation.
    This may allow future optimizations.

    zdump again builds standalone with ckdadd and without setenv,
    fixing a bug introduced in 2022g.  (Problem reported by panic.)

    leapseconds.awk can now process a leap seconds file that never
    expires; this might be useful if leap seconds are discontinued.

  Changes to commentary

    tz-link.html has a new section "Coordinating with governments and
    distributors".  (Thanks to Neil Fuller for some of the text.)

    To improve tzselect diagnostics, zone1970.tab's comments column is
    now limited to countries that have multiple timezones.

    Note that leap seconds are planned to be discontinued by 2035.

(christos)

2023-09-16 18:19:30 UTC MAIN commitmail json YAML

sync with tzcode 2023c

(christos)

2023-09-16 15:42:01 UTC MAIN commitmail json YAML

sh3/scif(4): redefine DPRINTF again, not all SH ports has machine/debug.h.
Those are defined for hpc only.

unbreaks build for evbsh some kernel configs and SFIC_DEBUG still builds.

(andvar)

2023-09-16 13:37:10 UTC MAIN commitmail json YAML

protect against multiple inclusion

(christos)

2023-09-15 20:59:56 UTC MAIN commitmail json YAML

sh3/scif(4): replace undefined scifstatus with DPRINTF.

fixes the build with SCIF_DEBUG enabled.

(andvar)

2023-09-15 15:45:19 UTC netbsd-8 commitmail json YAML

2023-09-15 15:44:20 UTC netbsd-8 commitmail json YAML

Pull up following revision(s) (requested by rin in ticket #1897):

sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.22
sys/arch/i386/stand/efiboot/eficpufunc.c: revision 1.1
sys/arch/i386/stand/efiboot/eficpufunc.h: revision 1.1
sys/arch/i386/stand/efiboot/eficons.c: revision 1.13
sys/arch/i386/stand/efiboot/eficons.c: revision 1.14

efiboot/x86: Add serial console support via raw I/O port access

Unfortunately, some (most?) UEFI implementations do not support
com ports by ``Serial I/O Protocol''.
``PNP0501-0'' and friends are not recognized also.

In this case, if user explicitly requires to switch to serial
console by ``consdev'' command, try to use raw I/O port access.

Ugly, but what FreeBSD does, at least.
Proposed as PR port-amd64/57523

efiboot/x86: eficons.c: Explicitly include params.h for howmany()

NFC for -current and netbsd-10, but necessary for netbsd-[89] to
pull up raw IO serial port support (PR port-amd64/57523).

(martin)

2023-09-15 15:42:58 UTC netbsd-9 commitmail json YAML

2023-09-15 15:40:22 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by rin in ticket #1732):

sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.22
sys/arch/i386/stand/efiboot/eficpufunc.c: revision 1.1
sys/arch/i386/stand/efiboot/eficpufunc.h: revision 1.1
sys/arch/i386/stand/efiboot/eficons.c: revision 1.13
sys/arch/i386/stand/efiboot/eficons.c: revision 1.14

efiboot/x86: Add serial console support via raw I/O port access

Unfortunately, some (most?) UEFI implementations do not support
com ports by ``Serial I/O Protocol''.
``PNP0501-0'' and friends are not recognized also.

In this case, if user explicitly requires to switch to serial
console by ``consdev'' command, try to use raw I/O port access.

Ugly, but what FreeBSD does, at least.
Proposed as PR port-amd64/57523

efiboot/x86: eficons.c: Explicitly include params.h for howmany()

NFC for -current and netbsd-10, but necessary for netbsd-[89] to
pull up raw IO serial port support (PR port-amd64/57523).

(martin)

2023-09-15 15:35:27 UTC netbsd-10 commitmail json YAML

2023-09-15 15:34:27 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by christos in ticket #375):

crypto/external/bsd/heimdal/dist/include/crypto-headers.h: revision 1.7
crypto/external/bsd/heimdal/dist/lib/krb5/context.c: revision 1.8

Explicitly load the legacy provider instead of using EVP_CIPHER_fetch() which
leaks memory.

(martin)

2023-09-14 22:48:49 UTC MAIN commitmail json YAML

lint: reduce pointer dereferences and relocations

No functional change.

(rillig)

2023-09-14 22:20:09 UTC MAIN commitmail json YAML

lint: remove pseudo operators INC and DEC

These operators were not used in expressions, they were only used as
additional token info.  Use a plain bool instead.

No functional change.

(rillig)

2023-09-14 21:53:02 UTC MAIN commitmail json YAML

lint: fix wording of diagnostics about 'C99 extension'

The term 'extension' means an extension to a C standard.  C99 by itself
is not an extension but a revision of the C standard.

(rillig)

2023-09-14 21:08:12 UTC MAIN commitmail json YAML

2023-09-14 20:03:56 UTC MAIN commitmail json YAML

npfctl: remove no-op NOLINT definition

Setting NOLINT must be done before including <bsd.own.mk> to have an
effect.

(rillig)

2023-09-14 19:54:41 UTC MAIN commitmail json YAML

lvm: add rationale for disabling lint

(rillig)

2023-09-14 19:52:09 UTC MAIN commitmail json YAML

dmsetup: add rationale for disabling lint for this program

(rillig)

2023-09-14 19:29:52 UTC MAIN commitmail json YAML

verify_krb5_conf: enable lint

There is no apparent reason to disable lint for this program.

(rillig)

2023-09-14 12:27:55 UTC MAIN commitmail json YAML

Enable crypto engine on Pinebook Pro.

Only used for rng at present.

(rjs)

2023-09-14 08:48:29 UTC MAIN commitmail json YAML

ixg(4): Rename some descriptions of flow control related event conters.

(msaitoh)

2023-09-14 08:47:24 UTC MAIN commitmail json YAML

ixg(4): Reorder some flow control related event counters for readability.

(msaitoh)

2023-09-14 03:58:50 UTC MAIN commitmail json YAML

2023-09-14 03:52:24 UTC MAIN commitmail json YAML

gcc.old: c++locale.h: Drop unnecessary <cstdio> include

This has no longer been required since rev 1.6 (of gcc one):

http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h#rev1.6

where __convert_from_v() migrated to .cc file, and direct call for
vsnprintf_l(3) from this header file was removed.

(rin)

2023-09-14 03:50:58 UTC MAIN commitmail json YAML

gcc: c_locale.h (c++locale.h): Drop unnecessary <cstdio> include

This has no longer been required since rev 1.6:

http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h#rev1.6

where __convert_from_v() migrated to .cc file, and direct call for
vsnprintf_l(3) from this header file was removed.

(rin)

2023-09-14 03:37:01 UTC MAIN commitmail json YAML

mips: Add initial support to gprof(1) for n64 userland

Use gp relative call for _mcount().

Stop using macro name MCOUNT as well for clarity. It has nothing to
do with one provided by <machine/profile.h>.

Now, gprof(1) works just fine for C programs. On the other hand, some
C++ profiling tests of ATF fail as partially observed for n32.

More C++ profile tests become broken for GCC12 in comparison to GCC10.
Something needs to be adjusted for us, or GCC, or both.

(rin)

2023-09-14 03:25:31 UTC MAIN commitmail json YAML

riscv: ptrace: Add PTRACE_ILLEGAL_ASM for ATF

All related tests successfully pass.

(rin)

2023-09-14 03:24:07 UTC MAIN commitmail json YAML

mips/trap: Fix reversed ksi_code for SIGTRAP cases

It should be TRAP_TRACE and TRAP_BRKPT for software single stepping
and ``real'' break insn, respectively.

(rin)

2023-09-14 03:17:02 UTC MAIN commitmail json YAML

libpthread/Makefile: trailing whitespace

(rin)

2023-09-14 03:08:31 UTC MAIN commitmail json YAML

netif_open: Fail with ENXIO instead of panic if no netif available

Avoid undesirable freeze for efiboot/x86 when interfaces are really
unavailable, or fail to be configured by buggy UEFI firmware.

(rin)

2023-09-14 03:05:15 UTC MAIN commitmail json YAML

efiboot/x86: eficons.c: Explicitly include params.h for howmany()

NFC for -current and netbsd-10, but necessary for netbsd-[89] to
pull up raw IO serial port support (PR port-amd64/57523).

(rin)

2023-09-13 20:31:58 UTC MAIN commitmail json YAML

lint: prevent invalid memory access when checking an expression

In check_expr_misc, the left and right operands of an expression were
accessed even in the case of CON (constant), STRING (string literal) and
NAME (identifier), which led to invalid values in pointer variables.
These invalid values were not used though, but technically they invoked
undefined behavior.

Precede each access to the operands with a check that the expression
indeed has operands, except in those cases where the operand is known to
have operands by only looking at the code of the current function.

(rillig)

2023-09-13 19:45:37 UTC MAIN commitmail json YAML

fix printf format specifier for physmem.

fixes VERBOSE_INIT_ARM enabled build for iyonix.

(andvar)

2023-09-13 17:08:15 UTC MAIN commitmail json YAML

change hd64461uart_init_regs third argument from NULL to 0x0,
since compiler complains about making integer from pointer without cast.

fully fixes KGDB enabled build for hpcsh.

(andvar)

2023-09-13 15:58:13 UTC MAIN commitmail json YAML

handle EHOSTDOWN the same way as EHOSTUNREACH in sctp_med_chunk_output().
Compile-tested only (I don't have a sctp setup); proposed in
http://mail-index.netbsd.org/tech-net/2023/09/11/msg008611.html
LGTM from Greg Troxel and Robert Swindells

(bouyer)

2023-09-13 15:54:28 UTC MAIN commitmail json YAML

Handle EHOSTDOWN the same way as EHOSTUNREACH and ENETDOWN for established
connections. Avoid premature end of tcp connection with "Host is down" error
in case of transient link-layer failure.
Discussed and patch proposed in
http://mail-index.netbsd.org/tech-net/2023/09/11/msg008610.html
and followups.

(bouyer)

2023-09-13 14:12:21 UTC MAIN commitmail json YAML

+CRQC  Cryptanalytically Relevant Quantum Computer

(jschauma)

2023-09-13 09:58:38 UTC netbsd-10 commitmail json YAML

2023-09-13 09:56:17 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by wiz in ticket #374):

doc/CHANGES.prev: revision 1.173
(applied to doc/CHANGES)

Unicode updates were pulled up

(martin)

2023-09-13 09:50:51 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by rin in ticket #373):

sys/net/bpf.h: revision 1.82

bpf: Fix SIZEOF_BPF_HDR (for LP64 userland) on mips64

It cannot fit within 18 bytes, of course ;)

As we had never provided working bpf(4) implementation for LP64
userland on mips, just use natural structure size here.

(martin)

2023-09-13 09:49:14 UTC netbsd-9 commitmail json YAML

2023-09-13 09:48:11 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by gutteridge in ticket #1731):

external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c: revision 1.19
external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c: revision 1.11

mDNSPosix.c: free very large struct on error path

DNSCommon.c: fix punctuation in a comment

This has very little value in itself; it's intended to make a material
change to this file to facilitate rebuilds. Otherwise, people running
update builds on branches will run into mismatches and build failures
after our switch to use arc4random(3). (That is, this change is
intended to be pulled up.)

(martin)

2023-09-13 09:46:49 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by gutteridge in ticket #372):

external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c: revision 1.19
external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c: revision 1.11

mDNSPosix.c: free very large struct on error path

DNSCommon.c: fix punctuation in a comment

This has very little value in itself; it's intended to make a material
change to this file to facilitate rebuilds. Otherwise, people running
update builds on branches will run into mismatches and build failures
after our switch to use arc4random(3). (That is, this change is
intended to be pulled up.)

(martin)

2023-09-13 09:42:51 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by bouyer in ticket #371):

sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts: revision 1.5
sys/arch/arm/dts/sun8i-h3-orangepi-one.dts: file removal

Remove now-unneeded and brocken (probably since dts-5.15 import)
sun8i-h3-orangepi-one.dts, and let the build use the one from sys/external.

Problem reported and fix tested by Dave Tyson as reported on port-arm@

While there remove #include "sun8i-h3.dtsi" from sun8i-h3-orangepi-plus2e.dts,
this file has been removed with the dts-5.15 import.

(martin)

2023-09-13 09:27:53 UTC MAIN commitmail json YAML

Unicode updates were pulled up

(wiz)

2023-09-13 08:05:23 UTC MAIN commitmail json YAML

ixg(4): Count Queue Bytes {Transmit, Receive} counter.

(msaitoh)

2023-09-13 07:38:31 UTC MAIN commitmail json YAML

ixg(4): Rename some descriptions of event counters.

- Rename some descriptions from register name to the meaning.
- For the same meaning's counters, add "(soft)" or "(reg)".
  The former is for a software level counter and the latter is for a
  statistics counter register based.

(msaitoh)

2023-09-13 07:28:51 UTC MAIN commitmail json YAML

2023-09-13 06:53:23 UTC MAIN commitmail json YAML

2023-09-12 22:11:08 UTC MAIN commitmail json YAML

sqlite: re-enable lint

Since <assert.h> 1.26, the 'assert' macro expands to the same text,
whether in lint mode or not.

Defining the NDEBUG macro was redundant, as it is conditionally defined
depending on SQLITE_DEBUG.

(rillig)

2023-09-12 22:08:24 UTC MAIN commitmail json YAML

assert.h: remove custom macro definitions for lint mode

In lint mode, 'assert(cond)' expanded to nothing.  This broke code like
sqlite that assumes 'assert(cond)' expands to an expression that can be
used as operand of the comma operator, as in 'return assert(i > 0), i'.

(rillig)

2023-09-12 22:07:33 UTC MAIN commitmail json YAML

double quotes should be in front of value, not property name.
fix KGDB enabled builds for dreamcast/hpcsh.

(andvar)

2023-09-12 22:01:05 UTC MAIN commitmail json YAML

lint: mark unreachable function call arguments as used as well

Previously, in a '?:' expression with a constant condition, the branch
that is not taken was skipped but any identifiers in there were intended
to be marked as used.  In function call expressions, this only worked
for the last argument, as the PUSH operator is not a binary operator
(see ops.def).  Cover this case as well.

(rillig)

2023-09-12 21:56:05 UTC MAIN commitmail json YAML

ctime.3: fix merge mistake

The paragraphs about the *_r and *_z/rz functions belong at the end of
the section (or somewhere like that), not affixed to the description of
difftime in the middle of the list of functions.

(dholland)

2023-09-12 21:50:12 UTC MAIN commitmail json YAML

remove ksyms from hpcsh DEBUG kernel config. It is already defined in GENERAL.

(andvar)

2023-09-12 21:19:53 UTC MAIN commitmail json YAML

DNSCommon.c: fix punctuation in a comment

This has very little value in itself; it's intended to make a material
change to this file to facilitate rebuilds. Otherwise, people running
update builds on branches will run into mismatches and build failures
after our switch to use arc4random(3). (That is, this change is
intended to be pulled up.)

(gutteridge)

2023-09-12 20:45:17 UTC MAIN commitmail json YAML

cpuctl(8): note that AMD updates need to be applied on all CPUs at once

Note that checking dmesg(8) after problems might be helpful.
Sort commands.
Bump date.

(wiz)

2023-09-12 20:43:38 UTC MAIN commitmail json YAML

cpuctl: be more verbose about problems and diagnosing them

(wiz)

2023-09-12 19:32:00 UTC MAIN commitmail json YAML

rename flash_cd to vrflash_cd, since device was renamed to vrflash.

Fixes hpcmips LCARD config linking issue that flash_cd is undefined.

(andvar)

2023-09-12 16:17:22 UTC MAIN commitmail json YAML

2023-09-12 12:56:21 UTC MAIN commitmail json YAML

Remove now-unneeded and brocken (probably since dts-5.15 import)
sun8i-h3-orangepi-one.dts, and let the build use the one from sys/external.
Problem reported and fix tested by Dave Tyson as reported on port-arm@
While there remove #include "sun8i-h3.dtsi" from sun8i-h3-orangepi-plus2e.dts,
this file has been removed with the dts-5.15 import.

(bouyer)

2023-09-12 07:23:27 UTC MAIN commitmail json YAML

lint: mark symbols that are only used in untaken '?:' branch as used

(rillig)

2023-09-12 06:51:02 UTC MAIN commitmail json YAML

tests/lint: show that '?:' skips untaken branches early

This is probably done to avoid wrong warnings from branches that are
only taken on other platforms, but it also generates a wrong 'unused'
warning.

(rillig)

2023-09-11 22:09:29 UTC MAIN commitmail json YAML

hpcmips/vrflash(4): custom DPRINTF definition requires additional brackets
around the arguments.

Fixes FLUSH_DEBUG build.

However the driver fails to link due to missing reference to flash_cd,
my guess because of obsoleted flash device-major.

(andvar)

2023-09-11 15:12:12 UTC MAIN commitmail json YAML

Explicitly load the legacy provider instead of using EVP_CIPHER_fetch() which
leaks memory.

(christos)

2023-09-11 15:07:52 UTC MAIN commitmail json YAML

+RAT  remoate access trojan

(jschauma)

2023-09-11 14:58:57 UTC netbsd-10 commitmail json YAML

2023-09-11 14:57:12 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by riastradh in ticket #370):

tests/lib/libc/hash/t_hmac.c: revision 1.3

no more md4 for you.

(martin)

2023-09-11 14:54:54 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by wiz in ticket #369):

share/locale/time/de_AT.UTF-8.src: revision 1.3

Add missing dot in abbreviation.

(martin)

2023-09-11 14:53:01 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by wiz in ticket #368):

share/locale/ctype/en_US.UTF-8.src: revision 1.10
share/locale/ctype/en_US.UTF-8.src: revision 1.8
share/locale/ctype/en_US.UTF-8.src: revision 1.9
share/locale/ctype/gen_ctype_utf8.pl: revision 1.1
share/locale/ctype/gen_ctype_utf8.pl: revision 1.2
tests/lib/libc/locale/t_mbstowcs.c: revision 1.3

Update unicode tables.

This version of the file, and the generator script, come from
OpenBSD. The script was written by Andrew Fresh.
The file covers the encodings from Unicode 13.0.0, based on the files
distributed with perl 5.32.1.

Add NetBSD RCS Id header instead of OpenBSD one.

Update Unicode tables.

These tables are for Unicode 14.0.0 using the data provided with
perl 5.36.0.

Update Unicode tables to 15.0.0.
This is based on the tables provided by perl 5.37.7.

adapt mbstowcs_basic test for unicode table update
reformat so it's easier to find which result data belongs to which input

(martin)

2023-09-11 14:45:05 UTC netbsd-9 commitmail json YAML

2023-09-11 14:43:27 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by khorben in ticket #1730):

build.sh: revision 1.374

build.sh: add support for git worktree

Git supports multiple working trees attached to the same repository,
with the git-worktree(1) subcommand.

When building from a Git working tree, the repository metadata in .git
from the top source directory is a file (containing the actual location
of the metadata) instead of the usual directory structure. With this
change, build.sh allows .git to be a directory or a regular file
instead, therefore letting the sources build as expected from a Git
working tree.

To test: (without this patch)
  src$ git worktree add ../src-clean-tree
  [...]
  src$ (cd ../src-clean-tree && ./build.sh tools)
  [...]
  ERROR: Cannot determine VCS for '.../src-clean-tree/'

(martin)

2023-09-11 14:41:51 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by khorben in ticket #367):

build.sh: revision 1.374

build.sh: add support for git worktree

Git supports multiple working trees attached to the same repository,
with the git-worktree(1) subcommand.

When building from a Git working tree, the repository metadata in .git
from the top source directory is a file (containing the actual location
of the metadata) instead of the usual directory structure. With this
change, build.sh allows .git to be a directory or a regular file
instead, therefore letting the sources build as expected from a Git
working tree.

To test: (without this patch)
  src$ git worktree add ../src-clean-tree
  [...]
  src$ (cd ../src-clean-tree && ./build.sh tools)
  [...]
  ERROR: Cannot determine VCS for '.../src-clean-tree/'

(martin)

2023-09-11 14:39:21 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by abs in ticket #366):

sys/dev/pci/ahcisata_pci.c: revision 1.70
sys/dev/ic/ahcisata_core.c: revision 1.108
sys/dev/ic/ahcisatavar.h: revision 1.28
sys/conf/files: revision 1.1309

Rework AHCISATA_EXTRA_DELAY for kern/56737
- Remove AHCI_QUIRK_EXTRA_DELAY as issue appears to be drive and
  not controller related
- Replace AHCISATA_EXTRA_DELAY with AHCISATA_REMOVE_EXTRA_DELAY,
  so defaulting to enabling the extra delay, as the downside of
  slower probing on systems which do not need it is less than having
  other systems intermittently fail to probe and attach drives
- Also allow disabling extra delay with AHCISATA_EXTRA_DELAY_MS = 0

We should return to this code to work out which of the extra delays
are needed, and how long they need to be. It may be that faster
systems are more likely to trigger the issue (I've only seen it on
a 13th gen i7-13700, though only tested on a limited set)

(martin)

2023-09-11 13:42:08 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by oster in ticket #365):

sys/arch/vax/include/cpu.h: revision 1.107

With the overhaul of the scheduler code the semantics of
ci_want_resched have changed, and for some reason vax
still requires ci_want_resched set to 1 in order to do
preemption.  This commit contains a workaround for the
preemption issued discussed in PR#55415.

(martin)

2023-09-11 13:38:42 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by riastradh in ticket #364):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.26

Revert "Teach zfs bdevsw to do b_psize."

This is used only by dump and swap, which won't work safely on zvols
anyway.  We should make swap work eventually, but right now it's
leading unwary ussers into deadlock scenarios, so let's make it fail
early instead.

(martin)

2023-09-11 13:35:38 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by rin in ticket #363):

sys/arch/aarch64/conf/Makefile.aarch64: revision 1.24
sys/arch/aarch64/conf/Makefile.aarch64: revision 1.25
sys/arch/shark/conf/Makefile.shark.inc: revision 1.28
sys/arch/alpha/conf/Makefile.alpha: revision 1.88
sys/arch/mips/conf/Makefile.mips: revision 1.73
sys/conf/Makefile.kern.inc: revision 1.298
sys/conf/Makefile.kern.inc: revision 1.299
sys/arch/cats/conf/Makefile.cats.inc: revision 1.37
sys/arch/arm/conf/Makefile.arm: revision 1.56
sys/arch/arm/conf/Makefile.arm: revision 1.57
sys/arch/riscv/conf/Makefile.riscv: revision 1.10

Always use arm-elf2aout; no a.out support both for binutils{,.old}

Fix kernel size inflation for arm and aarch64 (PR toolchain/57146)

For some conditions, SYSTEM_LD_TAIL is set for arm and aarch64.
Then, ctfmerge(1) in default SYSTEM_LD_TAIL is unintentionally
skipped, which results in the catastrophic kernel size inflation,
as reported in the PR.

Also, introduce and use OBJCOPY_STRIPFLAGS variable instead of
STRIPFLAGS, as strip(1) is replaced by objcopy(1) during MI
kernel build procedure.

For Makefile.{arm,aarch64}, weird logic is used to determine how
to handle debug symbols; MKDEBUG{,KERNEL} are taken into account
later in sys/conf/Makefile.kern.inc.

Use OBJCOPY_STRIPFLAGS instead of STRIPFLAGS.
Simplify fix for PR toolchain/57146

Introduce ARCH_STRIP_SYMBOLS variable to centralize logic for debug
symbols from MD Makefile's to Makefile.kern.inc.

(martin)

2023-09-11 13:30:36 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by rin in ticket #362):

sys/arch/i386/stand/efiboot/efipxe.c: revision 1.2
sys/stand/efiboot/efipxe.c: revision 1.3

MI and x86 efiboot: Fix device path type for PXE boot device.
It should be Messaging, not Media Device Path. Taken from OpenBSD, for
which this code was originally written:
https://cvsweb.openbsd.org/src/sys/arch/amd64/stand/efiboot/efipxe.c#rev1.6

Network-based device paths use Messaging and not Media types.  Thus
in reality the depth was always -1 which made the compare function
a No-Op.  Properly check the device path depth value and look for
the Messaging type instead to find the correct NIC.  This check
never worked before and was uncovered by the last change.

Regression noticed by bluhm@

(martin)

2023-09-11 13:25:42 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by rin in ticket #361):

sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.22
sys/arch/i386/stand/efiboot/eficpufunc.c: revision 1.1
sys/arch/i386/stand/efiboot/eficpufunc.h: revision 1.1
sys/arch/i386/stand/efiboot/eficons.c: revision 1.13

efiboot/x86: Add serial console support via raw I/O port access

Unfortunately, some (most?) UEFI implementations do not support
com ports by ``Serial I/O Protocol''.
``PNP0501-0'' and friends are not recognized also.

In this case, if user explicitly requires to switch to serial
console by ``consdev'' command, try to use raw I/O port access.

Ugly, but what FreeBSD does, at least.
Proposed as PR port-amd64/57523

(martin)

2023-09-11 12:00:45 UTC MAIN commitmail json YAML

sparc_v8.S: fix v8 .mul/.umul versions to conform to psABI

Both .mul and .umul are defined to return the most significant 32 bits
of the result in %o1, but v8 multiplication instructions put them in
%y.  Move them to %o1.  Nothing in the gcc generated code depends on
this, but hand-written assembly can rely on this and e.g. Self does.

(uwe)

2023-09-11 08:55:01 UTC MAIN commitmail json YAML

Add missing <sys/intr.h> include (previously indirectly hidden via pool.h)

(martin)

2023-09-11 01:54:18 UTC MAIN commitmail json YAML

ld: Enable --copy-dt-needed-entries by default again

Otherwise, terminfo(3) symbols referenced from curses(3)-based applications
are not resolved, unless -lterminfo is explicitly specified.

See, e.g., PR lib/57592

We had locally enabled this by default:

http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/binutils/dist/ld/emultempl/elf.em#rev1.2

But this was lost during 2.39 merge.

Thanks uwe@ for hints!

(rin)

2023-09-10 21:52:37 UTC MAIN commitmail json YAML

2023-09-10 21:13:20 UTC MAIN commitmail json YAML

return %#x specifier for pcihp->ioh and add (unsigned) cast instead,
as it is done everywhere in this code.

(andvar)

2023-09-10 20:55:30 UTC MAIN commitmail json YAML

rewrite tx39sib debug code to use debug.h DPRINTF definition.
also debug code uses dbg_bitmask_print(), thus build fails without the header.

fixes TX39SIBDEBUG enabled build.

(andvar)

2023-09-10 20:41:57 UTC MAIN commitmail json YAML

rewrite old style tx39biu_dump function declaration
and constify char *rowsel[], char *colsel[].

fixes TX39BIU_DEBUG enabled build.

(andvar)

2023-09-10 20:28:25 UTC MAIN commitmail json YAML

tx39ir(4): rewrite code to use DPRINTF definition from debug.h.
custom one had wrong vrpiu_debug variable in if block (likely copy pasta)
debug code also calls dbg_bitmask_print(), thus was failing to build.
remove unneeded #undef TX39IRDEBUG.

Fixes TX39IRDEBUG build (tested with hpcmips TX3912 kernel config).

(andvar)

2023-09-10 16:25:32 UTC MAIN commitmail json YAML

2023-09-10 15:23:01 UTC MAIN commitmail json YAML

If Xen system time went backward, instead of ignoring the event assume
one tick passed and reinitialise the local state.
If we need to call the hardclock timer several time to catch up missed events,
don't do more than one second in a single event; and schedule the next
event faster.

Hopefully fixes occasionnal
panic: cpu1: time has not advanced in 1501 heartbeats
or
panic: cpu0: softints stuck for 16 seconds
seen in daily Xen atf runs.

(bouyer)

2023-09-10 15:18:51 UTC MAIN commitmail json YAML

rewrite UCBTPDEBUG to use DPRINTF/DPRINTFN definitions from debug.h.

No functional changes intended.

(andvar)

2023-09-10 15:12:39 UTC MAIN commitmail json YAML

use CC_WNO_MAYBE_UNINITIALIZED and fix the clang build.

(mrg)

2023-09-10 15:03:56 UTC MAIN commitmail json YAML

Remove custom DPRINTF/DPRINTFN definitions and reuse one defined in debug.h.
Remove "#undef PLUMVIDEODEBUG", it is not defined by default.

fixes PLUMVIDEODEBUG enabled build.

(andvar)

2023-09-10 15:01:11 UTC MAIN commitmail json YAML

uvmpd_trylockowner(): release pg->interlock before calling rw_obj_free()
since it can call back into the VM system.

(ad)

2023-09-10 14:54:34 UTC MAIN commitmail json YAML

Align uvm_amap to COHERENCY_UNIT.

(ad)

2023-09-10 14:46:19 UTC MAIN commitmail json YAML

2023-09-10 14:45:53 UTC MAIN commitmail json YAML

- Do away with separate pool_cache for some kernel objects that have no special
  requirements and use the general purpose allocator instead.  On one of my
  test systems this makes for a small (~1%) but repeatable reduction in system
  time during builds presumably because it decreases the kernel's cache /
  memory bandwidth footprint a little.
- vfs_lockf: cache a pointer to the uidinfo and put mutex in the data segment.

(ad)

2023-09-10 14:44:08 UTC MAIN commitmail json YAML

It's easy to exhaust the open file limit on a system with many CPUs due to
caching.  Allow a bit of leeway to reduce the element of surprise.

(ad)

2023-09-10 14:31:24 UTC MAIN commitmail json YAML

KPREEMPT_ENABLE(): optimise away one of the conditionals; the same test is
repeated in kpreempt() which is rarely called.

(ad)

2023-09-10 14:29:13 UTC MAIN commitmail json YAML

Assert that kmem_alloc() provides the expected alignment.

(ad)

2023-09-10 14:28:57 UTC MAIN commitmail json YAML

Various fixes to (re)enable PLUMPCMCIA_DEBUG build:
remove brackets around DPRINTF params (that's leftover from custom definition).
pcihp->ioh expects %lx specifier, not %x.
constify char *width_names.
rename cardtype to type in one of DPRINTF argument's condition.

(andvar)

2023-09-10 14:11:34 UTC MAIN commitmail json YAML

nix whitespace before semicolon.

(andvar)

2023-09-10 14:04:28 UTC MAIN commitmail json YAML

Rework AHCISATA_EXTRA_DELAY for kern/56737

- Remove AHCI_QUIRK_EXTRA_DELAY as issue appears to be drive and
  not controller related
- Replace AHCISATA_EXTRA_DELAY with AHCISATA_REMOVE_EXTRA_DELAY,
  so defaulting to enabling the extra delay, as the downside of
  slower probing on systems which do not need it is less than having
  other systems intermittently fail to probe and attach drives
- Also allow disabling extra delay with AHCISATA_EXTRA_DELAY_MS = 0

We should return to this code to work out which of the extra delays
are needed, and how long they need to be. It may be that faster
systems are more likely to trigger the issue (I've only seen it on
a 13th gen i7-13700, though only tested on a limited set)

XXX pullup -10

(abs)

2023-09-10 12:50:38 UTC MAIN commitmail json YAML

Revert "Teach zfs bdevsw to do b_psize."

This is used only by dump and swap, which won't work safely on zvols
anyway.  We should make swap work eventually, but right now it's
leading unwary ussers into deadlock scenarios, so let's make it fail
early instead.

(riastradh)

2023-09-10 11:52:30 UTC MAIN commitmail json YAML

make: remove redundant 'extern' from function declaration

(rillig)

2023-09-10 11:41:33 UTC MAIN commitmail json YAML

make: add more details to usage message of -j option

(rillig)

2023-09-10 11:30:13 UTC MAIN commitmail json YAML

PLUM2 icu debug code uses dbg_bit_print, defined in hpcmips debug.h header file.
Thus rewrote code to use DPRINTF definition from it and include the header.

Fixes PLUMICUDEBUG enabled build.

(andvar)

2023-09-10 11:00:55 UTC MAIN commitmail json YAML

tests/make: add tests for parsing the -j option

(rillig)

2023-09-10 10:18:05 UTC MAIN commitmail json YAML

make: fix lint warning about strchr

main.c(416): warning:
    call to 'strchr' effectively discards 'const' from argument [346]

Even though C23 turns strchr into a const-generic function, it doesn't
do the same for strtol, so use separate pointers for the current parsing
position and the end of a number, as their constness differs.

(rillig)

2023-09-10 00:15:52 UTC MAIN commitmail json YAML

With the overhaul of the scheduler code the semantics of
ci_want_resched have changed, and for some reason vax
still requires ci_want_resched set to 1 in order to do
preemption.  This commit contains a workaround for the
preemption issued discussed in PR#55415.

XXX pullup-10

(oster)

2023-09-09 21:04:26 UTC MAIN commitmail json YAML

2023-09-09 21:01:57 UTC MAIN commitmail json YAML

s/reagion/region/ in called bus_space_read_region_stream_x method names.

relevant for hpcmips BUS_SPACE_HAS_REAL_STREAM_METHODS enabled build,
however it still fails due to other issues.

(andvar)

2023-09-09 20:47:29 UTC MAIN commitmail json YAML

relocate DPRINTF below to make sure that bpa is initialized.

fixes BUS_SPACE_DEBUG enabled build for hpcmips.

(andvar)

2023-09-09 20:13:54 UTC MAIN commitmail json YAML

uidinfo is an SLIST.

(ad)

2023-09-09 18:49:21 UTC MAIN commitmail json YAML

change #define to #error for MIPS3_4100i 8KB page size build protection.

(andvar)

2023-09-09 18:37:03 UTC MAIN commitmail json YAML

tsc_get_timecount(): cover the backwards check by DIAGNOSTIC since it has
proven the point by now.

(ad)

2023-09-09 18:34:44 UTC MAIN commitmail json YAML

do_sys_accessat(): copy credentials only when needed.

(ad)

2023-09-09 18:30:56 UTC MAIN commitmail json YAML

Fix a ~16 year old perf regression: when accepting a connection, add a
reference to the caller's credentials rather than copying them.

(ad)

2023-09-09 18:30:01 UTC MAIN commitmail json YAML

Note namecache tuning for 32-bit systems.

(ad)

2023-09-09 18:28:48 UTC MAIN commitmail json YAML

2023-09-09 18:27:59 UTC MAIN commitmail json YAML

- Shrink namecache entries to 64 bytes on 32-bit platforms and use 32-bit
  key values there for speed (remains 128 bytes & 64-bits on _LP64).
- Comments.

(ad)

2023-09-09 16:41:04 UTC MAIN commitmail json YAML

2023-09-09 16:01:09 UTC MAIN commitmail json YAML

Move the initialization of the random hash for addresses earlier so that
it does not happen under a spin lock context (when it is first used).

(christos)

2023-09-09 15:02:43 UTC netbsd-10 commitmail json YAML

2023-09-09 15:01:25 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by jdc in ticket #360):

sys/arch/sparc64/dev/fdc.c: revision 1.52
sys/arch/sparc64/include/intr.h: revision 1.32
sys/arch/sparc64/sparc64/autoconf.c: revision 1.239
sys/arch/sparc64/include/psl.h: revision 1.64

sparc64: fix interrupt level mapping for disk and and parallel devices
on SBUS-based machines

Change the mapping from PIL_SCSI to PIL_BIO, so that they interrupt above
the highest soft interrupt (softserial)

Remove unused PIL_SCSI, PIL_FDSOFT, PIL_AUSOFT and fix the printf in fdc.c

Add "socal" and "SUNW,bpp" to the interrupt map.

(martin)

2023-09-09 14:57:22 UTC netbsd-9 commitmail json YAML

2023-09-09 14:56:10 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by oster in ticket #1729):

sys/dev/raidframe/rf_reconstruct.c: revision 1.128

Revision 1.104 actually fixed the issues that were preventing
us from freeing the ReconControl structures.  So free them
and thus also prevent a panic on shutdown due to items not
being correctly returned to the pool.

Thanks to manu@ for report of the panic, and for initial testing
of the changes.

(martin)

2023-09-09 14:54:38 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by oster in ticket #359):

sys/dev/raidframe/rf_reconstruct.c: revision 1.128

Revision 1.104 actually fixed the issues that were preventing
us from freeing the ReconControl structures.  So free them
and thus also prevent a panic on shutdown due to items not
being correctly returned to the pool.

Thanks to manu@ for report of the panic, and for initial testing
of the changes.

(martin)

2023-09-09 14:50:15 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by riastradh in ticket #358):

usr.sbin/sysinst/util.c: revision 1.73

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.

(martin)

2023-09-09 09:38:02 UTC MAIN commitmail json YAML

add "midi* at midibus?" to hpmips VR41XX kernel config.
it is needed for umidi to build and makes this config to build as well.

(andvar)

2023-09-09 07:07:03 UTC MAIN commitmail json YAML

fix DEVMAP_ENTRY list termination symbol.

Makes hpcarm NETBOOKPRO config build again.

(andvar)

2023-09-09 04:38:49 UTC MAIN commitmail json YAML

add explicit cast for long -> int truncation warning-as-error.

as this is number of CPUs, i don't think we have to care about
it for a long, long, *long* time...

(mrg)

2023-09-09 01:30:59 UTC MAIN commitmail json YAML

make: allow -j to compute a multiple of ncpu

If _SC_NPROCESSORS_ONLN is supported; and -j arg is a floating point
number or ends in 'C' compute .MAKE.JOBS as a multiple of _SC_NPROCESSORS_ONLN

Based on a suggestion from des at freebsd.org
Discussed with: rillig, christos

(sjg)

2023-09-09 00:15:09 UTC MAIN commitmail json YAML

Revert "once(9): Assert sleepable in RUN_ONCE, unconditionally."

This would be nice but it'll break too many things for the moment.

(riastradh)

2023-09-09 00:14:16 UTC MAIN commitmail json YAML

solaris: Use pool_cache_reclaim, not pool_cache_invalidate.

pool_cache_invalidate invalidates cached objects, but doesn't return
any backing pages to the underlying page allocator.

pool_cache_reclaim does pool_cache_invalidate _and_ reutrns backing
pages to the underlying page alloator, so it is actually useful for
the page daemon to do when trying to free memory.

PR kern/57558

XXX pullup-10
XXX pullup-9
XXX pullup-8 (by patch to kmem.h instead of kmem.c)

(riastradh)

2023-09-08 23:25:39 UTC MAIN commitmail json YAML

once(9): Assert sleepable in RUN_ONCE, unconditionally.

Otherwise there's a good chance we'll never exercise many paths that
call RUN_ONCE when it's not sleepable, just because it's already been
done in a sleepable context before.

(riastradh)

2023-09-08 23:21:55 UTC MAIN commitmail json YAML

ffs_sync: Avoid unlocked access to v_numoutput/v_dirtyblkhd.

Found by lockdoc.

PR kern/57606

(riastradh)

2023-09-08 22:55:32 UTC MAIN commitmail json YAML

Revision 1.104 actually fixed the issues that were preventing
us from freeing the ReconControl structures.  So free them
and thus also prevent a panic on shutdown due to items not
being correctly returned to the pool.

Thanks to manu@ for report of the panic, and for initial testing
of the changes.

XXX pullup-9
XXX pullup-10

(oster)

2023-09-08 22:51:54 UTC MAIN commitmail json YAML

hp300/dcm(4): set dsp value after sc is initialized.
fixes DCMSTATS enabled build for hp300.

(andvar)

2023-09-08 20:46:45 UTC MAIN commitmail json YAML

Add check for space presence after comma in skin()

Check if comma is followed by space, otherwise it may lead to overflow in the
output buffer as space might be extra appended to the output buffer without
consuming anything from the input. This condition breaks the assumption that
length(input) >= length(output) while the code relies on it.

(shm)

2023-09-08 20:37:07 UTC MAIN commitmail json YAML

Fix writing outside of the nbuf buffer in skin()

Data provided to skin() can be longer than LINEBUF (if same header is provided
multiple times, hfield returns concatenated data).

Thanks to riastradh@ for the review and comments

(shm)

2023-09-08 19:55:51 UTC MAIN commitmail json YAML

2023-09-08 19:04:29 UTC MAIN commitmail json YAML

fix few typos in the text of Debug.tips and TODO.hp300 docs.

(andvar)

2023-09-08 18:51:19 UTC MAIN commitmail json YAML

s/Insruction/Instruction/

(andvar)

2023-09-08 18:17:41 UTC MAIN commitmail json YAML

PR/57609: Carl Engvall: Add salen checks but accept larger sizes
(upto sockaddr_storage)

(christos)

2023-09-08 14:34:02 UTC MAIN commitmail json YAML

Fix check_bufsize() incorrect behaviour

The function ensures that that buffer is large enough to store the data (if
not, it reallocates it). It doubled the buffer every time the buffer was too
small, but in some cases it wasn't enough, which might lead to heap overflows.
Rewrite of this function handles int overflow scenarios as well as ensures the
buffer is big enough to handle the data.

Thanks riastradh@ for the review and comments

(shm)

2023-09-08 14:22:04 UTC MAIN commitmail json YAML

Fixed undefined behaviour in hash()

Shift left on large int values was causing an undefined behaviour, fix it by
operating on unsigned int type instead. This patch changes behaviour of the
hash() slightly - if the computed hash is INT_MIN, the function previously
returned 0, but this case is negligible.

(shm)

2023-09-08 12:01:56 UTC MAIN commitmail json YAML

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.

(riastradh)

2023-09-08 09:10:54 UTC netbsd-8 commitmail json YAML

2023-09-08 09:09:56 UTC netbsd-8 commitmail json YAML

Pull up following revision(s) (requested by riastradh in ticket #1896):

lib/libpam/modules/pam_ksu/pam_ksu.c: revision 1.11

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.

(martin)

2023-09-08 09:09:08 UTC netbsd-9 commitmail json YAML

2023-09-08 09:08:13 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by riastradh in ticket #1728):

lib/libpam/modules/pam_ksu/pam_ksu.c: revision 1.11

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.

(martin)

2023-09-08 09:07:19 UTC netbsd-10 commitmail json YAML

2023-09-08 09:06:21 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by riastradh in ticket #357):

lib/libpam/modules/pam_ksu/pam_ksu.c: revision 1.11

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.

(martin)

2023-09-08 09:03:54 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by riastradh in ticket #356):

external/bsd/libevent/lib/Makefile: revision 1.5
external/bsd/libevent/lib/Makefile.subdir: revision 1.1
crypto/external/bsd/heimdal/lib/Makefile: revision 1.3
lib/Makefile: revision 1.297
external/bsd/openldap/lib/Makefile.subdir: revision 1.1
crypto/external/bsd/netpgp/lib/Makefile.subdir: revision 1.1
crypto/external/bsd/heimdal/lib/Makefile.subdir: revision 1.1
external/bsd/elftoolchain/lib/Makefile: revision 1.3
external/bsd/atf/lib/Makefile: revision 1.3
external/bsd/openldap/lib/Makefile: revision 1.3
external/bsd/atf/lib/Makefile.subdir: revision 1.1
crypto/external/bsd/netpgp/lib/Makefile: revision 1.18
external/bsd/elftoolchain/lib/Makefile.subdir: revision 1.1

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.

(martin)

2023-09-07 20:12:33 UTC MAIN commitmail json YAML

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.

(ad)

2023-09-07 20:07:04 UTC MAIN commitmail json YAML

Make the I2O management cdevs MPSAFE.

(ad)

2023-09-07 20:05:42 UTC MAIN commitmail json YAML

Remove dodgy and unused mutex_owner_running() & rw_owner_running().

(ad)

2023-09-07 20:04:18 UTC MAIN commitmail json YAML

2023-09-07 20:03:25 UTC MAIN commitmail json YAML

Remove unused I2O LAN class defs (the LAN driver was deleted years ago).

(ad)

2023-09-07 20:01:43 UTC MAIN commitmail json YAML

Permit calling cv_signal()/cv_broadcast() after mutex release.

(ad)

2023-09-07 19:59:20 UTC MAIN commitmail json YAML

raise() has understood threads for a long time, don't reimplment it.

(ad)

2023-09-07 16:38:08 UTC MAIN commitmail json YAML

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

(riastradh)

2023-09-07 12:48:49 UTC MAIN commitmail json YAML

Handle CAUSE_LOAD_PAGE_FAULT in trap_pagefault_fixup

(skrll)

2023-09-07 11:27:57 UTC MAIN commitmail json YAML

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

(riastradh)

2023-09-07 08:22:19 UTC netbsd-10 commitmail json YAML

2023-09-07 08:20:20 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by gutteridge in ticket #355):

sys/arch/arm/dts/rk3328-nanopi-r2s.dts: revision 1.1

Enable rkv1crypto on nanopi-r2s

Follow the example of rock64. Tested by myself.

(martin)

2023-09-07 08:05:14 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by riastradh in ticket #353):

tests/rump/kernspace/workqueue.c: revision 1.10

workqueue(9) tests: Fix mistake in rev. 1.9.

Somehow, despite manually verifying a build/install/test of every
revision in my patch series, I managed to commit the wrong version of
the file for what became rev. 1.9, so the test was just broken when
it went in and remained broken in the commit where I fixed the real
bug and removed the xfail marker on the test.

PR kern/5757

(martin)

2023-09-07 06:40:56 UTC MAIN commitmail json YAML

Fix memory leaks in bozo_cleanup

(shm)

2023-09-07 06:24:31 UTC MAIN commitmail json YAML

tests/lint: allow lint libraries to be installed

(rillig)

2023-09-07 06:17:35 UTC MAIN commitmail json YAML

tests/lint: test case labels with out-of-bounds values

(rillig)

2023-09-07 05:36:33 UTC MAIN commitmail json YAML

2023-09-06 23:44:43 UTC MAIN commitmail json YAML

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

(riastradh)

2023-09-06 22:08:38 UTC MAIN commitmail json YAML

2023-09-06 22:08:06 UTC MAIN commitmail json YAML

2023-09-06 20:17:43 UTC MAIN commitmail json YAML

Node that aarch64 implements CAS.

(ad)

2023-09-06 20:16:05 UTC MAIN commitmail json YAML

KNF, clarify/provide warning messages, set rval to fail initially and only
set to success once everything works.

(christos)

2023-09-06 19:56:57 UTC MAIN commitmail json YAML

+DAE    deterministic authenticated encryption

(jschauma)

2023-09-06 19:14:52 UTC MAIN commitmail json YAML

fix the example for container_of().

needs to be a pointer into the containing structure, not the
value of a pointer inside the structure.

(mrg)

2023-09-06 15:14:20 UTC netbsd-10 commitmail json YAML

2023-09-06 15:11:27 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by riastradh in ticket #352):

distrib/sets/lists/base/ad.mips: revision 1.93
distrib/sets/lists/debug/ad.aarch64: revision 1.37
distrib/sets/lists/base/shl.mi: revision 1.970
distrib/sets/lists/base/ad.aarch64: revision 1.45
distrib/sets/lists/debug/md.i386: revision 1.21
distrib/sets/lists/base/md.i386: revision 1.159
distrib/sets/lists/base/shl.mi: revision 1.945
distrib/sets/lists/debug/ad.mips: revision 1.83
distrib/sets/lists/xdebug/md.i386: revision 1.61
distrib/sets/lists/base/ad.arm: revision 1.87
distrib/sets/lists/xdebug/md.amd64: revision 1.64
distrib/sets/lists/debug/shl.mi: revision 1.330
distrib/sets/lists/debug/shl.mi: revision 1.331
distrib/sets/lists/comp/shl.mi: revision 1.354
distrib/sets/lists/debug/ad.arm: revision 1.81
(all via patch)

un-obsolete ./usr/lib/libisns.so*.  it's normal for these to be
symlinks in this case, and they also exist in the case that
MKDYNAMICROOT is not set.

also fixes running "makefs" against a destdir and it's METALOG*.

lists: Remove more bogus shlib obsolete entries.

Too much trouble to have to remember about libuv.so, libgmp.so, &c.
Just apply the rule uniformly.

All that's left is test libraries and loadable modules.
Searched with:
git grep 'lib.*\.so\.[0-9][0-9]*.*obsolete' distrib/sets/lists | grep -v '/modules/' | grep -v '/locale/lib/' | grep -v '/lib/npf/' | grep -v '/lib/librump' | grep -v '/lib/netbsd/libclang_rt' | grep -v '/runemodule/'
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).

(martin)

2023-09-06 15:07:37 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by riastradh in ticket #351):

libexec/httpd/lua/shlib_version: revision 1.2
distrib/sets/lists/base/shl.mi: revision 1.971
libexec/httpd/libbozohttpd/shlib_version: revision 1.2
distrib/sets/lists/debug/shl.mi: revision 1.332
(all via patch)

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

(martin)

2023-09-06 15:04:33 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by riastradh in ticket #350):

tests/usr.sbin/certctl/t_certctl.sh: revision 1.10
usr.sbin/certctl/certctl.sh: revision 1.5
tests/usr.sbin/certctl/t_certctl.sh: revision 1.9

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).

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.

(martin)

2023-09-06 13:38:54 UTC MAIN commitmail json YAML

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.

(riastradh)

2023-09-06 12:48:15 UTC MAIN commitmail json YAML

2023-09-06 12:44:45 UTC MAIN commitmail json YAML

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

(riastradh)

2023-09-06 12:31:49 UTC MAIN commitmail json YAML

sys/param.h: Welcome to 10.99.8!

Courtesy of nestable heartbeat_suspend/resume, which changed struct
cpu_info.

(riastradh)

2023-09-06 12:29:14 UTC MAIN commitmail json YAML

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

(riastradh)

2023-09-06 08:14:42 UTC MAIN commitmail json YAML

yet another tsleep/wakeup -> cv_*

(macallan)

2023-09-06 08:12:09 UTC MAIN commitmail json YAML

- 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

(shm)

2023-09-06 08:04:43 UTC netbsd-8 commitmail json YAML

2023-09-06 08:03:45 UTC netbsd-8 commitmail json YAML

Pull up following revision(s) (requested by mrg in ticket #1895):

crypto/external/bsd/openssl/dist/crypto/sparccpuid.S: revision 1.11

fix SPARC v8/v9 detection code.

this code uses a trick where the encoding on both v8 and v9 are
the same, and are not illegal instructions, but that the v9 one
has a detectable difference than v8.

the idea is that we perform a "subcc" (set condition codes) which
sets "%ccr" on v9, which is an unimplemented "%asr2" on v8, then
we read %ccr (v9) or %asr2 (v8), which will always be 0x99 on v9,
and .. is non-trapping but impleentation defined on v8.

for many implementations this returns the value of the %y reg.

as nothing actually sets %y in this path, it remains the value it
was most recently set to by something (anything), and if it just
happens to be 0x99 then the v9 paths will be taken on v8.

fix this by clearing the %y register before the potential read.

fixes PR port-sparc/57594.  tested on ss20 and in qemu.  this
version of the patch has been submitted upstream.

(martin)

2023-09-06 08:03:07 UTC netbsd-9 commitmail json YAML

2023-09-06 08:01:47 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by mrg in ticket #1727):

crypto/external/bsd/openssl/dist/crypto/sparccpuid.S: revision 1.11

fix SPARC v8/v9 detection code.

this code uses a trick where the encoding on both v8 and v9 are
the same, and are not illegal instructions, but that the v9 one
has a detectable difference than v8.

the idea is that we perform a "subcc" (set condition codes) which
sets "%ccr" on v9, which is an unimplemented "%asr2" on v8, then
we read %ccr (v9) or %asr2 (v8), which will always be 0x99 on v9,
and .. is non-trapping but impleentation defined on v8.

for many implementations this returns the value of the %y reg.

as nothing actually sets %y in this path, it remains the value it
was most recently set to by something (anything), and if it just
happens to be 0x99 then the v9 paths will be taken on v8.

fix this by clearing the %y register before the potential read.

fixes PR port-sparc/57594.  tested on ss20 and in qemu.  this
version of the patch has been submitted upstream.

(martin)

2023-09-06 08:01:09 UTC netbsd-10 commitmail json YAML

2023-09-06 08:00:12 UTC netbsd-10 commitmail json YAML

Pull up following revision(s) (requested by mrg in ticket #349):

crypto/external/bsd/openssl/dist/crypto/sparccpuid.S: revision 1.11

fix SPARC v8/v9 detection code.

this code uses a trick where the encoding on both v8 and v9 are
the same, and are not illegal instructions, but that the v9 one
has a detectable difference than v8.

the idea is that we perform a "subcc" (set condition codes) which
sets "%ccr" on v9, which is an unimplemented "%asr2" on v8, then
we read %ccr (v9) or %asr2 (v8), which will always be 0x99 on v9,
and .. is non-trapping but impleentation defined on v8.

for many implementations this returns the value of the %y reg.

as nothing actually sets %y in this path, it remains the value it
was most recently set to by something (anything), and if it just
happens to be 0x99 then the v9 paths will be taken on v8.

fix this by clearing the %y register before the potential read.

fixes PR port-sparc/57594.  tested on ss20 and in qemu.  this
version of the patch has been submitted upstream.

(martin)

2023-09-05 22:15:46 UTC MAIN commitmail json YAML

2023-09-05 22:14:08 UTC MAIN commitmail json YAML

apply previous to just GCC.

(mrg)

2023-09-05 21:57:29 UTC MAIN commitmail json YAML

drmkms: Fix module build.

(riastradh)