dragonfly.git
9 years agoMerge branch 'vendor/OPENSSL'
Sascha Wildner [Wed, 22 Oct 2014 17:30:55 +0000 (19:30 +0200)]
Merge branch 'vendor/OPENSSL'

9 years agoImport OpenSSL-1.0.1j.
Sascha Wildner [Wed, 22 Oct 2014 17:27:43 +0000 (19:27 +0200)]
Import OpenSSL-1.0.1j.

* Fixes for CVE-2014-3513, CVE-2014-3566, CVE-2014-3567 and
  CVE-2014-3568.

* Additional DigestInfo checks.

9 years agotip(1): Fix various warnings and errors emitted by clang
John Marino [Wed, 22 Oct 2014 12:28:45 +0000 (14:28 +0200)]
tip(1): Fix various warnings and errors emitted by clang

The most serious were void/return mismatches, but clang also complained
about ambiguous brackets and mis-matching printf formats.  It also didn't
like one particular K&R-formatted function, but I'm not sure why not.

9 years agoReally set default binutils to version 2.24
John Marino [Wed, 22 Oct 2014 09:06:39 +0000 (11:06 +0200)]
Really set default binutils to version 2.24

The last update of binutils missed changing the default in bsd.cpu.mk,
which means all the bootstrap and other tools were built with binutils
2.22 instead of 2.24.  This oversight is rectified now.

9 years agoboot: remove sparc, powerpc, ia64 code and references
John Marino [Wed, 22 Oct 2014 07:23:40 +0000 (09:23 +0200)]
boot: remove sparc, powerpc, ia64 code and references

While I'm here, remove the practically blank README.  Apparently this was
on Matt's "To-Do" list, but that was 4 years ago so I don't think it's
going to get done.

9 years agorouted - Apply FreeBSD-SA-14:21.routed
Matthew Dillon [Tue, 21 Oct 2014 22:16:18 +0000 (15:16 -0700)]
routed - Apply FreeBSD-SA-14:21.routed

* Apply patch to fix null-pointer DOS.

9 years agocsu: Remove $CFLAGS from intermediate object targets
John Marino [Tue, 21 Oct 2014 18:25:30 +0000 (20:25 +0200)]
csu: Remove $CFLAGS from intermediate object targets

These makefile case from FreeBSD, but the flags were called $ACFLAGS,
not $CFLAGS, and they are empty by default.  I noticed clang's
assembler screaming about unused flags and then noticed this mistake.

9 years agocustomcc: Improve wrapper script efficiency and capabilities
John Marino [Tue, 21 Oct 2014 13:11:34 +0000 (15:11 +0200)]
customcc: Improve wrapper script efficiency and capabilities

The wrapper script had some deficies, such as:
 * awk called every invocation
 * cc and gcc treated the same
 * c++ and g++ treated the same
 * evals for variables not used
 * every invocation of c++ or g++ called cc -dumpmachine
 * g++ hardcoded to dports include scheme
 * no support for "CC" or "gcov" (both defined by base compilers)

The update addresses these by:
 * awk eliminated by pushing INCOPT definition to defaults/compilers.conf
 * cc -dumpmachine eliminated during creation of defaults/compilers.conf
   It was only used for dports gcc, so with the assumption that the dports
   compiler matches the uname information (a decent assumption), this
   was predefined, yet overridable by /etc/compilers.conf
 * cc is treated separately from gcc
 * CC and c++ are treated the same but separately from g++
 * by wrapper default, gcc and g++ refer to base gcc4.7, but the default
   compilers.conf sets them to the same as the specified dports gcc
 * Support for clang, clang++, clang-cpp, CC, and gcov was added
 * Support for base clang, clang++, and clang-cpp was added in
   anticipation of bringing clang into base.
 * variables are only evaluated if used.
 * supports the ability to have gcc, g++, clang, clang++ point to base
   compilers while cc, c++, CC point to custom compiler.  However, the
   custom compiler can also point to any combination of cc, gcc, c++, and
   g++ and that's controllable by compilers.conf.

The /etc/defaults/compilers.conf file was augmented and support for
clang35 from dports added.  man 5 compilers.conf was edited accordingly
with placeholders for <version>_CLANG, <version>_CLANGCXX and
<version>_CLANGCPP which aren't applicable until clang comes into base.

9 years agokernel - Fix int/long truncation problem in rman_reserve_resource()
Matthew Dillon [Tue, 21 Oct 2014 06:08:50 +0000 (23:08 -0700)]
kernel - Fix int/long truncation problem in rman_reserve_resource()

* Use ulmin/ulmax instead of min/max in three places, fixing a 32-bit
  truncation problem when setting up memory resources that caused our
  48-core opteron to panic.

* An earlier commit adjusting count values to be more correct revealed
  the bug.

* Fixes booting the kernel on our 48-core opteron w/128G of ram.

9 years agokernel: FWIW, add FreeBSD's led(4) framework.
Sascha Wildner [Sun, 19 Oct 2014 18:22:43 +0000 (20:22 +0200)]
kernel: FWIW, add FreeBSD's led(4) framework.

It's not big and some ACPI code can utilize it.

Also add -l to morse(6) to output in led(4) compatible format.

Thanks to Markus Pfeiffer and Johannes Hofmann for testing and
finding issues.

Taken-from: FreeBSD

9 years agokernel - Add the nitems(x) macro from FreeBSD to sys/param.h
Matthew Dillon [Sun, 10 Aug 2014 08:24:56 +0000 (01:24 -0700)]
kernel - Add the nitems(x) macro from FreeBSD to sys/param.h

* Horrible name but... ok.

9 years agodma(8): Better integration with our periodic scripts.
Sascha Wildner [Sun, 19 Oct 2014 11:37:04 +0000 (13:37 +0200)]
dma(8): Better integration with our periodic scripts.

* Make dma(8) accept the -Ac option when run as 'mailq'. Also make it
  run as 'hoststat' and 'purgestat' (does nothing in this case).

* Adjust the 440.status-mailq daily periodic script to also check for
  "Mail queue is empty", which is dma(8)'s corresponding text.

Note: We really should be suppressing the checking of the submit queue
      automatically if mailer.conf is set up for dma(8) but I'm not
      sure yet what's the best way.

Reported and tested by Max Herrgard <herrgard@gmail.com>.

9 years agorc.d/nfsd: Add shutdown keyword so as it's stopped at shutdown.
YONETANI Tomokazu [Sun, 19 Oct 2014 06:34:02 +0000 (15:34 +0900)]
rc.d/nfsd: Add shutdown keyword so as it's stopped at shutdown.

9 years agoAdd ifmedia(4) reference to vkernel.7 (which is vke's manual page too).
Sascha Wildner [Sat, 18 Oct 2014 17:36:49 +0000 (19:36 +0200)]
Add ifmedia(4) reference to vkernel.7 (which is vke's manual page too).

9 years agovkernel: Add rudimentary media support to if_vke
Markus Pfeiffer [Fri, 17 Oct 2014 21:18:41 +0000 (21:18 +0000)]
vkernel: Add rudimentary media support to if_vke

9 years agodma(8): Fix some comment typos.
Sascha Wildner [Sat, 18 Oct 2014 11:46:07 +0000 (13:46 +0200)]
dma(8): Fix some comment typos.

9 years agovkernel - Enhance panic message for freeing held page table page
Matthew Dillon [Fri, 17 Oct 2014 20:35:35 +0000 (13:35 -0700)]
vkernel - Enhance panic message for freeing held page table page

* Adjust the 'freeing held page table page' to say 'freeing held pt page'
  and also include a bunch of pointer and other information.

9 years agokernel - Add /dev/upmap and /dev/kpmap and sys/upmap.h (4)
Matthew Dillon [Fri, 17 Oct 2014 20:32:36 +0000 (13:32 -0700)]
kernel - Add /dev/upmap and /dev/kpmap and sys/upmap.h (4)

* Properly remove pte entries for VM_MAPTYPE_UKSMAP mappings.  This maptype
  will have a NULL object.

* Fixes a vkernel panic, probably fixes a page leak in real kernels.

9 years agoSort SEE ALSO in libusb20.3 and environ.7
Sascha Wildner [Fri, 17 Oct 2014 13:49:35 +0000 (15:49 +0200)]
Sort SEE ALSO in libusb20.3 and environ.7

9 years agoacpiconf.8: Remove duplicate SEE ALSO.
Sascha Wildner [Fri, 17 Oct 2014 13:43:58 +0000 (15:43 +0200)]
acpiconf.8: Remove duplicate SEE ALSO.

9 years agovkernel - Support BPF for if_vke.
Matthew Dillon [Fri, 17 Oct 2014 02:32:59 +0000 (19:32 -0700)]
vkernel - Support BPF for if_vke.

* if_vke now supports tcpdump in both directions instead of just one
  direction.

9 years agokernel - Add /dev/upmap and /dev/kpmap and sys/upmap.h (3)
Matthew Dillon [Fri, 17 Oct 2014 02:25:04 +0000 (19:25 -0700)]
kernel - Add /dev/upmap and /dev/kpmap and sys/upmap.h (3)

* Add upmap->invfork.  When a vforked child is trying to access the upmap
  prior to exec we must still access the parent's map and not the child's,
  which means that the stored PID will be incorrect.

  To fix this issue we add the invfork field which allows userland to
  determine whether this is a vforked child accessing the parent's map.
  If it is, getpid() will use the system call.

* Fix a bug where a vfork()d child creates p->p_upmap for itself but then
  maps it into the parent's address space as a side effect of a getpid()
  or other call.  When this situation is detected, /dev/upmap will use
  the parent's p_upmap and not the child's, and also properly set the
  invfork flag.

* Implement system call overrides for getpid(), setproctitle(), and
  clock_gettime() (*_FAST and *_SECOND clock ids).  When more than 10 calls
  are made to one of these functions the new libc upmap/kpmap support is
  activated.  /dev/upmap and /dev/kpmap will be memory-mapped into the
  address space and further accesses will run through the maps instead of
  making system calls.

  This will obviously reduce overhead for these calls by a very significant
  multiplier.

* NOTE! gettimeofday() is still a system call and will likely remain a system
call in order to return a fine-grained time value.  Third-party code
that doesn't need a fine-grained time value must use clock_gettime()
to obtain the new performance efficiencies.

9 years agokernel - fixup buildworld after recent commits
Markus Pfeiffer [Thu, 16 Oct 2014 23:13:07 +0000 (23:13 +0000)]
kernel - fixup buildworld after recent commits

9 years agokernel - Add /dev/upmap and /dev/kpmap and sys/upmap.h (2)
Matthew Dillon [Thu, 16 Oct 2014 21:54:56 +0000 (14:54 -0700)]
kernel - Add /dev/upmap and /dev/kpmap and sys/upmap.h (2)

* Disallow writing to kpmap.

* Handle cpu read/update races against ts_uptime and ts_realtime by
  making these arrays[2] and using kpmap->upticks to tell userland
  which one is stable.

  The procedure is as follows:

struct timespec ts_uptime;
struct timespec ts_realtime;
int w;

        do {
                w = kpmap->upticks;
                cpu_lfence();
                ts_uptime = kpmap->ts_uptime[w & 1];
                ts_realtime = kpmap->ts_realtime[w & 1];
                cpu_lfence();
                w = kpmap->upticks - w;
        } while (w > 1);

  This procedure avoids having to loop in all standard cases including
  the nominal kernel update / userland read race.  It will only loop if
  the kernel deschedules the user process for > 1 tick during the access
  sequence.

9 years agokernel - Add /dev/upmap and /dev/kpmap and sys/upmap.h
Matthew Dillon [Thu, 16 Oct 2014 19:35:05 +0000 (12:35 -0700)]
kernel - Add /dev/upmap and /dev/kpmap and sys/upmap.h

* Add two memory-mappable devices for accessing a per-process and global
  kernel shared memory space.  These can be mapped to acquire certain
  information from the kernel that would normally require a system call
  in a more efficient manner.

  Userland programs using this feature should NOT directly map the sys_upmap
  and sys_kpmap structures (which is why they are in #ifdef _KERNEL sections
  in sys/upmap.h).  Instead, mmap the devices using UPMAP_MAPSIZE and
  KPMAP_MAPSIZE and parse the ukpheader[] array at the front of each area
  to locate the desired fields.  You can then simply cache a pointer to
  the desired field.

  The width of the field is encoded in the UPTYPE/KPTYPE elements and
  can be asserted if desired, user programs are not expected to handle
  integers of multiple sizes for the same field type.

* Add /dev/upmap.  A program can open and mmap() this device R+W and use
  it to access:

  header[...] - See sys/upmap.h.  An array of headers terminating with
  a type=0 header indicating where various fields are in
  the mapping.  This should be used by userland instead
  of directly mapping to the struct sys_upmap structure.

  version - The sys_upmap version, typically 1.

  runticks - Scheduler run ticks (aggregate, all threads).  This
  may be used by userland interpreters to determine
  when to soft-switch.

  forkid - A unique non-zero 64-bit fork identifier.  This is NOT a
  pid.  This may be used by userland libraries to determine
  if a fork has occurred by comparing against a stored
  value.

  pid - The current process pid.  This may be used to acquire the
  process pid without having to make further system calls.

  proc_title - This starts out as an empty buffer and may be used to set
  the process title.  To revert to the original process title,
  set proc_title[0] to 0.

  NOTE!  Userland may write to the entire buffer, but it is recommended
 that userland only write to fields intended to be writable.

  NOTE!  When a program forks, an area already mmap()d remains mmap()d but
 will point to the new process's area and not the old, so libraries
 do not need to do anything special atfork.

  NOTE!  Access to this structure is cpu localized.

* Add /dev/kpmap.  A program can open and mmap() this device RO and use
  it to access:

  header[...] - See sys/upmap.h.  An array of headers terminating with
  a type=0 header indicating where various fields are in
  the mapping.  This should be used by userland instead
  of directly mapping to the struct sys_upmap structure.

  version - The sys_kpmap version, typically 1.

  upticks - System uptime tick counter (32 bit integer).  Monotonic,
  uncompensated.

  ts_uptime - System uptime in struct timespec format at tick-resolution.
  Monotonic, uncompensated.

  ts_realtime - System realtime in struct timespec format at tick-resolution.
  This is compensated so reverse-indexing is possible.

  tsc_freq - If the system supports a TSC of some sort, the TSC
  frequency is recorded here, else 0.

  tick_freq - The tick resolution of ts_uptime and ts_realtime and
  approximate tick resolution for the scheduler.  Typically
  100.

  NOTE!  Userland may only read from this buffer.

  NOTE!  Access to this structure is NOT cpu localized.  A memory fence
 and double-check should be used when accessing non-atomic structures
 which might change such as ts_uptime and ts_realtime.

 XXX needs work.

9 years agoMakefile.inc1: Remove obsolete NO_FORTRAN definitions
John Marino [Thu, 16 Oct 2014 18:25:43 +0000 (20:25 +0200)]
Makefile.inc1: Remove obsolete NO_FORTRAN definitions

9 years agoUpdate the pciconf(8) database.
Sascha Wildner [Thu, 16 Oct 2014 11:11:52 +0000 (13:11 +0200)]
Update the pciconf(8) database.

October 15, 2014 snapshot from http://pciids.sourceforge.net/

9 years agodrm: Add and use drm/drm_mem_util.h
François Tigeot [Thu, 16 Oct 2014 06:42:01 +0000 (08:42 +0200)]
drm: Add and use drm/drm_mem_util.h

Reducing differences with the Linux code base

9 years agodrm: Consolidate memory allocation types
François Tigeot [Wed, 15 Oct 2014 18:43:53 +0000 (20:43 +0200)]
drm: Consolidate memory allocation types

* The DRM subsystem was using many different kmalloc types for no
  good reason

* Some types were only used twice (1x kmalloc() and 1x kfree() calls)

* Remove that useless complexity and only keep one kmalloc type for
  the whole DRM subsystem and its drivers

Inspired-by: OpenBSD
9 years agorc.conf.5: Adjust pim6dd reference to dports.
Sascha Wildner [Tue, 14 Oct 2014 19:14:27 +0000 (21:14 +0200)]
rc.conf.5: Adjust pim6dd reference to dports.

9 years agoest.4: Comment out estd reference.
Sascha Wildner [Tue, 14 Oct 2014 19:13:57 +0000 (21:13 +0200)]
est.4: Comment out estd reference.

9 years agoAdjust the cc wrapper script and compilers.conf to dports.
Sascha Wildner [Tue, 14 Oct 2014 18:57:13 +0000 (20:57 +0200)]
Adjust the cc wrapper script and compilers.conf to dports.

Provide defaults for various GCCs for now.

9 years agonetinet: Remove check for jailed process
Markus Pfeiffer [Mon, 13 Oct 2014 18:49:26 +0000 (18:49 +0000)]
netinet: Remove check for jailed process

This check caused jailed processes to not be able to do name lookups
via libc anymore, since a connect() on a udp socket failed.

Reviewed-by: Sepherosa Ziehau <sepherosa@gmail.com>
9 years agoComplete upgrade of libedit from 2012-12-13 => 2014-06-20
John Marino [Mon, 13 Oct 2014 16:25:37 +0000 (18:25 +0200)]
Complete upgrade of libedit from 2012-12-13 => 2014-06-20

9 years agoMerge branch 'vendor/LIBEDIT'
John Marino [Mon, 13 Oct 2014 17:10:37 +0000 (19:10 +0200)]
Merge branch 'vendor/LIBEDIT'

Conflicts:
contrib/libedit/src/vi.c

9 years agoUpdate libedit from version 2012-12-13 to 2014-06-20 on vendor branch
John Marino [Mon, 13 Oct 2014 16:07:36 +0000 (18:07 +0200)]
Update libedit from version 2012-12-13 to 2014-06-20 on vendor branch

9 years agokernel/acpi: Process the ACPI_Q_BATT_RATE_ABS quirk before the rate is used.
Sascha Wildner [Mon, 13 Oct 2014 16:56:23 +0000 (18:56 +0200)]
kernel/acpi: Process the ACPI_Q_BATT_RATE_ABS quirk before the rate is used.

Stupid mistake, we need to adjust the rate before it is added to
valid_rate.

Pointed-out-by: John Baldwin
9 years agoapciconf.8: Clarify that 0 means the first battery.
Sascha Wildner [Mon, 13 Oct 2014 16:43:00 +0000 (18:43 +0200)]
apciconf.8: Clarify that 0 means the first battery.

9 years agolagg.4: Use .Mt for email addresses.
Sascha Wildner [Mon, 13 Oct 2014 14:27:44 +0000 (16:27 +0200)]
lagg.4: Use .Mt for email addresses.

9 years agoRemove old time zones via 'make upgrade'.
Sascha Wildner [Mon, 13 Oct 2014 14:25:33 +0000 (16:25 +0200)]
Remove old time zones via 'make upgrade'.

9 years agowpa_supplicant: Fix driver list with -h or invalid command switch
John Marino [Mon, 13 Oct 2014 13:09:17 +0000 (15:09 +0200)]
wpa_supplicant: Fix driver list with -h or invalid command switch

If wpa_supplicant was given -h (help) argument to show usage, the NDIS
driver displayed as "(null)".  If wpa_supplicant was given no arguments,
the usage display would also appear, but this time the NDIS driver was
listed.

It seems that the NDIS driver is the only one that must be initialized,
and this initialization was getting skipped on unrecognized commands and
the help command.  The solution is to move the initialization of the
driver to occur before the commands are checked so that the driver data
will always be available.

9 years agohammer - Fix a NULL pointer dereference.
Antonio Huete Jimenez [Sun, 12 Oct 2014 18:52:12 +0000 (20:52 +0200)]
hammer - Fix a NULL pointer dereference.

- hammer_create_inode() allows its parameter dip to be NULL, so
  before checking nlinks, see if dip is actually not NULL.

Spotted-by: swildner
9 years agoSync zoneinfo database with tzdata2014h from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Sun, 12 Oct 2014 10:54:50 +0000 (12:54 +0200)]
Sync zoneinfo database with tzdata2014h from ftp://ftp.iana.org/tz/releases

We're coming from tzdata2014e.

Changes affecting future time stamps:

* Russia will subtract an hour from most of its time zones on 2014-10-26
    at 02:00 local time.  (Thanks to Alexander Krivenyshev.)

* Turks & Caicos is switching from US eastern time to UTC-4 year-round,
    modeled as a switch from EST/EDT to AST on 2014-11-02 at 02:00.

* Tons of changes to past time stamps and cleanup. It's really too much
    to repeat here. Please see the NEWS file for further information.

9 years agokernel/acpi: Remove unused variable from Makefile.
Sascha Wildner [Sat, 11 Oct 2014 21:03:11 +0000 (23:03 +0200)]
kernel/acpi: Remove unused variable from Makefile.

9 years agofind.1: Add missing whitespace.
Sascha Wildner [Sat, 11 Oct 2014 10:54:24 +0000 (12:54 +0200)]
find.1: Add missing whitespace.

9 years agoComplete upgrade of gnu grep 2.14 => 2.20
John Marino [Fri, 10 Oct 2014 21:33:40 +0000 (23:33 +0200)]
Complete upgrade of gnu grep 2.14 => 2.20

** 2.20 Bug fixes
  grep --max-count=N FILE would no longer stop reading after Nth match.
  I.e., while grep would still print the correct output, it would continue
  reading until end of input, and hence, potentially forever.
  [bug introduced in grep-2.19]

  A command like echo aa|grep -E 'a(b$|c$)' would mistakenly
  report the input as a matched line. [bug introduced in grep-2.19]

** 2.20 Changes in behavior
  grep --exclude-dir='FOO/' now excludes the directory FOO.
  Previously, the trailing slash meant the option was ineffective.

** 2.19 Improvements
  Performance has improved, typically by 10% and in some cases by a
  factor of 200.  However, performance of grep -P in UTF-8 locales has
  gotten worse as part of the fix for the crashes mentioned below.

** 2.19 Bug fixes
  grep no longer mishandles patterns like [a-[.z.]], and no longer
  mishandles patterns like [^a] in locales that have multicharacter
  collating sequences so that [^a] can match a string of two characters.

  grep no longer mishandles an empty pattern at the end of a pattern list.
  [bug introduced in grep-2.5]

  grep -C NUM now outputs separators consistently even when NUM is zero,
  and similarly for grep -A NUM and grep -B NUM.
  [bug present since "the beginning"]

  grep -f no longer mishandles patterns containing NUL bytes.
  [bug introduced in grep-2.11]

  Plain grep, grep -E, and grep -F now treat encoding errors in patterns
  the same way the GNU regular expression matcher treats them, with respect
  to whether the errors can match parts of multibyte characters in data.
  [bug present since "the beginning"]

  grep -w no longer mishandles a potential match adjacent to a letter that
  takes up two or more bytes in a multibyte encoding.
  Similarly, the patterns '\<', '\>', '\b', and '\B' no longer
  mishandle word-boundary matches in multibyte locales.
  [bug present since "the beginning"]

  grep -P now reports an error and exits when given invalid UTF-8 data.
  Previously it was unreliable, and sometimes crashed or looped.
  [bug introduced in grep-2.16]

  grep -P now works with -w and -x and backreferences. Before,
  echo aa|grep -Pw '(.)\1' would fail to match, yet
  echo aa|grep -Pw '(.)\2' would match.

  grep -Pw now works like grep -w in that the matched string has to be
  preceded and followed by non-word components or the beginning and end
  of the line (as opposed to word boundaries before).  Before, this
  echo a@@a| grep -Pw @@ would match, yet this
  echo a@@a| grep -w @@ would not.  Now, they both fail to match,
  per the documentation on how grep's -w works.

  grep -i no longer mishandles patterns containing titlecase characters.
  For example, in a locale containing the titlecase character
  'Lj' (U+01C8 LATIN CAPITAL LETTER L WITH SMALL LETTER J),
  'grep -i Lj' now matches both 'LJ' (U+01C7 LATIN CAPITAL LETTER LJ)
  and 'lj' (U+01C9 LATIN SMALL LETTER LJ).

** 2.18 Bug fixes
  grep no longer mishandles patterns like [^^-~] in unibyte locales.
  [bug introduced in grep-2.8]

  grep -i in a multibyte, non-UTF8 locale could be up to 200 times slower
  than in 2.16.  [bug introduced in grep-2.17]

** 2.17 Improvements
  grep -i in a multibyte locale is now typically 10 times faster
  for patterns that do not contain \ or [.

  grep (without -i) in a multibyte locale is now up to 7 times faster
  when processing many matched lines.

** 2.16 Bug fixes
  The fix to make \s and \S work with multi-byte white space broke
  the use of each shortcut whenever followed by a repetition operator.
  For example, \s*, \s+, \s? and \s{3} would all malfunction in a
  multi-byte locale.  [bug introduced in grep-2.15]

  The fix to make grep -P work better with UTF-8 made it possible for
  grep to evoke a larger set of PCRE errors, some of which could trigger
  an abort.  E.g., this would abort:
    printf '\x82'|LC_ALL=en_US.UTF-8 grep -P y
  Now grep handles arbitrary PCRE errors.  [bug introduced in grep-2.15]

  Handle very long lines (2GiB and longer) on systems with a deficient
  read system call.

** 2.15 Bug fixes
  grep's \s and \S failed to work with multi-byte white space characters.
  For example, \s would fail to match a non-breaking space, and this
  would print nothing: printf '\xc2\xa0' | LC_ALL=en_US.UTF-8 grep '\s'
  A related bug is that \S would mistakenly match an invalid multibyte
  character.  For example, the following would match:
    printf '\x82\n' | LC_ALL=en_US.UTF-8 grep '^\S$'
  [bug present since grep-2.6]

  grep -i would segfault on systems using UTF-16-based wchar_t (Cygwin)
  when converting an input string containing certain 4-byte UTF-8
  sequences to lower case.  The conversions to wchar_t and back to
  a UTF-8 multibyte string did not take surrogate pairs into account.
  [bug present since at least grep-2.6, though the segfault is new with 2.13]

  grep -E would segfault when given a regexp like '([^.]*[M]){1,2}'
  for any multibyte character M. [bug introduced in grep-2.6, which would
  segfault, but 2.7 and 2.8 had no problem, and 2.9 through 2.14 would
  hit a failed assertion. ]

  grep -F would get stuck in an infinite loop when given a search string
  that is an invalid byte sequence in the current locale and that matches
  the bytes of the input twice on a line.  Now grep fails with exit status 1.

  grep -P could misbehave.  While multi-byte mode is only supported by PCRE
  with UTF-8 locales, grep did not activate it.  This would cause failures
  to match multibyte characters against some regular expressions, especially
  those including the '.' or '\p' metacharacters.

** 2.15 New features
  grep -P can now use a just-in-time compiler to greatly speed up matches,
  This feature is transparent to the user; no flag is required to enable
  it.  It is only available if the corresponding support in the PCRE
  library is detected when grep is compiled.

9 years agoMerge branch 'vendor/GREP'
John Marino [Fri, 10 Oct 2014 22:51:31 +0000 (00:51 +0200)]
Merge branch 'vendor/GREP'

Conflicts:
contrib/grep/src/main.c

9 years agoUpgrade grep from 2.14 => 2.20 on the vendor branch
John Marino [Fri, 10 Oct 2014 19:48:14 +0000 (21:48 +0200)]
Upgrade grep from 2.14 => 2.20 on the vendor branch

9 years agoComplete upgrade of XZ 5.0.4 => 5.0.7
John Marino [Fri, 10 Oct 2014 18:21:11 +0000 (20:21 +0200)]
Complete upgrade of XZ 5.0.4 => 5.0.7

See the vendor branch commit for the change log diff.

9 years agoMerge branch 'vendor/XZ'
John Marino [Fri, 10 Oct 2014 19:14:07 +0000 (21:14 +0200)]
Merge branch 'vendor/XZ'

9 years agoUpgrade xz from 5.0.4 to 5.0.7 on the vendor branch
John Marino [Fri, 10 Oct 2014 17:58:57 +0000 (19:58 +0200)]
Upgrade xz from 5.0.4 to 5.0.7 on the vendor branch

5.0.7 (2014-09-20)
    * Fix regressions introduced in 5.0.6:
        - Fix building with non-GNU make.
        - Fix invalid Libs.private value in liblzma.pc which broke
          static linking against liblzma if the linker flags were
          taken from pkg-config.
5.0.6 (2014-09-14)
    * xzgrep now exits with status 0 if at least one file matched.
    * A few minor portability and build system fixes
5.0.5 (2013-06-30)
    * lzmadec and liblzma's lzma_alone_decoder(): Support decompressing
      .lzma files that have less common settings in the headers
      (dictionary size other than 2^n or 2^n + 2^(n-1), or uncompressed
      size greater than 256 GiB). The limitations existed to avoid false
      positives when detecting .lzma files. The lc + lp <= 4 limitation
      still remains since liblzma's LZMA decoder has that limitation.

      NOTE: xz's .lzma support or liblzma's lzma_auto_decoder() are NOT
      affected by this change. They still consider uncommon .lzma headers
      as not being in the .lzma format. Changing this would give way too
      many false positives.
    * xz:
        - Interaction of preset and custom filter chain options was
          made less illogical. This affects only certain less typical
          uses cases so few people are expected to notice this change.

          Now when a custom filter chain option (e.g. --lzma2) is
          specified, all preset options (-0 ... -9, -e) earlier are on
          the command line are completely forgotten. Similarly, when
          a preset option is specified, all custom filter chain options
          earlier on the command line are completely forgotten.

          Example 1: "xz -9 --lzma2=preset=5 -e" is equivalent to "xz -e"
          which is equivalent to "xz -6e". Earlier -e didn't put xz back
          into preset mode and thus the example command was equivalent
          to "xz --lzma2=preset=5".

          Example 2: "xz -9e --lzma2=preset=5 -7" is equivalent to
          "xz -7". Earlier a custom filter chain option didn't make
          xz forget the -e option so the example was equivalent to
          "xz -7e".
        - Fixes and improvements to error handling.
        - Various fixes to the man page.
    * xzless: Fixed to work with "less" versions 448 and later.
    * xzgrep: Made -h an alias for --no-filename.
    * Include the previously missing debug/translation.bash which can
      be useful for translators.
    * Include a build script for Mac OS X. This has been in the Git
      repository since 2010 but due to a mistake in Makefile.am the
      script hasn't been included in a release tarball before.

9 years agoComplete upgrade of gcc 4.7.3 => 4.7.4
John Marino [Fri, 10 Oct 2014 15:17:44 +0000 (17:17 +0200)]
Complete upgrade of gcc 4.7.3 => 4.7.4

The GCC Bugzilla shows 134 PRs were resolved on the GCC 4.7 branch since
GCC 4.7.3 was released.  I've run into one c++ bug on ports involving
try-catch that should be fixed (the current solution is use GCC 4.8.3
from ports).  Not all the PRs listed in milestone 4.7.4 are pertinent
for DragonFly's base compiler though.

9 years agoMerge branch 'vendor/GCC47'
John Marino [Fri, 10 Oct 2014 16:32:41 +0000 (18:32 +0200)]
Merge branch 'vendor/GCC47'

9 years agoUpgrade GCC from 4.7.3 to 4.7.4 on the vendor branch gitea/vendor/GCC47 origin/vendor/GCC47
John Marino [Fri, 10 Oct 2014 14:56:34 +0000 (16:56 +0200)]
Upgrade GCC from 4.7.3 to 4.7.4 on the vendor branch

9 years agoVOP_FSYNC.9: Missing comma
Sascha Wildner [Fri, 10 Oct 2014 14:53:31 +0000 (16:53 +0200)]
VOP_FSYNC.9: Missing comma

9 years agomanpages: Fix a couple things left behind on the previous commit
Antonio Huete Jimenez [Fri, 10 Oct 2014 10:15:05 +0000 (12:15 +0200)]
manpages: Fix a couple things left behind on the previous commit

9 years agotools - Fix backup file permissions for hammer-backup.sh
Antonio Huete Jimenez [Fri, 10 Oct 2014 09:45:21 +0000 (11:45 +0200)]
tools - Fix backup file permissions for hammer-backup.sh

- Make sure backup files are only readable by root
- Fix typo in a comment
- Set /usr/sbin as the default installation directory

9 years agomanpages - Bring VOP_ACCESS(9) up to date
Antonio Huete Jimenez [Wed, 8 Oct 2014 20:36:24 +0000 (22:36 +0200)]
manpages - Bring VOP_ACCESS(9) up to date

9 years agomanpages - Bring VOP_FSYNC(9) up to date
Antonio Huete Jimenez [Wed, 8 Oct 2014 20:27:47 +0000 (22:27 +0200)]
manpages - Bring VOP_FSYNC(9) up to date

9 years agoSync snapshots tools with pkgbox64's current.
Sascha Wildner [Fri, 10 Oct 2014 07:44:46 +0000 (09:44 +0200)]
Sync snapshots tools with pkgbox64's current.

9 years agoImprove frequency scaling-related manual pages
Matteo Cypriani [Wed, 8 Oct 2014 21:01:58 +0000 (17:01 -0400)]
Improve frequency scaling-related manual pages

Cross-reference powerd(8), est(4) and powernow(4); state that powerd
should be the preferred option.
Enforce the "new sentence on a new line" rule.

9 years agokernel/acpica: Stop being prepared for using ACPICA's local cache.
Sascha Wildner [Thu, 9 Oct 2014 11:19:37 +0000 (13:19 +0200)]
kernel/acpica: Stop being prepared for using ACPICA's local cache.

We provide our own objcache(9) based one for some time now.

9 years agokernel/acpica: Don't use ACPICA's own versions of various POSIX functions.
Sascha Wildner [Thu, 9 Oct 2014 08:29:44 +0000 (10:29 +0200)]
kernel/acpica: Don't use ACPICA's own versions of various POSIX functions.

This removes the need to compile utclib.c into the kernel, so remove it
from the list.

9 years agokernel/libkern: Add strncat() to libkern.
Sascha Wildner [Thu, 9 Oct 2014 10:24:10 +0000 (12:24 +0200)]
kernel/libkern: Add strncat() to libkern.

In preparation for switching ACPI over to using various of our
kernel functions instead of its own versions.

Taken from libc.

9 years agosys/conf/files: Sort ACPI alphabetically.
Sascha Wildner [Thu, 9 Oct 2014 07:55:21 +0000 (09:55 +0200)]
sys/conf/files: Sort ACPI alphabetically.

9 years agoinstaller: Create an initial initrd unconditionally.
Sascha Wildner [Thu, 9 Oct 2014 06:42:10 +0000 (08:42 +0200)]
installer: Create an initial initrd unconditionally.

Now that the mkinitrd has been detached from installworld, the rescue
image is no longer part of the ISOs/IMGs, so we have to always create
one during installation, not just for encrypted setup.

9 years agoinstaller: Save the installation log as the last step.
Sascha Wildner [Thu, 9 Oct 2014 06:34:57 +0000 (08:34 +0200)]
installer: Save the installation log as the last step.

9 years agotools: Add some missing includes.
Sascha Wildner [Thu, 9 Oct 2014 06:32:30 +0000 (08:32 +0200)]
tools: Add some missing includes.

9 years agosed(1): add -r option for compatibility with GNU sed.
Robin Hahling [Tue, 7 Oct 2014 20:00:43 +0000 (22:00 +0200)]
sed(1): add -r option for compatibility with GNU sed.

-r option is exactly the same option as -E

9 years agokernel/smbfs: Tabify a few lines.
Sascha Wildner [Sun, 5 Oct 2014 11:58:01 +0000 (13:58 +0200)]
kernel/smbfs: Tabify a few lines.

9 years agokernel: Remove some dead code.
Sascha Wildner [Sun, 5 Oct 2014 11:55:45 +0000 (13:55 +0200)]
kernel: Remove some dead code.

While here, also remove an unnecessary NULL check in smbfs (M_WAITOK is used)
and use M_ZERO instead of an explicit bzero().

Submitted-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
9 years agokernel/slaballoc: Remove redundant if().
Sascha Wildner [Sat, 4 Oct 2014 11:18:49 +0000 (13:18 +0200)]
kernel/slaballoc: Remove redundant if().

Found-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
9 years agodrm: Add Linux PCI headers
François Tigeot [Sat, 4 Oct 2014 07:45:33 +0000 (09:45 +0200)]
drm: Add Linux PCI headers

9 years agoudp: Add assertion for preconditions for direct detach
Sepherosa Ziehau [Fri, 3 Oct 2014 14:08:08 +0000 (22:08 +0800)]
udp: Add assertion for preconditions for direct detach

9 years agoudp: Add NOTINHASH assertion to udp_inswildcardhash()
Sepherosa Ziehau [Fri, 3 Oct 2014 12:44:12 +0000 (20:44 +0800)]
udp: Add NOTINHASH assertion to udp_inswildcardhash()

So that we could catch programming bugs earlier.

9 years agoinpcb: Factor out ASSERT_INP_NOTINHASH
Sepherosa Ziehau [Fri, 3 Oct 2014 12:42:02 +0000 (20:42 +0800)]
inpcb: Factor out ASSERT_INP_NOTINHASH

9 years agoudp: Use ncpus2 instead of ncpus, since udp uses ncpus2 netisrs
Sepherosa Ziehau [Fri, 3 Oct 2014 12:29:52 +0000 (20:29 +0800)]
udp: Use ncpus2 instead of ncpus, since udp uses ncpus2 netisrs

There is actually no functional change.

9 years agoinpcb: Factor out in_pcbresetroute()
Sepherosa Ziehau [Fri, 3 Oct 2014 12:24:28 +0000 (20:24 +0800)]
inpcb: Factor out in_pcbresetroute()

9 years agodrm/i915: Simplify the flush code
François Tigeot [Fri, 3 Oct 2014 09:20:58 +0000 (11:20 +0200)]
drm/i915: Simplify the flush code

Reduce differences with Linux 3.8.13

9 years agonet: some LINTing after if_lagg import
Markus Pfeiffer [Tue, 30 Sep 2014 09:17:14 +0000 (09:17 +0000)]
net: some LINTing after if_lagg import

* remove duplicate from include/Makefile
* sort mtree alphabetically
* update ifmedia(4) manpage to reflect updates to if_media.h

Reported-By: Sascha Wildner <swildner@online.de>
9 years agoBump __DragonFly_version for i915 hw context support
François Tigeot [Tue, 30 Sep 2014 06:50:45 +0000 (08:50 +0200)]
Bump __DragonFly_version for i915 hw context support

9 years agoudp: Optimize detach path
Sepherosa Ziehau [Mon, 29 Sep 2014 12:18:46 +0000 (20:18 +0800)]
udp: Optimize detach path

If the inpcb was never put onto wildcard hash and the multicast options
were never accessed nor modified, we could directly dispose the inpcb
on detach path instead of going through all netisrs to make sure that
it is no longer being accessed.

After this commit 'kq_connect_client -u' gives ~180Kconns/s instead of
~160Kconns/s (~12% improvement).

9 years agoinpcb: Define INP_WASBOUND_NOTANY as protocol specific flag
Sepherosa Ziehau [Mon, 29 Sep 2014 12:16:56 +0000 (20:16 +0800)]
inpcb: Define INP_WASBOUND_NOTANY as protocol specific flag

9 years agoinpcb: Revoke INP_WILDCARD_MP, which serves no purpose now
Sepherosa Ziehau [Mon, 29 Sep 2014 12:15:50 +0000 (20:15 +0800)]
inpcb: Revoke INP_WILDCARD_MP, which serves no purpose now

While I'm here, use ncpus2 instead of ncpus for TCP, which only uses
ncpus2 netisrs.

9 years agotcp: Check multicast sopt name after sopt level is checked
Sepherosa Ziehau [Mon, 29 Sep 2014 12:14:39 +0000 (20:14 +0800)]
tcp: Check multicast sopt name after sopt level is checked

9 years agonet: add version numbers to lagg sourcefiles, adapt manpage
Markus Pfeiffer [Sun, 28 Sep 2014 22:32:19 +0000 (22:32 +0000)]
net: add version numbers to lagg sourcefiles, adapt manpage

9 years agonet: import FreeBSD's if_lagg
Markus Pfeiffer [Fri, 22 Nov 2013 22:19:07 +0000 (22:19 +0000)]
net: import FreeBSD's if_lagg

9 years agotools/netrate: Get socket's cpu hint and bind cpu accordingly
Sepherosa Ziehau [Sun, 28 Sep 2014 11:43:20 +0000 (19:43 +0800)]
tools/netrate: Get socket's cpu hint and bind cpu accordingly

9 years agosocket: Provide socket owner cpuid hint
Sepherosa Ziehau [Thu, 25 Sep 2014 13:51:14 +0000 (21:51 +0800)]
socket: Provide socket owner cpuid hint

If the cpuid hint could not be provided or the cpuid hint does not make
sense, -1 will be returned as cpuid hint, e.g. TCP listen sockets w/o
SO_REUSEPORT.

This helps avoiding unnecessary IPIs and contention on receiving sockbuf
token.

9 years agoudp: Redistribute SO_REUSEPORT socket based on local group index
Sepherosa Ziehau [Mon, 22 Sep 2014 14:26:40 +0000 (22:26 +0800)]
udp: Redistribute SO_REUSEPORT socket based on local group index

This improves the request/response transation rate a lot for UDP sockets
which set SO_REUSEPORT, by cpu localizing the request and response
processing.

tools/netrate/udpecho 64B request/response transation rate is raised from
1.24Mtrans/s to 1.39Mtrans/s (~12% improvement).

9 years agoinpcb: Add in_pcb{link,unlink}_flags() to bypass INP_WILDCARD check
Sepherosa Ziehau [Mon, 22 Sep 2014 11:27:07 +0000 (19:27 +0800)]
inpcb: Add in_pcb{link,unlink}_flags() to bypass INP_WILDCARD check

It is safe to change the inpcb's pcblist while the it is still referenced
by the wildcard hash.

9 years agoinpcb: Save local group index
Sepherosa Ziehau [Sun, 21 Sep 2014 13:00:32 +0000 (21:00 +0800)]
inpcb: Save local group index

So that the caller, e.g. UDP protocol, could redistribute the inpcb
accordingly.

We keep the local group sorted by the inpcb local group index in
ascending order.  This eases the multi-process userland application
which uses SO_REUSEPORT sockets and binds process to the owner cpu
of the SO_REUSEPORT socket:
If we didn't sort the local group by the inpcb local group index and
one of the process owning an inpcb in this local group restarted, e.g.
crashed and restarted by watchdog, other processes owning a inpcb in
this local group would have to detect that event, refetch its socket's
owner cpu, and re-bind.

9 years agohammer - Disallow creation of a file/subdir/etc in a deleted directory
Matthew Dillon [Sat, 27 Sep 2014 04:41:23 +0000 (21:41 -0700)]
hammer - Disallow creation of a file/subdir/etc in a deleted directory

* Disallow the creation of inodes within deleted directories.  This
  possibility occurs if a program is CD'd into an empty directory which
  is then rmdir'd, and the program then tries to create something
  in the now-destroyed directory.

Reported-by: varialus
9 years agotest/udp: Add SO_REUSEPORT test
Sepherosa Ziehau [Tue, 23 Sep 2014 12:51:14 +0000 (20:51 +0800)]
test/udp: Add SO_REUSEPORT test

9 years agokernel/lockf: Add include for LOCKF_DEBUG and fix printf warnings.
Sascha Wildner [Tue, 23 Sep 2014 08:29:55 +0000 (10:29 +0200)]
kernel/lockf: Add include for LOCKF_DEBUG and fix printf warnings.

9 years agokernel/i915: Add missing opt_acpi.h to SRCS.
Sascha Wildner [Mon, 22 Sep 2014 11:33:25 +0000 (13:33 +0200)]
kernel/i915: Add missing opt_acpi.h to SRCS.

9 years agokernel/drm: Add back #include "opt_drm.h" to drmP.h so that DRM_DEBUG works.
Sascha Wildner [Mon, 22 Sep 2014 11:14:01 +0000 (13:14 +0200)]
kernel/drm: Add back #include "opt_drm.h" to drmP.h so that DRM_DEBUG works.

9 years agoudp: Factor out function to reset inpcb route cache
Sepherosa Ziehau [Sun, 21 Sep 2014 14:00:40 +0000 (22:00 +0800)]
udp: Factor out function to reset inpcb route cache

9 years agokernel/acpi: Sync acpi_resource with FreeBSD.
Sascha Wildner [Sun, 21 Sep 2014 09:21:27 +0000 (11:21 +0200)]
kernel/acpi: Sync acpi_resource with FreeBSD.

* Use AcpiWalkResources() for parsing _CRS result.

* Add support for 64-bit address range resources.

* Add workaround for BIOSes that specify edge-sensitive but active low
  settings for ACPI-enumerated serial ports (such as the one found on
  an Intel D2500CCE mobo).

* Minor fixes/cleanup.

9 years agonetrate/pktgen: Unbreak building
Sepherosa Ziehau [Sun, 21 Sep 2014 08:09:15 +0000 (16:09 +0800)]
netrate/pktgen: Unbreak building