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 (8m)  netbsd-8 (5d)  netbsd-10 (5d)  netbsd-9 (11d)  thorpej-ifq (175d)  thorpej-altq-separation (178d) 

2024-05-10 09:23:44 UTC Now

2020-05-15 19:28:10 UTC MAIN commitmail json YAML

2020-05-15 19:07:01 UTC MAIN commitmail json YAML

Don't add KCOV instrumentation on top of the KUBSAN instrumentation,
this is useless and too bloated.

(maxv)

2020-05-15 18:45:08 UTC MAIN commitmail json YAML

PR port-sparc/55261: sparc still panics running ATF tests

Put cpu_data at the end of cpu_info to see how that modifies the symptom.

(ad)

2020-05-15 16:58:28 UTC MAIN commitmail json YAML

whitespace (bad indent)

(jdolecek)

2020-05-15 16:34:44 UTC MAIN commitmail json YAML

automatically remove old debug files for modules.

(christos)

2020-05-15 16:33:38 UTC MAIN commitmail json YAML

Add a function to remove the debug bits of the stand files.

(christos)

2020-05-15 15:20:40 UTC MAIN commitmail json YAML

PR 55239: initialize all RAS sections for non-MP configurations

(martin)

2020-05-15 14:57:33 UTC MAIN commitmail json YAML

2020-05-15 14:44:05 UTC MAIN commitmail json YAML

Ignore warnings for tautological compares for clang.

(joerg)

2020-05-15 14:37:21 UTC MAIN commitmail json YAML

Hook up proper fork lock handling for malloc:
- lock all relevant mutexes just before fork
- unlock all mutexes just after fork in the parent
- full reinit non-spinlocks in the child
This is not using the normal pthread_atfork interface to ensure order of
operation, malloc is used as implementation detail too often.

(joerg)

2020-05-15 14:34:42 UTC MAIN commitmail json YAML

When using default mutex types, don't setup attributes for init.

(joerg)

2020-05-15 14:30:23 UTC MAIN commitmail json YAML

Lock/unlock/reinit pthread__deadqueue_lock over fork.

(joerg)

2020-05-15 14:29:53 UTC MAIN commitmail json YAML

Ignore unused private fields when building with clang

(joerg)

2020-05-15 14:29:29 UTC MAIN commitmail json YAML

Don't allow building with clang, uses GCC-specific attributes.

(joerg)

2020-05-15 13:09:02 UTC MAIN commitmail json YAML

Introduce kcov_silence_enter() and kcov_silence_leave(), to allow to
temporarily disable KCOV on the current lwp. Should be used in the rare
but problematic cases where extreme noise is introduced by an
uninteresting subsystem.

Use this capability to silence KCOV during the LOCKDEBUG lookups. This
divides the size of the KCOV output by more than two in my KCOV+vHCI
tests.

(maxv)

2020-05-15 12:34:52 UTC MAIN commitmail json YAML

Introduce KCOV remote support. This allows to collect KCOV coverage on
threads other than curlwp, which is useful when fuzzing components that
defer processing, such as the network stack (partially runs in softints)
and the USB stack (partially runs in uhub kthreads).

A subsystem that whishes to provide coverage for its threads creates a
"mailbox" via kcov_remote_register() and gives it a (subsystem, id)
identifier. There is one mailbox per "target lwp". The target lwp(s)
must then call kcov_remote_enter() and kcov_remote_leave() with the
identifier, to respectively enable and disable coverage within the
thread.

On the userland side, the fuzzer has access to the mailboxes on the
system with the KCOV_IOC_REMOTE_ATTACH and KCOV_IOC_REMOTE_DETACH ioctls.
When attached to a mailbox with a given identifier, the KCOV_IOC_ENABLE,
KCOV_IOC_DISABLE and mmap() operations will affect the mailbox.

As a demonstrator, the vHCI subsystem is changed to use KCOV mailboxes.
When the vHCI bus attaches it creates as many mailboxes as it has USB
ports, each mailbox being associated with a distinct port. Uhub is changed
to enable KCOV coverage in usbd_new_device(). With that in place, all of
the USB enumeration procedure can be traced with KCOV.

(maxv)

2020-05-15 12:31:04 UTC MAIN commitmail json YAML

crunchgen fix

Make sure local_port is not shared within a crunchgen binary. There is
more to do to get full functionnality in crunchgen, but at least this
change makes dhcpd listen on the right port again.

(manu)

2020-05-15 09:21:59 UTC MAIN commitmail json YAML

2020-05-15 09:08:10 UTC MAIN commitmail json YAML

2020-05-15 07:51:49 UTC MAIN commitmail json YAML

It should be allowed to have exactly a usb_descriptor_t.

(maxv)

2020-05-15 07:47:54 UTC MAIN commitmail json YAML

Use a generic description when scanning mbufs.

(maxv)

2020-05-15 07:42:58 UTC MAIN commitmail json YAML

use short for irq2port[] to save memory (4KB), it only needs to store
numbers <= NR_EVENT_CHANNELS (2048)

(jdolecek)

2020-05-15 07:31:07 UTC MAIN commitmail json YAML

only call PHYSDEVOP_map_pirq for a shared interrupt once, same as previous code

fixes boot problem reported privately by Frank Kardel and Patrick Welche

(jdolecek)

2020-05-15 06:34:34 UTC MAIN commitmail json YAML

igmp_sendpkt() expects ip_output() to set 'imo.imo_multicast_ttl' into
'ip->ip_ttl'; but ip_output() won't if the target is not a multicast
address, meaning that the uninitialized 'ip->ip_ttl' byte gets sent to
the network. This leaks one byte of kernel heap.

Fix this by filling 'ip->ip_ttl' with a TTL of one.

Found by KMSAN.

Reported-by: syzbot+e49f7b8a8fec5a477c9a@syzkaller.appspotmail.com

(maxv)

2020-05-15 06:26:44 UTC MAIN commitmail json YAML

Use howmany.  NFC.

(skrll)

2020-05-15 06:23:54 UTC MAIN commitmail json YAML

Use ux_length in isoc usb_syncmem.  Missed in previous commit.

(skrll)

2020-05-15 06:15:42 UTC MAIN commitmail json YAML

2020-05-15 06:01:26 UTC MAIN commitmail json YAML

2020-05-15 05:39:15 UTC MAIN commitmail json YAML

2020-05-15 04:55:40 UTC MAIN commitmail json YAML

SCTLR_EnIA should be enabled in the caller(locore).

For some reason, gcc make aarch64_pac_init() function non-leaf, and it uses paciasp/autiasp.

(ryo)

2020-05-15 01:43:47 UTC MAIN commitmail json YAML

2020-05-15 00:04:02 UTC MAIN commitmail json YAML

Undo previous, need to fix differently (fifofs is needed by other fs's and
fifo brings in rumpnet)

(christos)

2020-05-14 23:42:18 UTC MAIN commitmail json YAML

If we could not lock the pid file, don't continue as we end up with multiple
rtadvd's (thanks roy@)

(christos)

2020-05-14 23:09:29 UTC MAIN commitmail json YAML

Make efi_rng_show return early if RNG protocol is not available. While
here, use efi_rng_available() consistently, prefix all show messages with
"RNG: ", and use sizeof(foo) instead of sizeof foo.

(jmcneill)

2020-05-14 21:13:46 UTC MAIN commitmail json YAML

Note some random number generation updates.

Also note swap encryption in uvm.

(riastradh)

2020-05-14 20:10:34 UTC MAIN commitmail json YAML

PR/55102: Kamil Rytarowski: Remove fifo stuff duplicated in fifo_vnops.c

(christos)

2020-05-14 19:36:03 UTC MAIN commitmail json YAML

xen_vec_alloc() is no more

(jdolecek)

2020-05-14 19:26:28 UTC MAIN commitmail json YAML

Free kva for rndseed and efirng when done.

The physical pages remain forever reserved because it's not convenient
to unreserve them at the moment after we reserved them during
fdt_build_bootconifg, but it's just two pages so not that big a deal.

(riastradh)

2020-05-14 19:25:16 UTC MAIN commitmail json YAML

Bump efiboot version to note EFI RNG support.

(riastradh)

2020-05-14 19:24:35 UTC MAIN commitmail json YAML

Deduplicate address-range querying/mapping logic.

(riastradh)

2020-05-14 19:21:53 UTC MAIN commitmail json YAML

Deduplicate lazy /chosen node creation logic.

(riastradh)

2020-05-14 19:21:35 UTC MAIN commitmail json YAML

Ignore interception of the SIGCHLD signals.

SIGCHLD once blocked is discarded by the kernel as it has the
SA_IGNORE property. During the fork(2) operation all signals can be
shortly blocked and missed (unless there is a registered signal
handler in the traced child). This leads to a race in this test if
there would be an intention to catch SIGCHLD.

Fixes PR lib/55241 by Andreas Gustafsson

(kamil)

2020-05-14 19:21:06 UTC MAIN commitmail json YAML

Teach arm fdt kernel to use /chosen/netbsd,efirng data.

Feed it in as a separate random source, with zero entropy since this
is a best-effort fallback for devices we really don't know anything
about.

(riastradh)

2020-05-14 19:20:08 UTC MAIN commitmail json YAML

Pass EFI RNG output via /chosen/netbsd,efirng-{start,end}.

This is separate from /chosen/netbsd,rndseed-{start,end}, which
specifies NetBSD's persistent on-disk seed; efirng is the firmware's
RNG device.

(riastradh)

2020-05-14 19:19:08 UTC MAIN commitmail json YAML

2020-05-14 18:18:24 UTC MAIN commitmail json YAML

Fix uninitialized memory access. Found by KMSAN.

Reported-by: syzbot+9f2a173d29d66c88f9ac@syzkaller.appspotmail.com

(maxv)

2020-05-14 18:06:58 UTC MAIN commitmail json YAML

synaptics: Don't reset the device multiple times in succession

Cherrypicked from a patch from an anonymous contributor.

(nia)

2020-05-14 17:01:34 UTC MAIN commitmail json YAML

KASSERT -> panic

(maxv)

2020-05-14 16:57:53 UTC MAIN commitmail json YAML

Don't even try to go past a syscall. Fixes severe panic recursions in
KUBSAN.

(maxv)

2020-05-14 16:32:57 UTC MAIN commitmail json YAML

- prune src/gnu and src/sys/netsmb
- add src/sys/netcan
- remove bogus statement about location of reachover Makefiles
- tweak language

(snj)

2020-05-14 13:40:49 UTC MAIN commitmail json YAML

Use more markup.

(wiz)

2020-05-14 13:37:52 UTC MAIN commitmail json YAML

ptrace(2): Add PT_SET_SIGPASS and PT_GET_SIGPASS.

(kamil)

2020-05-14 13:34:46 UTC MAIN commitmail json YAML

Welcome to 9.99.62

struct sigctx gained ps_sigpass member.

(kamil)

2020-05-14 13:32:15 UTC MAIN commitmail json YAML

Introduce new ptrace(2) operations: PT_SET_SIGPASS and PT_GET_SIGPASS

They deliver the logic of bypassing selected signals directly to the
debuggee, without informing the debugger.

This can be used to implement the QPassSignals GDB/LLDB protocol.

This call can be useful to avoid signal races in ATF ptrace tests.

(kamil)

2020-05-14 13:25:40 UTC MAIN commitmail json YAML

fix resume for xennet, now the network continues working after resume

we can't read feature-rx-copy in resume, at that time the new backend
device is not filled yet; convert it just to feature flag read on interface
attach, can assume any backend would support rx-copy anyway

fix compile with XENNET_DEBUG

part of PR port-xen/55207

(jdolecek)

2020-05-14 13:18:55 UTC MAIN commitmail json YAML

fix compile when DPRINK() is defined

(jdolecek)

2020-05-14 11:50:05 UTC MAIN commitmail json YAML

2020-05-14 09:47:25 UTC MAIN commitmail json YAML

rearrange so that suspend & resume doesn't cause panics, and interface
is more likely to work - particularly, don't try to xengnt_revoke_access()
after resume, move xen_intr_disestablish() call to resume, also
unmask the event channel on resume

XXX right now xennet device detaches immediately after resume, which is not
desirable and needs to be fixed

part of PR port-xen/55207

(jdolecek)

2020-05-14 08:34:20 UTC MAIN commitmail json YAML

2020-05-14 08:26:29 UTC MAIN commitmail json YAML

Fix previous; specify lwpid for curlpw in the case of pid == 0.

For linux_sys_sched_setaffinity, pid == 0 means the current thread.
On the other hand, for our native sys_sched_setaffinity, lid == 0
means all lwp's that belong to the process.

(rin)

2020-05-14 07:59:03 UTC MAIN commitmail json YAML

Use MUTEX_NODEBUG for PV locks as is commonly done.  OK ryo.

(skrll)

2020-05-14 06:13:39 UTC MAIN commitmail json YAML

Mask all interrupts before reading (and clearing) the interrupt request
register in attach.

Picked up by an assert in the qemu code.

(skrll)

2020-05-13 22:13:49 UTC MAIN commitmail json YAML

fix how shutdown is acknowledged - do it just by writing empty value
into the key; this is necessary for suspend, for it removal fails with
EACCESS

now 'xl save' proceeds almost instantly without timing out, and no longer
complains about the domain not acknowleding suspend

part of port-xen/55207

(jdolecek)

2020-05-13 21:59:45 UTC MAIN commitmail json YAML

make the iscsi attached message aprint_verbose(), no need to show normally

(jdolecek)

2020-05-13 21:44:30 UTC MAIN commitmail json YAML

Fix and improve parsing of configuration files

XXX pull-up to netbsd-9

(khorben)

2020-05-13 21:34:01 UTC MAIN commitmail json YAML

smbfs has been removed.

(nakayama)

2020-05-13 21:09:02 UTC MAIN commitmail json YAML

Rework octeon_rnm(4) random number generator driver.

- Do a little on-line self-test for fun.
- Draw raw samples from the ring oscillators.
- Draw substantially more samples:
  => early RO samples seem to have considerably lower entropy
  => consecutive RO samples are not independent
- Make sure to use rnd_add_data_sync in the callback.
  => not technically needed in HEAD, but would be needed for pullup

(riastradh)

2020-05-13 19:33:48 UTC MAIN commitmail json YAML

Use ux_bufsize rather than ux_length in isoc path usb_syncmem calls.

ux_length is always 0 for isoc pipes, so it could not be used here.

To do: revisit this for other host controllers, uhci and ehci in particular?

(jakllsch)

2020-05-13 18:44:51 UTC MAIN commitmail json YAML

ohci_alloc_sed() returns a pointer, so use NULL rather than 0 on bail-out

(jakllsch)

2020-05-13 18:17:31 UTC netbsd-9 commitmail json YAML

2020-05-13 18:08:38 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by chs in ticket #907):

libexec/ld.elf_so/rtld.c: revision 1.205
libexec/ld.elf_so/rtld.h: revision 1.140
libexec/ld.elf_so/symbols.map: revision 1.3
libexec/ld.elf_so/symbols.map: revision 1.4
lib/libc/gen/pthread_atfork.c: revision 1.13
lib/libc/gen/pthread_atfork.c: revision 1.14
libexec/ld.elf_so/rtld.h: revision 1.139
libexec/ld.elf_so/rtld.c: revision 1.204

Introduce intermediate locking for fork, so that the dynamic linker is
in a consistent state. This most importantly avoids races between dlopen
and friends and fork, potentially resulting in dead locks in the child
when it itself tries to acquire locks.

Rename __atomic_fork to __locked_fork and give it &errno as argument.
rtld and libc use different storage, so the initial version would
incorrectly report the failure reason for fork().

There is still a small race condition inside ld.elf_so as it doesn't use
thread-safe errno internally, but that's a more contained internal
issue.

(martin)

2020-05-13 18:05:14 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by chs in ticket #906):

sys/uvm/uvm_page.h: revision 1.99

Include "opt_uvm_page_trkown.h" for UVM_PAGE_TRKOWN.

(martin)

2020-05-13 18:04:03 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by chs in ticket #905):

external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.6

Revert "Add fixup operation to remove private mutex types for x86."

The x86 (and arm) definitions of struct kmutex are no longer defined
differently depending on __MUTEX_PRIVATE.

(martin)

2020-05-13 18:01:50 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by chs in ticket #904):

sys/arch/x86/include/mutex.h: revision 1.8
sys/arch/x86/include/mutex.h: revision 1.9
sys/arch/arm/include/mutex.h: revision 1.22
sys/arch/arm/include/mutex.h: revision 1.23

Remove __MUTEX_PRIVATE conditional in definition of struct kmutex.

This doesn't buy us anything but the need to hack around it in
ctfmerge to avoid massive duplication of kernel types -- which only
worked for the x86 definition.

This changes only x86 and arm for now, pending compile-testing the
remaining architectures.

Fix userland build by surrounding stuff with #ifdef _KERNEL.
(...Why does this header file get exposed to userland at all?)

(martin)

2020-05-13 16:17:46 UTC MAIN commitmail json YAML

move the xen_intr_disestablish() to resume - having it in suspend
seems to cause panic in later phases of suspend

don't try to revoke grants in resume, they are all gone

add some diagnostic code in suspend to make sure the request lists are ready
for resume

part of PR port-xen/55207

(jdolecek)

2020-05-13 16:13:14 UTC MAIN commitmail json YAML

need to set the version on resume same as during initialization

part of PR port-xen/55207

(jdolecek)

2020-05-13 14:54:39 UTC MAIN commitmail json YAML

Fix unspecified semantics in left shift

Undefined Behavior in
/usr/src/sys/external/bsd/sljit/dist/test_src/sljitTest.c:568:113,
left shift of 1 by 63 places cannot be represented in type 'sljit_sw' (aka 'long')

Undefined Behavior in
/usr/src/sys/external/bsd/sljit/dist/test_src/sljitTest.c:585:73,
left shift of 1 by 63 places cannot be represented in type 'long long'

Cherry-pick upstream patch:

From 4c741e240668ab4cc4fdb67b67d8a566f98e07bf Mon Sep 17 00:00:00 2001
From: Zoltan Herczeg <zherczeg.u-szeged@partner.samsung.com>
Date: Mon, 6 Apr 2020 06:41:27 -0700
Subject: [PATCH] Rework 0x80..0 computation.

(kamil)

2020-05-13 14:00:58 UTC MAIN commitmail json YAML

Remove trailing whitespace

(joerg)

2020-05-13 13:19:38 UTC MAIN commitmail json YAML

2020-05-13 12:42:30 UTC netbsd-9 commitmail json YAML

2020-05-13 12:41:43 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by chs in ticket #903):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.66

fix the handling in putpage of the page containing EOF.

(martin)

2020-05-13 12:40:09 UTC netbsd-8 commitmail json YAML

2020-05-13 12:39:20 UTC netbsd-8 commitmail json YAML

Pull up following revision(s) (requested by yamaguchi in ticket #1547):

sys/arch/x86/pci/if_vmx.c: revision 1.60

Fix the wrong logic about making the number of vmx(4) TX/RX queue
be power of two

reviewed by nonaka@n.o.

(martin)

2020-05-13 12:38:37 UTC netbsd-9 commitmail json YAML

2020-05-13 12:37:31 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by yamaguchi in ticket #902):

sys/arch/x86/pci/if_vmx.c: revision 1.60

Fix the wrong logic about making the number of vmx(4) TX/RX queue
be power of two

reviewed by nonaka@n.o.

(martin)

2020-05-13 12:34:41 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by skrll in ticket #901):

sys/arch/aarch64/include/setjmp.h: revision 1.2
lib/libc/arch/aarch64/genassym.cf: revision 1.2
lib/libc/arch/aarch64/gen/setjmp.S: revision 1.3
lib/libc/arch/aarch64/gen/_setjmp.S: revision 1.4

Don't futz with tpidr_el0 in {set,long}jmp as it breaks TLS as seen in
qemu

(martin)

2020-05-13 12:31:11 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by skrll in ticket #900):

sys/arch/aarch64/include/Makefile: revision 1.4
sys/arch/aarch64/include/trap.h: revision 1.3
distrib/sets/lists/comp/ad.aarch64: revision 1.40

Provide a trap.h (currently empty)

Update for trap.h

(martin)

2020-05-13 12:24:11 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by nia in ticket #899):
crypto/external/bsd/openssl/lib/libcrypto/evp.inc: revision 1.9
Ensure that -DOPENSSL_CPUID_OBJ is passed when compiling AES EVP bits
This way CPUs that support AES-NI actually get detected properly ;_;
(... just one part of the puzzle)

(martin)

2020-05-13 12:21:56 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by maxv in ticket #898):

sys/dev/nvmm/x86/nvmm_x86_svm.c: revision 1.59
sys/dev/nvmm/nvmm_internal.h: revision 1.14
sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.53
sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.54
sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.55
sys/dev/nvmm/nvmm.c: revision 1.27
sys/dev/nvmm/nvmm.c: revision 1.28

When the identification fails, print the reason.

If we were processing a software int/excp, and got a VMEXIT in the middle,
we must also reflect the instruction length, otherwise the next VMENTER
fails and Qemu shuts the guest down.

On Intel CPUs, CPUID leaf 0xB, too, provides topology information, so
filter it correctly, to avoid inconsistencies if the host has SMT.

This fixes HaikuOS which fetches SMT information from there and would
panic because of the inconsistencies.

(martin)

2020-05-13 11:41:35 UTC MAIN commitmail json YAML

2020-05-13 10:34:05 UTC MAIN commitmail json YAML

Enable ualea(4) by default

(martin)

2020-05-13 10:33:16 UTC MAIN commitmail json YAML

Remove local USB device declarations, include the central list instead

(martin)

2020-05-13 10:13:29 UTC MAIN commitmail json YAML

Implement pmap_extract_coherency

(jmcneill)

2020-05-13 09:21:30 UTC MAIN commitmail json YAML

Add operation fstrans_held(struct mount *), true if the current thread
holds a fstrans lock.

Ride 9.99.61

(hannken)

2020-05-13 08:43:28 UTC MAIN commitmail json YAML

xen: enable MULTIPROCESSOR for Xen dom0

(bouyer)

2020-05-13 08:42:01 UTC MAIN commitmail json YAML

MULTIPROCESSOR for dom0 should be safe now. Enable it.

(bouyer)

2020-05-13 06:09:25 UTC MAIN commitmail json YAML

fix evbarm64 build release with LLVM

(ryo)

2020-05-13 06:08:51 UTC MAIN commitmail json YAML

2020-05-13 05:52:54 UTC MAIN commitmail json YAML

fix the handling in putpage of the page containing EOF.

(chs)

2020-05-13 05:37:16 UTC MAIN commitmail json YAML

for "mach cpuinfo", print ci_biglock_count too.

(chs)

2020-05-12 23:18:52 UTC MAIN commitmail json YAML

NetBSD 9.99.61 - vfa_cache interface changed

(ad)

2020-05-12 23:18:03 UTC MAIN commitmail json YAML

2020-05-12 23:17:42 UTC MAIN commitmail json YAML

cache_enter_id(): give it a boolean parameter to indicate whether the cached
identity is valid.

(ad)

2020-05-12 21:56:17 UTC MAIN commitmail json YAML

PR kern/55251 (use of ZFS may trigger kernel memory corruption (KASAN error))

Previous wasn't quite right.  Redo it differently - disable preemption
earlier instead.

(ad)

2020-05-12 21:24:30 UTC MAIN commitmail json YAML

PR kern/55251: use of ZFS may trigger kernel memory corruption

mutex_vector_enter(): reload mtx_owner with preemption disabled before
calling mutex_oncpu(), otherwise lwp_dtor() can intervene.

(ad)

2020-05-12 20:50:17 UTC MAIN commitmail json YAML

Don't invoke callbacks of rndsources with collection disabled.

(riastradh)

2020-05-12 17:26:43 UTC MAIN commitmail json YAML

2020-05-12 17:04:00 UTC MAIN commitmail json YAML

Ooops, backout previous - twice the entropy saving is not needed.
Instead slightly improve the (slightly) hidden other code that already
did it.

(martin)

2020-05-12 16:18:04 UTC MAIN commitmail json YAML

2020-05-12 16:17:58 UTC MAIN commitmail json YAML

- in script mode always output errors to stderr prefixed by the program name.
- in command mode always output errors to stdout not prefixed " " "
- perror(3) -> warn(3)

(christos)

2020-05-12 14:29:06 UTC MAIN commitmail json YAML

Keep track of the filename to print in error messages.
Change quoting of error string from [] to `'.

(christos)

2020-05-12 14:04:50 UTC MAIN commitmail json YAML

Oceton RNG/RNM driver modernisation to fit new entropy world order by
riastradh@, with some tweaks to get working in RNG mode.

XXX TODO: work out how to get raw entropy mode working.

(simonb)

2020-05-12 11:39:09 UTC MAIN commitmail json YAML

Remove mentions of CLONE_PID and CLONE_STOPPED

CLONE_PID was removed in Linux 2.5.15 and recycled for
CLONE_PIDFD since Linux 5.2.

CLONE_STOPPED was removed in Linux 2.6.38 and recycled
for CLONE_NEWCGROUP since Linux 4.6.

(kamil)

2020-05-12 11:21:10 UTC MAIN commitmail json YAML

Remove the stub support of CLONE_PID in clone(2)

CLONE_PID causes the child clonee to share the same process id as cloner.

It was implemented for debugging purposes in the Linux kernel 2.0,
restricted to root only in 2.3.21 and removed from Linux 2.5.16.

The CLONE_PID bit was recycled for CLONE_PIDFD in Linux 5.2.

(kamil)

2020-05-12 10:37:10 UTC MAIN commitmail json YAML

If bus_space_map fails, just don't attach the driver instead of panicing.
Check RNG built in self test, don't attach if that fails too.

(simonb)

2020-05-12 10:20:16 UTC MAIN commitmail json YAML

Remove a reference to /etc/netstart

It was removed in rc.d era and no longer honored (except by newbtconf(8)).

Noticed by Ottavio Caruso on #netbsd@Freenode, thanks!

(leot)

2020-05-12 10:12:08 UTC MAIN commitmail json YAML

Add a few more bits.
XXX convert to __BITS.

(simonb)

2020-05-12 10:02:56 UTC MAIN commitmail json YAML

need to take IFNET_LOCK() around if_stop (on suspend) and if_init (on resume)
calls, those need to read and/or manipulate if_flags and hence need
the lock for IFEF_MPSAFE drivers; the drivers can't do IFNET_LOCK() themselves,
because the ioctl path call these hooks with the lock held

fixes KASSERT() in xennet(4) while investigating PR port-xen/55207

(jdolecek)

2020-05-12 09:54:02 UTC MAIN commitmail json YAML

move xen_intr_disestablish() call in xbd_xenbus_suspend() so it's executed
without holding the xbd mutex, to avoid LOCKDEBUG assertion on suspend

while here only disestablish the intr if it was established

part of PR port-xen/55207

(jdolecek)

2020-05-12 09:48:44 UTC MAIN commitmail json YAML

Whitespace alignment nits.

(simonb)

2020-05-12 06:32:05 UTC MAIN commitmail json YAML

Don't use TSC freq value from CPUID if calibration works.

- When it's the first call of cpu_get_tsc_freq() the HPET is not initialized,
  so try to use CPUID to get TSC freq.
- If it's the 2nd call, don't use CPUID. Instead, print the difference
  between the calibrated value and CPUID's value if the verbose mode is set.

(msaitoh)

2020-05-12 06:23:07 UTC MAIN commitmail json YAML

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.

(martin)

2020-05-11 23:47:45 UTC MAIN commitmail json YAML

msk(4): ack Status BMU IRQ only if we're (apparently) caught up with it

Possibility for acking an unprocessed Status BMU IRQ still exists, and
remains handled by the watchdog.  Nevertheless this should reduce the
likelyhood that path is taken.

(jakllsch)

2020-05-11 21:51:25 UTC MAIN commitmail json YAML

Fix the build for MKCOMPAT=no.

The t_user_ldt test needs the i386 compat library which is only built
when MKCOMPAT=yes.

(yhardy)

2020-05-11 21:40:12 UTC MAIN commitmail json YAML

Remove cprng initialization order hack.

cprng_init now runs early enough that the hack should no longer be
needed to address PR port-arm32/55252.

(riastradh)

2020-05-11 21:38:54 UTC MAIN commitmail json YAML

Move cprng_init before configure.

This makes it available to device drivers, e.g. to generate MAC
addresses at random, without initialization order hacks.

Requires a minor initialization hack for cpu_name(primary cpu) early
on, since that doesn't get set until mi_cpu_attach which may not run
until the middle of configure.  But this hack is less bad than other
initialization order hacks.

(riastradh)

2020-05-11 21:37:31 UTC MAIN commitmail json YAML

Teach percpu to run constructors on CPU attach.

This should make percpu work reliably for things like cprng_strong
much earlier -- not just after all CPUs have been detected.  This is
also necessary (though not on its own sufficient) for CPU hotplug.

(riastradh)

2020-05-11 21:18:11 UTC MAIN commitmail json YAML

Fix potential race in ptrace(2) clone(2) tests

Instead of comparing old and new signal mask, just after the cloning
operation, check whether the expected signal is still masked and in
another test whether it is still ignored.

Catch up after t_ptrace_fork_wait.h r. 1.2.

(kamil)

2020-05-11 20:58:48 UTC MAIN commitmail json YAML

Fix race in fork_singalmasked

ELF RTLD after rtld.c r. 1.204 introduced locking that wraps the fork
syscall. This locking changes signal mask of the calling process during
the forking process.

Instead of comparing old and new signal mask, just after the forking
operation, check whether the expected signal is still masked and in
another test whether it is still ignored.

(kamil)

2020-05-11 19:36:40 UTC MAIN commitmail json YAML

KAUTH_MACHDEP_SVS_DISABLE is deprecated.

sysctl machdep.svs.enabled can't be changed anymore
at runtime because it's now a boot option.

(alnsn)

2020-05-11 19:17:46 UTC MAIN commitmail json YAML

msk(4): simplify interrupt return value creation

This also corrects a problem where we would not claim we handled an
interrupt that was ours.

(jakllsch)

2020-05-11 18:49:05 UTC MAIN commitmail json YAML

msk(4): moderate no interrupts globally

The global interrupt moderator on mskc(4) is mostly redundant with the Status Unit's tx and rx interrupt coalescing for our purpouses

Revisits interrupt moderation change in 1.108.

(jakllsch)

2020-05-11 18:38:27 UTC MAIN commitmail json YAML

Reject setting unaligned Program Counter

Patch taken from OpenBSD.

Tested in qemu.

Fixes PR port-sparc/54734 by Andreas Gustafsson

(kamil)

2020-05-11 18:29:59 UTC MAIN commitmail json YAML

Add "wb at ebus" and sdmmc, ld for the SD card reader on SPARCle.

(jdc)

2020-05-11 17:40:50 UTC MAIN commitmail json YAML

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.

(martin)

2020-05-11 17:27:48 UTC MAIN commitmail json YAML

Work around early calls to cprng_strong.

The bottleneck here is getting percpu_create to work early enough.
We should really fix that, but for now, this workaround will serve.

Should fix PR port-arm32/55252.

(riastradh)

2020-05-11 15:56:15 UTC MAIN commitmail json YAML

Add an ebus frontend for the Winbond W83l518D SD card reader as found on
Tadpole SPARCLE latops.

(jdc)

2020-05-11 15:27:41 UTC MAIN commitmail json YAML

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.

(martin)

2020-05-11 15:15:15 UTC MAIN commitmail json YAML

Fix GCC flags for Spectre mitigation to really only apply to GCC.

(joerg)

2020-05-11 14:55:20 UTC MAIN commitmail json YAML

Make the driver endian-independent.
Add a quirk so that the bus front end can specify 1-bit only mode.
Remove unused isa includes.
Change the error returned for unsupported opcodes to ENOTSUP, so that
we can pass this back to sdmmc_mem, where it's handled since r1.72 of
  src/sys/dev/sdmmc/sdmmc_mem.c

(jdc)

2020-05-11 14:54:34 UTC MAIN commitmail json YAML

Do as the manual says, and use _PATH_DEFPATH if PATH is not present in
the environment rather than simply turning into posix_spawn() in that case.

Also, we cannot use strtok() to parse PATH, the semantics don't fit the API.
Borrow the guts of execvp for the PATH search.

We still simply check for a file with 'x' permission, and assume that one
will do, whatever it is, which isn't really correct, but ...

(kre)

2020-05-11 14:44:16 UTC MAIN commitmail json YAML

Add support for the ARMv8.5-RNG CPU random number generator.

We use the RNDRRS system register.  I made the following two
wild-arse guesses about the architecture of real implementations,
which might not exist yet:

1. There's only one physical source per CPU package, so not worth
  attaching one per core.

2. Like other CPU RNGs -- RDSEED, VIA C3 -- this probably gives about
  half a bit of entropy per bit of data (although perhaps we should
  say zero and revisit this once it arrives on real silicon).

Tested in qemu as well as I can, using `-cpu max' (which doesn't get
to userland for unrelated reasons).

This uses the numeric notation `mrs %0, s3_3_c2_c4_1' for the rndrrs
system register instead of the more legible `mrs %0, rndrrs' as
suggested in the ARMv8.5 ARM.  Why?

- clang doesn't like `mrs %0, rndrrs' for reasons unclear to me.

- gas only likes it with `.arch armv8.5-a+rng', but there's no clear
  way to keep that scoped; the `.set push/pop' stack that would be an
  obvious choice for this works only on mips.

- gcc supports __attribute__((target("arch=..."))) on functions, but
  the version we use doesn't yet know about armv8.5-a+rng.

Later on, we should replace this by a target attribute and the more
obvious `mrs %0, rndrrs' notation.

ok nick

(riastradh)

2020-05-11 12:42:58 UTC MAIN commitmail json YAML

2020-05-11 12:17:57 UTC MAIN commitmail json YAML

Simplify previous

Emit SIGKILL without a loop and without checking for exact process status
once it is collected.

(kamil)

2020-05-11 11:03:15 UTC MAIN commitmail json YAML

Do not fail when trying to kill a dying process

A dying process can disappear for a while. Rather than aborting, retry
sending SIGKILL to it.

(kamil)

2020-05-11 10:34:37 UTC MAIN commitmail json YAML

Note hppa modules default

(skrll)

2020-05-11 10:23:37 UTC MAIN commitmail json YAML

2020-05-11 10:21:24 UTC MAIN commitmail json YAML

Update the list of hppa options to build working kernel modules.

(skrll)

2020-05-11 09:51:47 UTC MAIN commitmail json YAML

If the controller doesn't support switch func (opcode 6) then skip
setting this but continue with other settings.  This allows us to use
a card, albeit at a lower speed.

(jdc)

2020-05-11 03:59:33 UTC MAIN commitmail json YAML

Remove timedwaitclock.

This did not fix the bug I hoped it would fix in futex, and needs
more design thought.  Might redo it somewhat differently later.

(riastradh)

2020-05-11 03:00:57 UTC MAIN commitmail json YAML

"options ARMV83_PAC" is now supported for gcc as well.

- add "-msign-return-address=all" to CFLAGS for gcc when specified options ARMV83_PAC
- AARCH64REG_{READ,WRITE}_INLINE3 macro can now use the APIAKey registers in both gcc and llvm.
  llvm requires asm(".arch armv8.3-a"), whereas gcc requires __attribute__((target("arch=armv8.3-a"))).
- use ".arch armv8.3-a" rather than ".arch armv8.3-a+pac" in *.S for llvm.

(ryo)

2020-05-10 22:38:51 UTC MAIN commitmail json YAML

warn only for > INFO level messages.

(christos)

2020-05-10 22:33:09 UTC MAIN commitmail json YAML

Print errors to stderr until we daemonize.
Fix typo.

(christos)

2020-05-10 22:28:09 UTC MAIN commitmail json YAML

Add missing dependency.

Fixes builds with VM_SWAP but no other users of rijndael crypto code.

(pgoyette)

2020-05-10 21:42:06 UTC MAIN commitmail json YAML

Teach cpuctl(8) about ARMv8.5-RNG RNDR/RNDRRS support.

(riastradh)

2020-05-10 21:41:19 UTC MAIN commitmail json YAML

Print RNDR support in verbose CPU feature identification.

(riastradh)

2020-05-10 21:40:38 UTC MAIN commitmail json YAML

Fix ID_AA64ISAR0_EL1_RNDR field definition for RNDR support.

ARMv8.5 ARM, p. D13-3232

(riastradh)

2020-05-10 19:54:49 UTC MAIN commitmail json YAML

prefix errors with the program name and use stderr.

(christos)

2020-05-10 19:36:49 UTC MAIN commitmail json YAML

Don't add getentropy.c to the build (remove symbol from libc)

Still being discussed in tech-userlevel. If we wait any longer someone
is going to try the excuse that the discussion is entirely pointless, since
removing symbols is too hard.

(maya)

2020-05-10 17:58:16 UTC MAIN commitmail json YAML

Add SIGPIPE to the list of dhcpcd affected signals since we sigignore it.

(christos)

2020-05-10 14:34:31 UTC MAIN commitmail json YAML

Rename curbrk to __curbrk, and make it and __minbrk hidden

(skrll)

2020-05-10 14:05:59 UTC MAIN commitmail json YAML

2020-05-10 13:03:40 UTC MAIN commitmail json YAML

2020-05-10 12:42:11 UTC MAIN commitmail json YAML

usr.bin/make: sort test cases alphabetically

(rillig)

2020-05-10 12:34:01 UTC MAIN commitmail json YAML

2020-05-10 11:06:14 UTC MAIN commitmail json YAML

2020-05-10 11:04:09 UTC MAIN commitmail json YAML

2020-05-10 06:42:38 UTC MAIN commitmail json YAML

2020-05-10 06:38:24 UTC MAIN commitmail json YAML

Pass -Wno-unused-command-line-argument for LLVM, discussed on
tech-toolchain@.

(maxv)

2020-05-10 06:30:57 UTC MAIN commitmail json YAML

Reintroduce cpu_rng_early_sample(), but this time with embedded detection
for RDRAND/RDSEED, because TSC is not very strong.

(maxv)

2020-05-10 06:24:16 UTC MAIN commitmail json YAML

Respect the convention for the hypervisor information: return the highest
hypervisor leaf in 0x40000000.EAX.

(maxv)

2020-05-10 02:56:12 UTC MAIN commitmail json YAML

Make rndctl -E/-C reset entropy accounting.

If we don't trust a source, it's unreasonable to trust any entropy it
previously provided, and we don't have any way to undo only the
effects of that source, so just zero our estimate of the entropy in
the pool and start over.

(However, keep the samples already in the pool -- just treat them as
though they had zero entropy and start gathering more.)

(riastradh)

2020-05-10 02:38:10 UTC MAIN commitmail json YAML

Rename things so the symbol better matches the sysctl name.

No functional change intended, except that the symbol that was
previously `uvm_swap_encryption' is now `uvm_swap_encrypt', backing
the sysctl knob `vm.swap_encrypt'.

(riastradh)

2020-05-10 02:32:32 UTC MAIN commitmail json YAML

Mark experimental-default-off knobs clearly as such.

(riastradh)

2020-05-10 02:31:29 UTC MAIN commitmail json YAML

Document vm.swap_encrypt.

(riastradh)

2020-05-10 02:30:33 UTC MAIN commitmail json YAML

Tweak kern.arandom documentation.

(riastradh)

2020-05-10 01:29:40 UTC MAIN commitmail json YAML

2020-05-10 00:08:12 UTC MAIN commitmail json YAML

Use a temporary pool to consolidate entropy atomically.

There was a low-probability race with the entropy consolidation
logic: calls to entropy_extract at the same time as consolidation is
happening might witness partial contributions from the CPUs when
needed=256, say 64 bits at a time.

To avoid this, feed everything from the per-CPU pools into a
temporary pool, and then feed the temporary pool into the global pool
under the lock at the same time as we update needed.

(riastradh)

2020-05-09 22:00:48 UTC MAIN commitmail json YAML

Avoid overflow if a very large number of pages are swapped at once.

Unlikely, but let's make sure we don't hit this ever.

(riastradh)

2020-05-09 21:50:39 UTC MAIN commitmail json YAML

Implement swap encryption.

Enabled by sysctl -w vm.swap_encrypt=1.  Key is generated lazily when
we first need to swap a page.  Key is chosen independently for each
swap device.  The ith swap page is encrypted with AES256-CBC using
AES256_k(le32enc(i) || 0^96) as the initialization vector.  Can be
changed at any time; no need for compatibility with on-disk formats.
Costs one bit of memory per page in each swapdev, plus a few hundred
bytes per swapdev to store the expanded AES key.

Shoulda done this decades ago!  Plan to enable this by default;
performance impact is unlikely to matter because it only happens when
you're already swapping anyway.  Much easier to set up than cgd, so
we can rip out all the documentation about carefully setting up
random-keyed cgd at the right time.

(riastradh)

2020-05-09 16:18:57 UTC MAIN commitmail json YAML

Improve the CPUID emulation of basic leaves:
- Hide DCA and PQM, they cannot be used in guests.
- On Intel, explicitly handle each basic leaf until 0x16.
- On AMD, explicitly handle each basic leaf until 0x0D.

(maxv)

2020-05-09 15:13:19 UTC MAIN commitmail json YAML

Make the uvm_voaddr structure more compact, only occupying 2 pointers
worth of space, by encoding the type in the lower bits of the object
pointer.

(thorpej)

2020-05-09 13:16:43 UTC MAIN commitmail json YAML

2020-05-09 12:20:50 UTC MAIN commitmail json YAML

Ensure that -DOPENSSL_CPUID_OBJ is passed when compiling AES EVP bits

This way CPUs that support AES-NI actually get detected properly ;_;

(... just one part of the puzzle)

(nia)

2020-05-09 09:08:41 UTC MAIN commitmail json YAML

A kernel without USER_LDT returns ENOSYS, not ENOTSUP.

(maxv)

2020-05-09 08:39:07 UTC MAIN commitmail json YAML

On Intel CPUs, CPUID leaf 0xB, too, provides topology information, so
filter it correctly, to avoid inconsistencies if the host has SMT.

This fixes HaikuOS which fetches SMT information from there and would
panic because of the inconsistencies.

(maxv)

2020-05-09 08:25:34 UTC MAIN commitmail json YAML

2020-05-09 08:21:36 UTC netbsd-9 commitmail json YAML

2020-05-09 08:20:34 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by hannken in ticket #897):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.65

Revert Rev. 1.63 and add a comment why we have to zil_commit() here:

Operation zfs_znode.c::zfs_zget_cleaner() depends on this
zil_commit() as a barrier to guarantee the znode cannot
get freed before its log entries are resolved.

Operation zfs_zget_cleaner() cannot fail, comment and add assertions.

(martin)

2020-05-09 08:16:54 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by skrll in ticket #896):

sys/dev/usb/if_cdce.c: revision 1.71

Search the descriptors of the appropriate interface to ensure correct
match.

PR kern/55240 cdce(4) error "no data interface" when ECM USB IF are
preceded by ACM USB IF

(martin)

2020-05-09 08:01:38 UTC MAIN commitmail json YAML

Also set x86_delay to xen_delay, unbreaks PVH

(bouyer)

2020-05-09 06:12:32 UTC MAIN commitmail json YAML

2020-05-08 22:10:09 UTC MAIN commitmail json YAML

Run Solaris cyclics from statclock() so dtrace isn't locked out by IPL_SCHED
(assuming the machine has a separate statclock() which almost all don't).

(ad)

2020-05-08 22:01:55 UTC MAIN commitmail json YAML

Fix the TSC timecounter (on the systems I have access to):

- Make the early i8254-based calculation of frequency a bit more accurate.

- Keep track of how far the HPET & TSC advance between HPET attach and
  secondary CPU boot, and use to compute an accurate value before attaching
  the timecounter.  Initial idea from joerg@.

- When determining skew and drift between CPUs, make each measurement 1000
  times and pick the lowest observed value.  Increase the error threshold to
  1000 clock cycles.

- Use the frequency computed on the boot CPU for secondary CPUs too.

- Remove cpu_counter_serializing().

(ad)

2020-05-08 21:58:03 UTC MAIN commitmail json YAML

cpu_counter: only need to clear %eax (zero extends).

(ad)

2020-05-08 21:43:54 UTC MAIN commitmail json YAML

2020-05-08 17:28:33 UTC MAIN commitmail json YAML

strlcpy() the command line only if it's present.

(bouyer)

2020-05-08 16:43:18 UTC MAIN commitmail json YAML

if_skreg.h: remove duplicate or triplicate identical #defines

(jakllsch)

2020-05-08 16:05:36 UTC MAIN commitmail json YAML

Omit needless comment.

We've already committed part of the write, so ERESTART is definitely
not appropriate at this point.

(riastradh)

2020-05-08 15:57:24 UTC MAIN commitmail json YAML

Simplify loops by putting interrupt test at end.

(riastradh)