Commit Graph

276751 Commits

Author SHA1 Message Date
christos ce6ae1732f Add a function to remove the debug bits of the stand files. 2020-05-15 16:33:38 +00:00
martin 8be1e866ab PR 55239: initialize all RAS sections for non-MP configurations 2020-05-15 15:20:40 +00:00
joerg 7cbd7912a7 Bump libc minor version for malloc lock change 2020-05-15 14:57:33 +00:00
joerg 2fd68a1040 Ignore warnings for tautological compares for clang. 2020-05-15 14:44:05 +00:00
joerg 8409cf4a20 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.
2020-05-15 14:37:21 +00:00
joerg 6389ebde8b When using default mutex types, don't setup attributes for init. 2020-05-15 14:34:41 +00:00
joerg 858ee362bb Lock/unlock/reinit pthread__deadqueue_lock over fork. 2020-05-15 14:30:23 +00:00
joerg 0daa3ac7e4 Ignore unused private fields when building with clang 2020-05-15 14:29:53 +00:00
joerg bdfc26edeb Don't allow building with clang, uses GCC-specific attributes. 2020-05-15 14:29:29 +00:00
maxv 69ffbd327c 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.
2020-05-15 13:09:02 +00:00
maxv 5e7beab597 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.
2020-05-15 12:34:52 +00:00
manu 96922cbd05 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.
2020-05-15 12:31:03 +00:00
kamil b2e8cbc777 Fix typo
Reported by vezhlys on IRC.
2020-05-15 09:21:59 +00:00
ryo f561586770 use ldp if possible 2020-05-15 09:08:10 +00:00
maxv 1a12946e5b It should be allowed to have exactly a usb_descriptor_t. 2020-05-15 07:51:49 +00:00
maxv 41e4e1211b Use a generic description when scanning mbufs. 2020-05-15 07:47:53 +00:00
jdolecek 0ae0d1b180 use short for irq2port[] to save memory (4KB), it only needs to store
numbers <= NR_EVENT_CHANNELS (2048)
2020-05-15 07:42:58 +00:00
jdolecek 3726b4a324 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
2020-05-15 07:31:07 +00:00
maxv 145523e834 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
2020-05-15 06:34:34 +00:00
skrll 5b7653f57e Use howmany. NFC. 2020-05-15 06:26:44 +00:00
skrll ea6ee7bb44 Use ux_length in isoc usb_syncmem. Missed in previous commit. 2020-05-15 06:23:54 +00:00
skrll c06981d88c Update ux_length in usbd_setup_isoc_xfer and use this to usb_syncmem
in the HCDs
2020-05-15 06:15:42 +00:00
skrll 4861adadcb Fix build on arm 2020-05-15 06:01:26 +00:00
skrll 9618ff6670 Use __diagused 2020-05-15 05:39:15 +00:00
ryo fe47dc62ff 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.
2020-05-15 04:55:40 +00:00
tnn c41b7f118e fix non-diag build 2020-05-15 01:43:47 +00:00
christos 52eb862ffa Undo previous, need to fix differently (fifofs is needed by other fs's and
fifo brings in rumpnet)
2020-05-15 00:04:02 +00:00
christos 32e17edfb9 If we could not lock the pid file, don't continue as we end up with multiple
rtadvd's (thanks roy@)
2020-05-14 23:42:18 +00:00
jmcneill 3aca75b32b 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.
2020-05-14 23:09:29 +00:00
riastradh 7ce697eb23 Note some random number generation updates.
Also note swap encryption in uvm.
2020-05-14 21:13:46 +00:00
christos ea742848d9 PR/55102: Kamil Rytarowski: Remove fifo stuff duplicated in fifo_vnops.c 2020-05-14 20:10:34 +00:00
jdolecek 290baabb08 xen_vec_alloc() is no more 2020-05-14 19:36:02 +00:00
riastradh 443c8837b8 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.
2020-05-14 19:26:28 +00:00
riastradh 48e749766f Bump efiboot version to note EFI RNG support. 2020-05-14 19:25:16 +00:00
riastradh b9044f81a3 Deduplicate address-range querying/mapping logic. 2020-05-14 19:24:35 +00:00
riastradh 248f2a779e Deduplicate lazy /chosen node creation logic. 2020-05-14 19:21:53 +00:00
kamil 1cb4f56df8 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
2020-05-14 19:21:35 +00:00
riastradh 76fee9e5d6 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.
2020-05-14 19:21:06 +00:00
riastradh f26bf7cc37 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.
2020-05-14 19:20:08 +00:00
riastradh b962c94008 Draft logic to get at EFI RNG. 2020-05-14 19:19:08 +00:00
maxv d9377f8093 Fix uninitialized memory access. Found by KMSAN.
Reported-by: syzbot+9f2a173d29d66c88f9ac@syzkaller.appspotmail.com
2020-05-14 18:18:24 +00:00
nia e78dab04ee synaptics: Don't reset the device multiple times in succession
Cherrypicked from a patch from an anonymous contributor.
2020-05-14 18:06:58 +00:00
maxv 40b3ef3749 KASSERT -> panic 2020-05-14 17:01:34 +00:00
maxv 6ba9523826 Don't even try to go past a syscall. Fixes severe panic recursions in
KUBSAN.
2020-05-14 16:57:53 +00:00
snj f27f66ae80 - prune src/gnu and src/sys/netsmb
- add src/sys/netcan
- remove bogus statement about location of reachover Makefiles
- tweak language
2020-05-14 16:32:57 +00:00
wiz 3528b8e86e Use more markup. 2020-05-14 13:40:49 +00:00
kamil 5b84972668 ptrace(2): Add PT_SET_SIGPASS and PT_GET_SIGPASS. 2020-05-14 13:37:52 +00:00
kamil 6351c73d8b Welcome to 9.99.62
struct sigctx gained ps_sigpass member.
2020-05-14 13:34:46 +00:00
kamil 48b46ced17 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.
2020-05-14 13:32:15 +00:00
jdolecek 2c2a96663a 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
2020-05-14 13:25:40 +00:00