]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r306009 [trasz]:
dteske [Tue, 13 Dec 2016 04:43:03 +0000 (04:43 +0000)]
MFC r306009 [trasz]:
Make autofs(5) -media map also use "async" and "noatime" for ext2fs(5).

7 years agoMFC r305969 [trasz]:
dteske [Tue, 13 Dec 2016 04:41:49 +0000 (04:41 +0000)]
MFC r305969 [trasz]:
Make autofs use the "noatime" flag for msdosfs, ntfs, and ufs
filesystems mounted on /media.

7 years agoMFC r305968 [trasz]:
dteske [Tue, 13 Dec 2016 04:39:44 +0000 (04:39 +0000)]
MFC r305968 [trasz]:
Make autofs use the "async" flag for msdosfs and ufs filesystems mounted
on /media.

7 years agoMFC r303943: Allow enforce_statfs (see jail(8)) to be set per jail
dteske [Tue, 13 Dec 2016 04:37:14 +0000 (04:37 +0000)]
MFC r303943: Allow enforce_statfs (see jail(8)) to be set per jail

Reviewed by: jelischer

7 years agoMFC r302798 [cy]: Restore lost comment from r301295.
dteske [Tue, 13 Dec 2016 04:35:19 +0000 (04:35 +0000)]
MFC r302798 [cy]: Restore lost comment from r301295.

PR: 211027
Reported by: Trond.Endrestol@ximalas.info

7 years agoRegen after r309954
bapt [Mon, 12 Dec 2016 21:49:29 +0000 (21:49 +0000)]
Regen after r309954

7 years agoMFC r309805:
bapt [Mon, 12 Dec 2016 21:45:25 +0000 (21:45 +0000)]
MFC r309805:

Make WITHOUT_CAPSICUM implying WITHOUT_CASPER

PR: 214562
Reported by: dewayne@heuristicsystems.com.au

7 years agoMFC r309797-r309802
bapt [Mon, 12 Dec 2016 21:43:17 +0000 (21:43 +0000)]
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

7 years agoMFC r307684, r307747
ken [Mon, 12 Dec 2016 21:02:34 +0000 (21:02 +0000)]
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

7 years agoMFC r307402: Guard against bad service name argument(s) to load_rc_config()
dteske [Mon, 12 Dec 2016 17:56:56 +0000 (17:56 +0000)]
MFC r307402: Guard against bad service name argument(s) to load_rc_config()

7 years agoMFC: r309060
brueffer [Mon, 12 Dec 2016 11:02:55 +0000 (11:02 +0000)]
MFC: r309060

Fix comment typo.

PR: 208484
Submitted by: madpilot

7 years agoMFC r309550:
kib [Mon, 12 Dec 2016 09:43:48 +0000 (09:43 +0000)]
MFC r309550:
Rename fast taskqueues used by DMAR.

7 years agoMFC r309803:
bapt [Mon, 12 Dec 2016 07:02:53 +0000 (07:02 +0000)]
MFC r309803:

Fix pw groupshow <gid>

PR: 204676
Submitted by: longwitz@incore.de

7 years agoMFC r309796:
bapt [Mon, 12 Dec 2016 07:00:14 +0000 (07:00 +0000)]
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>

7 years agoMFC r309795:
bapt [Mon, 12 Dec 2016 06:56:19 +0000 (06:56 +0000)]
MFC r309795:

Update pci ids database to 2016.11.21

7 years agoMFC r309392, r309393
araujo [Mon, 12 Dec 2016 02:24:54 +0000 (02:24 +0000)]
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)

7 years agoMFC r309241,309243:
delphij [Mon, 12 Dec 2016 02:20:20 +0000 (02:20 +0000)]
MFC r309241,309243:

Plug memory leaks.

7 years agoMFC r309238,309239:
delphij [Mon, 12 Dec 2016 02:13:35 +0000 (02:13 +0000)]
MFC r309238,309239:

r309238: Plug a potential memory leak.
r309239: style(9).

7 years agoMFC r309232-309234:
delphij [Mon, 12 Dec 2016 00:45:43 +0000 (00:45 +0000)]
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.

7 years agoMFC r307745
hiren [Sun, 11 Dec 2016 23:36:11 +0000 (23:36 +0000)]
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>

7 years agoMFC r309722:
dim [Sun, 11 Dec 2016 19:58:13 +0000 (19:58 +0000)]
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

7 years agoMFC r309539:
kib [Sun, 11 Dec 2016 18:42:17 +0000 (18:42 +0000)]
MFC r309539:
Restructure the code to handle reporting of non-exited processes from
wait(2).

7 years agoMFC r304875:
delphij [Sun, 11 Dec 2016 08:14:42 +0000 (08:14 +0000)]
MFC r304875:

Use printable ASCII instead of octal representation.

7 years agoMFC r308420: MFV r308392: file 5.29.
delphij [Sun, 11 Dec 2016 07:33:02 +0000 (07:33 +0000)]
MFC r308420: MFV r308392: file 5.29.

7 years agoMFC r303285:
delphij [Sun, 11 Dec 2016 06:08:01 +0000 (06:08 +0000)]
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

7 years agoMFC r309394, r309787
marcel [Sun, 11 Dec 2016 04:02:38 +0000 (04:02 +0000)]
MFC r309394, r309787

Fix use-after-free bugs in pfsync(4)

7 years agoMFC r306299:
marcel [Sun, 11 Dec 2016 03:59:37 +0000 (03:59 +0000)]
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.

7 years agoMFC r305855, r306297, r306300, r306312-r306313
marcel [Sun, 11 Dec 2016 03:57:21 +0000 (03:57 +0000)]
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

7 years agoMFC r309491: Build smbios.ko as a module for amd64 and i386
rpokala [Sun, 11 Dec 2016 02:01:57 +0000 (02:01 +0000)]
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.

7 years agoMFC: r309198, r309199
rmacklem [Sat, 10 Dec 2016 21:13:50 +0000 (21:13 +0000)]
MFC: r309198, r309199
Document the -E flag for nfsstat.
This is a content change.

7 years agoMFC: r309197
rmacklem [Sat, 10 Dec 2016 21:03:49 +0000 (21:03 +0000)]
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.

7 years agoMFH (r308297): use what(1) instead of strings(1).
des [Sat, 10 Dec 2016 20:20:33 +0000 (20:20 +0000)]
MFH (r308297): use what(1) instead of strings(1).

PR: 213665
Submitted by: Pawel Worach <pawel.worach@gmail.com>

7 years agoMFC r309544:
bapt [Sat, 10 Dec 2016 11:35:28 +0000 (11:35 +0000)]
MFC r309544:

Import tzdata 2016j

7 years agoMFC r309184:
delphij [Sat, 10 Dec 2016 06:24:26 +0000 (06:24 +0000)]
MFC r309184:

style(9) indent changes, no actual code change.

7 years agoMFC: r309171
rmacklem [Sat, 10 Dec 2016 00:32:10 +0000 (00:32 +0000)]
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.

7 years agoMFC r302785, r308300, r308441
manu [Fri, 9 Dec 2016 21:17:40 +0000 (21:17 +0000)]
MFC r302785, r308300, r308441

r302785 (jmcneill):
H3/A83T: Use PLL_PERIPH/2 for AHB2 parent clock.

Reviewed by: manu

r308300:
For AHB clock we need to set the assigned parents for cpufreq(4) to work.

r308441:
Do not fail to attach the clock if we cannot set the assigned parents as this
property isn't mandatory.

7 years agoMFC r305951: elfdump: adjust stdout/stderr capabilities
emaste [Fri, 9 Dec 2016 21:07:03 +0000 (21:07 +0000)]
MFC r305951: elfdump: adjust stdout/stderr capabilities

stdio uses fstat and the TIOCGETA ioctl. Also collapse the
cap_rights_limit and new cap_ioctls_limit calls into one if statement.
Errors here are not actionable by the user and distinguishing stdout
from stderr doesn't really have value.

7 years agoMFC r308298, r308440
manu [Fri, 9 Dec 2016 21:00:16 +0000 (21:00 +0000)]
MFC r308298, r308440

r308298:
Add clk_set_assigned

assigned-clock-parents are DT properties used to configure
some default parent clocks on one node.

Reviewed by: mmel

r308440:
Do not warn if the 'assigned-clock-parents' property does not exists.

7 years agoMFC r304796, r308233 (jmcneill)
manu [Fri, 9 Dec 2016 20:52:48 +0000 (20:52 +0000)]
MFC r304796, r308233 (jmcneill)

r304796:
Switch parent clock when setting frequency if a new parent is a better
candidate for the target rate.

Reviewed by: andrew, manu

r308233:
The DTS may report fewer than 4 parents for a module clock. Avoid setting
the module clock parent to an out-of-range index in these cases.

7 years agoMFC r302587 (jmcneill):
manu [Fri, 9 Dec 2016 20:48:47 +0000 (20:48 +0000)]
MFC r302587 (jmcneill):

Include sys/rman.h to fix build on arm64.

7 years agoMFC r302584 (jmcneill):
manu [Fri, 9 Dec 2016 20:45:11 +0000 (20:45 +0000)]
MFC r302584 (jmcneill):

Remove unused bus_space prototypes.

7 years agoMFC r302586 (jmcneill):
manu [Fri, 9 Dec 2016 20:37:34 +0000 (20:37 +0000)]
MFC r302586 (jmcneill):

Attach RSB early. Children of RSB may provide resources necessary for
other devices such as interrupts, GPIOs, and regulators.

7 years agoMFC r304795, r307366 (jmcneill):
manu [Fri, 9 Dec 2016 20:35:01 +0000 (20:35 +0000)]
MFC r304795, r307366 (jmcneill):

r304795:
Add support for Allwinner multi-parent bus gates.

Reviewed by: andrew, manu

r307366:
Match "allwinner,sun8i-h3-apb0-gates-clk" compatible string.

7 years agoMFC r305058 (jmcneill):
manu [Fri, 9 Dec 2016 20:28:28 +0000 (20:28 +0000)]
MFC r305058 (jmcneill):

Add support for Allwinner A64 watchdog timer.

7 years agoMFC r302585 (jmcneill):
manu [Fri, 9 Dec 2016 20:25:59 +0000 (20:25 +0000)]
MFC r302585 (jmcneill):

Build fix for arm64. The phy interface uses intptr_t for the "phy"
parameter, not int.

7 years agoMFC r308235 (jmcneill):
manu [Fri, 9 Dec 2016 20:21:48 +0000 (20:21 +0000)]
MFC r308235 (jmcneill):

Register the device's xref handle at attach time.

7 years agoMFC r308309:
manu [Fri, 9 Dec 2016 20:17:07 +0000 (20:17 +0000)]
MFC r308309:

Add support for AXP221 Power Management Unit.

AXP221 is used on board with A31/A31S and is mostly compatible with AXP209.
Regulators, GPIO and Sensors are supported.

7 years agoMFC r305349 (jmcneill):
manu [Fri, 9 Dec 2016 20:13:31 +0000 (20:13 +0000)]
MFC r305349 (jmcneill):

Add support for reading root key on A83T/A64.

7 years agoMFC r308704-r308705 (jmcneill)
manu [Fri, 9 Dec 2016 20:07:01 +0000 (20:07 +0000)]
MFC r308704-r308705 (jmcneill)

r308704:
Allow the MMC frequency to be set up to 52MHz for MMC high speed timings.

r308705:
On command error, reset only DMA and FIFO engines instead of the entire
controller. Fixes eMMC device detection on OrangePi Plus 2e (and likely
others).

7 years agoMFC r309029:
manu [Fri, 9 Dec 2016 20:03:49 +0000 (20:03 +0000)]
MFC r309029:

Do not attempt to disable/release clock if it had not been enabled.
While here fix a style(9) issue.

7 years agoMFC r304793 (jmcneill):
manu [Fri, 9 Dec 2016 19:40:33 +0000 (19:40 +0000)]
MFC r304793 (jmcneill):

Remove dependency on allwinner_soc_family() as it is not available on arm64.

7 years agoMFC r306479 (mmel):
manu [Fri, 9 Dec 2016 19:36:13 +0000 (19:36 +0000)]
MFC r306479 (mmel):

ALLWINNER: ahci_devclass is local variable, don't export it.

7 years agoMFC r306825: portsnap: use lam on the known good hash list
emaste [Fri, 9 Dec 2016 17:21:59 +0000 (17:21 +0000)]
MFC r306825: portsnap: use lam on the known good hash list

This change is equivalent to the approach committed in r306417, but if
sed has a bug it could be exploited by the untrusted tar file. Instead,
generate the expected tar content and compare that with find's output.

Submitted by: cperciva (in review D8052)

7 years agoMFC r309298: libm: remove duplicate version script entries
emaste [Fri, 9 Dec 2016 17:20:24 +0000 (17:20 +0000)]
MFC r309298: libm: remove duplicate version script entries

These symbols already appear in the common lib/msun/Symbol.map.
Duplicate entries produce an error with LLVM's LLD linker.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r309167:
jhibbits [Fri, 9 Dec 2016 04:35:07 +0000 (04:35 +0000)]
MFC r309167:

  Add an isync to after mtsrin, required by the MPC750 errata

7 years agoMFC 309613: cxgbe(4): Update firmwares from version 1.16.12.0 to 1.16.22.0.
jhb [Fri, 9 Dec 2016 01:44:26 +0000 (01:44 +0000)]
MFC 309613: cxgbe(4): Update firmwares from version 1.16.12.0 to 1.16.22.0.

Sponsored by: Chelsio Communications

7 years agoMFC r309281:
oleg [Thu, 8 Dec 2016 12:42:36 +0000 (12:42 +0000)]
MFC r309281:

Fix 'ipfw delete set N':
do not emit meaningless 'rule 0 not found' warning if set was already empty.

7 years agoPartial MFC r309300:
mm [Thu, 8 Dec 2016 01:06:09 +0000 (01:06 +0000)]
Partial MFC r309300:

Apply fix for libarchive issue #821:
  "tar -P" cannot extract hardlinks through symlinks

PR: 213255
Reported by: Tijl Coosemans <tilj@FreeBSD.org>

7 years agoMerge rr309688: address regressions in SA-16:37.libc.
glebius [Wed, 7 Dec 2016 23:19:46 +0000 (23:19 +0000)]
Merge rr309688: address regressions in SA-16:37.libc.

PR: 215105
Submitted by: <jtd2004a sbcglobal.net>

7 years agoDocument EN-16:19, EN-16:20, EN-16:21, SA-16:36, SA-16:37, SA-16:38.
gjb [Wed, 7 Dec 2016 18:55:55 +0000 (18:55 +0000)]
Document EN-16:19, EN-16:20, EN-16:21, SA-16:36, SA-16:37, SA-16:38.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r306030,r306031,r306033,r306036,r306038,r307190,r307196,r307204,r307205,r307701...
ngie [Wed, 7 Dec 2016 06:57:08 +0000 (06:57 +0000)]
MFC r306030,r306031,r306033,r306036,r306038,r307190,r307196,r307204,r307205,r307701,r307702:

r306030:

Port vnode_leak_test:main to FreeBSD

Use a simpler way of dumping kern.maxvnodes, i.e. `sysctl -n kern.maxvnodes`

The awk filtering method employed in NetBSD doesn't work on FreeBSD

r306031:

Port contrib/netbsd-tests/fs/h_funcs.subr to FreeBSD

Use kldstat -m to determine whether or not a filesystem is loaded. This works
well with tmpfs, ufs, and zfs

r306033:

Port sizes_test and statvfs_test to FreeBSD

Similar to r306030, use a simpler method for getting the value of
`hw.pagesize`, i.e. `sysctl -n hw.pagesize`. The awk filtering method doesn't
work on FreeBSD

r306036:

Port to mknod_test and readdir_test to FreeBSD

The `mknod <file> p` command doesn't exist on FreeBSD, like on NetBSD. Use
mkfifo instead to create named pipes (FIFOs).

r306038:

Port vnd_test to FreeBSD

Use mdmfs/mdconfig instead of vndconfig/newfs. vndconfig doesn't exist on FreeBSD.

TODO: need to parameterize out the md(4) device as it's currently hardcoded to "3"
(in both the FreeBSD and NetBSD cases).

r307190:

Skip :uchg on FreeBSD

Unfortunately removing files with uchg set always succeeds with root on
FreeBSD. Unfortunately running the test as an unprivileged user isn't doable
because mounting tmpfs requires root

PR: 212861

r307196:

Port contrib/netbsd-tests/fs/tmpfs/h_tools.c to FreeBSD

- Add inttypes.h #include for PRId64 macro
- Use FreeBSD's copy of getfh(2), which doesn't include a `fh_size` parameter.
  Use sizeof(fhandle_t) instead as the size of fhp is always fixed as
  fhandle_t, unlike NetBSD's copy of fhp, which is void*.

r307204:

Expect :large to fail on FreeBSD

FreeBSD doesn't appear to validate large -o size values like
NetBSD does

PR: 212862

r307205:

Change atf_skip call to atf_expect_fail to make it clear that a failure is
expected

PR: 212861
Suggested by: jmmv

r307701:

Expect tests/sys/fs/tmpfs/link_test:kqueue to fail

It fails with: "dir/b did not receive NOTE_LINK"

Also, add needed cleanup logic to cleanup the mountpoint after the fact

PR: 213662

r307702:

Integrate contrib/netbsd-tests/fs/tmpfs into the FreeBSD test suite
as tests/sys/fs

These testcases exercise tmpfs support

7 years agoMFC r306962:
ngie [Wed, 7 Dec 2016 00:55:36 +0000 (00:55 +0000)]
MFC r306962:
r306962 (by br):

Ensure data in pipe is available to read.
Useful for latest (5th, direct mode) test only.

7 years agoMerge r309640 from head:
glebius [Tue, 6 Dec 2016 18:54:43 +0000 (18:54 +0000)]
Merge r309640 from head:

  Fix possible integer overflow in guest memory bounds checking, which could
  lead to access from the virtual machine to the heap of the bhyve(8) process.

Submitted by: Felix Wilhelm <fwilhelm ernw.de>
Patch by: grehan
Security: FreeBSD-SA-16:38.bhyve

7 years agoMerge r309639 from head:
glebius [Tue, 6 Dec 2016 18:53:21 +0000 (18:53 +0000)]
Merge r309639 from head:

  Fix possible buffer overflow(s) in link_ntoa(3).

  A specially crafted sockaddr_dl argument can trigger a static buffer overflow
  in the libc library, with possibility to rewrite with arbitrary data following
  static buffers that belong to other library functions.

Reviewed by: kib
Security: FreeBSD-SA-16:37.libc

7 years agoMerge r309638 from head:
glebius [Tue, 6 Dec 2016 18:52:02 +0000 (18:52 +0000)]
Merge r309638 from head:

  When telnetd(8) composes argument list for login(1), an unexpected sequence
  of memory allocation failures combined with insufficient error checking
  could result in the construction and execution of an argument sequence that
  was not intended.

  Fix that treating malloc(3) failures as fatal condition.

Submitted by: brooks
Security: FreeBSD-SA-16:36.telnetd

7 years agoMFC r309282: Explicitly initialize cdai.flags.
mav [Tue, 6 Dec 2016 17:09:28 +0000 (17:09 +0000)]
MFC r309282: Explicitly initialize cdai.flags.

In SES driver uninitialized value caused unreliable physpath reporting.

7 years agoMFC r309332:
dim [Tue, 6 Dec 2016 07:33:49 +0000 (07:33 +0000)]
MFC r309332:

Cleanup old debug dirs in delete-old-dirs target

Any .debug or .symbols files under /usr/lib/debug which correspond to
OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up
by the delete-old target.  Make this also apply to any OLD_DIRS entries.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D8683

7 years agoMFC r307220:
ngie [Tue, 6 Dec 2016 04:35:24 +0000 (04:35 +0000)]
MFC r307220:
r307220 (by br):

Fix typos: use correct string format and value to compare.

7 years agoMFC 308066: cxgbe(4): Accurate statistics for all chip settings.
jhb [Mon, 5 Dec 2016 23:55:53 +0000 (23:55 +0000)]
MFC 308066: cxgbe(4): Accurate statistics for all chip settings.

There are 4 independent knobs in T5+ chips to include or exclude PAUSE
frames from the "total frames" and "multicast frames" counters in either
direction.  This change lets the driver deal with any combination of
these settings.

7 years agoMFC 307876:
jhb [Mon, 5 Dec 2016 23:46:21 +0000 (23:46 +0000)]
MFC 307876:
cxgbe(4): Fix bug in the calculation of the number of physically
contiguous regions in an mbuf chain.

If the payload of an mbuf ends at a page boundary count_mbuf_nsegs would
incorrectly consider the next mbuf's payload physically contiguous based
solely on a KVA comparison.

7 years agoMFC 307759: cxgbe(4): Dump any mailbox command that times out.
jhb [Mon, 5 Dec 2016 23:35:37 +0000 (23:35 +0000)]
MFC 307759: cxgbe(4): Dump any mailbox command that times out.

7 years agoMFC 307233:
jhb [Mon, 5 Dec 2016 23:25:49 +0000 (23:25 +0000)]
MFC 307233:
cxgbe(4): Allow the interface MTU to be set as high as the actual
hardware limit.

7 years agoMFC 306821,306823: Permit updating firmware config file in flash.
jhb [Mon, 5 Dec 2016 23:02:26 +0000 (23:02 +0000)]
MFC 306821,306823: Permit updating firmware config file in flash.

306821:
cxgbe(4): Add an ioctl to copy a firmware config file to the card's flash.

306823:
cxgbetool: Add a loadcfg subcommand to allow a user to upload a firmware
configuration file to the card.

7 years agoMFC 306277:
jhb [Mon, 5 Dec 2016 22:13:09 +0000 (22:13 +0000)]
MFC 306277:
cxgbe(4): Make the location/length of all descriptor rings available in
the sysctl MIB.

7 years agoMFC 305695,305696,305699,305702,305703,305713,305715,305827,305852,305906,
jhb [Mon, 5 Dec 2016 20:43:25 +0000 (20:43 +0000)]
MFC 305695,305696,305699,305702,305703,305713,305715,305827,305852,305906,
305908,306062,306063,306137,306138,306206,306216,306273,306295,306301,
306465,309302:
Add support for adapters using the Terminator T6 ASIC.

305695:
cxgbe(4): Set up fl_starve_threshold2 accurately for T6.

305696:
cxgbe(4): Use correct macro for header length with T6 ASICs.  This
affects the transmit of the VF driver only.

305699:
cxgbe(4): Update the pad_boundary calculation for T6, which has a
different range of boundaries.

305702:
cxgbe(4): Use smaller min/max bursts for fl descriptors with a T6.

305703:
cxgbe(4): Deal with the slightly different SGE_STAT_CFG in T6.

305713:
cxgbe(4): Add support for additional port types and link speeds.

305715:
cxgbe(4): Catch up with the rename of tlscaps -> cryptocaps.  TLS is one
of the capabilities of the crypto engine in T6.

305827:
cxgbe(4): Use the interface's viid to calculate the PF/VF/VFValid fields
to use in tx work requests.

305852:
cxgbe(4): Attach to cards with the Terminator 6 ASIC.  T6 cards will
come up as 't6nex' nexus devices with 'cc' ports hanging off them.

The T6 firmware and configuration files will be added as soon as they
are released.  For now the driver will try to work with whatever
firmware and configuration is on the card's flash.

305906:
cxgbe/t4_tom: The SMAC entry for a VI is at a different location in the T6.

305908:
cxgbe/t4_tom: Update the active/passive open code to support T6.  Data
path works as-is.

306062:
cxgbe(4): Show wcwr_stats for T6 cards.

306063:
cxgbe(4): Setup congestion response for T6 rx queues.

306137:
cxgbetool: Add T6 support to the SGE context decoder.

306138:
Fix typo.

306206:
cxgbe(4): Catch up with the different layout of WHOAMI in T6.

Note that the code moved below t4_prep_adapter() as part of this change
because now it needs a working chip_id().

306216:
cxgbe(4): Fix the output of the "tids" sysctl on T6.

306273:
cxgbe(4): Fix netmap with T6, which doesn't encapsulate SGE_EGR_UPDATE
message inside a FW_MSG.  The base NIC already deals with updates in
either form.

306295:
cxgbe(4): Support SIOGIFXMEDIA so that ifconfig displays correct media
for 25Gbps and 100Gbps ports.   This should have been part of r305713,
which is when the driver first started reporting extended media types.

306301:
cxgbe(4): Use the port's top speed to figure out whether it is "high
speed" or not (for the purpose of calculating the number of queues etc.)
This does the right thing for 25Gbps and 100Gbps ports.

306465:
cxgbe(4): Claim the T6 -DBG card.

309302:
cxgbe(4): Include firmware for T6 cards in the driver.  Update all
firmwares to 1.16.12.0.

Sponsored by: Chelsio Communications

7 years agoMFC 305667:
jhb [Mon, 5 Dec 2016 19:37:15 +0000 (19:37 +0000)]
MFC 305667:
cxgbe(4): Avoid a NULL dereference in the clearstats ioctl handler.
Port softc's are not initialized when the adapter is in recovery mode.

7 years agoMFC 305652: cxgbe(4): Do not prescreen frames before attempting LRO.
jhb [Mon, 5 Dec 2016 19:34:52 +0000 (19:34 +0000)]
MFC 305652: cxgbe(4): Do not prescreen frames before attempting LRO.

7 years agoMFC 305433:
jhb [Mon, 5 Dec 2016 19:32:06 +0000 (19:32 +0000)]
MFC 305433:
cxgbe/t4_tom: toepcb should be all-zero on allocation because the code
that cleans up on failure assumes that non-NULL values indicate
initialized items.

7 years agoMFC 303688,303750,305166,305167: Centralize and rework page pod handling.
jhb [Mon, 5 Dec 2016 19:15:33 +0000 (19:15 +0000)]
MFC 303688,303750,305166,305167: Centralize and rework page pod handling.

303688:
cxgbe/t4_tom: Read the chip's DDP page sizes and save them in a
per-adapter data structure.  This replaces a global array with hardcoded
page sizes.

303750:
cxgbe/t4_tom: The page pod arena allocates from pod address space and
not index space.  The minimum valid allocation out of this arena is the
size of a single page pod.

305166:
cxgbe/t4_tom: Add general purpose routines to deal with page pod regions
and allocations within them.  Switch to these routines to manage the TOE
DDP region.

305167:
cxgbe/t4_tom: Two new routines to allocate and write page pods for a
buffer in the kernel's address space.

Sponsored by: Chelsio Communications

7 years agoMFC r308943
hiren [Mon, 5 Dec 2016 06:20:27 +0000 (06:20 +0000)]
MFC r308943

For RTT calculations mid-session, we explicitly ignore ACKs with tsecr of 0 as
many borken middle-boxes tend to do that. But during 3whs, in syncache_expand(),
we don't do that which causes us to send a RST to such a client. Relax this
constraint by only using tsecr to compare against timestamp that we sent when it
is not 0. As a result, we'd now accept the final ACK of 3whs with tsecr of 0.

Sponsored by: Limelight Networks

7 years agoMFC r309026: open(2): Clarify non-POSIX error when opening a symlink with
jilles [Sun, 4 Dec 2016 15:55:59 +0000 (15:55 +0000)]
MFC r309026: open(2): Clarify non-POSIX error when opening a symlink with
O_NOFOLLOW.

We return [EMLINK] instead of [ELOOP] when trying to open a symlink with
O_NOFOLLOW, so that the original case of [ELOOP] can be distinguished. Code
like cmp -h and xz takes advantage of this.

PR: 214633

7 years agoMFC r309209:
kib [Sun, 4 Dec 2016 00:33:07 +0000 (00:33 +0000)]
MFC r309209:
Do not enable nullfs vnode caching over nfs v4 mounts.

7 years agoMFC: r308871
rmacklem [Sat, 3 Dec 2016 21:49:26 +0000 (21:49 +0000)]
MFC: r308871
Modify umount so that it does not do an Unmount RPC for NFSv4 mounts
and uses TCP for the Unmount RPC if the mount is over TCP.
Without this patch, umount does an Unmount RPC over UDP for all NFS mounts.

7 years agoMFC r308250:
trasz [Sat, 3 Dec 2016 21:27:19 +0000 (21:27 +0000)]
MFC r308250:

Check for lengths being <= 0.  Note that this interface can only
be accessed by root.  It uses unsigned ints instead of size_t
to preserve the ABI.

PR: 207627

7 years agoMFC r308209:
trasz [Sat, 3 Dec 2016 21:23:43 +0000 (21:23 +0000)]
MFC r308209:

Fix getfsstat(2) with MNT_WAIT to not skip filesystems that are in the
process of being unmounted.  Previously it would skip them, even if the
unmount eventually failed eg due to the filesystem being busy.

This behaviour broke autounmountd(8) - if you tried to manually unmount
a mounted filesystem, using 'automount -u', and the autounmountd attempted
to refresh the filesystem list in that very moment, it would conclude that
the filesystem got unmounted and not try to unmount it afterwards.

7 years agoMFC r308088:
trasz [Sat, 3 Dec 2016 21:19:45 +0000 (21:19 +0000)]
MFC r308088:

Fix getfsstat(2) handling of flags. The 'flags' argument is an enum,
not a bitfield. For the intended usage - being passed either MNT_WAIT,
or MNT_NOWAIT - this shouldn't introduce any changes in behaviour.

7 years agoMFC r309356: svn 1.9.4 -> 1.9.5
peter [Sat, 3 Dec 2016 20:30:05 +0000 (20:30 +0000)]
MFC r309356: svn 1.9.4 -> 1.9.5

7 years agoMFC r308206:
trasz [Sat, 3 Dec 2016 19:53:15 +0000 (19:53 +0000)]
MFC r308206:

Make autounmountd(8) not die when traced with "truss -p".

7 years agoMFC r308668:
gonzo [Sat, 3 Dec 2016 17:40:26 +0000 (17:40 +0000)]
MFC r308668:

[evdev] Add evdev support to kbdmux(4) driver

To enable event sourcing from kbdmux(4) kern.evdev.rcpt_mask value
should have bit 1 set (this is default)

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Differential Revision: https://reviews.freebsd.org/D8437

7 years agoMFC r309189:
kib [Sat, 3 Dec 2016 17:10:04 +0000 (17:10 +0000)]
MFC r309189:
Fix automatic eventtimer hardware selection when ARAT is not implemented,
and do not ignore TSCDLT.

7 years agoMFC r309474:
ngie [Sat, 3 Dec 2016 03:59:24 +0000 (03:59 +0000)]
MFC r309474:

Don't build :strvis_locale if VIS_NOLOCALE is undefined

The copy of contrib/libc-vis on ^/stable/10 doesn't contain all of the features
in the ^/stable/11 // ^/head version, including VIS_NOLOCALE. The risk is lower
in conditionally running the test instead of backporting the newer version of
libc-vis

7 years agoMFC r309472:
ngie [Sat, 3 Dec 2016 03:15:09 +0000 (03:15 +0000)]
MFC r309472:

Restore pathing for factor(1), which unnecessarily diverged in r278616

factor lives in /usr/games/, not /usr/bin, in NetBSD.

The correct way to handle this is do on-the-fly manipulation of the test
script via ATF_TESTS_SH_SED_<foo>, not by modify the pathing directly in
the test script.

This is being done to resolve an unnecessary conflict made when pulling
back ^/head@r309469 (contrib/netbsd-tests update) to ^/stable/10.

No functional change

7 years agoMFC r305449:
ngie [Sat, 3 Dec 2016 03:05:44 +0000 (03:05 +0000)]
MFC r305449:

Install h_db to unbreak some of the lib/libc/db testcases after
r305358

7 years agoMFC r305451:
ngie [Sat, 3 Dec 2016 03:04:20 +0000 (03:04 +0000)]
MFC r305451:

Fix lib/libc/rpc test assumptions added in r305358

- Require root in the tcp/udp subtests (it's needed on FreeBSD when
  registering services).
- Skip the tests if service registration fails.

7 years agoMFC r304797,r305467,r305468,r305483:
ngie [Sat, 3 Dec 2016 02:55:19 +0000 (02:55 +0000)]
MFC r304797,r305467,r305468,r305483:

r304797 (by jmmv):

Make use of Kyua's work directories.

Change the vnode tests to use the current directory when creating temporary
files, which we can assume is a volatile work directory, and then make the
kqueue_test.sh driver _not_ abandon the directory created by Kyua.

This makes the various kqueue tests independent of each other, and ensures
the temporary file is cleaned up on failure.

Problem spotted by asomers@ when reviewing D4254.

r305467:

Move tests/sys/kqueue/... to tests/sys/kqueue/libkqueue/...

This is being done to clearly distinguish the libkqueue tests
from the (soon to be imported) NetBSD tests.

r305468:

Port contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/...

proc2_test must be skipped because the invariant tested
(`ke.fflags & NOTE_TRACKERR`) doesn't pass.

r305483:

Fix tests/sys/kqueue NetBSD tests on 32-bit platforms by using proper
format specifier for pointers when printing them out with printf(3)

Pointyhat to: ngie

7 years agoMFC r305921:
ngie [Sat, 3 Dec 2016 02:48:55 +0000 (02:48 +0000)]
MFC r305921:

Similar to r305920, remove spurious newlines from ATF_REQUIRE_MSG calls

7 years agoMFC r305358:
ngie [Sat, 3 Dec 2016 02:47:16 +0000 (02:47 +0000)]
MFC r305358:

Update contrib/netbsd-tests with new content from NetBSD

This updates the snapshot from 09/30/2014 to 08/11/2016

This brings in a number of new testcases from upstream, most
notably:

- bin/cat
- lib/libc
- lib/msun
- lib/libthr
- usr.bin/sort

lib/libc/tests/stdio/open_memstream_test.c was moved to
lib/libc/tests/stdio/open_memstream2_test.c to accomodate
the new open_memstream test from NetBSD.

Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox

7 years agoMFC 303348:
jhb [Sat, 3 Dec 2016 01:10:45 +0000 (01:10 +0000)]
MFC 303348:
cxgbe(4): Initialize the adapter queues (fwq and mgmtq) instead of
returning EAGAIN if they aren't available when the user tries to program
a filter.  Do this after validating the filter so that the driver
doesn't bring up the queues if it doesn't have to.

7 years agoMFC 302440,304873,305704,305985,306787,307531: Fixes for sysctls.
jhb [Sat, 3 Dec 2016 01:04:59 +0000 (01:04 +0000)]
MFC 302440,304873,305704,305985,306787,307531: Fixes for sysctls.

302440:
cxgbe(4): Add sysctl to display the RSS indirection table size for an
interface.

dev.cxl.<n>.rss_size
dev.vcxl.<n>.rss_size

304873:
cxgbe(4): Provide more details about the card in the sysctl MIB.

dev.t5nex.0.%desc: Chelsio T580-CR
dev.t5nex.0.hw_revision: 1
dev.t5nex.0.sn: PT13140042
dev.t5nex.0.pn: 110117150A0
dev.t5nex.0.ec: 0000000000000000
dev.t5nex.0.na: 0007432AF490
dev.t5nex.0.vpd_version: 3
dev.t5nex.0.scfg_version: 53255
dev.t5nex.0.bs_version: 1.1.0.0
dev.t5nex.0.er_version: 1.0.0.68
dev.t5nex.0.tp_version: 0.1.4.9
dev.t5nex.0.firmware_version: 1.16.2.0

305704:
cxgbe(4): Rename the debug_flags driver tunable/sysctl to dflags.
Tunables that end with _flags are special.

305985:
cxgbe(4): Fixes to wrq stats.

- Increment tx_wrs_copied in the correct place.
- Add tx_wrs_sspace to the sysctl MIB.

306787:
cxgbe(4): Fix whitespace in the pm_stats display.

307531:
cxgbe(4): Adjust whitespace to line up the column titles in cim_qcfg
with the values displayed.

Sponsored by: Chelsio Communications

7 years agoMFC r309179:
pfg [Sat, 3 Dec 2016 00:43:11 +0000 (00:43 +0000)]
MFC r309179:
ext2fs: avoid possible overflow when calculating malloc size.

This is inspired on r308064 for the case of mounting UFS.