277292 Commits

Author SHA1 Message Date
thorpej
b9bf75580a Remove superfluous checking for a "disable" property in the device_t
properties dictionary.
2020-05-31 23:52:19 +00:00
rin
d76d437a3f Switch from kmem_intr_alloc(sz, KM_NOSLEEP) to kmem_alloc(sz, KM_SLEEP).
Clearly document these functions are *not* for DDB session, but for
permanent data storage when initializing DDB.
2020-05-31 23:34:34 +00:00
christos
58b288d88d use strlcpy() instead of strncpy() for gcc happiness 2020-05-31 23:24:23 +00:00
rin
fbbf6b42a6 Stop allocating buffers dynamically in a DDB session, in order not to
disturb on-going debugged state of kernel datastructures.

Since DDB is running on 1 CPU at a time, static buffers are enough.

Increase in BSS section is:
  52552 for amd64 (LP64)
   9152 for m68k  (ILP32)

Requested by thorpej@ and mrg@.
Also suggested by ryo@.
Thanks!
2020-05-31 23:24:20 +00:00
maxv
869e8f7b28 Reset ud_ifaces and ud_cdesc to NULL, to prevent use-after-free in
usb_free_device().

Reported-by: syzbot+c7e74d0ae89e9f08f863@syzkaller.appspotmail.com
2020-05-31 18:33:08 +00:00
jdolecek
39045d90bd also set ifc->ui_endpoints to NULL in usbd_free_iface_data() when the value
is freed, to make it impossible to re-enter this by mistake

very likely has no effect for the syzbot problem, but good to do nevetheless

Reported-by: syzbot+c555801d6bc0d768f402@syzkaller.appspotmail.com
2020-05-31 18:20:23 +00:00
maxv
3774168381 If we failed because we didn't encounter an endpoint, do not attempt to
read 'ed', because its value is past the end of the buffer, and we thus
perform out-of-bounds accesses.

Detected thanks to vHCI+KASAN. First bug found by USB fuzzing.

Reported-by: syzbot+59e7f6b3f353584ac810@syzkaller.appspotmail.com
2020-05-31 17:52:58 +00:00
christos
4944dbf225 sync with regular socket code (no effect) 2020-05-31 17:45:02 +00:00
kamil
47ead56b15 Mask NULL + 0 LLVM UBSan reports in the ATF test: t_pslist.c
Pass -fno-delete-null-pointer-checks for Clang for the
MKSANITIZER/MKLIBCSANITIZER build
2020-05-31 16:36:07 +00:00
tnn
e097843b4c npf-params.7: s/filer/filter/ 2020-05-31 16:32:07 +00:00
rmind
a55d34090b npf-params(7): fix the state.key defaults. 2020-05-31 15:57:15 +00:00
simonb
d6f100329c Finish rename of all Cavium Octeon device driver functions, structs etc from
"octeon_foo" to "octfoo" (missed octeon_uart + entries in iobus config).
2020-05-31 14:05:21 +00:00
roy
2fc8fc72fa postinstall: Move files out of dhcpcd chroot 2020-05-31 13:45:47 +00:00
roy
e6c8f49786 Revert prior - mark dirs as obsolete.
Thanks wiz@
2020-05-31 13:07:50 +00:00
roy
79d62731fd We don't install any chroot subdirs for dhcpcd anymore 2020-05-31 13:00:48 +00:00
roy
cfd6163780 dhcpcd: Empty the chroot
While here, set correct optional hooks.
2020-05-31 12:58:09 +00:00
roy
d31eb9bba7 Sync 2020-05-31 12:52:11 +00:00
roy
7c187152f8 Update to dhcpcd-9.1.0 with the following changes:
* Leases are stored outside the chroot again
 * The chroot directory can now be (and should be) empty [1]
 * ARP is now per address rather than per interface
 * Filter allowed ioctls in the privileged actioneer
 * Filter allowed UDP ports used by sendto(2) in the privileged actioneer
 * Filter allowed file paths in the privileged actioneer
 * route socket is now drained on overflow as it cannot be
   re-opened by the unpriviledged user

 * hostname can no longer be clobbered by SLAAC
 * grep is no longer used by the test hook
 * Interface hardware address type changes are now picked up
 * Fixed some RA timing issues
 * Fixed nd_* option parsing in dhcpcd.conf
 * Allow SIGPIPE in scripts
 * Default dhcpcd.conf no longer sends the current hostname
 * Default dhcpcd.conf no longer sends a vendorclassid
2020-05-31 12:50:46 +00:00
rin
9769066979 Fix typo in comment. 2020-05-31 12:37:07 +00:00
rin
3a564f248f Add m68k assembler version of __muldi3().
This is intended for 68060:
  - GCC does not emit __muldi3() for 68020-40, that have 32 * 32 --> 64 mulul
  - mulsl (and moveml), used in this code, are not implemented for 68010

In comparison with that from compiler_rt, this version saves:
  - 12% of processing time
  - 12 bytes of stack
  - 50 bytes of code size
Also, slightly faster, memory saving, and smaller than libgcc version.

By examining with evcnt(9), __muldi3() is invoked more than 1000 times per
sec by kernel, which should justify to introduce assembler version of this
function.
2020-05-31 11:43:37 +00:00
martin
4d789df8b3 Avoid using excessive kernel stack.
XXX maybe we should unite all "static proc_t" and "static lwp_t" in ddb
into one global each?
2020-05-31 11:28:52 +00:00
jdolecek
f7fe1fb9c3 make bwfm_usb_bus_ops static and const 2020-05-31 11:12:36 +00:00
rin
158697e3f9 Stop returning while PMAP_LOCK() (= KERNEL_LOCK(1, NULL)) is held.
Kernel freeze with heavy load is significantly mitigated (fixed?),
in which I could not even enter DDB from console.

XXX
There is still inconsistency in usage of two PVO pools.
I will send-pr later.

XXX
pullup to netbsd-[987]
2020-05-31 10:49:39 +00:00
rin
a97ea11828 Switch to db_alloc() from kmem_intr_alloc(9).
Fix build failure as a part of crash(8).
Noticed by tnn@, thanks!
2020-05-31 09:59:37 +00:00
rin
c3cc3a31be Revert introduction of db_alloc.h.
db_alloc() and friends are already provided in crash.c.
Sorry for confusing you...
2020-05-31 09:51:55 +00:00
rin
223a0956ca XXX
DDB can be running in the interrupt context, e.g., when activated from
console. Therefore, we use kmem_intr_alloc(9) and friends in order to
avoid assertion failure.
2020-05-31 09:42:46 +00:00
rin
cd246064d2 Introduce db_alloc.h.
Provide db_alloc() and friends to userland, i.e., crash(8).
2020-05-31 09:40:09 +00:00
rin
99bd1f6041 #ifdef out debug garbage. 2020-05-31 09:00:25 +00:00
rin
21624d2d9c For wdc_obio_match(), struct wdc_regs is too large for stack.
Use kmem_alloc(9) instead.

Frame size becomes:
    3088 --> 0
2020-05-31 08:59:40 +00:00
rin
46b290a0c3 struct statvfs is too large for stack. Use malloc(9) instead.
XXX
Switch to kmem(9) for entire this file.

Frame size, e.g. for m68k, becomes:
    3292 --> 12
2020-05-31 08:38:54 +00:00
rin
851ed85132 db_show_callout(): struct callout_cpu and cpu_info are too much for stack.
XXX
DDB can be running in the interrupt context, e.g., when activated from
console. Therefore, use kmem_intr_alloc(9) instead of kmem_alloc(9).

Frame size, e.g. for m68k, becomes:
    9212 (oops!) --> 0
2020-05-31 08:33:47 +00:00
maxv
cbead1015e sc_statuspend is allocated with kmem_zalloc, so no need to memset it. 2020-05-31 08:05:30 +00:00
maxv
ad8bcb1485 Add comments. 2020-05-31 07:53:38 +00:00
simonb
3f508e4d23 Rename all Cavium Octeon device driver functions, structs etc from
"octeon_foo" to "octfoo", except "octeon_eth" becomes "cnmac".
2020-05-31 06:27:06 +00:00
simonb
a767432eb8 Remove unused Timer Unit register definitions and stubs. Can be
resurrected from the attic in the unlikely event we'll ever have
a driver for this device.
2020-05-31 06:23:49 +00:00
nat
b35a6d5b1b Avoid running of the end of the array if a file cannot be opened.
Found by plunky@.
2020-05-31 06:17:23 +00:00
simonb
8aae866fa5 Clean up Cavium Octeon device names. Rename devices from "octeon_foo"
to "octfoo" - this follows the naming conventions used by many other
MIPS CPUs.
2020-05-31 04:56:35 +00:00
ad
4d7613fc58 Disable read of the ACPI timer during idle, fixing performance degradation
observed with acpicpu.  C1 (MWAIT) is the deepest sleep currently enabled so
there should be no functional change.  Also, the computed nap time is run
through hztoms() which seems incorrect as the ACPI timer is running in the
MHz range.
2020-05-31 01:39:33 +00:00
joerg
a3a68b7379 Don't define psl as common symbol, move it into the only file using it. 2020-05-30 23:52:09 +00:00
sevan
b7feb0b56f Use device_xname() to access dv_xname 2020-05-30 22:39:40 +00:00
sevan
0940ad8bdc Use device_t for sc_dev 2020-05-30 22:27:55 +00:00
sevan
a164c08f15 Switch from printf to aprintf_error/normal 2020-05-30 22:01:05 +00:00
sevan
112b980b8d Initialise sc->sc_dev, otherwise unnamed interfaces show up and things go
downhill from there.
2020-05-30 21:39:49 +00:00
rmind
231831948d npftest -- npf_test_init(): add a workaround for NetBSD. 2020-05-30 21:00:31 +00:00
rmind
8727ac3ab2 npf_worker_sys{init,fini}: initialize/destroy the exit_cv condvar. 2020-05-30 20:54:54 +00:00
christos
f944c04b7f Create pic lib and don't install pkgconfig file. 2020-05-30 20:54:46 +00:00
christos
e4bfa5b301 Make libuv private, requested by joerg@ 2020-05-30 20:47:58 +00:00
ad
a638247c0b Fix merge error - adjust assertions. 2020-05-30 20:23:25 +00:00
ad
2c626bbc9e Regen. 2020-05-30 20:16:34 +00:00
ad
b17e3baa45 A couple of small changes to lookup that cut 5-10% system time from
"build.sh release" on my test system:

- Crossing mount points during lookup is slow because the set up for, and
  act of doing VFS_ROOT() is quite involved.  Use the name cache to help
  with this.  Cache an "impossible" zero-length name with covered vnodes,
  that points to the root of the file system mounted there.  Use it to cross
  mounts.  When cache_purge() is called on either of the vnodes involved the
  cache entry will disappear.  All of the needed calls for that are already
  in place (vnode reclaim, unmount, etc).

- In lookup_fastforward(), if the the last component has been found and the
  parent directory (searchdir) is not going to be returned, then don't get a
  reference to it.
2020-05-30 20:16:14 +00:00