dragonfly.git
3 years agobzip2: Update README.DRAGONFLY.
Daniel Fojt [Thu, 21 May 2020 05:37:09 +0000 (07:37 +0200)]
bzip2: Update README.DRAGONFLY.

3 years agoMerge branch 'vendor/BZIP'
Sascha Wildner [Fri, 22 May 2020 18:36:11 +0000 (20:36 +0200)]
Merge branch 'vendor/BZIP'

3 years agovendor/bzip: upgrade bzip2 from 1.0.6 to 1.0.8 vendor/BZIP
Daniel Fojt [Thu, 21 May 2020 05:26:34 +0000 (07:26 +0200)]
vendor/bzip: upgrade bzip2 from 1.0.6 to 1.0.8

Fixes CVE-2016-3189 and CVE-2019-12900.

3 years agohier.7: Describe /var/chroot (taken from NetBSD).
Sascha Wildner [Fri, 22 May 2020 17:01:52 +0000 (19:01 +0200)]
hier.7: Describe /var/chroot (taken from NetBSD).

3 years agosyscall.9: Adjust for the makesyscalls.sh changes.
Sascha Wildner [Fri, 22 May 2020 08:52:21 +0000 (10:52 +0200)]
syscall.9: Adjust for the makesyscalls.sh changes.

3 years agokernel: Clean up some no longer used types from makesyscalls.sh.
Sascha Wildner [Fri, 22 May 2020 08:49:24 +0000 (10:49 +0200)]
kernel: Clean up some no longer used types from makesyscalls.sh.

3 years ago<machine/pc/bios.h>: Switch to standard types for a few remaining cases.
Sascha Wildner [Fri, 22 May 2020 08:09:16 +0000 (10:09 +0200)]
<machine/pc/bios.h>: Switch to standard types for a few remaining cases.

3 years agokernel: Clean up a few headers a bit.
Sascha Wildner [Fri, 22 May 2020 08:06:07 +0000 (10:06 +0200)]
kernel: Clean up a few headers a bit.

Remove 'extern' and parameter names from function prototypes.

3 years agozoneinfo: Remove the obsolete systemv file.
Sascha Wildner [Thu, 21 May 2020 19:45:12 +0000 (21:45 +0200)]
zoneinfo: Remove the obsolete systemv file.

3 years agowpa_supplicant: Adjust master for the 2.9 upgrade.
Daniel Fojt [Sun, 3 May 2020 11:20:47 +0000 (13:20 +0200)]
wpa_supplicant: Adjust master for the 2.9 upgrade.

- update README.DRAGONFLY and README.DELETED
- apply local modifications to contrib/wpa_supplicant
- adapt build to vendor update
- update manpages wpa_cli(8), wpa_passphrase(8) and wpa_supplicant(8)
- update /etc/wpa_supplicant.conf

Adapt rc script:

- add is_wired_interface() and is_ndis_interface() to network.subr (taken
  from FreeBSD)
- remove "security" warning
- don't consider DPorts wpa_supplicant anymore
- allow wpa_supplicant to be launched either for a single interface or in
  interface matching mode, ie. single daemon handling multiple interfaces
- add wpa_supplicant_* variables to /etc/defaults/rc.conf

3 years agoMerge branch 'vendor/WPA_SUPPLICANT'
Sascha Wildner [Thu, 21 May 2020 19:31:34 +0000 (21:31 +0200)]
Merge branch 'vendor/WPA_SUPPLICANT'

3 years agoworld - libmagic depends on several other libraries
Matthew Dillon [Wed, 20 May 2020 20:57:05 +0000 (13:57 -0700)]
world - libmagic depends on several other libraries

* Fix missing dependencies. libmagic needs libbz2 and liblzma.

* Fixes devel/py-subversion@py27 build

Reported-by: tuxillo
3 years agotzsetup(8): Sync with FreeBSD, more or less, with some modifications.
Sascha Wildner [Wed, 20 May 2020 15:31:35 +0000 (17:31 +0200)]
tzsetup(8): Sync with FreeBSD, more or less, with some modifications.

New things:

* When in a VM, skip the initial question about the hardware clock
  being set to UTC because it is assumed that the hardware clock in
  a VM is set to UTC.

* Split out the dialog(3) code into #ifdef HAVE_DIALOG.

* Some miscellaneous fixes.

The dialog(3) code separation allows us to build tzsetup(8) as a
bootstrap tool without needing libdialog and friends. Prepare the
Makefile for this by not defining HAVE_DIALOG when bootstrapping.
It will be used in a later commit to upgrade /etc/localtime upon
installing new timezones.

3 years agondp(8): Tweak Makefile against the tcpdump update
Aaron LI [Sun, 17 May 2020 07:49:39 +0000 (15:49 +0800)]
ndp(8): Tweak Makefile against the tcpdump update

The new tcpdump enables IPv6 by default, so there is no need to define
the 'INET6' flag.

Clean the style a bit.

3 years agotcpdump(8): Workaround compilation warnings and raise WARNS to 3
Aaron LI [Sun, 17 May 2020 08:01:20 +0000 (16:01 +0800)]
tcpdump(8): Workaround compilation warnings and raise WARNS to 3

It's necessay to fix these compilation warnings in print-esp.c,
otherwise we would be forced to use WARNS of 0.

Credit to FreeBSD for the workaround.

3 years agotcpdump(8): Regenerate config.h and update Makefile
Aaron LI [Sun, 17 May 2020 07:44:20 +0000 (15:44 +0800)]
tcpdump(8): Regenerate config.h and update Makefile

* Regenerate config.h
* Update Makefile against to the vendor update
* Define more macros / flags in Makefile for IPv6 and our private
  LibreSSL library. (Credit to FreeBSD)
* Improve the tcpdump.1 man page generate a bit
* Clean up the Makefile a bit

Credit to deef (Daniel Fojt) for doing the vendor update.

3 years agocontrib/tcpdump: Apply our own modifications
Aaron LI [Sun, 17 May 2020 07:43:37 +0000 (15:43 +0800)]
contrib/tcpdump: Apply our own modifications

3 years agocontrib/tcpdump: Update README.DRAGONFLY
Aaron LI [Sun, 17 May 2020 07:36:33 +0000 (15:36 +0800)]
contrib/tcpdump: Update README.DRAGONFLY

3 years agoMerge branch 'vendor/TCPDUMP' (version 4.3.0 -> 4.9.3)
Aaron LI [Mon, 18 May 2020 22:41:06 +0000 (06:41 +0800)]
Merge branch 'vendor/TCPDUMP' (version 4.3.0 -> 4.9.3)

3 years agocontrib/tcpdump: Revert local modification for vendor update
Aaron LI [Mon, 18 May 2020 22:39:55 +0000 (06:39 +0800)]
contrib/tcpdump: Revert local modification for vendor update

3 years agovendor/TCPDUMP: Import tcpdump 4.9.3
Aaron LI [Mon, 18 May 2020 22:35:30 +0000 (06:35 +0800)]
vendor/TCPDUMP: Import tcpdump 4.9.3

Original source can be downloaded from:
https://www.tcpdump.org/release/

file = tcpdump-4.9.3.tar.gz
date = 2019-10-01
size = 2333119
sha1 = 59b309f3620ac4b709de2eaf7bf3a83bf04bc048

A list of files and directories removed is in README.DELETED.

3 years agolibpcap: Remove unused header file after the upgrade
Aaron LI [Sun, 17 May 2020 04:45:06 +0000 (12:45 +0800)]
libpcap: Remove unused header file after the upgrade

3 years agolibpcap: Regenerate config.h and update Makefile
Aaron LI [Sun, 17 May 2020 04:39:09 +0000 (12:39 +0800)]
libpcap: Regenerate config.h and update Makefile

* Regenerate config.h
* Update Makefile against to the vendor update

Don't bump the libpcap so version because the API change is small as
suggested by zrj.  In addition, my limited tests showed that tcpdump(8),
wpa_supplicant(8) and pflogd(8) also works with the new libpcap.so.

Credit to deef (Daniel Fojt) for doing most of the work.

3 years agocontrib/libpcap: Apply patches from DPorts net/libpcap
Aaron LI [Mon, 18 May 2020 15:13:32 +0000 (23:13 +0800)]
contrib/libpcap: Apply patches from DPorts net/libpcap

3 years agocontrib/libpcap: Reapply our local modifications
Aaron LI [Sun, 17 May 2020 04:37:55 +0000 (12:37 +0800)]
contrib/libpcap: Reapply our local modifications

3 years agocontrib/libpcap: Update README.DRAGONFLY
Aaron LI [Sun, 17 May 2020 04:35:29 +0000 (12:35 +0800)]
contrib/libpcap: Update README.DRAGONFLY

3 years ago<net/dlt.h>: Sync with libpcap 1.9.1
Aaron LI [Sun, 17 May 2020 03:32:30 +0000 (11:32 +0800)]
<net/dlt.h>: Sync with libpcap 1.9.1

Our current <net/dlt.h> is missing some macros for libpcap 1.9.1, so
sync ours with the one from libpcap 1.9.1.  FreeBSD is also using the
<net/dlt.h> from libpcap.

3 years agolibpcap: Clean up Makefile
Aaron LI [Sun, 17 May 2020 00:52:01 +0000 (08:52 +0800)]
libpcap: Clean up Makefile

* Group sections better and sort files
* Add 'scanner.h' to SRCS and specify its dependency.  Without this,
  just 'make' in the lib/libpcap directory would fail because it cannot
  find the 'scanner.h' file.

3 years agoMerge branch 'vendor/LIBPCAP' (version 1.8.1 -> 1.9.1)
Aaron LI [Mon, 18 May 2020 14:49:16 +0000 (22:49 +0800)]
Merge branch 'vendor/LIBPCAP' (version 1.8.1 -> 1.9.1)

3 years agocontrib/libpcap: Revert local modification for vendor update
Aaron LI [Mon, 18 May 2020 14:48:07 +0000 (22:48 +0800)]
contrib/libpcap: Revert local modification for vendor update

3 years agovendor/LIBPCAP: Import libpcap 1.9.1
Aaron LI [Mon, 18 May 2020 14:42:47 +0000 (22:42 +0800)]
vendor/LIBPCAP: Import libpcap 1.9.1

Original source can be downloaded from:
https://www.tcpdump.org/release/

file = libpcap-1.9.1.tar.gz
date = 2019-10-01
size = 861228
sha1 = 04d6e619defad5bb17af15f6d2304e79b649786c

A list of files and directories removed is in README.DELETED.

3 years agoinstaller: Fix process killing issue in installer.sh
Aaron LI [Sat, 16 May 2020 06:43:20 +0000 (14:43 +0800)]
installer: Fix process killing issue in installer.sh

The original way of obtaining PIDs is actually wrong, becuase it would
get the user of processes instead of the process ID.

Directly use killall(1) to fix the issue as well as clean the code.

3 years agonrelease: Use pw(8) and chpass(1) to setup 'installer' and 'root' users
Aaron LI [Sat, 16 May 2020 04:45:42 +0000 (12:45 +0800)]
nrelease: Use pw(8) and chpass(1) to setup 'installer' and 'root' users

Use pw(8) to add the 'installer' user and use chpass(1) to disable
passwords for the 'installer' and 'root' users.  So we can drop the
customized 'master.passwd' file and be in sync with the one in
usr/src/etc.

3 years agonrelease: Recopy passwd and master.passwd as well
Aaron LI [Sat, 16 May 2020 04:52:12 +0000 (12:52 +0800)]
nrelease: Recopy passwd and master.passwd as well

Ports/packages may also install new users.

While there, use '--yes' option for 'pkg autoremove' to clean a bit.

3 years agonrelease: Remove superfluous files
Aaron LI [Sat, 16 May 2020 03:37:06 +0000 (11:37 +0800)]
nrelease: Remove superfluous files

* The 'pwd.db' and 'spwd.db' files should be generated by pwd_mkdb(8).
* The 'login.conf' is not customized and thus not needed.

Anyway, the 'gui' framework is still using the deprecated pkgsrc
framework and has not been maintained for years...

3 years agorc.d: fix mounttmpfs rcorder
Daniel Fojt [Fri, 15 May 2020 19:38:50 +0000 (21:38 +0200)]
rc.d: fix mounttmpfs rcorder

In case tmpfs is to be mounted under /var/run, ensure it's done before any
other components start using it, either to store pidfiles or (more important)
to create sockets, like syslogd(8) does.

3 years agoUpdate the pciconf(8) database.
Sascha Wildner [Fri, 15 May 2020 07:40:59 +0000 (09:40 +0200)]
Update the pciconf(8) database.

May 13, 2020 snapshot from https://pci-ids.ucw.cz

3 years agodaemon.8: Document the changes made in 9f0202884c1ad1d00fb71dad7.
Sascha Wildner [Thu, 14 May 2020 14:26:07 +0000 (16:26 +0200)]
daemon.8: Document the changes made in 9f0202884c1ad1d00fb71dad7.

Discussed-with: Peeter Must

3 years agoSync zoneinfo database with tzdata2020a from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Thu, 14 May 2020 03:41:16 +0000 (05:41 +0200)]
Sync zoneinfo database with tzdata2020a from ftp://ftp.iana.org/tz/releases

* Morocco's second spring-forward transition in 2020 will be May 31,
    not May 24 as predicted earlier.  (Thanks to Semlali Naoufal.)

* Canada's Yukon advanced to -07 year-round on 2020-03-08.

* America/Nuuk renamed from America/Godthab.

* Shanghai observed DST in 1919.  (Thanks to Phake Nick.)

* To reflect current usage in English better, America/Godthab has
    been renamed to America/Nuuk.  A backwards-compatibility link
    remains for the old name.

For a detailed list of changes, see share/zoneinfo/NEWS.

3 years agodrm/linux/tasklets: queue new requests after existing ones
François Tigeot [Wed, 13 May 2020 09:16:19 +0000 (11:16 +0200)]
drm/linux/tasklets: queue new requests after existing ones

* The i915 driver expects its requests to be processed in the same
  order they were submitted

* Insert new tasklets at the tail of regular and high priority lists

3 years agorelease: Mount tmpfs at /usr/local/etc only if exists for ISO
Aaron LI [Tue, 12 May 2020 14:38:34 +0000 (22:38 +0800)]
release: Mount tmpfs at /usr/local/etc only if exists for ISO

For an ISO release built with the 'nopkgs' option, it doesn't have the
'/usr/local/etc' directory.  Thus the boot process would fail because it
cannot mount tmpfs at the non-existent directory '/usr/local/etc'.

Fix this issue by checking the existence of '/usr/local/etc' before
appending the corresponding entry to the ISO's fstab.

3 years agonrelease/Makefile: Fix 'pkg_${PKG}' to 'PKG_${PKG}' in a message
Aaron LI [Tue, 12 May 2020 14:08:57 +0000 (22:08 +0800)]
nrelease/Makefile: Fix 'pkg_${PKG}' to 'PKG_${PKG}' in a message

3 years agoinstaller: Allow special characters in passwords
Aaron LI [Sun, 10 May 2020 02:53:20 +0000 (10:53 +0800)]
installer: Allow special characters in passwords

Store the password in an environment variable and pass it to the pw(8)
command.  This way of passing passwords allows special characters in the
password.  Actually, adduser(8) uses the same method to deal with the
password.  So this closes the old bug #3027.

In addition, this prevents the plaintext password from appearing on the
command line or in the installation log file.  Although the installer
will print every executed command to the install.log (located at
'/var/log/install.log' with mode 0600 though), the root password setting
and new user creation steps belong to the 'configuration' stage rather
than the 'installation', so currently the plaintext passwords won't go
to the install.log.

Credit to pikrzyszt (Krzysztof Piecuch) for submitting the initial patch
in bug #3027.

3 years agoinstaller/dfuibe_installer: Clean up fn_root_passwd()
Aaron LI [Fri, 8 May 2020 14:54:39 +0000 (22:54 +0800)]
installer/dfuibe_installer: Clean up fn_root_passwd()

Improve the logic of fn_root_passwd() by referring to fn_add_user().

3 years agonrelease/Makefile: Display help text when no target specified
Aaron LI [Sun, 10 May 2020 04:46:48 +0000 (12:46 +0800)]
nrelease/Makefile: Display help text when no target specified

Make the 'help' target the default, so that the help text is shown when
no target is specified.  Before this change, a bare 'make' would give
message: `gui' is up to date.

3 years agoadduser(8): Honor uidstart in adduser.conf when showing in the prompt
Aaron LI [Fri, 8 May 2020 05:52:19 +0000 (13:52 +0800)]
adduser(8): Honor uidstart in adduser.conf when showing in the prompt

When using 'uidstart' in /etc/adduser.conf, get the next available user
ID and show it in the 'Uid [xxx]' prompt.

Obtained-from: FreeBSD (revision 232146)

3 years agoadduser(8): Allow standard IFS characters in passwords
Aaron LI [Fri, 8 May 2020 05:40:32 +0000 (13:40 +0800)]
adduser(8): Allow standard IFS characters in passwords

Notably, the default IFS contains space/tab, thus any leading/trailing
whitespace characters tend to be removed.

Set IFS= for just the read lines to mitigate this, allowing the user to
be less surprised when their leading/trailing spaces weren't actually
captured in the password as they are with other means of setting a
user's password.

Obtained-from: FreeBSD (revision 359642)

3 years agofile(1): Re-add README.D{ELETED,RAGONFLY} on master.
Sascha Wildner [Mon, 11 May 2020 09:41:30 +0000 (11:41 +0200)]
file(1): Re-add README.D{ELETED,RAGONFLY} on 

3 years agoMerge branch 'vendor/FILE'
Sascha Wildner [Mon, 11 May 2020 09:35:46 +0000 (11:35 +0200)]
Merge branch 'vendor/FILE'

3 years agovendor/file: Small file mode fix.
Sascha Wildner [Mon, 11 May 2020 09:29:43 +0000 (11:29 +0200)]
vendor/file: Small file mode fix.

3 years agovendor/file: upgrade from 5.32 to 5.38
Sascha Wildner [Mon, 11 May 2020 09:16:45 +0000 (11:16 +0200)]
vendor/file: upgrade from 5.32 to 5.38

[I forgot to push the vendor branch previously.]

Submitted-by: Daniel Fojt <df@neosystem.org>
3 years agodaemon(8): Make daemon aware of log rotation
Peeter Must [Sun, 10 May 2020 08:49:05 +0000 (11:49 +0300)]
daemon(8): Make daemon aware of log rotation

* Make daemon listen to SIGUSR1 so that when newsyslog
  has finished log rotation, it can send SIGUSR1 to
  daemon, who can then reopen the log file specified by
  the '-o' option.

* Failure to open the log file will be logged through
  syslog with LOG_NOTICE. The next attempt to reopen
  the log file will be made upon receiving signal SIGUSR1.

Reviewed-by: swildner, tuxillo, dillon, aly
3 years agodrm/linux/tasklets: Factor out common code
François Tigeot [Fri, 8 May 2020 14:58:07 +0000 (16:58 +0200)]
drm/linux/tasklets: Factor out common code

Use a common macro for tasklet_schedule() and tasklet_hi_schedule()

3 years agofile(1): Adapt build to vendor update.
Daniel Fojt [Thu, 7 May 2020 11:37:20 +0000 (13:37 +0200)]
file(1): Adapt build to vendor update.

Add README.DRAGONFLY and README.DELETED on master.

3 years agoMerge branch 'vendor/FILE'
Sascha Wildner [Fri, 8 May 2020 11:34:35 +0000 (13:34 +0200)]
Merge branch 'vendor/FILE'

3 years agovendor/file: upgrade from 5.32 to 5.38
Sascha Wildner [Fri, 8 May 2020 11:33:55 +0000 (13:33 +0200)]
vendor/file: upgrade from 5.32 to 5.38

Submitted-by: Daniel Fojt <df@neosystem.org>
3 years agodrm/linux: Add tasklet enable and disable functions
François Tigeot [Thu, 7 May 2020 12:27:30 +0000 (14:27 +0200)]
drm/linux: Add tasklet enable and disable functions

Remove a debug message in passing

3 years agodrm/linux: Add xchg()
François Tigeot [Thu, 7 May 2020 08:38:27 +0000 (10:38 +0200)]
drm/linux: Add xchg()

3 years agoVOP_GETPAGES.9: Improve a tiny bit.
Sascha Wildner [Wed, 6 May 2020 14:48:53 +0000 (16:48 +0200)]
VOP_GETPAGES.9: Improve a tiny bit.

3 years agokernel/vm: Rename *_putpages()'s 'sync' argument to 'flags'.
Sascha Wildner [Tue, 5 May 2020 08:41:38 +0000 (10:41 +0200)]
kernel/vm: Rename *_putpages()'s 'sync' argument to 'flags'.

It used to be a boolean but has now become a general flags argument
(for OBJPC_*).

3 years agokernel/vm: Rename VM_PAGER_PUT_* to OBJPC_*.
Sascha Wildner [Tue, 5 May 2020 08:39:14 +0000 (10:39 +0200)]
kernel/vm: Rename VM_PAGER_PUT_* to OBJPC_*.

While here, rename the rest of the VM_PAGER_* flags too.

Suggested-by: dillon
3 years agokernel/vm_pager: Add some pagerops typedefs to improve readability.
Sascha Wildner [Mon, 4 May 2020 19:21:07 +0000 (21:21 +0200)]
kernel/vm_pager: Add some pagerops typedefs to improve readability.

I've left the swap pager alone for now because some of its ops are
global functions.

3 years agovendor/wpa_supplicant: upgrade from 2.1 to 2.9
Daniel Fojt [Tue, 21 Apr 2020 13:31:08 +0000 (15:31 +0200)]
vendor/wpa_supplicant: upgrade from 2.1 to 2.9

3 years agoSome little cleanup after the tcplay upgrade.
Sascha Wildner [Sat, 2 May 2020 06:51:34 +0000 (08:51 +0200)]
Some little cleanup after the tcplay upgrade.

* Remove old lib via 'make upgrade'. I don't think libtcplay is used
  by anything in dports.

* Remove two references to kpartx in libtcplay's manual page.

3 years agokernel/vinum: Fix panic when vinum was loaded twice.
Sascha Wildner [Fri, 1 May 2020 16:13:26 +0000 (18:13 +0200)]
kernel/vinum: Fix panic when vinum was loaded twice.

Occurred when it was both compiled into the kernel and in loader.conf
at the same time.

Reported-by: CuteLarva (on IRC)
3 years agodsynth - Automatically run at nice 10 by default
Matthew Dillon [Fri, 1 May 2020 01:56:30 +0000 (18:56 -0700)]
dsynth - Automatically run at nice 10 by default

* dsynth now automatically nices sub-processes to +10.  This is a
  good middle-of-the-road nice to ensure that dsynth does not interfere
  with other system tasks too much (beyond the massive amount of memory
  and cpu these builds burn normally).

  We don't want to nice it too high or the scheduler won't have enough
  room for its normal dynamic priority management.

* This feature may be disabled via -N.

3 years agoSync ACPICA with Intel's version 20200430.
Sascha Wildner [Thu, 30 Apr 2020 20:40:41 +0000 (22:40 +0200)]
Sync ACPICA with Intel's version 20200430.

* Various bug fixes and cleanups.

For detailed list, please see sys/contrib/dev/acpica/changes.txt.

3 years ago__realpath.2: Small mdoc correction.
Sascha Wildner [Thu, 30 Apr 2020 16:46:52 +0000 (18:46 +0200)]
__realpath.2: Small mdoc correction.

3 years agotest/debug: Remove duplicate #include <vm/vm_page.h>
Sascha Wildner [Thu, 30 Apr 2020 16:02:31 +0000 (18:02 +0200)]
test/debug: Remove duplicate #include <vm/vm_page.h>

3 years agotcplay.3: Add missing .Pp
Sascha Wildner [Thu, 30 Apr 2020 15:35:25 +0000 (17:35 +0200)]
tcplay.3: Add missing .Pp

3 years agoUpdate tcplay(8) manpage.
Daniel Fojt [Thu, 30 Apr 2020 04:42:46 +0000 (06:42 +0200)]
Update tcplay(8) manpage.

- bump date
- move '--fde' option to correct place in synopsis
- remove kpartx and Linux references
- use valid ciphers combination for volume creation example
- add missing '--device' option to several example commands
- adapt examples to Dragonfly context

3 years agoUpdate tcplay from 2.0 to 3.3
Daniel Fojt [Tue, 28 Apr 2020 11:50:53 +0000 (13:50 +0200)]
Update tcplay from 2.0 to 3.3

3 years agolibc - Fix a serious memory leak in the nmalloc code
Matthew Dillon [Thu, 30 Apr 2020 08:39:05 +0000 (01:39 -0700)]
libc - Fix a serious memory leak in the nmalloc code

* Fix a bug where mtmagazine_free() would assign mt->newmag without
  re-checking its contents, potentially overwriting an assignment
  made by _slaballoc(), causing a memory leak.

* This bug generally rears its ugly head in heavily pthreaded programs,
  but it can occur under other conditions too.

Reported-by: hsw (irc)
3 years agotmpfs - Fix bug in page-free bypass path
Matthew Dillon [Thu, 30 Apr 2020 03:05:13 +0000 (20:05 -0700)]
tmpfs - Fix bug in page-free bypass path

* tmpfs moves pages between two objects in order to allow data to
  be paged to swap.  Tmpfs makes an optimization to evict pages
  that are already backed by swap when reclaiming a vnode.

  Fix a bug in this code which can sometimes attempt to free a VM
  page which is still flagged PG_MAPPED, causing an assertion and
  panic.  The page is not mapped at this point in time but the meaning
  of the flag has changed somewhat and the flag can still be left
  set by the time the page gets to this bit of code.

3 years agocpdup(1): Drop old compatible code for other OSes
Aaron LI [Wed, 29 Apr 2020 13:52:20 +0000 (21:52 +0800)]
cpdup(1): Drop old compatible code for other OSes

The compatible code of cpdup(1) for Linux and other BSDs has been better
maintained in its standalone repository:
https://github.com/DragonFlyBSD/cpdup

So let's drop the old and unmaintained compatible code here.

3 years agorc.d: Add mounttmpfs to support tmpfs at /var/run and /tmp
Aaron LI [Wed, 29 Apr 2020 04:47:23 +0000 (12:47 +0800)]
rc.d: Add mounttmpfs to support tmpfs at /var/run and /tmp

We are already mounting a tmpfs at /var/run/shm to support shm_open()
etc functions.  However, this makes it harder for a user to make
/var/run on a tmpfs.  Actually, using a tmpfs for /var/run is a good
idea, though the deamons/system need to create necessary folders, and
Linux has adopted such a model for /run (symlink to /var/run) for years.

Introduce the 'mounttmpfs' rc script to support mounting tmpfs at
/var/run and /tmp, which is enabled by setting 'tmpfs_var_run=YES'
and 'tmpfs_tmp=YES' in /etc/rc.conf, respectively.  The default values
for these two new configurations are both 'NO'.

The new 'mounttmpfs' rc script is ordered *after* 'mountcritremote', so
that NFS-mounted /var is also properly handled, although I think
NFS-mounted /var is not a good idea and I don't know anyone really need
to do so.

Also move the tmpfs mounting at /var/run/shm from 'mountcritlocal' to
the new 'mounttmpfs' script.

Reviewed-by: tuxillo
3 years agosbin/fsck_msdosfs: Do not overflow when calculating file system size
Tomohiro Kusumi [Tue, 28 Apr 2020 18:10:08 +0000 (03:10 +0900)]
sbin/fsck_msdosfs: Do not overflow when calculating file system size

from freebsd/freebsd@2ccadef77b81e7f18dd6bc4380357d6c6a797c5a

3 years agoFix various grammatical issues in our messages, documentation etc. (2)
Sascha Wildner [Tue, 28 Apr 2020 16:24:50 +0000 (18:24 +0200)]
Fix various grammatical issues in our messages, documentation etc. (2)

3 years ago<sys/flame_graph.h>: Include <sys/types.h> for some used types.
Sascha Wildner [Tue, 28 Apr 2020 15:49:07 +0000 (17:49 +0200)]
<sys/flame_graph.h>: Include <sys/types.h> for some used types.

While here, add a copyright header.

3 years ago<sys/namecache.h>: Include <sys/lock.h> for nc_lock.
Sascha Wildner [Tue, 28 Apr 2020 15:48:31 +0000 (17:48 +0200)]
<sys/namecache.h>: Include <sys/lock.h> for nc_lock.

While here, remove <sys/thread.h> which is no longer needed.

3 years agolibc/setproctitle(): Add missing va_end()s in error paths.
Sascha Wildner [Sat, 25 Apr 2020 06:39:15 +0000 (08:39 +0200)]
libc/setproctitle(): Add missing va_end()s in error paths.

3 years agolibc/strcoll_l(): Remove bogus checks.
Sascha Wildner [Fri, 24 Apr 2020 18:41:38 +0000 (20:41 +0200)]
libc/strcoll_l(): Remove bogus checks.

t1 and t2 are guaranteed to be non-NULL at this point.

3 years ago<sys/sglist.h>: Adjust the type of struct sglist's sg_refs to unsigned.
Sascha Wildner [Fri, 24 Apr 2020 18:09:46 +0000 (20:09 +0200)]
<sys/sglist.h>: Adjust the type of struct sglist's sg_refs to unsigned.

To match the refcount API which is used under the hood.

3 years agoFix various grammatical issues in our messages, documentation etc.
Sascha Wildner [Tue, 28 Apr 2020 15:40:46 +0000 (17:40 +0200)]
Fix various grammatical issues in our messages, documentation etc.

3 years agoinet6: nd6_na_input() now considers ln_state <= ND6_LLINFO_INCOMPLETE
Roy Marples [Tue, 28 Apr 2020 11:46:59 +0000 (11:46 +0000)]
inet6: nd6_na_input() now considers ln_state <= ND6_LLINFO_INCOMPLETE

Otherwise if ln_state != ND6_LLINFO_INCOMPLETE and the is no lladdr
and this message was solicited then ln_state is set to ND6_LLINFO_REACHABLE
which then causes confusion elsewhere in the stack.
If ln_state > ND6_LLINFO_INCOMPLETE then it's assumed we have a lladdr.

Depending on the timing, it's technically possible to receive such
a message after the llentry is created with ND6_LLINFO_NOSTATE.

Taken from NetBSD.

3 years agosbin/fsck_msdosfs: Fix a bug with dirty file system handling
Tomohiro Kusumi [Mon, 27 Apr 2020 16:40:53 +0000 (01:40 +0900)]
sbin/fsck_msdosfs: Fix a bug with dirty file system handling

r356313 broke handling of dirty file system because we have restricted
the correction of "odd" byte sequences to checkfat(), and as a result
the dirty bit is never cleared.  The old fsck_msdosfs code would write
FAT twice to fix the dirty bit, which is also not ideal.

Fix this by introducing a new rountine, cleardirty() which will perform
the set of clean bit only, and use it in checkfilesys() if we thought
the file system was dirty.

https://svnweb.freebsd.org/base?view=revision&revision=356313

from freebsd/freebsd@ffa396196c4c0fcf8a6bf4d1dd88ffb9ce531ccc

3 years agoroute.4: Fix date
Aaron LI [Sat, 25 Apr 2020 10:50:19 +0000 (18:50 +0800)]
route.4: Fix date

Fix date for commit ced8848230553786e51dc0d08f17ccc302f556d1.

3 years agodrm/linux: Add for_each_clear_bit()
François Tigeot [Sat, 25 Apr 2020 09:58:12 +0000 (11:58 +0200)]
drm/linux: Add for_each_clear_bit()

Obtained-from: FreeBSD

3 years agodrm/linux: Add BIT_ULL() and GENMASK_ULL()
François Tigeot [Sat, 25 Apr 2020 08:06:36 +0000 (10:06 +0200)]
drm/linux: Add BIT_ULL() and GENMASK_ULL()

3 years agokernel - Detune memory slab allocator pcpu caching a little
Matthew Dillon [Fri, 24 Apr 2020 17:02:28 +0000 (10:02 -0700)]
kernel - Detune memory slab allocator pcpu caching a little

* The kernel tries to cache a lot of slab zones on a pcpu basis
  due to the high overhead of mapping and unmapping kernel memory.
  However, this can burn an excessive amount of physical memory on
  high-core-count cpus.

* Reduce the pcpu cache hysteresis on systems with more than 32 cpu
  threads.  So on a 128-thread TR with 256GB of ram, this reduces
  the slab cache from a ridiculous 30GB to a more reasonable 10GB.

3 years agosbin/fsck_hammer2: Refactor print_blockref_verbose()
Tomohiro Kusumi [Fri, 24 Apr 2020 15:12:05 +0000 (00:12 +0900)]
sbin/fsck_hammer2: Refactor print_blockref_verbose()

3 years agokernel - Remove CACHE_VREF: RACED debugging output
Matthew Dillon [Fri, 24 Apr 2020 04:19:06 +0000 (21:19 -0700)]
kernel - Remove CACHE_VREF: RACED debugging output

* Remove 'CACHE_VREF: RACED' debugging output after verifying
  that the race can occur and is properly handled.

3 years agohammer2 - Fix serious de-duplication bug and a few other things (2)
Matthew Dillon [Fri, 24 Apr 2020 01:06:03 +0000 (18:06 -0700)]
hammer2 - Fix serious de-duplication bug and a few other things (2)

* Remove debugging kprintf()

3 years agohammer2 - Fix serious de-duplication bug and a few other things
Matthew Dillon [Fri, 24 Apr 2020 00:38:10 +0000 (17:38 -0700)]
hammer2 - Fix serious de-duplication bug and a few other things

* Fix a serious de-duplication bug.  When small files <= 512
  bytes are extended with write()s to being larger than 512 bytes,
  it triggers a de-duplication bug in the first block of the file
  if that block can be de-duplicated from other sources.

  A mishandled skip condition combined with modest buffer cache
  flush loads can cause this first block can wind up getting
  zero'd out and cause a CHECK failure (I/O error) on the file.

  The fixes for this are primarily in hammer2_chain_modify().

* Replace HAMMER2_BREF_FLAG_ZERO in the bref.flags with
  HAMMER2_CHAIN_NOTTESTED in the chain structure and deprecate
  the flag.  This flag could sometimes accidentally be flushed
  to the media.

* Clear HAMMER2_CHAIN_INITIAL in two strategy write paths
  that are not typically hit.  The flag is probably already
  clear at this point since hammer2_chain_modify() has likely
  already been called, but be sure.

3 years agokernel - Fix excessive VM pageout flushes (2)
Matthew Dillon [Fri, 24 Apr 2020 00:37:10 +0000 (17:37 -0700)]
kernel - Fix excessive VM pageout flushes (2)

* Add a couple of missing page-rebusy tests in the vnode/putpages
  path for the pageout daemon.

3 years agobuild - Add a few things in test/debug
Matthew Dillon [Thu, 23 Apr 2020 06:15:47 +0000 (23:15 -0700)]
build - Add a few things in test/debug

* Add a few more kernel probing utilities.

3 years agosbin/fsck_hammer2: Support regular file
Tomohiro Kusumi [Thu, 23 Apr 2020 18:27:40 +0000 (03:27 +0900)]
sbin/fsck_hammer2: Support regular file

3 years agosbin/fsck_hammer2: Adjust indentations for error messages
Tomohiro Kusumi [Thu, 23 Apr 2020 17:34:05 +0000 (02:34 +0900)]
sbin/fsck_hammer2: Adjust indentations for error messages

3 years agodsynth - Revert PkgDepMemoryTarget default
Matthew Dillon [Thu, 23 Apr 2020 02:41:04 +0000 (19:41 -0700)]
dsynth - Revert PkgDepMemoryTarget default

* The issues observed were actually not the fault of dsynth, but
  instead due to paging behavior by the kernel.  Changing this value
  did not actually fix anything, but fixes to the kernel did.

  Revert the calculation back to divide-by-3.

3 years agokernel - Fix excessive VM pageout flushes
Matthew Dillon [Thu, 23 Apr 2020 02:39:37 +0000 (19:39 -0700)]
kernel - Fix excessive VM pageout flushes

* The VM pageout code was calculating the laundering limit improperly.
  We were trying to calculate a per-pass limit within each queue list
  but were not taking into account the fact that the number of queues
  have greatly increased in the last few years AND also that the paging
  scans only check 1/10 of each queue for each scan.

  These fixes allow the pageout scan to pick-up many more clean pages
  before beginning to stall-out on dirty pages.

* vm_max_launder is now calculated as 1/256 of physical memory at startup
  instead of hardwired.

* local max_launder calculations now take into account the number of
  queues and the fact that only 1/10 of each queue is checked in each
  pass.

  In addition, the local max_launder calculation is increased by the
  pass number divided by 10 so as to only increase for each full queue
  scan.

* the 'pass' variable passed down into helper functions is now divided
  by 10 because we do not want it to 'increment' and trigger stronger
  behavior until after the entire inactive queue has been scanned.