summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-12-13Add lockcount output via printflockcount-9.3Merlin Scholz
2022-12-10First concept for lock countingMerlin Scholz
2022-11-02Decouple LOCKDEBUG and LOCKDOC kernel flagsMerlin Scholz
2022-10-28First working lock logsMerlin Scholz
2022-10-27Undo previous log_lock functions only used for testingMerlin Scholz
2022-10-25Hook into lockdebug.hMerlin Scholz
2022-10-24Separate LOCKDEBUG and LOCKDOG kernel flagsMerlin Scholz
2022-10-24First proper lockdoc hooksMerlin Scholz
2022-10-19Fix memory padding by replacing char with enum in log_actionMerlin Scholz
2022-10-17Continue implementationMerlin Scholz
2022-10-17Port over code skeletonMerlin Scholz
2022-10-16Add sterilized LOCKDOC kernel configMerlin Scholz
2022-08-04Welcome to 9.3!martin
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1493):martin
sys/dev/usb/ucom.c: revision 1.129 ucom(4): Fix earlier mistake causing pipes not to be closed. In revision 1.123, mrg@ changed what he thought was a double-close, but was actually abort&close (as is appropriate) to just abort (which is not enough -- leaks the pipe). This restores the abort&close. The original `bug' was found by code inspection, whereas this bug was found by asserting in usb_subr.c that no pipes are open on device disconnection after detach; the asserts actually triggered with several ucom(4) devices, and no longer trigger with this change. XXX pullup-9
2022-08-03Tickets #1490 - #1495martin
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1495):martin
share/man/man4/tpm.4: revision 1.7 sys/dev/ic/tpm.c: revision 1.17 sys/dev/ic/tpmvar.h: revision 1.10 sys/dev/ic/tpm.c: revision 1.18 sys/dev/ic/tpm.c: revision 1.19 sys/dev/acpi/tpm_acpi.c: revision 1.14 sys/dev/ic/tpmreg.h: revision 1.10 sys/dev/ic/tpmreg.h: revision 1.11 sys/dev/ic/tpm.c: revision 1.21 sys/dev/ic/tpm.c: revision 1.22 sys/dev/ic/tpm.c: revision 1.23 sys/dev/ic/tpm.c: revision 1.24 sys/dev/ic/tpm.c: revision 1.25 sys/dev/ic/tpmreg.h: revision 1.7 sys/dev/ic/tpmreg.h: revision 1.8 sys/dev/ic/tpmreg.h: revision 1.9 sys/dev/ic/tpmvar.h: revision 1.8 sys/dev/ic/tpmvar.h: revision 1.9 dev/ic/tpm: Tidy up headers. - Add include guards. - Add necessary includes. - Sort includes. - Use _BYTE_ORDER, not BYTE_ORDER, for public header. dev/ic/tpm: Add missing line break in attach output. dev/ic/tpm: Take advantage of entropy source if available. If the tpm is deactivated, though, detach the entropy source so we don't continue to try polling it -- it can't be activated without a reboot anyway. Add note about enabling TPM and rnd(4) source. tpm(4): Handle TPM 2.0 random source too, and loop on short reads. Tested on ThinkPad T480. tpm(4): Preserve error if any on ending commands. This way we don't spuriously suppress an error, such as TPM_DEACTIVATED, in a loop where we rely on it. tpm@acpi: Require only one locality's worth of register space. We don't actually use the registers for the other localities, and some older TPMs only have the first locality exposed via ACPI. tpm(4): Fix disabling of rnd source if tpm is deactivated. Nothing prevents a second worker from being queued when the first one is about to do rnd_detach_source. Instead, just set a flag so future requests don't bother running a new thread; if there's a concurrent one that's already been scheduled on another CPU, well, too bad, we get a couple extra log messages but that's fine. A better way to do this would probably be to detect whether the tpm is deactivated at attach time, but that requires reading more of the tpm spec than I care to do when there are alternative ways to procrastinate like scrubbing the toilet. tpm(4): Fix suspend and rework I/O transaction lock. Use sc->sc_lock over individual I/O transactions, not open/close of the whole device. This way there is a bounded time before the tpm is unbusied even if userland is getting at it, so userland can't hold up suspend indefinitely. Of course, the tpm might be suspended and resumed in the middle of the user's session this way -- tough. This limits the response buffer to 1024 bytes -- which is already a bit hefty to have on the stack (but it's probably not very deep on the stack from userland so maybe not a big deal). If it turns out we need more, we can use kmem to allocate a buffer on the heap, with the caveat that it might fail. This is necessary so that suspend doesn't block indefinitely on uiomove in tpmread. tpm(4): Nix TPM_BE16/TPM_BE32. Just use sys/endian.h.
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1494):martin
external/cddl/osnet/sys/kern/kmem.c: revision 1.3 kmem_cache_create()'s "name" parameter can be on the stack, so make a copy of it rather than keeping a pointer to it.
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1492):martin
sys/dev/usb/ukbd.c: revision 1.154 ukbd(4): Wait for callouts and blinking to complete in detach. This detach routine (and whole driver) has got a lotta other problems, but let's fix 'em one at a time...
2022-08-03Apply patch, requested by riastradh in ticket #1491:martin
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h (apply patch) Fix newlines in i915 console messages
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1490):martin
sys/dev/acpi/thinkpad_acpi.c: revision 1.48 With the recent change of the EC address space handler, we no longer get an ACPI_INTEGER in host byte order but a byte sized buffer with little endian data. Extract only the low 8 bits from buffer to get the fan speed again.
2022-08-03Tickets #1484 - #1489martin
2022-08-03Apply patch, requested by riastradh in ticket #1487:martin
sys/compat/common/vfs_syscalls_20.c (apply patch) sys/compat: Memset zero before copyout. Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry.
2022-08-03Pull up following revision(s), all via patchmartin
(requested by riastradh in ticket #1487): sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168 sys/compat/sunos/sunos_misc.c: revision 1.177 sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52 sys/compat/common/kern_resource_43.c: revision 1.23 sys/compat/netbsd32/netbsd32_conv.h: revision 1.46 sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35 sys/compat/common/vfs_syscalls_12.c: revision 1.38 sys/compat/ultrix/ultrix_misc.c: revision 1.126 sys/compat/common/kern_sig_43.c: revision 1.37 sys/compat/linux/common/linux_mtio.c: revision 1.8 sys/compat/freebsd/freebsd_misc.c: revision 1.34 sys/compat/freebsd/freebsd_machdep.c: revision 1.5 sys/compat/linux/common/linux_olduname.c: revision 1.67 sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44 sys/compat/freebsd/freebsd_sched.c: revision 1.23 sys/compat/ossaudio/ossaudio.c: revision 1.84 sys/compat/sys/time_types.h: revision 1.6 sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51 sys/compat/common/ieee80211_20.c: revision 1.7 sys/compat/linux/common/linux_file.c: revision 1.119 sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34 sys/compat/netbsd32/netbsd32_wait.c: revision 1.25 sys/compat/linux32/common/linux32_time.c: revision 1.38 sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33 sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52 sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46 sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36 sys/compat/ultrix/ultrix_ioctl.c: revision 1.39 sys/compat/linux/common/linux_misc.c: revision 1.252 sys/compat/linux/common/linux_hdio.c: revision 1.19 sys/compat/sunos/sunos_ioctl.c: revision 1.71 sys/compat/linux/common/linux_sched.c: revision 1.79 sys/compat/common/kern_info_43.c: revision 1.40 sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20 sys/compat/linux/common/linux_socket.c: revision 1.153 sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60 sys/compat/common/vfs_syscalls_43.c: revision 1.68 sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25 sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9 sys/compat/common/kern_time_50.c: revision 1.37 sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42 sys/compat/linux/common/linux_cdrom.c: revision 1.28 sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43 sys/compat/common/kern_info_09.c: revision 1.22 sys/compat/linux32/common/linux32_resource.c: revision 1.12 sys/compat/linux/common/linux_oldolduname.c: revision 1.67 sys/compat/common/if_media_80.c: revision 1.4 sys/compat/linux/arch/alpha/linux_osf1.c: revision 1.5 sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8 sys/compat/linux32/common/linux32_signal.c: revision 1.21 sys/compat/common/kern_sig_13.c: revision 1.22 sys/compat/sunos32/sunos32_ioctl.c: revision 1.36 sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62 sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23 sys/compat/netbsd32/netbsd32_time.c: revision 1.56 sys/compat/linux/common/linux_signal.c: revision 1.84 sys/compat/netbsd32/netbsd32_signal.c: revision 1.52 sys/compat/sunos32/sunos32_misc.c: revision 1.85 sys/compat/linux/common/linux_time.c: revision 1.40 sys/compat/linux/common/linux_fdio.c: revision 1.14 sys/compat/common/vfs_syscalls_30.c: revision 1.43 sys/compat: Memset zero before copyout. Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry.
2022-08-03Pull up following revision(s), all via patchmartin
(requested by riastradh in ticket #1489): sys/compat/netbsd32/netbsd32_netbsd.c: revision 1.232 sys/compat/netbsd32/netbsd32_socket.c: revision 1.56 sys/compat/netbsd32/netbsd32_conv.h: revision 1.45 sys/compat/netbsd32/netbsd32_fs.c: revision 1.92 sys/compat/netbsd32/netbsd32.h: revision 1.137 The read/write/send/recv system calls return ssize_t because -1 is returned on error. Therefore we must restrict the lengths of any buffers to NETBSD32_SSIZE_MAX with compat32 to avoid garbage return values. Fixes ATF lib/libc/sys/t_write:write_err.
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1488):martin
sys/altq/altq_hfsc.c: revision 1.29 sys/altq/altq_priq.c: revision 1.27 sys/altq: Memset zero before copyout. Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry.
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1486):martin
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.7 compat_netbsd32: Copy out 32-bit version in nfssvc32_nsd_out.
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1485):martin
sys/dev/pci/if_iwi.c: revision 1.117 sys/dev/raidframe/rf_netbsdkintf.c: revision 1.401 sys/dev/scsipi/ses.c: revision 1.52 sys/dev/isa/mcd.c: revision 1.121 sys/dev: Memset zero before copyout. Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry. I think the iwi(4), mcd(4), and ses(4) changes actually plug leaks; the raidframe(4) change probably doesn't (but doesn't hurt).
2022-08-03Pull up following revision(s) (requested by wiz in ticket #1484):martin
lib/libc/sys/clone.2: revision 1.14 lib/libc/sys/clone.2: revision 1.15 include/sched.h: revision 1.13 include/sched.h: revision 1.14 include/sched.h: revision 1.15 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. sched.h: Linux documents clone and __clone as only available when_GNU_SOURCE is defined - follow suit. Ok martin@ clone(2): document that _GNU_SOURCE must be defined for the prototypes sched.h: format comment to follow KNF requested by thorpej@ sched.h: keep __clone() visible under _NETBSD_SOURCE
2022-08-01Ticket #1483martin
2022-08-01Pull up following revision(s) (requested by rin in ticket #1483):martin
sys/dev/usb/uslsa.c: revision 1.32 PR kern/56946 Baud rate must be in little endian for SLSA_R_SET_BAUDRATE request.
2022-07-27Ticket #1482martin
2022-07-27regen for ticket #1482martin
2022-07-27Pull up the following revisions, requested by msaitoh in ticket #1482:martin
sys/dev/pci/pcidevs 1.1422,1.1445-1.1460 via patch sys/arch/x86/pci/amdsmn.c 1.13 Update pcidevs: - Add Intel Alder Lake devices and Intel 600 Series PCH devices. - Add some Intel Xeon Scalable / Skylake-E devices. - Fix AMD F16_HB from 0x1568 to 0x1538. - Add some devices for AMD and improve some descriptions to clarify. - Add VMware AHCI and NVMe. - Update Intel 700 series Ethernet devices. - Add some Broadcom devices. - Add some Broadcom / LSI RAID cards. - Fix typos and whitespace.
2022-07-25Add missing entry for ticket #1476.msaitoh
2022-07-24Ticket #1481martin
2022-07-24Pull up following revision(s) (requested by nia in ticket #1481):martin
external/mit/ctwm/libexec/ctwm_app_menu: revision 1.5 (via patch) ctwm_app_menu: Work around "emacs being installed results in the generated ctwmrc containing invalid syntax" problem. Emacs installs a desktop file called "emacsclient" that contains "doublequotes" in its exec string. Pending a better solution for dumping escaped shell lines into the config file, hide or sanitize desktop entires that might mess up the internal ctwmrc quoting rules.
2022-07-17Ticket #1480martin
2022-07-17Pull up following revision(s) (requested by simonb in ticket #1480):martin
usr.bin/vmstat/vmstat.c: revision 1.255 When operating on core files or /dev/mem when using the -M option, use 64-bit math to calculate pool sizes. Fixes overflow errors for pools larger than 4GB and gives the correct output with "vmstat -m" for in use, total allocation and utilisation numbers.
2022-07-17Ticket #1479martin
2022-07-17Pull up following revision(s) (requested by simonb in ticket #1479):martin
sys/kern/subr_pool.c: revision 1.285 Use 64-bit math to calculate pool sizes. Fixes overflow errors for pools larger than 4GB and gives the correct output for kernel pool pages in "vmstat -s" output.
2022-07-15Ticket #1478martin
2022-07-11Ticket #1477martin
2022-07-11Pull up the following revisions, requested by msaitoh in ticket #1477:martin
sys/dev/pci/if_wmreg.h 1.122-1.125 sys/dev/pci/if_wmvar.h 1.48 sys/dev/pci/if_wm.c 1.719-1.720, 1.722-1.725, 1.727-1.740 via patch - wm_tick: Add missing splx(s) when not WM_MPSAFE. - Print DMA range info if the system is booting in the verbose mode. - Micro optimization: - Call m_freem(m) only if m0 == NULL. - Call wm_xxeof() only when limit > 0. - Don't set the more flag when there is no packet to process. - No functional changes: - Call txeof first, then rxeof for the consistency. - Remove duplicated break. - Remove stray semicolons from struct declaration. - Fix value return from void function. - Use macros. - Modify comment. - KNF.
2022-06-22Pull up following revision(s) (requested by martin in ticket #1476):msaitoh
usr.sbin/sysinst/label.c: revision 1.39 PR 56893: fix input validation when the user moves a new partition to a totaly different part of the disk. Fix size handling for freshly added partitions (which would previously use random stack data due to bogus error checking).
2022-06-17Ticket #1475martin
2022-06-17Pull up following revision(s) (requested by shm in ticket #1475):martin
sys/miscfs/procfs/procfs_vnops.c: revision 1.229 Add missing permission check
2022-06-16Tickets #1473 and #1474martin
2022-06-16Pull up following revision(s) (requested by skrll in ticket #1474):martin
sys/arch/hppa/hppa/pmap.c: revision 1.120 Re-reading the PA2.0 Cache Move-In rules tells me we do indeed need to purge the translations from the TLBs in pmap_procwr. PR/56867: hppa: intermittent SIGSEGV reports in t_ptrace_wait's stepN and setstepN test cases
2022-06-16Pull up following revision(s) (requested by skrll in ticket #1473):martin
sys/lib/libkern/arch/hppa/milli_extra.S: revision 1.2 Fix a dumb typo/thinko Thanks to Tom Lane for spotting it.
2022-06-14Tickets #1470 - #1472martin