dragonfly.git
7 years agoPatch ssh vendor code for xauth's default location.
Peter Avalos [Sat, 13 Aug 2016 21:54:53 +0000 (14:54 -0700)]
Patch ssh vendor code for xauth's default location.

This puts the change in one obvious place instead of scattering it
around different Makefiles and makes documention correct.

7 years agosshd(8): Disable tunneled cleartext passwords.
Peter Avalos [Sat, 13 Aug 2016 20:49:59 +0000 (13:49 -0700)]
sshd(8): Disable tunneled cleartext passwords.

This was previously our default that got wiped away when I removed our
local changes to OpenSSH. It's unlikely that anyone running master saw
any change to their sshd behavior, because they likely had the
PasswordAuthentication line uncommented in their configuration file.

7 years ago<sys/errno.h>: Use __BSD_VISIBLE instead of !_POSIX_SOURCE.
Sascha Wildner [Sat, 13 Aug 2016 19:24:19 +0000 (21:24 +0200)]
<sys/errno.h>: Use __BSD_VISIBLE instead of !_POSIX_SOURCE.

_POSIX_SOURCE is no longer set since it was superseded by
_POSIX_C_SOURCE. In other words, #ifndef _POSIX_SOURCE is
always true, unless IEEE Std 1003.1-1988 is explicitly
requested.

While here, clean up the visibility of all errno defines.
Those not mentioned in any standard are __BSD_VISIBLE now.
We can further restrict the standard ones at some later
point.

7 years ago<sys/errno.h>: Adjust whitespace (no functional change).
Sascha Wildner [Sat, 13 Aug 2016 19:23:54 +0000 (21:23 +0200)]
<sys/errno.h>: Adjust whitespace (no functional change).

7 years agosbin/hammer: Don't include libhammer.h unconditionally
Tomohiro Kusumi [Fri, 12 Aug 2016 13:29:10 +0000 (22:29 +0900)]
sbin/hammer: Don't include libhammer.h unconditionally

Though /sbin/hammer links to libhammer, only two commands use it.

Move SNAPSHOTS_BASE from cmd_cleanup.c to hammer.h.
This macro is defined in both sbin/hammer and libhammer.
It apparently doesn't need to ask an external library for snapshot location.

 # grep libhammer sbin/hammer sbin/newfs_hammer -rIl
 sbin/hammer/cmd_info.c
 sbin/hammer/cmd_snapshot.c
 sbin/hammer/hammer.h

7 years agosbin/hammer: Rewrite hammer bstats/iostats
Tomohiro Kusumi [Fri, 12 Aug 2016 12:44:38 +0000 (21:44 +0900)]
sbin/hammer: Rewrite hammer bstats/iostats

- Detach from libhammer.
- Add sysctls that were missing in libhammer.
- It's simply better and clearer without an external library wrappers
  for hammer command itself to just read hammer sysctls.

7 years agosys/boot: Unbreak WORLD_CCVER=gcc47
zrj [Tue, 9 Aug 2016 14:29:49 +0000 (17:29 +0300)]
sys/boot: Unbreak WORLD_CCVER=gcc47

Fix -Ox flags mess that exploded boot2_32 image size, by ensuring
that intended -Ox flags were used were needed (gcc50 unaffected).

There is still compilation issue for buildkernel w/ gcc47 but that
-Werror=maybe-uninitialized on i915_gem_stolen.c can wait a bit.

7 years agosys.mk: Introduce WORLD_CFLAGS.
zrj [Mon, 8 Aug 2016 15:03:26 +0000 (18:03 +0300)]
sys.mk: Introduce WORLD_CFLAGS.

Main purpose of this flag is to provide user a way to safely add extra
compiler flags to the build system without accidentally removing things
like -pipe or -Ox flags. Also it will help to ensure that none of user
set world flags will propagate to dports compilation to cause ruckus.
CFLAGS is still available as before provided it will be handled with care.

While there, adjust make.conf(5) to promote WORLD_CFLAGS usage instead of
manipulating CFLAGS directly. Also fix typo, ld.gold is default.

7 years agosys.mk: Introduce WORLD_CCOPTLEVEL.
zrj [Tue, 9 Aug 2016 12:38:28 +0000 (15:38 +0300)]
sys.mk: Introduce WORLD_CCOPTLEVEL.

After checking out what other compilers than gcc do decided to cave in
and leave 3 recently added NO_* knobs (yep, there are worse compilers).
Not to make matters worse and continue with the work, now pushing just
infrastructure bits for further testing.

WORLD_CCOPTLEVEL controls the optimization level for used -Ox
compiler flag. For now make it default to previous -O.
Also make initial separation between kernel and userland.

Optimization level can be selected globally from /etc/make.conf like:
WORLD_CCOPTLEVEL=2 # valid values are 0,1,2,3,s,g,fast

Use of -O3 and -Ofast is strongly discouraged.

7 years agobsd.sys.mk: Make build permissive for pre gcc 5 compilers.
zrj [Tue, 9 Aug 2016 11:42:58 +0000 (14:42 +0300)]
bsd.sys.mk: Make build permissive for pre gcc 5 compilers.

GCC 4.7 4.8 4.9 are known to have certain bugs, so instead of
forcing developers to use NO_WERROR=yes it is better to allow
certain diagnostics to happen, than cripple the primary gcc50.

7 years agoxz: Don't use SSE headers for gcc < 5.
zrj [Tue, 9 Aug 2016 10:51:17 +0000 (13:51 +0300)]
xz: Don't use SSE headers for gcc < 5.

liblzma was configured against gcc50 private SSE headers.
Avoid using SSE features for pre gcc5.
Mainly to unbreak WORLD_CCVER=gcc47.

7 years agostrcoll(3): Make source compatible to more compilers.
zrj [Tue, 9 Aug 2016 10:41:35 +0000 (13:41 +0300)]
strcoll(3): Make source compatible to more compilers.

Mainly to unbreak the WORLD_CCVER=gcc47 for now.
While there, fix a typo.

7 years agoTRE: Fix const discard issue for all compilers.
zrj [Tue, 9 Aug 2016 10:30:28 +0000 (13:30 +0300)]
TRE: Fix const discard issue for all compilers.

Mainly to unbreak WORLD_CCVER=gcc47 and avoid use of #pragma diagnostic.

7 years agosbin/hammer: Cleanup sbin/hammer/hammer_util.h
Tomohiro Kusumi [Thu, 11 Aug 2016 10:55:46 +0000 (19:55 +0900)]
sbin/hammer: Cleanup sbin/hammer/hammer_util.h

Move externs for global variables from hammer_util.h to hammer.h.
These are either only accessible via /sbin/hammer getopt options,
or only locally used by /sbin/hammer commands.

7 years agosbin/newfs_hammer: Add -d option from hammer(8)
Tomohiro Kusumi [Thu, 11 Aug 2016 10:55:07 +0000 (19:55 +0900)]
sbin/newfs_hammer: Add -d option from hammer(8)

Let /sbin/newfs_hammer access debug tunable which is accessible
via the same -d option in /sbin/hammer.

The real problem here is that /sbin/newfs_hammer and /sbin/hammer
are having their own getopt call, while these two share the basic
volume/buffer structure that manages ondisk filesystem metadata,
and some options that have something to do with volume/buffer
structure are available only in /sbin/hammer.

This option isn't mentioned in newfs_hammer(8) because hammer(8)
doesn't either. There are only a few places that actually use
this debug flag, so no real users use this and no one cares.

7 years agosbin/newfs_hammer: Link against sbin/hammer/misc.o
Tomohiro Kusumi [Thu, 11 Aug 2016 07:44:39 +0000 (16:44 +0900)]
sbin/newfs_hammer: Link against sbin/hammer/misc.o

Make /sbin/newfs_hammer link to sbin/hammer/misc.o, and use
sizetostr() via sbin/hammer/misc.o instead of having its own one,
by moving sbin/hammer/misc.c prototypes to hammer_util.h.

It's okay to do this because /sbin/newfs_hammer fully depends on
data structures of sbin/hammer/*. It's just better to make use of
sbin/hammer/misc.o except that the binary becomes a bit larger.

The difference between hammer.h and hammer_util.h is that hammer.h
is specific to /sbin/hammer. hammer_util.h seems to have been made
for more general stuff that could be used by other programs like
/sbin/hammer (but not outbox programs as the header isn't exposed
to outside the dfly source).

7 years agosbin/hammer: Move score_printf()/hammer_check_restrict() to cmd_mirror.c
Tomohiro Kusumi [Thu, 11 Aug 2016 07:37:46 +0000 (16:37 +0900)]
sbin/hammer: Move score_printf()/hammer_check_restrict() to cmd_mirror.c

Make sbin/hammer/misc.c independent of /sbin/hammer's global variables
(used by two functions score_printf()/hammer_check_restrict()) that
aren't accessible from other programs such as /sbin/newfs_hammer
which already links to some of sbin/hammer/*.o's.

/sbin/newfs_hammer could make use of misc.o, but globals have been
preventing from linking against sbin/hammer/misc.o. If these are
to be used by other hammer commands, they need to be reimplemented
without dependencies.

7 years agosbin/hammer: Increment recovery scan offset regardless of get_buffer() result
Tomohiro Kusumi [Thu, 11 Aug 2016 05:53:37 +0000 (14:53 +0900)]
sbin/hammer: Increment recovery scan offset regardless of get_buffer() result

otherwise the loop may become an infinite loop though that's not
likely to actually happen in this case.

7 years agosbin/hammer: Add debug prints while scanning node during recovery
Tomohiro Kusumi [Tue, 9 Aug 2016 17:21:11 +0000 (02:21 +0900)]
sbin/hammer: Add debug prints while scanning node during recovery

Prints "zone2offset nodetype elmnum elmtypes" with -d.
Prints "zone2offset -" for invalid offsets in addition to above with -dd.

-- example
...
20000000207fd000 -
20000000207fe000 -
20000000207ff000 -
2000000020800000 L 2 RR
mkinode (dir) /tmp/xxxxx/PFS00000
2000000020801000 I 52 LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
2000000020802000 L 32 RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
mkdir /tmp/xxxxx/PFS00000/obj_0x0000000100010590
...

7 years agosbin/hammer: Use HAMMER_BTREE_TYPE_RECORD
Tomohiro Kusumi [Tue, 9 Aug 2016 17:24:32 +0000 (02:24 +0900)]
sbin/hammer: Use HAMMER_BTREE_TYPE_RECORD

7 years agoppp(8): Remove useless _POSIX_SOURCE checks (no functional change).
Sascha Wildner [Wed, 10 Aug 2016 17:43:52 +0000 (19:43 +0200)]
ppp(8): Remove useless _POSIX_SOURCE checks (no functional change).

7 years agotcsetattr.3: Adjust for recent termios.h changes.
Sascha Wildner [Wed, 10 Aug 2016 16:51:28 +0000 (18:51 +0200)]
tcsetattr.3: Adjust for recent termios.h changes.

7 years agokernel - Add workaround for improper yield in ACPI path
Matthew Dillon [Mon, 8 Aug 2016 17:46:35 +0000 (10:46 -0700)]
kernel - Add workaround for improper yield in ACPI path

* For now add a workaround for an improper yield that can occur indirectly
  via the ACPI path.  The problem is that the ACPI contrib code can hold
  a spinlock across a kmalloc() call.

* The ACPI code, in particular AcpiOsAcquireLock(), uses a spin lock.  At
  the same time it MUST use a spinlock because it might be called from
  the idle thread.  But it also appears that the code might call kmalloc()
  while holding a spinlock.

  The kmalloc path ACPI calls is with M_INTWAIT, which reduces the chance
  that kmalloc might try to block.  However, kmalloc is used to execute
  staged kfrees which can create a sequence:

  kmalloc -> kmem_slab_free -> (vm system) ->
  vm_object_page_remove_callback -> lwkt_user_yield().

7 years ago<sys/termios.h>: Clean up the namespace.
Sascha Wildner [Mon, 8 Aug 2016 17:35:33 +0000 (19:35 +0200)]
<sys/termios.h>: Clean up the namespace.

7 years ago<sys/termios.h>: Adjust whitespace (no functional change).
Sascha Wildner [Mon, 8 Aug 2016 17:35:01 +0000 (19:35 +0200)]
<sys/termios.h>: Adjust whitespace (no functional change).

7 years agomake upgrade: Remove one more file I forgot in 859c2e538.
Sascha Wildner [Mon, 8 Aug 2016 06:15:59 +0000 (08:15 +0200)]
make upgrade: Remove one more file I forgot in 859c2e538.

7 years agogold: Fix CFLAGS override.
zrj [Mon, 8 Aug 2016 04:40:29 +0000 (07:40 +0300)]
gold: Fix CFLAGS override.

This was not intended.

In-discussion-with: marino

7 years agokernel - Remove some debug output
Matthew Dillon [Mon, 8 Aug 2016 02:44:33 +0000 (19:44 -0700)]
kernel - Remove some debug output

* Remove "Warning: cache_resolve: ncp '%s' was unlinked" debug output.
  This was originally added to validate a particular code path and is
  no longer needed.

7 years agoi386 removal, part 57/x: Remove two i386 leftovers.
Sascha Wildner [Sun, 7 Aug 2016 17:49:40 +0000 (19:49 +0200)]
i386 removal, part 57/x: Remove two i386 leftovers.

7 years agokernel: Remove useless I586_PMC_GUPROF option.
Sascha Wildner [Sun, 7 Aug 2016 16:31:12 +0000 (18:31 +0200)]
kernel: Remove useless I586_PMC_GUPROF option.

7 years agoi386 removal, part 56/x: Remove old i386 specific manual pages.
Sascha Wildner [Sun, 7 Aug 2016 16:21:00 +0000 (18:21 +0200)]
i386 removal, part 56/x: Remove old i386 specific manual pages.

Shuffle a number of them to share/man/man4 because they didn't seem to
be i386 specific for one reason or another.

7 years agokernel: Remove the old vx(4) network driver.
Sascha Wildner [Sun, 7 Aug 2016 16:17:51 +0000 (18:17 +0200)]
kernel: Remove the old vx(4) network driver.

Aside from being quite obsolete, its documentation always was in the
i386 so i have my doubts that it still works.

If anyone needs it back for some reason I can't imagine currently,
we can take another look then.

7 years agoi386 removal, part 55/x: Remove if_sbni(4) remains.
Sascha Wildner [Sun, 7 Aug 2016 15:37:56 +0000 (17:37 +0200)]
i386 removal, part 55/x: Remove if_sbni(4) remains.

7 years agoi386 removal, part 54/x: Remove perfmon(4) remains.
Sascha Wildner [Sun, 7 Aug 2016 15:26:26 +0000 (17:26 +0200)]
i386 removal, part 54/x: Remove perfmon(4) remains.

It only ever was compilable into i386 kernels. I forgot to remove it
too in f4c88b0b86f1810db0482795bc097597d1197c54.

7 years agoi386 removal, part 53/x: Remove the code of the fe(4) driver too.
Sascha Wildner [Sun, 7 Aug 2016 14:22:04 +0000 (16:22 +0200)]
i386 removal, part 53/x: Remove the code of the fe(4) driver too.

It only ever was compilable into i386 kernels. I forgot to remove it
too in f4c88b0b86f1810db0482795bc097597d1197c54.

7 years agokernel: Remove the old ep(4) and ex(4) network drivers.
Sascha Wildner [Sun, 7 Aug 2016 14:08:27 +0000 (16:08 +0200)]
kernel: Remove the old ep(4) and ex(4) network drivers.

Aside from being quite obsolete, their documentation always was in the
i386 so i have my doubts that they still work.

If anyone needs them back for some reason I can't imagine currently,
we can take another look then.

7 years agoi386 removal, part 52/x: Remove the old cs(4) network driver.
Sascha Wildner [Sun, 7 Aug 2016 13:09:47 +0000 (15:09 +0200)]
i386 removal, part 52/x: Remove the old cs(4) network driver.

Looks like it was i386 specific and ended up in our x86_64 configs by
mistake. At least its manpage was in the i386 section and FreeBSD does
not have it in amd64's NOTES either.

7 years agoClean up some more after the sys/emulation/linux removal.
Sascha Wildner [Sun, 7 Aug 2016 12:49:22 +0000 (14:49 +0200)]
Clean up some more after the sys/emulation/linux removal.

7 years agosbin/hammer: Abort if failed to creat recover target dir
Tomohiro Kusumi [Sun, 7 Aug 2016 11:28:44 +0000 (20:28 +0900)]
sbin/hammer: Abort if failed to creat recover target dir

7 years agosbin/hammer: Add verbose volume message while recovering
Tomohiro Kusumi [Sun, 7 Aug 2016 08:59:07 +0000 (17:59 +0900)]
sbin/hammer: Add verbose volume message while recovering

sizetostr() is brought from newfs_hammer code.

newfs_hammer should use sizetostr() by linking sbin/hammer/misc.o,
as it already has dependencies on other sbin/hammer/*.o.
(Also note that hammer2 also has sizetostr() in both directories)

7 years ago<time.h>: Adjust the visibility of CLOCK_REALTIME and TIMER_ABSTIME.
Sascha Wildner [Sun, 7 Aug 2016 09:29:13 +0000 (11:29 +0200)]
<time.h>: Adjust the visibility of CLOCK_REALTIME and TIMER_ABSTIME.

Looks like they came in with IEEE Std 1003.1b-1993.

Helps building math/clblas with GCC.

Reported-by: zrj
7 years agoboot - Force -O
Matthew Dillon [Sun, 7 Aug 2016 08:34:54 +0000 (01:34 -0700)]
boot - Force -O

* Always force -O for the boot code.  -O2 will implode it.  This is a bit
  weird but -O will override any prior -O2.  We still want other CFLAGS
  that mk scripts supply so we can't just set CFLAGS=

7 years agotcsh - Work around gcc-5 bug
Matthew Dillon [Sun, 7 Aug 2016 08:04:48 +0000 (01:04 -0700)]
tcsh - Work around gcc-5 bug

* GCC-5 improperly tries to optimize tcsh's calloc() replacement into a
  tail-jmp to tcsh's calloc.  It tries to optimize the malloc+memset
  sequence into calloc, inside calloc itself.

  This is really a bug in GCC-5 but work around it for now by hacking
  tcsh's calloc().

7 years agobuild - prepare for higher optimization levels (2)
Matthew Dillon [Sun, 7 Aug 2016 07:21:55 +0000 (00:21 -0700)]
build - prepare for higher optimization levels (2)

* A couple more programs need Makefile mods.

7 years agobuild - Add support for new NO_* make variables
Matthew Dillon [Sun, 7 Aug 2016 07:07:29 +0000 (00:07 -0700)]
build - Add support for new NO_* make variables

* Add support for NO_STRICT_ALIASING, NO_STRICT_OVERFLOW,
  and NO_WARRAY_BOUNDS.

7 years agobuild - prepare for higher optimization levels
Matthew Dillon [Sun, 7 Aug 2016 07:04:51 +0000 (00:04 -0700)]
build - prepare for higher optimization levels

* Add NO_STRICT_ALIASING, NO_STRICT_OVERFLOW, and NO_WARRAY_BOUNDS
  make variables as-needed.

7 years agokernel - Fix minor bug in powermng
Matthew Dillon [Sun, 7 Aug 2016 07:00:30 +0000 (00:00 -0700)]
kernel - Fix minor bug in powermng

* Fix a minor array overflow (incorrect index used) bug in powermng.

7 years agokernel - Cleanup gcc warnings
Matthew Dillon [Sun, 7 Aug 2016 04:02:46 +0000 (21:02 -0700)]
kernel - Cleanup gcc warnings

* Cleanup gcc warnings at higher optimization levels.  This will allow
  us to build kernels -O2 or -O3.

7 years agolibc/strptime: Handle ISO 8601 time zone formats in %z.
zrj [Wed, 27 Jul 2016 16:17:54 +0000 (19:17 +0300)]
libc/strptime: Handle ISO 8601 time zone formats in %z.

Formats of +hh:mm +hh Z are now also accepted to previous +hhmm.

7 years agolibc/strptime: Fix "%Y %W %w %H:%M:%S".
zrj [Tue, 26 Jul 2016 12:29:59 +0000 (15:29 +0300)]
libc/strptime: Fix "%Y %W %w %H:%M:%S".

Also throw in the fix for "12:34:56 2016 30 0", "%H:%M:%S %Y %W %w".
Correct partial format reads are still not supported.

7 years agostrptime.3: Sync with FreeBSD.
zrj [Tue, 26 Jul 2016 13:48:35 +0000 (16:48 +0300)]
strptime.3: Sync with FreeBSD.

7 years agolibc/strptime: Attempt to fix up %U and %W.
zrj [Tue, 26 Jul 2016 12:14:49 +0000 (15:14 +0300)]
libc/strptime: Attempt to fix up %U and %W.

Thera are still few issues left.

Taken-from: FreeBSD

7 years agolibc/strptime: Add support for %t and %n per POSIX.
zrj [Tue, 26 Jul 2016 10:05:36 +0000 (13:05 +0300)]
libc/strptime: Add support for %t and %n per POSIX.

Only skip space for %e and fail on unknown specifiers.
Also remove magic year 1900 constants.

Taken-from: FreeBSD

7 years agolibc/strptime: Check for NULL, not 0.
zrj [Tue, 26 Jul 2016 06:59:42 +0000 (09:59 +0300)]
libc/strptime: Check for NULL, not 0.

Also add check for gmtime_r() result.

While there, perform license change as per FreeBSD r267544

7 years agokernel - Fix memcpy assembly ABI
Matthew Dillon [Sun, 7 Aug 2016 04:25:26 +0000 (21:25 -0700)]
kernel - Fix memcpy assembly ABI

* memcpy must return the original (dst) argument, and wasn't for the kernel.
  Nothing used it explicitly, but gcc sometimes decides to call memcpy and
  assumes the correct return value.  It was just luck that it hasn't up until
  now.

7 years agolibc - Include information on the 'e' flag in the popen() manual page.
Matthew Dillon [Sat, 6 Aug 2016 18:05:10 +0000 (11:05 -0700)]
libc - Include information on the 'e' flag in the popen() manual page.

* Include information on the 'e' flag in the popen() manual page.

7 years agokernel, world - Remove the remaining vestiges of linux emul
Matthew Dillon [Sat, 6 Aug 2016 17:53:59 +0000 (10:53 -0700)]
kernel, world - Remove the remaining vestiges of linux emul

* Remove the remaining bits of the 32-bit linux emulation code.  This
  code hasn't been used in ages and we have no plans to implement a
  64-bit linux emulation.

7 years agosbin/hammer: Directly access volume in volume list
Tomohiro Kusumi [Sat, 6 Aug 2016 12:08:15 +0000 (21:08 +0900)]
sbin/hammer: Directly access volume in volume list

This is what ondisk code does.
No reference/etc to acquire via get_volume().

7 years agosys/vfs/hammer: Add HAMMER_VOL_BUF_SIZE()
Tomohiro Kusumi [Sat, 6 Aug 2016 09:58:58 +0000 (18:58 +0900)]
sys/vfs/hammer: Add HAMMER_VOL_BUF_SIZE()

7 years agosbin/hammer: Remove rel_volume()
Tomohiro Kusumi [Sat, 6 Aug 2016 08:54:29 +0000 (17:54 +0900)]
sbin/hammer: Remove rel_volume()

It does nothing after da519351 which got rid of unnecessary
volume-modified flag.

volume_info list never gets cleaned up once it's added, so
release isn't necessary, unlike buffers (incl volume buffer)
that need to be managed.

7 years agokernel - Fix kern.proc.pathname sysctl
Matthew Dillon [Fri, 5 Aug 2016 20:12:08 +0000 (13:12 -0700)]
kernel - Fix kern.proc.pathname sysctl

* kern.proc.pathname is a sysctl used by programs to find the path
  of the running program.  This sysctl was created before we stored
  sufficient information in the proc structure to construct the
  correct path when multiple aliases are present (due to e.g. null-mounts)
  to the same file.

* We do have this information, in p->p_textnch, so change the sysctl to
  use it.  The sysctl will now return the actual full path in the context
  of whomever ran the program, so it should properly take into account
  chroots and such.

7 years agoUse ; instead of , where appropriate.
Sascha Wildner [Fri, 5 Aug 2016 08:33:54 +0000 (10:33 +0200)]
Use ; instead of , where appropriate.

Also add the coccinelle patch which found this to test/cocci (taken from
https://github.com/coccinelle/coccinellery/blob/master/comma/comma.cocci).

7 years agodma - Fix security hole
Matthew Dillon [Fri, 5 Aug 2016 07:18:07 +0000 (00:18 -0700)]
dma - Fix security hole

* dma makes an age-old mistake of not properly checking whether a file
  owned by a user is a symlink or not, a bug which the original mail.local
  also had.

* Add O_NOFOLLOW to disallow symlinks.

Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked
   about the mail.local bug.

7 years agobsd-family-tree: Sync with FreeBSD (DragonFly 4.6.0).
Sascha Wildner [Fri, 5 Aug 2016 07:07:57 +0000 (09:07 +0200)]
bsd-family-tree: Sync with FreeBSD (DragonFly 4.6.0).

7 years agoMerge branch 'vendor/OPENSSH'
Peter Avalos [Thu, 4 Aug 2016 10:29:55 +0000 (03:29 -0700)]
Merge branch 'vendor/OPENSSH'

7 years agoAdd a openbsd-compat file for latest import.
Peter Avalos [Thu, 4 Aug 2016 10:28:43 +0000 (03:28 -0700)]
Add a openbsd-compat file for latest import.

7 years agoUpdate files for OpenSSH-7.3p1 import.
Peter Avalos [Thu, 4 Aug 2016 10:27:08 +0000 (03:27 -0700)]
Update files for OpenSSH-7.3p1 import.

7 years agoMerge branch 'vendor/OPENSSH'
Peter Avalos [Thu, 4 Aug 2016 08:15:20 +0000 (01:15 -0700)]
Merge branch 'vendor/OPENSSH'

7 years agoImport OpenSSH-7.3p1.
Peter Avalos [Thu, 4 Aug 2016 06:09:16 +0000 (23:09 -0700)]
Import OpenSSH-7.3p1.

7 years agoRemove most local modifications from OpenSSH.
Peter Avalos [Thu, 4 Aug 2016 01:25:04 +0000 (18:25 -0700)]
Remove most local modifications from OpenSSH.

This primarily removes the HPN patches. It's become too cumbersome to
maintain these patches as demonstrated by the fact that we haven't
updated OpenSSH in quite some time. If people want additional
functionality in their OpenSSH, it's available in dports
(security/openssh).

Instead of just silently ignoring removed options in people's
configurations, I decided to treat these as errors so that the admin
will need to decide to remove it from their configuration or install the
dport to get the functionality back.

7 years agomake upgrade: Remove no longer existing manpages after the OpenSSL upgrade.
Sascha Wildner [Thu, 4 Aug 2016 06:53:34 +0000 (08:53 +0200)]
make upgrade: Remove no longer existing manpages after the OpenSSL upgrade.

7 years agostrftime.3: Remove extra whitespace.
Sascha Wildner [Thu, 4 Aug 2016 06:53:21 +0000 (08:53 +0200)]
strftime.3: Remove extra whitespace.

7 years agokernel - Fix lwp_fork/exit race (2) (vkernel)
Matthew Dillon [Thu, 4 Aug 2016 02:38:11 +0000 (19:38 -0700)]
kernel - Fix lwp_fork/exit race (2) (vkernel)

* Fix same race as before, in vkernel also.

7 years agolibcrypto(3): Set CC variable for Perl scripts.
Peter Avalos [Wed, 3 Aug 2016 20:22:16 +0000 (13:22 -0700)]
libcrypto(3): Set CC variable for Perl scripts.

This detects assembler/compiler capabilities.

Obtained-from:   FreeBSD

7 years agodrm/linux: kernel_ulong_t is defined in linux/mod_devicetable.h
François Tigeot [Wed, 3 Aug 2016 19:35:34 +0000 (21:35 +0200)]
drm/linux: kernel_ulong_t is defined in linux/mod_devicetable.h

7 years agoFix typo.
Peter Avalos [Wed, 3 Aug 2016 19:16:05 +0000 (12:16 -0700)]
Fix typo.

7 years agolibcrypto(3): Remove some cruft from when we supported 32-bit.
Peter Avalos [Wed, 3 Aug 2016 19:11:29 +0000 (12:11 -0700)]
libcrypto(3): Remove some cruft from when we supported 32-bit.

7 years agoAdd IDEA support for libcrypto(3).
Peter Avalos [Wed, 3 Aug 2016 19:05:00 +0000 (12:05 -0700)]
Add IDEA support for libcrypto(3).

The patent expired years ago.

7 years agovkernel: Add a simple pagezero() macro (unbreaks build).
Sascha Wildner [Wed, 3 Aug 2016 18:09:42 +0000 (20:09 +0200)]
vkernel: Add a simple pagezero() macro (unbreaks build).

7 years agoUpdate files for OpenSSL-1.0.2h import.
Peter Avalos [Wed, 3 Aug 2016 09:52:16 +0000 (02:52 -0700)]
Update files for OpenSSL-1.0.2h import.

Make the jump to 1.0.2, because support for 1.0.1 ends at the end of
this year.

7 years agoMerge branch 'vendor/OPENSSL'
Peter Avalos [Wed, 3 Aug 2016 08:18:34 +0000 (01:18 -0700)]
Merge branch 'vendor/OPENSSL'

7 years agoImport OpenSSL-1.0.2h. vendor/OPENSSL
Peter Avalos [Wed, 3 Aug 2016 08:02:32 +0000 (01:02 -0700)]
Import OpenSSL-1.0.2h.

7 years agokernel - Fix lwp_fork/exit race
Matthew Dillon [Wed, 3 Aug 2016 05:28:54 +0000 (22:28 -0700)]
kernel - Fix lwp_fork/exit race

* In a multi-threaded program it is possible for the exit sequence to
  deadlock if one thread is trying to exit (exit the entire process)
  while another thread is simultaniously creating a new thread.

* Fix the issue by having the new thread checking for the exit condition and
  sending a SIGKILL to itself.  And kprintf() a message when it happens.

7 years agolibrt/aio: #ifndef notyet -> #if 0 /* not yet */
Sascha Wildner [Wed, 3 Aug 2016 03:39:50 +0000 (05:39 +0200)]
librt/aio: #ifndef notyet -> #if 0 /* not yet */

7 years agoAdjust a couple of manual pages to the recent header changes.
Sascha Wildner [Wed, 3 Aug 2016 02:59:16 +0000 (04:59 +0200)]
Adjust a couple of manual pages to the recent header changes.

7 years ago<sys/types.h>: Use __BSD_VISIBLE instead of !_POSIX_SOURCE.
Sascha Wildner [Wed, 3 Aug 2016 02:48:08 +0000 (04:48 +0200)]
<sys/types.h>: Use __BSD_VISIBLE instead of !_POSIX_SOURCE.

7 years ago<sys/stat.h>: Clean up the POSIX namespace.
Sascha Wildner [Wed, 3 Aug 2016 02:47:13 +0000 (04:47 +0200)]
<sys/stat.h>: Clean up the POSIX namespace.

* Use __BSD_VISIBLE instead of !_POSIX_SOURCE.

* Reduce visibility of some BSD specific stuff.

* Expand visibility of fchmod() and lstat().

7 years ago<sys/aio.h>: Remove unneeded includes (cleans up namespace).
Sascha Wildner [Wed, 3 Aug 2016 02:46:23 +0000 (04:46 +0200)]
<sys/aio.h>: Remove unneeded includes (cleans up namespace).

7 years ago<sys/ipc.h>: Some POSIX adjustments.
Sascha Wildner [Wed, 3 Aug 2016 02:45:14 +0000 (04:45 +0200)]
<sys/ipc.h>: Some POSIX adjustments.

* Use standard types.

* Reduce visibility of some BSD specific stuff.

* While here, add missing parentheses around a macro argument.

7 years ago<sys/shm.h>: Some POSIX adjustments.
Sascha Wildner [Wed, 3 Aug 2016 02:43:40 +0000 (04:43 +0200)]
<sys/shm.h>: Some POSIX adjustments.

* Define pid_t, size_t and time_t as required.

* Put BSD specific stuff under __BSD_VISIBLE.

7 years ago<sys/sem.h>: Some POSIX adjustments.
Sascha Wildner [Wed, 3 Aug 2016 02:42:14 +0000 (04:42 +0200)]
<sys/sem.h>: Some POSIX adjustments.

* Define pid_t, size_t and time_t as required.

* Put BSD specific stuff under __BSD_VISIBLE.

* Use standard types.

7 years ago<sys/msg.h>: Some POSIX adjustments.
Sascha Wildner [Wed, 3 Aug 2016 02:41:14 +0000 (04:41 +0200)]
<sys/msg.h>: Some POSIX adjustments.

* Define msglen_t and msgqnum_t and use them (no size change).

* Define pid_t, size_t, ssize_t and time_t as required.

* Put BSD specific stuff under __BSD_VISIBLE.

7 years ago<netinet/tcp.h>: Clean up the POSIX namespace a bit.
Sascha Wildner [Wed, 3 Aug 2016 02:39:47 +0000 (04:39 +0200)]
<netinet/tcp.h>: Clean up the POSIX namespace a bit.

7 years agoClean up whitespace in a few headers (no functional change).
Sascha Wildner [Wed, 3 Aug 2016 02:36:12 +0000 (04:36 +0200)]
Clean up whitespace in a few headers (no functional change).

<netinet/tcp.h>
<sys/aio.h>
<sys/ipc.h>
<sys/msg.h>
<sys/sem.h>
<sys/shm.h>
<sys/stat.h>
<sys/types.h>

In preparation for namespace cleanup.

7 years agokernel - Remove PG_ZERO and zeroidle (page-zeroing) entirely
Matthew Dillon [Wed, 3 Aug 2016 00:41:08 +0000 (17:41 -0700)]
kernel - Remove PG_ZERO and zeroidle (page-zeroing) entirely

* Remove the PG_ZERO flag and remove all page-zeroing optimizations,
  entirely.  Aftering doing a substantial amount of testing, these
  optimizations, which existed all the way back to CSRG BSD, no longer
  provide any benefit on a modern system.

  - Pre-zeroing a page only takes 80ns on a modern cpu.  vm_fault overhead
    in general is ~at least 1 microscond.

  - Pre-zeroing a page leads to a cold-cache case on-use, forcing the fault
    source (e.g. a userland program) to actually get the data from main
    memory in its likely immediate use of the faulted page, reducing
    performance.

  - Zeroing the page at fault-time is actually more optimal because it does
    not require any reading of dynamic ram and leaves the cache hot.

  - Multiple synth and build tests show that active idle-time zeroing of
    pages actually reduces performance somewhat and incidental allocations
    of already-zerod pages (from page-table tear-downs) do not affect
    performance in any meaningful way.

* Remove bcopyi() and obbcopy() -> collapse into bcopy().  These other
  versions existed because bcopy() used to be specially-optimized and
  could not be used in all situations.  That is no longer true.

* Remove bcopy function pointer argument to m_devget().  It is no longer
  used.  This function existed to help support ancient drivers which might
  have needed a special memory copy to read and write mapped data.  It has
  long been supplanted by BUSDMA.

7 years agokernel - Cleanup vm_page_pcpu_cache()
Matthew Dillon [Mon, 1 Aug 2016 20:03:52 +0000 (13:03 -0700)]
kernel - Cleanup vm_page_pcpu_cache()

* Remove the empty vm_page_pcpu_cache() function and related call.  Page
  affinity is handled by the vm_page_queues[] array now.

7 years agodrm/linux: Add linux/kobject.h
François Tigeot [Sun, 31 Jul 2016 15:45:29 +0000 (17:45 +0200)]
drm/linux: Add linux/kobject.h

7 years agokernel - Refactor cpu localization for VM page allocations (3)
Matthew Dillon [Sun, 31 Jul 2016 03:40:06 +0000 (20:40 -0700)]
kernel - Refactor cpu localization for VM page allocations (3)

* Instead of iterating the cpus in the mask starting at cpu #0, iterate
  starting at mycpu to the end, then from 0 to mycpu - 1.

  This fixes random masked wakeups from favoring lower-numbered cpus.

* The user process scheduler (usched_dfly) was favoring lower-numbered
  cpus due to a bug in the simple selection algorithm, causing forked
  processes to initially weight improperly.  A high fork or fork/exec
  rate skewed the way the cpus were loaded.

  Fix this by correctly scanning cpus from the (scancpu) rover.

* For now, use a random 'previous' affinity for initially scheduling a
  fork.

7 years agodrm/linux: Add vmap()
François Tigeot [Sun, 31 Jul 2016 06:06:36 +0000 (08:06 +0200)]
drm/linux: Add vmap()

7 years agoSync ACPICA with Intel's version 20160729.
Sascha Wildner [Sat, 30 Jul 2016 20:19:24 +0000 (22:19 +0200)]
Sync ACPICA with Intel's version 20160729.

* Restructured and standardized the C library configuration for
  ACPICA.

* AML interpreter: Allows for execution of so-called "executable"
  AML code outside of control methods, not just at the module level
  (top level) but also within any scope declared outside of a
  control method - Scope{}, Device{}, Processor{}, PowerResource{},
  and ThermalZone{}. Lv Zheng.

* iASL: Add full support for the RASF ACPI table (RAS Features Table).

* iASL: Allows for compilation/disassembly of so-called "executable"
  AML code (see above).

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