215057 Commits

Author SHA1 Message Date
Andriy Gapon
ad2f496bfe MFC r308985: revert r304520, set canmount=on is not supposed to mount
the filesystem
2016-12-14 16:10:58 +00:00
Andriy Gapon
69a4df5ad0 MFC r308887,309090: fix unsafe modification of zfs_vnodeops when
DIAGNOSTIC is enabled
2016-12-14 16:08:28 +00:00
Andriy Gapon
363a2a677a MFC r308527: smb: fix SMB_READB, SMB_READW, SMB_PCALL to work as documented 2016-12-14 16:05:48 +00:00
Andriy Gapon
5994965c15 MFC r308480: pmc_process_csw_out: ignore deleted counters 2016-12-14 16:04:04 +00:00
Dag-Erling Smørgrav
a2880da9dd MFH (r308996, r309051, r309738): refactor, avoid repeating DNS requests 2016-12-14 14:20:32 +00:00
Eric van Gyzen
dd4c4c5a6b MFC r309460
thr_set_name(): silently truncate the given name as needed

Instead of failing with ENAMETOOLONG, which is swallowed by
pthread_set_name_np() anyway, truncate the given name to MAXCOMLEN+1
bytes.  This is more likely what the user wants, and saves the
caller from truncating it before the call (which was the only
recourse).

Polish pthread_set_name_np(3) and add a .Xr to thr_set_name(2)
so the user might find the documentation for this behavior.

Sponsored by:	Dell EMC
2016-12-13 23:34:07 +00:00
Eric van Gyzen
0427a55635 MFC r309625
This is imported from NetBSD.  The author--Joerg Sonnenberger--agreed
to apply a two-clause BSD license, just so the license was clear.

This source tree location matches NetBSD, and is the first place someone
might look for such a tool.

Obtained from:	Joerg Sonnenberger via NetBSD
Sponsored by:	Dell EMC
2016-12-13 23:12:59 +00:00
Eric van Gyzen
607a2283e6 MFC r309364 r309367 r309624
locale: fix buffer management

Also, handle signed and unsigned chars, and more gracefully handle
invalid input.

locale: enable more warnings; fix them

Do not set WARNS, so it gets the current default of 6.
Fix the warnings by sprinkling static, const, or strdup.
Make some constant data tables const.  Fix whitespace.

Sponsored by:	Dell EMC
2016-12-13 23:09:22 +00:00
Konstantin Belousov
62ed581d51 MFC r309630:
Do not leak curthread->inact_mtx when cancelling in pthread_cond_wait(3).
2016-12-13 09:43:49 +00:00
Andrey V. Elsukov
16f82fadb1 MFC r309660:
Convert result of hash_packet6() into host byte order.

  For IPv4 similar function uses addresses and ports in host byte order,
  but for IPv6 it used network byte order. This led to very bad hash
  distribution for IPv6 flows. Now the result looks similar to IPv4.
2016-12-13 09:17:30 +00:00
Devin Teske
ead7609945 MFC r308615 [brd]:
Attempt to make the parts that people are supposed to change stand out more
by capitalizing them.

Approved by:	me
2016-12-13 04:53:25 +00:00
Devin Teske
81da25e58e MFC r309504: Fix bug preventing limits(1) from being applied
PR:		misc/212493
Differential Revision:	https://reviews.freebsd.org/D8232
Submitted by:	girgen
Reviewed by:	adrian
2016-12-13 04:50:45 +00:00
Devin Teske
0fb9d03e83 MFC r307159: Add jail_confwarn="NO" (default YES)
Differential Revision:	https://reviews.freebsd.org/D7465
Reviewed by:	jelischer
Sponsored by:	FIS Global, Inc.
2016-12-13 04:47:21 +00:00
Devin Teske
4d1a0eba94 MFC r306012 [trasz]:
Fix -media to not mount ufs with "async"; it doesn't make sense when
there is softupdates.
2016-12-13 04:45:21 +00:00
Devin Teske
3b00c6fcd2 MFC r306011 [trasz]:
Stop appending "noatime" in the autofs -media map, and instead add it
to auto_master, since all filesystems seem to support it.  It's cleaner
this way, and easier to customize.
2016-12-13 04:44:06 +00:00
Devin Teske
67bffd18bc MFC r306009 [trasz]:
Make autofs(5) -media map also use "async" and "noatime" for ext2fs(5).
2016-12-13 04:43:03 +00:00
Devin Teske
5b863dbc04 MFC r305969 [trasz]:
Make autofs use the "noatime" flag for msdosfs, ntfs, and ufs
filesystems mounted on /media.
2016-12-13 04:41:49 +00:00
Devin Teske
a1df6fb455 MFC r305968 [trasz]:
Make autofs use the "async" flag for msdosfs and ufs filesystems mounted
on /media.
2016-12-13 04:39:44 +00:00
Devin Teske
cdb8416cd8 MFC r303943: Allow enforce_statfs (see jail(8)) to be set per jail
Reviewed by:	jelischer
2016-12-13 04:37:14 +00:00
Devin Teske
86d0de4cc4 MFC r302798 [cy]: Restore lost comment from r301295.
PR:		211027
Reported by:	Trond.Endrestol@ximalas.info
2016-12-13 04:35:19 +00:00
Baptiste Daroussin
a6c7932dcc Regen after r309954 2016-12-12 21:49:29 +00:00
Baptiste Daroussin
6c2d00574f MFC r309805:
Make WITHOUT_CAPSICUM implying WITHOUT_CASPER

PR:		214562
Reported by:	dewayne@heuristicsystems.com.au
2016-12-12 21:45:25 +00:00
Baptiste Daroussin
bbb0cfd345 MFC r309797-r309802
r309797:
Add entries to remove timed files with make delete-old if WITHOUT_TIMED is set

r309798:
Also remove auditdistd files if src.conf has WITHOUT_AUDIT

r309799:
Respect WITHOUT_RBOOTD in src.conf when running make delete-old

r309800:
Respect WITHOUT_BOOTPARAMD in src.conf when running make delete-old

r309801:
Respect WITHOUT_BOOTPD in src.conf when running make delete-old

r309802:
Respect WITHOUT_FINGER in src.conf when running make delete-old

PR:		213719, 213720, 213721, 213722, 213723, 213724
Submitted by:	philippe.michel7@sfr.fr
2016-12-12 21:43:17 +00:00
Kenneth D. Merry
3bd8cb74a2 MFC r307684, r307747
------------------------------------------------------------------------
  r307684 | ken | 2016-10-20 13:42:26 -0600 (Thu, 20 Oct 2016) | 13 lines

  For CCBs allocated on the stack, we need to clear the entire CCB, not just
  the header.  Otherwise stack garbage can lead to random flags getting set.

  This showed up as 'camcontrol rescan all' failing with EINVAL because the
  address type wasn't CAM_DATA_VADDR.

  sbin/camcontrol/camcontrol.c:
  	In rescan_or_reset_bus(), bzero the stack-allocated CCBs before
  	use instead of clearing the body.

  Sponsored by:	Spectra Logic

  ------------------------------------------------------------------------
  r307747 | ken | 2016-10-21 12:54:56 -0600 (Fri, 21 Oct 2016) | 27 lines

  Fix a problem in camcontrol(8) that cropped up with r307684.

  In r307684, I changed rescan_or_reset_bus() to bzero stack-allocated CCBs
  before sending them to the kernel because there was stack garbage in there
  that wound up meaning that bogus CCB flags were set.

  While this fixed the 'camcontrol rescan all' case (XPT_DEV_MATCH CCBs were
  failing previously), it broke the 'camcontrol rescan 0' (or any other
  number) case when INVARIANTS are turned on.  Rescanning a single bus
  reliably produced an assert in cam_periph_runccb():

  panic: cam_periph_runccb: ccb=0xfffff80044ffe000, func_code=0x708, flags=0xffffdde0

  The flags values don't make sense from the code.  Changing the CCBs in
  rescan_or_reset_bus() from stack to heap allocated avoids the problem.

  It would be better to understand why userland stack allocated CCBs don't
  work properly, since there may be other code that breaks if stack allocated
  CCBs don't work.

  sbin/camcontrol/camcontrol.c:
  	In rescan_or_reset_bus(), allocate the CCBs using malloc(3) instead
  	of on the stack to avoid an assertion in cam_periph_runccb().

  Sponsored by:	Spectra Logic

  ------------------------------------------------------------------------

Sponsored by:	Spectra Logic
2016-12-12 21:02:34 +00:00
Devin Teske
81ea2761b2 MFC r307402: Guard against bad service name argument(s) to load_rc_config() 2016-12-12 17:56:56 +00:00
Christian Brueffer
b3092e5fa5 MFC: r309060
Fix comment typo.

PR:		208484
Submitted by:	madpilot
2016-12-12 11:02:55 +00:00
Konstantin Belousov
ad3a975d95 MFC r309550:
Rename fast taskqueues used by DMAR.
2016-12-12 09:43:48 +00:00
Baptiste Daroussin
59b5de4cea MFC r309803:
Fix pw groupshow <gid>

PR:		204676
Submitted by:	longwitz@incore.de
2016-12-12 07:02:53 +00:00
Baptiste Daroussin
243f67cab4 MFC r309796:
Perl is not available in base fix scripts depending on it to use
the version from ports

PR:		215159
Reported by:	Anatoly Kamchatnov <akamch@gmail.com>
2016-12-12 07:00:14 +00:00
Baptiste Daroussin
12d9e5f529 MFC r309795:
Update pci ids database to 2016.11.21
2016-12-12 06:56:19 +00:00
Marcelo Araujo
ae53434830 MFC r309392, r309393
r309392:
String terminators are called NUL, not NULL, also the variable
mentioned in the comment is p and not u.

Obtained from:	OpenBSD (r1.34)

r309393:
Use memset(3) instead of bzero(3).

Obtained from:	OpenBSD (r1.12, r1.20, r1.18 and r1.37)
2016-12-12 02:24:54 +00:00
Xin LI
f84d19b7f1 MFC r309241,309243:
Plug memory leaks.
2016-12-12 02:20:20 +00:00
Xin LI
6cd7ba5509 MFC r309238,309239:
r309238: Plug a potential memory leak.
r309239: style(9).
2016-12-12 02:13:35 +00:00
Xin LI
3a5c71e2a7 MFC r309232-309234:
r309232: Fix an obvious typo.
r309233: Eliminate variables that are computed, assigned but
         never used.
r309234: pages and psize are always assigned, so there is no
         need to initialize them as zero.
2016-12-12 00:45:43 +00:00
Hiren Panchasara
c27545d0c8 MFC r307745
In sendit(), if mp->msg_control is present, then in sockargs() we are
allocating mbuf to store mp->msg_control. Later in kern_sendit(), call
to getsock_cap(), will check validity of file pointer passed, if this
fails EBADF is returned but mbuf allocated in sockargs() is not freed.
Made code changes to free the same.

Since freeing control mbuf in sendit() after checking (control != NULL)
may lead to double freeing of control mbuf in sendit(), we can free
control mbuf in kern_sendit() if there are any errors in the routine.

Submitted by:		Lohith Bellad <lohith.bellad@me.com>
2016-12-11 23:36:11 +00:00
Dimitry Andric
fc7f77705e MFC r309722:
Pull in r281586 from upstream llvm trunk (by Wei Mi):

  Add some shortcuts in LazyValueInfo to reduce compile time of
  Correlated Value Propagation.

  The patch is to partially fix PR10584. Correlated Value Propagation
  queries LVI to check non-null for pointer params of each callsite. If
  we know the def of param is an alloca instruction, we know it is
  non-null and can return early from LVI. Similarly, CVP queries LVI to
  check whether pointer for each mem access is constant. If the def of
  the pointer is an alloca instruction, we know it is not a constant
  pointer. These shortcuts can reduce the cost of CVP significantly.

  Differential Revision: https://reviews.llvm.org/D18066

This significantly reduces memory usage and compilation time when
compiling a particular C++ source file of the graphics/colmap port.

PR:		215136
2016-12-11 19:58:13 +00:00
Konstantin Belousov
fd333cce58 MFC r309539:
Restructure the code to handle reporting of non-exited processes from
wait(2).
2016-12-11 18:42:17 +00:00
Xin LI
a5ee5bcf44 MFC r304875:
Use printable ASCII instead of octal representation.
2016-12-11 08:14:42 +00:00
Xin LI
87dd2b17dc MFC r308420: MFV r308392: file 5.29. 2016-12-11 07:33:02 +00:00
Xin LI
47cbc9f0fd MFC r303285:
Change bsdiff to use divsufsort suffix sort library instead of qsufsort,
which is more efficient.

Note that for now we do not create a separate library for libdivsufsort
because it's not used anywhere else.

Obtained from:        Chromium
2016-12-11 06:08:01 +00:00
Marcel Moolenaar
847586ac12 MFC r309394, r309787
Fix use-after-free bugs in pfsync(4)
2016-12-11 04:02:38 +00:00
Marcel Moolenaar
1a6a3a2a3c MFC r306299:
Update local variable 'block' after calling capacity_resize(),
otherwise format_resize(), which is called right after, isn't
getting the current/actual image size. Rather than rounding up,
format_resize() could end up truncating the size and we don't
allow that by design.
2016-12-11 03:59:37 +00:00
Marcel Moolenaar
a4c13625af MFC r305855, r306297, r306300, r306312-r306313
When MAKEOBJDIRPREFIX points to a case-insensitive file system, the
build can break when different source files create the same object
files (case-insensitivity speaking).  This is the case for object
files compiled with -fpic and shared libraries. The former uses
an extension of ".So", and the latter an extension ".so".  Rename
shared object files from *.So to *.pico to match what NetBSD does.

Also:
 o  Compile _Exit.c as C99_Exit.c, as it conflicts with _exit.s
 o  Add entry to UPDATING
 o  Document .pico extension
2016-12-11 03:57:21 +00:00
Ravi Pokala
d2cc75055b MFC r309491: Build smbios.ko as a module for amd64 and i386
For whatever reason, smapi, smbios, vpd are all under the "bios" directory.
smapi is only for i386, so the entire "bios" directory is only built for
i386. Break smapi out, and make only it i386-specific. Then, build the
"bios" directory for both amd64 and i386.
2016-12-11 02:01:57 +00:00
Rick Macklem
0a61e088a4 MFC: r309198, r309199
Document the -E flag for nfsstat.
This is a content change.
2016-12-10 21:13:50 +00:00
Rick Macklem
a7acd54093 MFC: r309197
Add a -E flag to nfsstat.c so that it prints out the NFSv4.1
procedure/operation counts.
It also avoids clipping the counts at 9 digits.
2016-12-10 21:03:49 +00:00
Dag-Erling Smørgrav
ebacbba769 MFH (r308297): use what(1) instead of strings(1).
PR:		213665
Submitted by:	Pawel Worach <pawel.worach@gmail.com>
2016-12-10 20:20:33 +00:00
Baptiste Daroussin
26eab93e24 MFC r309544:
Import tzdata 2016j
2016-12-10 11:35:28 +00:00
Xin LI
a3c852b9ed MFC r309184:
style(9) indent changes, no actual code change.
2016-12-10 06:24:26 +00:00
Rick Macklem
77df17ac60 MFC: r309171
Stop "nfsstat -z" from clearing counts of NFSv4 state structures.

The "-z" option on nfsstats was erroneously zeroing out the counts
of NFSv4 state structures. These counts will normally go back down
to zero as state is released. When zeroed out by "-z", these counts
can go negative. This patch fixes this problem.
2016-12-10 00:32:10 +00:00