Commit Graph

19623 Commits

Author SHA1 Message Date
martin a8233c2c29 In preparation for the upcoming release, turn off DIAGNOSTIC in most
kernel configs, modules and libc.
2019-11-21 18:17:58 +00:00
martin 8c580115fe Pull up following revision(s) (requested by isaki in ticket #446):
lib/libossaudio/ossaudio.c: revision 1.37
	lib/libossaudio/ossaudio.c: revision 1.38
	sys/compat/ossaudio/ossaudio.c: revision 1.77
	sys/compat/ossaudio/ossaudio.c: revision 1.78
Use record.sample_rate for recording on SNDCTL_DSP_SPEED.
Fix PR lib/54667.
Use record.sample_rate for recording on SNDCTL_DSP_SPEED.
It's kernel side of PR lib/54667.
Use record field for recording even on
SNDCTL_DSP_STEREO, SNDCTL_DSP_SETFMT, and SNDCTL_DSP_CHANNELS.
2019-11-19 11:01:27 +00:00
martin 799801cc20 Pull up following revision(s) (requested by maxv in ticket #405):
usr.sbin/nvmmctl/nvmmctl.8: revision 1.2
	lib/libnvmm/libnvmm.3: revision 1.24
	sys/dev/nvmm/nvmm.h: revision 1.11
	lib/libnvmm/libnvmm.3: revision 1.25
	sys/dev/nvmm/x86/nvmm_x86.h: revision 1.16
	sys/dev/nvmm/nvmm.h: revision 1.12
	sys/dev/nvmm/x86/nvmm_x86.h: revision 1.17
	tests/lib/libnvmm/h_mem_assist.c: revision 1.12
	sys/dev/nvmm/x86/nvmm_x86.h: revision 1.18
	share/mk/bsd.hostprog.mk: revision 1.82
	lib/libnvmm/libnvmm.c: revision 1.15
	distrib/sets/lists/base/md.amd64: revision 1.281
	tests/lib/libnvmm/h_mem_assist.c: revision 1.13
	lib/libnvmm/libnvmm.c: revision 1.16
	tests/lib/libnvmm/h_mem_assist.c: revision 1.14
	lib/libnvmm/libnvmm_x86.c: revision 1.32
	lib/libnvmm/libnvmm.c: revision 1.17
	tests/lib/libnvmm/h_mem_assist.c: revision 1.15
	lib/libnvmm/libnvmm_x86.c: revision 1.33
	lib/libnvmm/libnvmm.c: revision 1.18
	usr.sbin/nvmmctl/Makefile: revision 1.1
	tests/lib/libnvmm/h_mem_assist_asm.S: revision 1.7
	tests/lib/libnvmm/h_mem_assist.c: revision 1.16
	lib/libnvmm/libnvmm_x86.c: revision 1.34
	usr.sbin/nvmmctl/Makefile: revision 1.2
	tests/lib/libnvmm/h_mem_assist_asm.S: revision 1.8
	tests/lib/libnvmm/h_mem_assist.c: revision 1.17
	sys/dev/nvmm/nvmm_internal.h: revision 1.13
	lib/libnvmm/libnvmm_x86.c: revision 1.35
	lib/libnvmm/libnvmm_x86.c: revision 1.36
	usr.sbin/postinstall/postinstall.in: revision 1.8
	lib/libnvmm/libnvmm_x86.c: revision 1.37
	lib/libnvmm/libnvmm_x86.c: revision 1.38
	lib/libnvmm/libnvmm_x86.c: revision 1.39
	usr.sbin/Makefile: revision 1.282
	lib/libnvmm/nvmm.h: revision 1.13
	lib/libnvmm/nvmm.h: revision 1.14
	lib/libnvmm/nvmm.h: revision 1.15
	sys/dev/nvmm/nvmm.c: revision 1.23
	lib/libnvmm/nvmm.h: revision 1.16
	sys/dev/nvmm/nvmm.c: revision 1.24
	lib/libnvmm/nvmm.h: revision 1.17
	sys/dev/nvmm/nvmm.c: revision 1.25
	tests/lib/libnvmm/h_io_assist.c: revision 1.9
	etc/MAKEDEV.tmpl: revision 1.209
	tests/lib/libnvmm/h_io_assist.c: revision 1.10
	tests/lib/libnvmm/h_io_assist.c: revision 1.11
	etc/group: revision 1.35
	distrib/sets/lists/man/mi: revision 1.1660
	sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.40
	sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.41
	sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.42
	sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.43
	sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.44
	sys/dev/nvmm/x86/nvmm_x86_svm.c: revision 1.51
	sys/dev/nvmm/nvmm_ioctl.h: revision 1.8
	sys/dev/nvmm/x86/nvmm_x86_svm.c: revision 1.52
	sys/dev/nvmm/nvmm_ioctl.h: revision 1.9
	sys/dev/nvmm/x86/nvmm_x86_svm.c: revision 1.53
	usr.sbin/nvmmctl/nvmmctl.c: revision 1.1
	lib/libnvmm/libnvmm.3: revision 1.20
	distrib/sets/lists/debug/md.amd64: revision 1.106
	lib/libnvmm/libnvmm.3: revision 1.21
	lib/libnvmm/libnvmm.3: revision 1.22
	usr.sbin/nvmmctl/nvmmctl.8: revision 1.1
	lib/libnvmm/libnvmm.3: revision 1.23

Fix incorrect parsing: the R/M field uses a special GPR map when the
address size is 16 bits, regardless of the actual operating mode. With
this special map there can be two registers referenced at once, and
also disp16-only.
Implement this special behavior, and add associated tests. While here
simplify a few things.
With this in place, the Windows 95 installer initializes correctly.
Part of PR/54611.
add missing initializer
Implement XCHG, add associated tests, and add comments to explain. With
this in place the Windows 95 installer completes successfuly.
Part of PR/54611.
Improve nvmm_vcpu_dump().
Put back 'default', because llvm apparently doesn't realize that all cases
are covered in the switch.
Miscellaneous changes in NVMM, to address several inconsistencies and
issues in the libnvmm API.
 - Rename NVMM_CAPABILITY_VERSION to NVMM_KERN_VERSION, and check it in
   libnvmm. Introduce NVMM_USER_VERSION, for future use.
 - In libnvmm, open "/dev/nvmm" as read-only and with O_CLOEXEC. This is to
   avoid sharing the VMs with the children if the process forks. In the
   NVMM driver, force O_CLOEXEC on open().
 - Rename the following things for consistency:
       nvmm_exit*              -> nvmm_vcpu_exit*
       nvmm_event*             -> nvmm_vcpu_event*
       NVMM_EXIT_*             -> NVMM_VCPU_EXIT_*
       NVMM_EVENT_INTERRUPT_HW -> NVMM_VCPU_EVENT_INTR
       NVMM_EVENT_EXCEPTION    -> NVMM_VCPU_EVENT_EXCP
   Delete NVMM_EVENT_INTERRUPT_SW, unused already.
 - Slightly reorganize the MI/MD definitions, for internal clarity.
 - Split NVMM_VCPU_EXIT_MSR in two: NVMM_VCPU_EXIT_{RD,WR}MSR. Also provide
   separate u.rdmsr and u.wrmsr fields. This is more consistent with the
   other exit reasons.
 - Change the types of several variables:
       event.type                  enum -> u_int
       event.vector                uint64_t -> uint8_t
       exit.u.*msr.msr:            uint64_t -> uint32_t
       exit.u.io.type:             enum -> bool
       exit.u.io.seg:              int -> int8_t
       cap.arch.mxcsr_mask:        uint64_t -> uint32_t
       cap.arch.conf_cpuid_maxops: uint64_t -> uint32_t
 - Delete NVMM_VCPU_EXIT_MWAIT_COND, it is AMD-only and confusing, and we
   already intercept 'monitor' so it is never armed.
 - Introduce vmx_exit_insn() for NVMM-Intel, similar to svm_exit_insn().
   The 'npc' field wasn't getting filled properly during certain VMEXITs.
 - Introduce nvmm_vcpu_configure(). Similar to nvmm_machine_configure(),
   but as its name indicates, the configuration is per-VCPU and not per-VM.
   Migrate and rename NVMM_MACH_CONF_X86_CPUID to NVMM_VCPU_CONF_CPUID.
   This becomes per-VCPU, which makes more sense than per-VM.
 - Extend the NVMM_VCPU_CONF_CPUID conf to allow triggering VMEXITs on
   specific leaves. Until now we could only mask the leaves. An uint32_t
   is added in the structure:
        uint32_t mask:1;
        uint32_t exit:1;
        uint32_t rsvd:30;
   The two first bits select the desired behavior on the leaf. Specifying
   zero on both resets the leaf to the default behavior. The new
   NVMM_VCPU_EXIT_CPUID exit reason is added.
Three changes in libnvmm:
 - Add 'mach' and 'vcpu' backpointers in the nvmm_io and nvmm_mem
   structures.
 - Rename 'nvmm_callbacks' to 'nvmm_assist_callbacks'.
 - Rename and migrate NVMM_MACH_CONF_CALLBACKS to NVMM_VCPU_CONF_CALLBACKS,
   it now becomes per-VCPU.
Update the libnvmm man page:
 - Sync the naming with reality.
 - Replace "relevant" by "desired" and "virtualizer" by "emulator", closer
   to what I meant.
 - Add a "VCPU Configuration" section.
 - Add a "Machine Ownership" section.
Add the "nvmm" group, and make nvmm_init() public. Sent to tech-kern@ a few
days ago.
Use the new PTE naming, and define CR3_FRAME_* separately. No functional
change.
Add a new VCPU conf option, that allows userland to request VMEXITs after a
TPR change. This is supported on all Intel CPUs, and not-too-old AMD CPUs.
The reason for wanting this option is that certain OSes (like Win10 64bit)
manage interrupt priority in hardware via CR8 directly, and for these OSes,
the emulator may want to sync its internal TPR state on each change.
Add two new fields in cap.arch, to report the conf capabilities. Report TPR
only on Intel for now, not AMD, because I don't have a recent AMD CPU on
which to test.
Mask CPUID leaf 0x0A on Intel, because we don't want the guest to try (and
fail) to probe the PMC MSRs. This avoids "Unexpected WRMSR" warnings in
qemu-nvmm.
Add PCID support in the guests. This speeds up most 64bit guests, because
since Meltdown, everybody uses PCID (including NetBSD).
Change the way root_owner works: consider the calling process as root_owner
not if it has root privileges, but if the /dev/nvmm device was opened with
write permissions. Introduce the undocumented nvmm_root_init() function to
achieve that.
The goal is to simplify the logic and have more granularity, eg if we want
a monitoring agent to access VMs but don't want to give this agent real
root access on the system.
A few changes:
 - Use smaller types in struct nvmm_capability.
 - Use smaller type for nvmm_io.port.
 - Switch exitstate to a compacted structure.
Add nram in struct nvmm_ctl_mach_info.
Add nvmmctl, with two commands for now.
Macro tidyness.
Sort SEE ALSO.
should be fork(2), noticed by wiz
Add debug entry for newly introduced nvmmctl utility.
Annotate a covering switch as such to avoid warnings about missing
returns.
Forgot to put nvmmctl in the "nvmm" group.
Add nvmm group.
2019-11-10 12:58:29 +00:00
martin b6b3cc7e14 Pull up following revision(s) (requested by kamil in ticket #326):
lib/libc/sys/ptrace.2: revision 1.81

Document PT_STOP, update PT_KILL in the ptrace(2) man-page
Formatting by <mgorny>
2019-10-15 19:13:22 +00:00
martin 56b1c18036 Pull up following revision(s) (requested by rmind in ticket #282):
usr.sbin/npf/npfctl/npf_build.c: revision 1.53
	lib/libnpf/npf.c: revision 1.48
	usr.sbin/npf/npfctl/npfctl.h: revision 1.50
	sys/net/npf/npf_impl.h: revision 1.80
	usr.sbin/npf/npfctl/npfctl.h: revision 1.51
	sys/net/npf/npf_ruleset.c: revision 1.49
	usr.sbin/npf/npfctl/npf.conf.5: revision 1.90
	sys/net/npf/npf_ctl.c: revision 1.59
	lib/libnpf/libnpf.3: revision 1.11
	usr.sbin/npf/npfctl/npf_parse.y: revision 1.50
	usr.sbin/npf/npftest/npftest.conf: revision 1.8
	usr.sbin/npf/npfctl/npfctl.c: revision 1.62
	usr.sbin/npf/npfctl/npfctl.c: revision 1.63
	usr.sbin/npf/npfctl/npf_scan.l: revision 1.30
	usr.sbin/npf/npfctl/npfctl.8: revision 1.22
	lib/libnpf/npf.h: revision 1.38
	usr.sbin/npf/npfctl/npfctl.8: revision 1.23
	usr.sbin/npf/npfctl/npfctl.8: revision 1.24
	sys/net/npf/npf_if.c: revision 1.11
	sys/net/npf/npf_if.c: revision 1.12
	usr.sbin/npf/npfctl/npf.conf.5: revision 1.89
	sys/net/npf/npf_conn.c: revision 1.30
	usr.sbin/npf/npfctl/npf_build.c: revision 1.52

npfctl: implement table replace subcommand.
Contributed by Timshel Knoll-Miller.

NPF ifmap: rework and fix a few small bugs.

npfctl: implement table replace subcommand.
Contributed by Timshel Knoll-Miller.
(missed a file in previous commit; cvs is so helpful..)

libnpf/npfctl: support dynamic NAT rulesets using a name prefix.

Use -width Pa for FILES.

Fix pasto in table replace -t type

Use -width Pa for FILES.

npf_ifmap_copylogname: be more defensive.
2019-10-04 08:06:34 +00:00
martin 13e99c9c2b Pull up following revision(s) (requested by brad in ticket #252):
external/cddl/osnet/lib/libzpool/Makefile: revision 1.13
	lib/libpthread/Makefile: revision 1.95
	external/cddl/osnet/lib/libuutil/Makefile: revision 1.6
	distrib/sets/lists/base/shl.mi: revision 1.871
	external/cddl/osnet/lib/libzfs_core/Makefile: revision 1.2
	external/cddl/osnet/lib/libnvpair/Makefile: revision 1.11
	external/cddl/osnet/lib/libzfs/Makefile: revision 1.10
	external/cddl/osnet/lib/libavl/Makefile: revision 1.6
	distrib/sets/lists/debug/shl.mi: revision 1.230
	external/cddl/osnet/lib/libumem/Makefile: revision 1.7

Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}.  The general effect is to move them
from /usr/lib to /lib.  Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.
Run tested on amd64 and i386 and compile tested on evbarm.

Fix MKDEBUG distrib sets
Add libpthread, libnvpair and ZFS libs to dynamicroot.
2019-09-27 09:24:29 +00:00
martin a590d00c03 Pull up following revision(s) (requested by kamil in ticket #198):
lib/libpthread/thrd.c: revision 1.4
	lib/libpthread/threads.h: revision 1.3

Switch back _Noreturn to __dead in C11 threads

There is an ongoing discussion to unify unreturn attribute between C and
C++, making a compatible version, shared between languages. Instead of
picking C11-only approach here, switch back to __dead that wraps the
compiler extension for the same purpose.

This change makes this header more compatible with C++ and pre-C11.
Reference:

<a  rel="nofollow" href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2410.pdf">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2410.pdf</a>
2019-09-13 06:54:09 +00:00
martin 6146c875f0 Pull up following revision(s) (requested by maya in ticket #186):
lib/libc/nameser/ns_name.c: revision 1.12

Since we advance cp after the bounds check, we need to test for bounds
again before using it. Discovered via fuzzing, reported by enh at google, via:

    https://android-review.googlesource.com/c/platform/bionic/+/1093130
2019-09-06 19:51:54 +00:00
martin 53237ac71f Pull up following revision(s) (requested by sevan in ticket #174):
lib/libc/sys/chmod.2: revision 1.48
	lib/libc/sys/stat.2: revision 1.59
	lib/libc/sys/unlink.2: revision 1.30
	lib/libc/sys/lseek.2: revision 1.25
	lib/libc/sys/getuid.2: revision 1.18
	lib/libc/sys/chown.2: revision 1.37
	lib/libm/man/exp.3: revision 1.32
	lib/libm/man/log.3: revision 1.7
	lib/libc/sys/open.2: revision 1.60
	lib/libc/stdio/fopen.3: revision 1.36
	lib/libc/stdio/putc.3: revision 1.14
	lib/libc/sys/mount.2: revision 1.51
	share/man/man9/copy.9: revision 1.22
	share/man/man9/uiomove.9: revision 1.20
	lib/libc/sys/setuid.2: revision 1.23
	lib/libc/sys/close.2: revision 1.18
	sbin/init/init.8: revision 1.61
	lib/libc/sys/write.2: revision 1.36
	lib/libc/sys/read.2: revision 1.39
	sbin/init/init.8: revision 1.62
	lib/libc/sys/wait.2: revision 1.40
	usr.bin/tty/tty.1: revision 1.10
	lib/libc/sys/link.2: revision 1.33
	usr.bin/du/du.1: revision 1.24
	lib/libc/stdlib/exit.3: revision 1.17
	usr.bin/su/su.1: revision 1.53
	usr.bin/mail/mail.1: revision 1.66
	lib/libc/sys/fork.2: revision 1.25
	usr.bin/su/su.1: revision 1.54
	usr.bin/mail/mail.1: revision 1.67
	lib/libm/man/sin.3: revision 1.15
	share/man/man9/intro.9: revision 1.26
	share/man/man5/utmp.5: revision 1.17
	lib/libc/compat-43/creat.3: revision 1.17
	lib/libc/time/ctime.3: revision 1.61
	lib/libcompat/4.1/stty.3: revision 1.10
	usr.bin/dc/dc.1: revision 1.3
	lib/libm/man/cos.3: revision 1.17
	lib/libc/sys/chdir.2: revision 1.23
	lib/libc/gen/exec.3: revision 1.30
	lib/libc/gen/exec.3: revision 1.31
	games/bcd/bcd.6: revision 1.18
	games/bcd/bcd.6: revision 1.19
	usr.bin/write/write.1: revision 1.7
	usr.bin/wc/wc.1: revision 1.18
	usr.bin/pr/pr.1: revision 1.24
	usr.bin/who/who.1: revision 1.25
	lib/libc/sys/mkdir.2: revision 1.30
	lib/libc/stdio/getc.3: revision 1.13
	usr.bin/sort/sort.1: revision 1.40
	usr.bin/mesg/mesg.1: revision 1.11
	share/man/man5/passwd.5: revision 1.34
sort was there since v1
https://www.bell-labs.com/usr/dmr/www/man61.pdf

dc was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

du was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

mail was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

mesg was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf

su was in v1
https://www.bell-labs.com/usr/dmr/www/man13.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man14.pdf
Update URL

write was in v1
https://www.bell-labs.com/usr/dmr/www/man14.pdf
grammar

passwd(5) was in v1
https://www.bell-labs.com/usr/dmr/www/man51.pdf

utmp(5) was present in v1
https://www.bell-labs.com/usr/dmr/www/man51.pdf

Earliest version of wtmp I could find was in v3
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man5/wtmp.5

Document history of chdir(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history of chmod(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history of chown(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf

create was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history of exec()
Move statement on execlpe() & execvpe() to HISTORY section.

Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf

fork was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf
stat() was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

document history of fstat()
https://www.bell-labs.com/usr/dmr/www/man21.pdf

getuid was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf

stty & gtty were around since v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf
https://www.bell-labs.com/usr/dmr/www/man22.pdf

mount & umount were present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

Open was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

read was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

seek was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

setuid was in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

unlink was presen in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

wait was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

write was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

start documenting history
exp was present in v1
https://www.bell-labs.com/usr/dmr/www/man31.pdf

Start documenting history
https://www.bell-labs.com/usr/dmr/www/man31.pdf

Start documenting history
https://www.bell-labs.com/usr/dmr/www/man31.pdf

log appeared in v1
https://www.bell-labs.com/usr/dmr/www/man31.pdf

putc & putw were in v1
https://www.bell-labs.com/usr/dmr/www/man31.pdf

putchar was in v4
https://minie.tuhs.org/cgi-bin/utree.pl?file=V4/man/man3/putchr.3

Start documenting history
https://www.bell-labs.com/usr/dmr/www/man31.pdf

Document history.
https://www.bell-labs.com/usr/dmr/www/man11.pdf
Between v1 & v6 UNIX, bcd was rewritten in C, but I don't know if which
version,
hence I've skipped mentioning it.
End sentence with a dot.
Remove superfluous Pp.
Remove superfluous Pp.
Remove superfluous Ns.
Remove superfluous Pp.
fetch(9) -> ufetch(9)
fetch(9) -> ufetch(9). Remove superfluous Pp.
fetch(9) -> ufetch(9). Remove reference to unimplemented ppi(9).
2019-09-05 08:19:40 +00:00
martin b522530833 Pull up following revision(s) (requested by brad in ticket #110):
libexec/lfs_cleanerd/lfs_cleanerd.c: revision 1.59
	libexec/lfs_cleanerd/lfs_cleanerd.8: revision 1.19
	sbin/resize_lfs/resize_lfs.c: revision 1.15
	usr.sbin/puffs/rump_lfs/rump_lfs.c: revision 1.19
	libexec/lfs_cleanerd/lfs_cleanerd.c: revision 1.60
	lib/libutil/getdiskrawname.c: revision 1.6
	tests/fs/common/fstest_lfs.c: revision 1.7

Use getdiskrawname to find the device name.
Reviewed by Christos

 -

Teach getdiskrawname and getdiskcookedname about zvols.
Reviewed by Christos

 -

Add support for passing the raw device name separate from the
filesystem.  This is useful in the case where the cleaner is compiled
into code, such as rump_lfs and the ATF tests.  This helps to fix
bin/54488

 -

The cleaner is compiled into rump_lfs and executed as a thread.  Pass
in the raw device using the new -J option.  This avoids the use of
getdiskrawname which is not particularly rump safe in this context and
insures that the rump container device is used for cleaning, not the
outer device.
2019-09-02 16:16:56 +00:00
martin 71b9ece811 Pull up following revision(s) (requested by rmind in ticket #140):
external/bsd/libnv/lib/Makefile: revision 1.3
	usr.sbin/npf/npfd/Makefile: revision 1.7
	lib/libnpf/Makefile: revision 1.11
	lib/libnpf/Makefile: revision 1.12
	libexec/identd/Makefile: revision 1.18
	usr.sbin/npf/npfctl/Makefile: revision 1.14
	lib/npf/mod.mk: revision 1.8
	external/bsd/libnv/lib/srcs.mk: revision 1.1

libnpf fix: link the library itself to libnv; libnpf users should not be
expected to assume this dependency.

Move common parts into a makefile fragment usable from elsewhere.
Suggested by mrg.

Include libnv directly into this library
2019-09-01 13:18:39 +00:00
martin 1292fa3065 Pull up following revision(s) (requested by rmind in ticket #139):
lib/libnpf/npf.c: revision 1.47
	usr.sbin/npf/npftest/libnpftest/npf_nbuf_test.c: revision 1.10
	usr.sbin/npf/npftest/libnpftest/npf_mbuf_subr.c: revision 1.10
	sys/net/npf/npf.h: revision 1.61
	sys/net/npf/npf_ctl.c: revision 1.56
	sys/net/npf/npf_os.c: revision 1.15
	lib/libnpf/libnpf.3: revision 1.10
	sys/net/npf/npf_tableset.c: revision 1.34
	usr.sbin/npf/npfctl/npfctl.c: revision 1.61
	sys/net/npf/npf_impl.h: revision 1.77
	lib/libnpf/npf.h: revision 1.37

- npftest: fix a memleak in a unit test (standalone path only).
- Minor style fixes.  No functional change.
npfkern/libnpf: Add support for the table replace/swap operation.
Contributed by Timshel Knoll-Miller.
2019-09-01 13:13:13 +00:00
martin 489c11d4fa Pull up following revision(s) (requested by kamil in ticket #126):
external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-m64/Makefile: revision 1.3
	external/bsd/compiler_rt/lib/clang/lib/netbsd/msan_cxx-m64/Makefile: revision 1.3
	external/gpl2/lvm2/lvm2tools.mk: revision 1.5
	common/lib/libc/gmon/mcount.c: revision 1.14
	Makefile: revision 1.331
	share/mk/Makefile: revision 1.51
	external/bsd/fetch/lib/Makefile: revision 1.12
	external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64/Makefile: revision 1.3
	tests/lib/libc/net/Makefile: revision 1.12
	external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone_cxx-m64/Makefile: revision 1.3
	external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64/Makefile: revision 1.3
	distrib/sets/lists/base/mi: revision 1.1213
	share/mk/bsd.lib.mk: revision 1.380
	external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-m64/Makefile: revision 1.3
	external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/Makefile: revision 1.3
	share/mk/bsd.sanitizer.mk: revision 1.1
	share/mk/bsd.prog.mk: revision 1.323
	external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan-m64/Makefile: revision 1.3
	external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan_cxx-m64/Makefile: revision 1.3
	lib/libc/gen/sysctlgetmibinfo.c: revision 1.14

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.

Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.
2019-09-01 10:44:22 +00:00
martin 2f01679d96 Pull up following revision(s) (requested by manu in ticket #50):
lib/libperfuse/ops.c: revision 1.87

Rollback directory filehandle screening for FUSE lock operations
libfuse has a different usage of filehandles for files and directories.

A directory filehandle is valid only for directory operations such
as OPENDIR, READDIR, RELEASEDIR, FSYNCDIR. Change of src/lib/libperfuse/ops.c
1.85-1.86 made sure filehandles of directories were only sent for that
operations.

However, the status of lock operations GETLK, SETLK, SETLKW was overlooked.

The only FUSE filesystem I found using locks is GlusterFS, and it needs
directory filehandles to be provided on lock operations, otherwise locking
crashes the filesystem. Hence this change brings back filehandles for
lock operations on directories.
2019-08-13 14:44:37 +00:00
sevan 7cc04b4007 typo 2019-07-28 14:28:50 +00:00
christos 0a19c9139d PR/54414: Valery Ushakov: c99 requires that wcsrtombs(3) updates the source
argument on conversion error
2019-07-28 13:52:23 +00:00
christos 272963ae08 PR/54415: Ricky Zhou: libedit stats completions for non-file completions
Use the proper completion function and account for the character appended
by the function when computing the number of columns.
2019-07-28 09:27:29 +00:00
uwe 4753bc1e70 __slk_set_finalise - fix length vs. width confusion 2019-07-28 00:51:59 +00:00
uwe 96ffe7929a __slk_set - fix calculating "len" for HAVE_WCHAR 2019-07-28 00:15:38 +00:00
sevan 5442ac99a4 nit 2019-07-27 16:15:58 +00:00
sevan 09453b8368 list the wide variant of functions. 2019-07-27 16:00:02 +00:00
uwe 7cefafafd5 Put slk_color() undef #ifdef HAVE_WCHAR too. 2019-07-27 00:58:34 +00:00
uwe acf023e482 Put wide character functions under #ifdef HAVE_WCHAR 2019-07-27 00:46:43 +00:00
uwe 7e8b9e03e4 #ifdef HAVE_WCHAR around enhanced curses stuff. 2019-07-25 20:18:50 +00:00
riastradh c3b035f199 Update uuidgen(2) man page to reflect reality as of five years ago. 2019-07-24 06:11:57 +00:00
wiz eed20ae12c Try improving a description. 2019-07-23 14:18:20 +00:00
christos 755b70304b remove stray brace 2019-07-23 13:10:11 +00:00
christos 585d8da984 put the NULL check immediately after the allocation 2019-07-23 10:19:35 +00:00
christos 113f06a345 PR/54399: Sören Tempel: Uninitialized memory access in libedit history.
Initialize the buffer using calloc. While here change all malloc(a * sizeof(b))
to calloc(a, sizeof(b)). XXX: should fix realloc similarly.
2019-07-23 10:18:52 +00:00
christos 38ee0c7eda PR/54400: Sören Tempel: out-of-bounds read in libedit c_delbefore 2019-07-23 09:47:16 +00:00
rmind dadc88e3b0 NPF improvements:
- Add support for dynamic NETMAP algorithm (stateful net-to-net).
- Add most of the support for the dynamic NAT rules; a little bit more
  userland work is needed to finish this up and enable.
- Replace 'stateful-ends' with more permissive 'stateful-all'.
- Add various tunable parameters and document them, see npf-params(7).
- Reduce the memory usage of the connection state table (conndb).
- Portmap rewrite: use memory more efficiently, handle addresses dynamically.
- Bug fix: add splsoftnet()/splx() around the thmap writers and comment.
- npftest: clean up and simplify; fix some memleaks to make ASAN happy.
2019-07-23 00:52:01 +00:00
mgorny 3f42a56a4c Fix thinko: syscalls -> signals 2019-07-11 03:30:01 +00:00
mgorny 5428c4a258 Improve/fix doc of PT_SETSTEP and PT_CLEARSTEP.
Reviewed by kamil.
2019-07-10 19:51:14 +00:00
mgorny d79e8eeec8 Fix typo: SIGRAP -> SIGTRAP 2019-07-10 19:03:47 +00:00
mlelstv 37d9a541e0 The correct fix for lib/51000 is not to remove the apparently dead assignment
but to add the missing usage.

From https://bitbucket.org/tnozaki/netbsd/commits/24b35fdce250
Thanks to Takehiko Nozaki
2019-07-08 06:45:01 +00:00
dholland c2e7ae765c Fix up mangled logic, hopefully. PR 54323 from David Binderman.
XXX: This code is pretty dodgy in general and would benefit from a
XXX: workover by someone who knows what it's supposed to be doing.
XXX: E.g. it appears that a read error will cause an infinite loop...
2019-07-03 18:40:33 +00:00
christos 7005738d9a Sync with 2019b:
zic's new -b option supports a way to control data bloat and to
    test for year-2038 bugs in software that reads TZif files.
    'zic -b fat' and 'zic -b slim' generate larger and smaller output;
    for example, changing from fat to slim shrinks the Europe/London
    file from 3648 to 1599 bytes, saving about 56%.  Fat and slim
    files represent the same set of timestamps and use the same TZif
    format as documented in tzfile(5) and in Internet RFC 8536.
    Fat format attempts to work around bugs or incompatibilities in
    older software, notably software that mishandles 64-bit TZif data
    or uses obsolete TZ strings like "EET-2EEST" that lack DST rules.
    Slim format is more efficient and does not work around 64-bit bugs
    or obsolete TZ strings.  Currently zic defaults to fat format
    unless you compile with -DZIC_BLOAT_DEFAULT=\"slim\"; this
    out-of-the-box default is intended to change in future releases
    as the buggy software often mishandles timestamps anyway.

    zic no longer treats a set of rules ending in 2037 specially.
    Previously, zic assumed that such a ruleset meant that future
    timestamps could not be predicted, and therefore omitted a
    POSIX-like TZ string in the TZif output.  The old behavior is no
    longer needed for current tzdata, and caused problems with newlib
    when used with older tzdata (reported by David Gauchard).

    zic no longer generates some artifact transitions.  For example,
    Europe/London no longer has a no-op transition in January 1996.
2019-07-03 15:50:16 +00:00
wiz f3a84d0dfb Improve formatting, fix a typo, bump date for previous. 2019-07-01 07:16:25 +00:00
blymn 4aba88d186 Bump major number due to libcurses major bump 2019-06-30 22:17:22 +00:00
blymn cb5c29f5ae Fix return for mvscanw to return ERR/OK instead of the number of
elements scanned, now matches SUSv2 specification

Bump lib major due to return change.
2019-06-30 22:16:20 +00:00
christos ac94b724c0 Add a comment explaining why we don't use DO here. Correct the attribution
on the previous patch: The patch was from Jordan Lewis and the report from
Raphael Poss.
2019-06-30 13:30:15 +00:00
christos 0d31660187 PR/54329: Raphael Ross: According to https://www.gnu.org/software/termutils/\
manual/termcap-1.3/html_chapter/termcap_4.html#SEC23 the cursor move multiple
escapes have undefined results when moving out of the screen. Stop using DO
to move down multiple lines and use a loop of newlines instead.
2019-06-29 21:35:09 +00:00
wiz cb2bfe58e7 Use Vt for variable types. New sentence, new line. Add a missing ')'.
Add/remove some articles or other missing words.
2019-06-26 13:31:48 +00:00
mgorny c2ad96ff63 Implement PT_GETXSTATE and PT_SETXSTATE
Introduce two new ptrace() requests: PT_GETXSTATE and PT_SETXSTATE,
that provide access to the extended (and extensible) set of FPU
registers on amd64 and i386.  At the moment, this covers AVX (YMM)
and AVX-512 (ZMM, opmask) registers.  It can be easily extended
to cover further register types without breaking backwards
compatibility.

PT_GETXSTATE issues the XSAVE instruction with all kernel-supported
extended components enabled.  The data is copied into 'struct xstate'
(which -- unlike the XSAVE area itself -- has stable format
and offsets).

PT_SETXSTATE issues the XRSTOR instruction to restore the register
values from user-provided 'struct xstate'.  The function replaces only
the specific XSAVE components that are listed in 'xs_rfbm' field,
making it possible to issue partial updates.

Both syscalls take a 'struct iovec' pointer rather than a direct
argument.  This requires the caller to explicitly specify the buffer
size.  As a result, existing code will continue to work correctly
when the structure is extended (performing partial reads/updates).
2019-06-26 12:30:12 +00:00
wiz e92fdad11f fifo -> FIFO. Sort errors. 2019-06-20 06:59:32 +00:00
kamil 177438b064 Add mkfifo{,at}(2) mode in mknod{,at}(2) as requested by POSIX
mknod with mode & S_IFIFO and dev=0 shall behave like mkfifo.

Update the documentation to reflect this state.

Add ATF tests.

This is an in-kernel implementation as typically user-space programs use
mkfifo(2) directly, however whenever there is need to bypass libc (like in
valgrind) then portable POSIX software calls the mknod syscall.

Noted on tech-kern@ by Greg Troxel.
2019-06-20 03:31:53 +00:00
uwe b84ea9c460 Small markup fixes. 2019-06-19 20:20:52 +00:00
kamil a04979c2ea Fix warning message for mknod symbol linkage
The correct reference for mknod(2) is in <sys/stat.h>
2019-06-18 14:25:04 +00:00
wiz f525fbd105 Fix typo. 2019-06-12 12:32:54 +00:00
kamil 3fa4aee840 Try to make posix_spawn(3) note in ptrace(2) less confusing 2019-06-12 12:30:42 +00:00