]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoFix rtld-elf compilation warning for powerpc64 ELFv2 ABI
jhibbits [Sun, 13 Jan 2019 02:33:20 +0000 (02:33 +0000)]
Fix rtld-elf compilation warning for powerpc64 ELFv2 ABI

Summary: reloc_jmpslot function parameter 'defobj' is not used when using ELFv2
ABI

Submitted by: alfredo.junior_eldorado.org.br
Reviewed By: kib, git_bdragon.rtk0.net, emaste, jhibbits
Differential Revision: https://reviews.freebsd.org/D18808

5 years agoAdd AT_HWCAP / AT_HWCAP2 to elf64_sysvec_v2.
jhibbits [Sun, 13 Jan 2019 02:28:37 +0000 (02:28 +0000)]
Add AT_HWCAP / AT_HWCAP2 to elf64_sysvec_v2.

Summary:
I was working on implementing ifuncs on powerpc64 elfv2 today, and I suddenly
realized that the reason I was having so much trouble with AT_HWCAP and
AT_HWCAP2 is they are missing from the sysentvec.

After adding them, the auxv is being filled like it should.

Submitted by: Brandon Bergren (git_bdragon.rtk0.net)
Differential Revision: https://reviews.freebsd.org/D18575

5 years agoRegenerate sysent files after having modified syscalls.master.
cognet [Sun, 13 Jan 2019 00:38:55 +0000 (00:38 +0000)]
Regenerate sysent files after having modified syscalls.master.

5 years agoamd64 is the only arch that doesn't require padding for 32bits syscalls, so
cognet [Sun, 13 Jan 2019 00:37:31 +0000 (00:37 +0000)]
amd64 is the only arch that doesn't require padding for 32bits syscalls, so
instead of listing every arch thar requires it, just exclude amd64.

5 years agoInstead of using an incomplete list of platforms that uses 64bits time_t
cognet [Sun, 13 Jan 2019 00:19:15 +0000 (00:19 +0000)]
Instead of using an incomplete list of platforms that uses 64bits time_t
in 32bits mode, special case amd64, as i386 is the only arch that still
uses 32bits time_t.

5 years agoamdtemp(4): Add support for Family 15h, Model >=60h
cem [Sat, 12 Jan 2019 22:36:33 +0000 (22:36 +0000)]
amdtemp(4): Add support for Family 15h, Model >=60h

Family 15h is a bit of an oddball.  Early models used the same temperature
register and spec (mostly[1]) as earlier CPU families.

Model 60h-6Fh and 70-7Fh use something more like Family 17h's Service
Management Network, communicating with it in a similar fashion.  To support
them, add support for their version of SMU indirection to amdsmn(4) and use
it in amdtemp(4) on these models.

While here, clarify some of the deviceid macros in amdtemp(4) that were
added with arbitrary, incorrect family numbers, and remove ones that were
not used.  Additionally, clarify intent and condition of heterogenous
multi-socket system detection.

[1]: 15h adds the "adjust range by -49°C if a certain condition is met,"
which previous families did not have.

Reported by: D. C. <tjoard AT gmail.com>
PR: 234657
Tested by: D. C. <tjoard AT gmail.com>

5 years agopowerpc/pseries: Cache the IPI vector to avoid the common static lookup
jhibbits [Sat, 12 Jan 2019 22:10:31 +0000 (22:10 +0000)]
powerpc/pseries: Cache the IPI vector to avoid the common static lookup

The IPI vector is static, and happens to be the most common interrupt by far
on some systems.  Rather than searching for the interrupt every time, cache
the index.

This appears to yield a small performance boost, of about 8% reduction in
buildworld times, on my POWER9 system, when paired with r342975.

5 years agopowerpc: Add opaque 'private data' to interrupt vectors
jhibbits [Sat, 12 Jan 2019 22:05:42 +0000 (22:05 +0000)]
powerpc: Add opaque 'private data' to interrupt vectors

The XICS and XIVE need extra data beyond irq and vector.  Rather than
performing a separate search, it's better for the general interrupt facility
to hold a private pointer, since the search already must be done anyway at
that level.

5 years agoCreate crtsavres.o for powerpc builds
jhibbits [Sat, 12 Jan 2019 21:29:54 +0000 (21:29 +0000)]
Create crtsavres.o for powerpc builds

Summary:
GCC expects to link in a crtsavres.o on powerpc platforms.  On
powerpc64 this is an empty file, but on powerpc and powerpcspe this does contain
some save/restore functions, which may not actually be necessary for newer
modern GCC and clang.  This appeases the in-tree gcc, though, and is needed in
order to switch to the BSD CRTRBEGIN.

PR: 233751
Reviewed By: andrew
Differential Revision: https://reviews.freebsd.org/D18826

5 years agoFix the check for the offset of td_frame and td_emuldata in struct thread.
andrew [Sat, 12 Jan 2019 20:41:57 +0000 (20:41 +0000)]
Fix the check for the offset of td_frame and td_emuldata in struct thread.

Pointy hat: andrew
Sponsored by: DARPA, AFRL

5 years agoDisable FTS3, FTS4, and RTREE in bundled and private sqlite3.
cy [Sat, 12 Jan 2019 17:56:23 +0000 (17:56 +0000)]
Disable FTS3, FTS4, and RTREE in bundled and private sqlite3.

Suggested by: delphij@
Reviewed by: delphij@ (for secteam@)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18786

5 years agoAdd missing documentation for dev.acpi_ibm.0.mic_led added in r335304
allanjude [Sat, 12 Jan 2019 17:52:52 +0000 (17:52 +0000)]
Add missing documentation for dev.acpi_ibm.0.mic_led added in r335304

PR: 229074
X-MFC-With: 335304
Submitted by: Ali Abdallah <aliovx@gmail.com>

5 years agonet80211: fix possible panic for some drivers after r342211
avos [Sat, 12 Jan 2019 14:57:12 +0000 (14:57 +0000)]
net80211: fix possible panic for some drivers after r342211

Check if rate control structures were allocated before trying to
access them in various places; this was possible before on
allocation failure (unlikely), but was revealed after r342211
where allocation was deferred.

In case if driver uses wlan_amrr(4) and it is loaded it
is possible to reproduce the panic via

sysctl net.wlan.<number>.rate_stats

(for wlan0 the number will be 0).

Tested with: RTL8188EE, AP mode + RTL8188CUS, STA mode.

MFC after: 3 days

5 years agoFix indentation in ruptime command output for hosts in the "down" state.
nyan [Sat, 12 Jan 2019 12:57:32 +0000 (12:57 +0000)]
Fix indentation in ruptime command output for hosts in the "down" state.

PR: 234239
MFC after: 1 week

5 years agoSync with OpenBSD.
nyan [Sat, 12 Jan 2019 12:35:02 +0000 (12:35 +0000)]
Sync with OpenBSD.

bc.y: Rev 1.50
- write parse errors to stderr, prompted by Martijn Dekker
- we're only interactive if stdout en stderr are a tty as well as stdin

PR: 234430
Obtained from: OpenBSD
MFC after: 1 week

5 years agoTemporarily disable the kcov tests. Not all architectures have
andrew [Sat, 12 Jan 2019 11:50:39 +0000 (11:50 +0000)]
Temporarily disable the kcov tests. Not all architectures have
atomic_store_64 and atomic_store_64.

Sponsored by: DARPA, AFRL

5 years agoAdd support for the Clang Coverage Sanitizer in the kernel (KCOV).
andrew [Sat, 12 Jan 2019 11:21:28 +0000 (11:21 +0000)]
Add support for the Clang Coverage Sanitizer in the kernel (KCOV).

When building with KCOV enabled the compiler will insert function calls
to probes allowing us to trace the execution of the kernel from userspace.
These probes are on function entry (trace-pc) and on comparison operations
(trace-cmp).

Userspace can enable the use of these probes on a single kernel thread with
an ioctl interface. It can allocate space for the probe with KIOSETBUFSIZE,
then mmap the allocated buffer and enable tracing with KIOENABLE, with the
trace mode being passed in as the int argument. When complete KIODISABLE
is used to disable tracing.

The first item in the buffer is the number of trace event that have
happened. Userspace can write 0 to this to reset the tracing, and is
expected to do so on first use.

The format of the buffer depends on the trace mode. When in PC tracing just
the return address of the probe is stored. Under comparison tracing the
comparison type, the two arguments, and the return address are traced. The
former method uses on entry per trace event, while the later uses 4. As
such they are incompatible so only a single mode may be enabled.

KCOV is expected to help fuzzing the kernel, and while in development has
already found a number of issues. It is required for the syzkaller system
call fuzzer [1]. Other kernel fuzzers could also make use of it, either
with the current interface, or by extending it with new modes.

A man page is currently being worked on and is expected to be committed
soon, however having the code in the kernel now is useful for other
developers to use.

[1] https://github.com/google/syzkaller

Submitted by: Mitchell Horne <mhorne063@gmail.com> (Earlier version)
Reviewed by: kib
Testing by: tuexen
Sponsored by: DARPA, AFRL
Sponsored by: The FreeBSD Foundation (Mitchell Horne)
Differential Revision: https://reviews.freebsd.org/D14599

5 years agosnd_uaudio: Add quirks for Edirol UA-25EX in advanced driver mode.
hselasky [Sat, 12 Jan 2019 11:14:59 +0000 (11:14 +0000)]
snd_uaudio: Add quirks for Edirol UA-25EX in advanced driver mode.

Extend the vendor class USB audio quirk to cover devices without
the USB audio control descriptor.

PR: 234794
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agocxgbe(4): Move some INTx specific code to a more appropriate place.
np [Sat, 12 Jan 2019 04:44:25 +0000 (04:44 +0000)]
cxgbe(4): Move some INTx specific code to a more appropriate place.

5 years agoAdd Linux compatibility support for `SC_NPROCESSORS_{CONF,ONLN}` as `_SC_NPROCESSORS_...
ngie [Fri, 11 Jan 2019 22:28:18 +0000 (22:28 +0000)]
Add Linux compatibility support for `SC_NPROCESSORS_{CONF,ONLN}` as `_SC_NPROCESSORS_{CONF,ONLN}`

The goal of this change is to make it easier to use getconf to query
the number of available processors.

Sadly it's unclear per POSIX, which form (with a preceding _ or
lacking it) is correct. I will bring this up on the Austin Group list so
this point is clarified for implementors that might rely on this getconf
variable in future POSIX spec versions.

This is something I noticed when trying to import GoogleTest to FreeBSD
as one of the CI scripts uses this variable on Linux.

MFC after: 2 weeks
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D18640

5 years agoAdd man page for device_delete_children.
imp [Fri, 11 Jan 2019 19:05:40 +0000 (19:05 +0000)]
Add man page for device_delete_children.

Submitted by: Jeroen Ruigrok van der Werven
Differential Revision: https://reviews.freebsd.org/D18452

5 years agoFix duplication.
bapt [Fri, 11 Jan 2019 16:18:23 +0000 (16:18 +0000)]
Fix duplication.

The patch adding the manpage was probably applied twice, so it resulted
in duplication of the manpage

5 years agoRemove accessing remote node and domain objects while processing cam actions.
ram [Fri, 11 Jan 2019 15:59:24 +0000 (15:59 +0000)]
Remove accessing remote node and domain objects while processing cam actions.
Issue:
  ocs_fc(4) driver panics. It's induced by setting the port_state
sysctl to offline, then online, then offline, then online, and so
forth and so on in rapid succession.

Reason:
  While we set the port_state to online fc discovery will start and OS
is enumerating the target discs by calling ocs_action(),  then set the
port state to "offline" which deletes domain/sport/nodes.

  In ocs_action()->XPT_GET_TRAN_SETTINGS we are accessing the remote
node which can be invalid to get the wwpn, wwnn and port.

Fix:
  Removed accessing of remote node and domain in some ocs_action() cases.
  Populated the required values from ocs_fcport.
  This removes the dependency of node and domain structures while
processing XPT_PATH_INQ and XPT_GET_TRAN_SETTINGS.
   We will invalidate the target entries after the device lost
timeout(30 seconds).

Approved by: ken, mav
MFC after: 3 weeks

5 years agoAdd `bluetooth-config` script to simplify setting up bluetooth connections to
lme [Fri, 11 Jan 2019 15:52:09 +0000 (15:52 +0000)]
Add `bluetooth-config` script to simplify setting up bluetooth connections to
devices like mice, keyboards, bt-audio, ...

This script currently allows scanning for nearby devices, adds one to
/etc/bluetooth/hosts, adds an entry to hcsecd's conf and if it is a HID, add an
entry to bthidd's configs, as well.

Submitted by: erdgeist <erdgeist@erdgeist.org>
Approved by: bapt
MFC after: 2 weeks
Differential Revision: D3778
Reviewers: bapt, emax

5 years agoFix spelling of identifier
rgrimes [Fri, 11 Jan 2019 14:21:59 +0000 (14:21 +0000)]
Fix spelling of identifier

Approved by: phk (mentor)
MFC after: 3 days

5 years agoFix the location of td->td_frame at the top of the kernel stack.
andrew [Fri, 11 Jan 2019 11:32:46 +0000 (11:32 +0000)]
Fix the location of td->td_frame at the top of the kernel stack.

In cpu_thread_alloc we would allocate space for the trap frame at the top of
the kernel stack. This is just below the pcb, however due to a missing cast
the pointer arithmetic would use the pcb size, not the trapframe size. As
the pcb is larger than the trapframe this is safe, however later in cpu_fork
we include the case leading to the two disagreeing on the location.

Fix by using the same arithmetic in both locations.

Found by: An early KASAN patch
Sponsored by: DARPA, AFRL

5 years agoImport DTS from Linux 4.20
manu [Fri, 11 Jan 2019 09:40:34 +0000 (09:40 +0000)]
Import DTS from Linux 4.20

MFC after: 2 months

5 years agoImport DTS includes from 4.19
manu [Fri, 11 Jan 2019 09:20:18 +0000 (09:20 +0000)]
Import DTS includes from 4.19
This was missed in r340337

MFC after: 3 days

5 years agocpucontrol: check for the supposed firmware file type and skip
kib [Fri, 11 Jan 2019 08:35:49 +0000 (08:35 +0000)]
cpucontrol: check for the supposed firmware file type and skip
non-regular entry.

do_update() skips entries with DT_DIR type.  This does not eliminate
other entries that might exist in the directory.  More, since NFS
might fill d_type with DT_UNKNOWN, dot and dotdot entries are not
skipped, then mmap(2) call failed for them when update microcode files
are located on NFS.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoFix errno values returned from DUMMY_XATTR linuxulator calls
fsu [Fri, 11 Jan 2019 07:58:25 +0000 (07:58 +0000)]
Fix errno values returned from DUMMY_XATTR linuxulator calls

Reported by: weiss@uni-mainz.de
Reviewed by: markj
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D18812

5 years agoImport DTS files from Linux 4.20
manu [Fri, 11 Jan 2019 05:27:30 +0000 (05:27 +0000)]
Import DTS files from Linux 4.20

5 years agoChange ZFS quotas to return EINVAL when not present (matches man page).
sef [Fri, 11 Jan 2019 02:53:46 +0000 (02:53 +0000)]
Change ZFS quotas to return EINVAL when not present (matches man page).

UFS will return EINVAL when quotas are not enabled on a filesystem; ZFS'
equivalent involves not having quotas (there is not way to enable or disable
quotas as such).  My initial implementation had it return ENOENT, but
quotactl(2) indicates EINVAL is more appropriate.

MFC after: 2 weeks
Approved by: mav
Reviewed by: markj
Reported by: Emrion <kmachine@free.fr>
Sponsored by: iXsystems Inc
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234413

5 years agoRelax requirement to packet size of CARP protocol and remove version check.
ae [Fri, 11 Jan 2019 01:54:15 +0000 (01:54 +0000)]
Relax requirement to packet size of CARP protocol and remove version check.

CARP shares protocol number 112 with VRRP (RFC 5798). And the size of
VRRP packet may be smaller than CARP. ipfw_chk() does m_pullup() to at
least sizeof(struct carp_header) and can fail when packet is VRRP. This
leads to packet drop and message about failed pullup attempt.
Also, RFC 5798 defines version 3 of VRRP protocol, this version number
also unsupported by CARP and such check leads to packet drop.

carp_input() does its own checks for protocol version and packet size,
so we can remove these checks to be able pass VRRP packets.

PR: 234207
MFC after: 1 week

5 years agodtb: allwinner: Add orangepi-pc to the build
manu [Fri, 11 Jan 2019 01:42:47 +0000 (01:42 +0000)]
dtb: allwinner: Add orangepi-pc to the build

PR: 226011
Submitted by: Greg V <greg@unrelenting.technology>
MFC after: 1 week

5 years agoRemove recursive NET_EPOCH_ENTER() from sysctl_ifmalist(), missed in r342872.
glebius [Fri, 11 Jan 2019 00:45:22 +0000 (00:45 +0000)]
Remove recursive NET_EPOCH_ENTER() from sysctl_ifmalist(), missed in r342872.

5 years agoRemove support for FreeBSD 9 kernel, which used to change byte order
glebius [Thu, 10 Jan 2019 23:27:29 +0000 (23:27 +0000)]
Remove support for FreeBSD 9 kernel, which used to change byte order
of packet headers.

5 years agoUpdate my committer name and add my new mentor relationship
ngie [Thu, 10 Jan 2019 17:27:47 +0000 (17:27 +0000)]
Update my committer name and add my new mentor relationship

## Regarding the name change

A few years ago I changed my legal name to "Enji Cooper". When I rejoined the
project, I requested that accounts@ use my legal name instead of my [previous]
nickname. This change syncs up a reference to use the proper name for clarity.

## Regarding the new mentor relationship

@emaste and @jtl graciously accepted my request to mentor me this time around
with my src commits while I get up to speed.

I am leaving my previous mentorship details in committers-src.dot for historical
reasons, per @emaste's request.

-- Thank you very much @jmmv and @rpaulo for the help with my previous
   mentorship; I really appreciate it!

Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D18644

5 years agoFix a comment, pushed onto is two words.
andrew [Thu, 10 Jan 2019 16:31:07 +0000 (16:31 +0000)]
Fix a comment, pushed onto is two words.

While here make the comments sentences.

Sponsored by: DARPA, AFRL

5 years agoUpdate to ELF Tool Chain r3668
emaste [Thu, 10 Jan 2019 14:35:23 +0000 (14:35 +0000)]
Update to ELF Tool Chain r3668

Highlights:
- Make sure that only TLS sections are sorted into TLS segment.
- Fixed multiple errors in "Section to Segment mapping".
- Man page updates
- ar improvements
- elfcopy: avoid filter_reloc uninitialized variable for rela
- elfcopy: avoid stripping relocations from static binaries
- readelf: avoid printing directory in front of absolute path
- readelf: add NT_FREEBSD_FEATURE_CTL FreeBSD note type
- test improvements

NOTES:

Some of these changes originated in FreeBSD and simply reduce diffs
between contrib and vendor.

ELF Tool Chain ar is not (currently) used in FreeBSD, and there are
improvements in both FreeBSD and ELF Tool Chain ar that are not in
the other.

Sponsored by: The FreeBSD Foundation

5 years agoImport ELF Tool Chain snapshot at r3668
emaste [Thu, 10 Jan 2019 14:18:11 +0000 (14:18 +0000)]
Import ELF Tool Chain snapshot at r3668

From http://svn.code.sf.net/p/elftoolchain/code/

5 years agortwn_usb(4): add IQ calibration support for RTL8192CU
avos [Thu, 10 Jan 2019 05:49:47 +0000 (05:49 +0000)]
rtwn_usb(4): add IQ calibration support for RTL8192CU

The code is similar to the one for RTL8188E* and probably
should be shared with RTL8188CE (needs to be tested).

Checked with RTL8188CUS, STA mode.

MFC after: 5 days

5 years agolibbe(3): Change be_mount to mount/unmount child datasets
kevans [Thu, 10 Jan 2019 03:27:20 +0000 (03:27 +0000)]
libbe(3): Change be_mount to mount/unmount child datasets

This set of changes is geared towards making bectl respect deep boot
environments when they exist and are mounted. The deep BE composition
functionality (`bectl add`) remains disabled for the time being. This set of
changes has no effect for the average user. but allows deep BE users to
upgrade properly with their current setup.

libbe(3): Open the target boot environment and get a zfs handle, then pass
that with the target mountpoint to be_mount_iter; If the BE_MNT_DEEP flag is
set call zfs_iter_filesystems and mount the child datasets.

Similar logic is employed when unmounting the datasets, save for children
are unmounted first.

bectl(8): Change bectl_cmd_jail to pass the BE_MNT_DEEP flag when
calling be_mount as well as call be_unmount when cleaning up after the
jail has exited instead of umount(2) directly.

PR: 234795
Submitted by: Wes Maag <jwmaag_gmail.com> (test additions by kevans)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18796

5 years agogrep(1) outputs NOT-matched lines with multi-byte characters
pfg [Thu, 10 Jan 2019 02:59:19 +0000 (02:59 +0000)]
grep(1) outputs NOT-matched lines with multi-byte characters

PR 113343
MFC after: 2 months

5 years agoFix the build with INVARIANTS.
ae [Thu, 10 Jan 2019 02:01:20 +0000 (02:01 +0000)]
Fix the build with INVARIANTS.

MFC after: 1 month

5 years agoReduce the size of struct ip_fw_args from 240 to 128 bytes on amd64.
ae [Thu, 10 Jan 2019 01:47:57 +0000 (01:47 +0000)]
Reduce the size of struct ip_fw_args from 240 to 128 bytes on amd64.
And refactor the code to avoid unneeded initialization to reduce overhead
of per-packet processing.

ipfw(4) can be invoked by pfil(9) framework for each packet several times.
Each call uses on-stack variable of type struct ip_fw_args to keep the
state of ipfw(4) processing. Currently this variable has 240 bytes size
on amd64.  Each time ipfw(4) does bzero() on it, and then it initializes
some fields.

glebius@ has reported that they at Netflix discovered, that initialization
of this variable produces significant overhead on packet processing.
After patching I managed to increase performance of packet processing on
simple routing with ipfw(4) firewalling to about 11% from 9.8Mpps up to
11Mpps (Xeon E5-2660 v4@ + Mellanox 100G card).

Introduced new field flags, it is used to keep track of what fields was
initialized. Some fields were moved into the anonymous union, to reduce
the size. They all are mutually exclusive. dummypar field was unused, and
therefore it is removed.  The hopstore6 field type was changed from
sockaddr_in6 to a bit smaller struct ip_fw_nh6. And now the size of struct
ip_fw_args is 128 bytes.

ipfw_chk() was modified to properly handle ip_fw_args.flags instead of
rely on checking for NULL pointers.

Reviewed by: gallatin
Obtained from: Yandex LLC
MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D18690

5 years agoRemove unnecessary ifdef. With INVARIANTS all KASSERTs are empty statements,
glebius [Thu, 10 Jan 2019 00:52:06 +0000 (00:52 +0000)]
Remove unnecessary ifdef. With INVARIANTS all KASSERTs are empty statements,
so won't be compiled in.

5 years agoBring the comment up to date.
glebius [Thu, 10 Jan 2019 00:37:14 +0000 (00:37 +0000)]
Bring the comment up to date.

5 years agoSimplify sosetopt() so that function has single return point. No
glebius [Thu, 10 Jan 2019 00:25:12 +0000 (00:25 +0000)]
Simplify sosetopt() so that function has single return point. No
functional change.

5 years agoroute(8): clarify -prefixlen description
ngie [Thu, 10 Jan 2019 00:10:12 +0000 (00:10 +0000)]
route(8): clarify -prefixlen description

Try to reword -prefixlen section to more clearly and accurately describe how
the -prefixlen modifier works.

While here, fix a word that igor considered a typo: aggregatable addresses is a
valid technical term per RFC-2374, however, it was superseded by the term
"aggregator" in RFC-3587.

MFC after: 1 week
Reviewed by: 0mp, crees
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D10087

5 years agolibbe(3): move altroot augmentation bits around a little bit
kevans [Wed, 9 Jan 2019 22:31:10 +0000 (22:31 +0000)]
libbe(3): move altroot augmentation bits around a little bit

We could perhaps have a method that does this given a dataset, but it's yet
clear that we'll always want to bypass the altroot when we grab the
mountpoint. For now, we'll refactor things a bit so we grab the altroot
length when libbe is initialized and have a common method that does the
necessary augmentation (replace with / if it's the root, return a pointer to
later in the string if not).

This will be used in some upcoming work to make be_mount work properly for
deep BEs.

MFC after: 1 week

5 years agostyle(9): fix the indent of a return.
brooks [Wed, 9 Jan 2019 17:23:59 +0000 (17:23 +0000)]
style(9): fix the indent of a return.

5 years agoComplete the removal of obsolete ioctl handlers.
markj [Wed, 9 Jan 2019 17:23:08 +0000 (17:23 +0000)]
Complete the removal of obsolete ioctl handlers.

PR: 234706
Reviewed by: imp
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18778

5 years agoStop setting if_linkmib in vlan(4) ifnets.
markj [Wed, 9 Jan 2019 16:47:16 +0000 (16:47 +0000)]
Stop setting if_linkmib in vlan(4) ifnets.

There are several reasons:
- The structure being exported via IFDATA_LINKSPECIFIC doesn't appear
  to be a standard MIB.
- The structure being exported is private to the kernel and always
  has been.
- No other drivers in common use set the if_linkmib field.
- Because IFDATA_LINKSPECIFIC can be used to overwrite the linkmib
  structure, a privileged user could use it to corrupt internal
  vlan(4) state. [1]

PR: 219472
Reported by: CTurt <ecturt@gmail.com> [1]
Reviewed by: kp (previous version)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18779

5 years agonetmap: fix bridge example in netmap(4)
vmaffione [Wed, 9 Jan 2019 15:03:54 +0000 (15:03 +0000)]
netmap: fix bridge example in netmap(4)

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194872
Reported by: adrian
MFC after: 3 days

5 years agonetmap: fix sysctl variable in vale(4)
vmaffione [Wed, 9 Jan 2019 14:54:24 +0000 (14:54 +0000)]
netmap: fix sysctl variable in vale(4)

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212333
MFC after: 3 days

5 years agoFix loopback traffic when using non-lo0 link local IPv6 addresses.
hselasky [Wed, 9 Jan 2019 14:28:08 +0000 (14:28 +0000)]
Fix loopback traffic when using non-lo0 link local IPv6 addresses.

The loopback interface can only receive packets with a single scope ID,
namely the scope ID of the loopback interface itself. To mitigate this
packets which use the scope ID are appearing as received by the real
network interface, see "origifp" in the patch. The current code would
drop packets which are designated for loopback which use a link-local
scope ID in the destination address or source address, because they
won't match the lo0's scope ID. To fix this restore the network
interface pointer from the scope ID in the destination address for
the problematic cases. See comments added in patch for a more detailed
description.

This issue was introduced with route caching (ae@).

Reviewed by: bz (network)
Differential Revision: https://reviews.freebsd.org/D18769
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agonet80211: fix panic when device is removed during initialization
avos [Wed, 9 Jan 2019 12:50:24 +0000 (12:50 +0000)]
net80211: fix panic when device is removed during initialization

if_dead() is called during device detach - check if interface is
still exists before trying to refresh vap MAC address
(IF_LLADDR will trigger page fault otherwise).

MFC after: 5 days

5 years agoAvoid bsd.files.mk duplicate rule warning for bfd ldscripts
arichardson [Wed, 9 Jan 2019 11:13:05 +0000 (11:13 +0000)]
Avoid bsd.files.mk duplicate rule warning for bfd ldscripts

Without this change I get lots of
warning: duplicate script for target "_FILESINS_ldscripts/elf64btsmip_fbsd.xw" ignored
message for every tree walk.

Reviewed By: imp, emaste
Differential Revision: https://reviews.freebsd.org/D18783

5 years agoMake sh(1) recognize the default $HOME. By default /home
trasz [Wed, 9 Jan 2019 11:04:27 +0000 (11:04 +0000)]
Make sh(1) recognize the default $HOME.  By default /home
is a symlink; without this change, when you log in, sh(1)
won't realize the current directory (eg '/usr/home/test')
is the same as $HOME ('/home/test').

Reviewed by: jilles
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18775

5 years agoFix an edge case when parsing large numbers which resulted in inconsistent
des [Wed, 9 Jan 2019 09:36:54 +0000 (09:36 +0000)]
Fix an edge case when parsing large numbers which resulted in inconsistent
results between an expression that refers to a variable by name and the
same expression that includes the same variable by value.

Submitted by: se@
MFC after: 1 week

5 years agoFix getsockopt() for IP_OPTIONS/IP_RETOPTS.
tuexen [Wed, 9 Jan 2019 06:36:57 +0000 (06:36 +0000)]
Fix getsockopt() for IP_OPTIONS/IP_RETOPTS.

r336616 copies inp->inp_options using the m_dup() function.
However, this function expects an mbuf packet header at the beginning,
which is not true in this case.
Therefore, use m_copym() instead of m_dup().

This issue was found by syzkaller.
Reviewed by: mmacy@
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D18753

5 years agoAdd quirk for 128MB Creative Nomad.
imp [Wed, 9 Jan 2019 06:21:49 +0000 (06:21 +0000)]
Add quirk for 128MB Creative Nomad.

PR: 78984
Submitted by: Mark Kirkwood

5 years agoTimer interval is correctly counted in ticks (1/100 s) in
glebius [Wed, 9 Jan 2019 05:53:59 +0000 (05:53 +0000)]
Timer interval is correctly counted in ticks (1/100 s) in
mibif_reset_hc_timer().  Multiplication by 10 is erroneous
and is probably a blind copy and paste from next function.

PR: 132993
Submitted by: Vitezslav Novy <vnovy vnovy.net>

5 years agoEnable use of Capsicum sandbox when there is only one
delphij [Wed, 9 Jan 2019 05:30:46 +0000 (05:30 +0000)]
Enable use of Capsicum sandbox when there is only one
input file (or the input is stdin) and we are not creating
output file.

Reported by: Lasse Collin
MFC after: 1 month

5 years agoTurn off ec2_ephemeralswap for now
cperciva [Wed, 9 Jan 2019 03:55:25 +0000 (03:55 +0000)]
Turn off ec2_ephemeralswap for now

This script broke around FreeBSD 11.0 as a result of SWAPMETA no longer
being reported by vmstat -z; but it also needs to be reworked due to the
arrival in EC2 of nvme ephemeral disks.

I'll turn this option back on after I've found time to rewrite the
script in question.

PR: 234686
Reported by: meta@
MFC after: 1 week

5 years agoFix bsdgrep manpage clobbering grep(1) with default build options
kevans [Wed, 9 Jan 2019 02:47:07 +0000 (02:47 +0000)]
Fix bsdgrep manpage clobbering grep(1) with default build options

The default build should install bsdgrep(1) and grep(1), with the latter
being gnugrep(1). WITH_BSD_GREP flips this situation such that we have
gnugrep(1) and grep(1), with the latter being bsdgrep(1).

Changes to start installing the zgrep script out of usr.bin/grep
inadvertently altered the default build such that grep(1) was being
installed, and it was bsdgrep(1). Correct the typo.

Reported by: bcran
MFC after: 3 days

5 years agoIn r316006 the getstrfromtype_locked() function was modified to return
pjd [Wed, 9 Jan 2019 01:16:35 +0000 (01:16 +0000)]
In r316006 the getstrfromtype_locked() function was modified to return
an empty string, instead of NULL, if an entry is missing in the audit_control
file. Because of that change the getachost() function started to return
success even if the host name was not defined in the audit_control.
This in turn led to auditd_hostlen always being set (for an empty host it was
set to 0). If auditd_hostlen was not equal to -1 we were trying to append
the host name to trail file name. All this led to situation where when host
name is not defined in audit_control, auditd will create trail files with
a leading '.', which breaks auditdistd as it doesn't work with longer audit
trail file names.

Fix this by appending host name to the trail file name only if the host name
is not empty.

5 years agoMechanical cleanup of epoch(9) usage in network stack.
glebius [Wed, 9 Jan 2019 01:11:19 +0000 (01:11 +0000)]
Mechanical cleanup of epoch(9) usage in network stack.

- Remove macros that covertly create epoch_tracker on thread stack. Such
  macros a quite unsafe, e.g. will produce a buggy code if same macro is
  used in embedded scopes. Explicitly declare epoch_tracker always.

- Unmask interface list IFNET_RLOCK_NOSLEEP(), interface address list
  IF_ADDR_RLOCK() and interface AF specific data IF_AFDATA_RLOCK() read
  locking macros to what they actually are - the net_epoch.
  Keeping them as is is very misleading. They all are named FOO_RLOCK(),
  while they no longer have lock semantics. Now they allow recursion and
  what's more important they now no longer guarantee protection against
  their companion WLOCK macros.
  Note: INP_HASH_RLOCK() has same problems, but not touched by this commit.

This is non functional mechanical change. The only functionally changed
functions are ni6_addrs() and ni6_store_addrs(), where we no longer enter
epoch recursively.

Discussed with: jtl, gallatin

5 years agoRemove unused sqlite3 bundled with heimdal.
cy [Wed, 9 Jan 2019 01:09:42 +0000 (01:09 +0000)]
Remove unused sqlite3 bundled with heimdal.

Reported by: delphij@

5 years agoRemove part of comment that doesn't match reality.
glebius [Wed, 9 Jan 2019 00:38:16 +0000 (00:38 +0000)]
Remove part of comment that doesn't match reality.

5 years agoMFV: r342867
jkim [Wed, 9 Jan 2019 00:31:10 +0000 (00:31 +0000)]
MFV: r342867

Merge ACPICA 20190108.

5 years agoAdd NO_SYNC_CACHE quirk for PENTAX cameras
imp [Tue, 8 Jan 2019 20:55:02 +0000 (20:55 +0000)]
Add NO_SYNC_CACHE quirk for PENTAX cameras

PR: 93389
Submitted by: Demin Alexander

5 years agobiospci_write_config args were backwards
imp [Tue, 8 Jan 2019 20:01:56 +0000 (20:01 +0000)]
biospci_write_config args were backwards

biospci_write_config args swapped length and value to write. Some
hardware coped just fine, while other hardware had issues.

PR: 155441
Submitted by: longwitz at incore dot de

5 years agoSpecify the correct option level when emulating SO_PEERCRED.
markj [Tue, 8 Jan 2019 17:21:59 +0000 (17:21 +0000)]
Specify the correct option level when emulating SO_PEERCRED.

Our equivalent to SO_PEERCRED, LOCAL_PEERCRED, is implemented at
socket option level 0, not SOL_SOCKET.

PR: 234722
Submitted by: Dániel Bakai <bakaidl@gmail.com>
MFC after: 2 weeks

5 years agoAdd termcap entries for TI Silent 703/707 terminals.
markj [Tue, 8 Jan 2019 17:08:10 +0000 (17:08 +0000)]
Add termcap entries for TI Silent 703/707 terminals.

PR: 234716
Submitted by: Robert Clausecker <fuz@fuz.su>
MFC after: 1 week

5 years agoAdd NVMe drive to NOIOB quirk list
chuck [Tue, 8 Jan 2019 15:30:56 +0000 (15:30 +0000)]
Add NVMe drive to NOIOB quirk list

Dell-branded Intel P4600 NVMe drives benefit from NVMe 1.3's NOIOB
feature. Unfortunately just like Intel DC P4500s, they don't advertise
themselves as benefiting from this...

This changes adds P4600s to the existing list of old drives which
benefit from striping.

PR: 233969
Submitted by: David Fugate <dave.fugate@gmail.com>
Reviewed by: imp, mav
Approved by: imp (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18772

5 years agoports.7: Do not mention deprecated WITH_SSP_PORTS and WITH_GHOSTSCRIPT_VER
0mp [Tue, 8 Jan 2019 09:41:52 +0000 (09:41 +0000)]
ports.7: Do not mention deprecated WITH_SSP_PORTS and WITH_GHOSTSCRIPT_VER

As mentioned in this special status report[1] from EuroBSDCon 2013,
WITH_SSP_PORTS was relevant in the FreeBSD 9 and FreeBSD 10 days.
Nowadays, -fstack-protector is set by default. Relevant knobs and variables
are documented in ports/Mk/bsd.port.mk.

WITH_GHOSTSCRIPT_VER was part of USE_GHOSTSCRIPT, which is deprecated.

[1]: https://www.freebsd.org/news/status/report-2013-09-devsummit.html#Ports-and-Packages

Reviewed by: bcr, mat, tobik
Approved by: bcr (doc)
Approved by: krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D18056

5 years agoAvoid overfow in vtruncbuf()
tuexen [Tue, 8 Jan 2019 09:04:27 +0000 (09:04 +0000)]
Avoid overfow in vtruncbuf()

Using daddr_t instead of int avoids trunclbn to become negative when it
shouldn't.
This isssue was found by running syzkaller.

Reviewed by: mckusick, kib, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18763

5 years agoAdded support for the SIOCGI2C ioctl.
delphij [Tue, 8 Jan 2019 05:41:04 +0000 (05:41 +0000)]
Added support for the SIOCGI2C ioctl.

Submitted by: Ram Kishore Vegesna <ram.vegesna@broadcom.com>
Obtained from: Broadcom
MFC after: 2 weeks

5 years agoUse iflib_if_init_locked() during resume instead of iflib_init_locked().
shurd [Mon, 7 Jan 2019 23:46:54 +0000 (23:46 +0000)]
Use iflib_if_init_locked() during resume instead of iflib_init_locked().

iflib_init_locked() assumes that iflib_stop() has been called, however,
it is not called for suspend.  iflib_if_init_locked() calls stop then init,
so fixes the problem.

This was causing errors after a resume from suspend.

PR: 224059
Reported by: zeising
MFC after: 1 week
Sponsored by: Limelight Networks

5 years agoFix regression in r331368, that broke dumping of UMA startup pages
glebius [Mon, 7 Jan 2019 23:17:09 +0000 (23:17 +0000)]
Fix regression in r331368, that broke dumping of UMA startup pages
when WITNESS is present.

Discussed with: markj

5 years agoAdd a tunable which changes mincore(2) algorithm to only report data
kib [Mon, 7 Jan 2019 22:10:48 +0000 (22:10 +0000)]
Add a tunable which changes mincore(2) algorithm to only report data
from the local mapping.

Enable the setting by default.
The article behind the change: https://arxiv.org/abs/1901.01161

Reviewed by: markj
Discussed with: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D18764

5 years agopowerpc: Fix regression introduced in r342771
cem [Mon, 7 Jan 2019 19:39:31 +0000 (19:39 +0000)]
powerpc: Fix regression introduced in r342771

In r342771, I introduced a regression in Power by abusing the platform
smp_topo() method as a shortcut for providing the MI information needed for
the stated sysctls.  The smp_topo() method was already called later by
sched_ule (under the name cpu_topo()), and initializes a static array of
scheduler topology information.  I had skimmed the smp_topo_foo() functions
and assumed they were idempotent; empirically, they are not (or at least,
detect re-initialization and panic).

Do the cleaner thing I should have done in the first place and add a
platform method specifically for core- and thread-count probing.

Reported by: luporl via jhibbits
Reviewed by: luporl
X-MFC-With: r342771
Differential Revision: https://reviews.freebsd.org/D18777

5 years agopow(3): Workaround possible signed shift Undefined Behavior.
pfg [Mon, 7 Jan 2019 17:35:09 +0000 (17:35 +0000)]
pow(3): Workaround possible signed shift Undefined Behavior.

j is int32_t and thus j<<31 is undefined if j==1.

Hinted by: muusl-lib (git 688d3da0f1730daddbc954bbc2d27cc96ceee04c)
Discussed with: freebsd-numerics (kargl)

5 years agoAdd a missing \n to a bootverbose printf.
ian [Mon, 7 Jan 2019 16:36:45 +0000 (16:36 +0000)]
Add a missing \n to a bootverbose printf.

5 years agolibbe(3): Don't allow bootfs to be destroyed
kevans [Mon, 7 Jan 2019 16:16:47 +0000 (16:16 +0000)]
libbe(3): Don't allow bootfs to be destroyed

Previously, the following sequence of events was feasible under some
circumstance:

bectl create test
bectl activate test
# the test BE dataset gets promoted and set as bootfs
bectl destroy test

I was unable to reproduce the destroy succeeding, but we should be rejecting
this before it even gets to libzfs because it would leave the system in an
inconsistent state. Forcing the user to be explicit as to which environment
should be activated instead is much better.

Reported by: Graham Perrin <grahamperrin@gmail.com>
MFC after: 3 days

5 years agoOptionalObsoleteFiles: remove groff leftovers
emaste [Mon, 7 Jan 2019 15:53:54 +0000 (15:53 +0000)]
OptionalObsoleteFiles: remove groff leftovers

usr/share/dict/eign is removed unconditionally as of r319664, so it no
longer needs to be in OptionalObsoleteFiles.

PR: 230353
Reported by: philippe.michel7 sfr.fr

5 years agoCorrect documentation year.
delphij [Mon, 7 Jan 2019 08:29:27 +0000 (08:29 +0000)]
Correct documentation year.

MFC after: 2 weeks

5 years agoPort NetBSD improvements:
delphij [Mon, 7 Jan 2019 08:27:11 +0000 (08:27 +0000)]
Port NetBSD improvements:

 - Add -l support for xz files
 - Add lzip support to gzip based on the example lzip decoder.

Obtained from: NetBSD
MFC after: 2 weeks
Relnotes: yes

5 years agoFix a race between setting up the interrupt handler and it firing by
imp [Mon, 7 Jan 2019 06:19:51 +0000 (06:19 +0000)]
Fix a race between setting up the interrupt handler and it firing by
setting the data prior to setting up the interrupt. Now we only set
the cookie afterwards, and that (a) cannot be helpd and (b) isn't used
in the ISR.

PR: 147127
Submitted by: hps@

5 years agoFix TI PCI1520 PCI Cardbus bridge, but others affected.
imp [Mon, 7 Jan 2019 05:59:58 +0000 (05:59 +0000)]
Fix TI PCI1520 PCI Cardbus bridge, but others affected.

On system with Celeron 1.5GHz CPU, sometimes when a PCMCIA to Compact Flash
adapter containing a Compact Flash card is inserted in the cardbus slot the
system hangs. This problem has not been observed in systems with a 2.8GHz
XEON CPU or faster.

Analysis of the cbb driver shows functional interrupts are routed to PCI
BEFORE the interrupt handler for functional interrupts has been registered.

Fix applied as described in the bug.

PR: 128040
Submitted by: Arthur Hartwig

5 years agoCreate MK_LOADER_VERBOSE and connect it to ELF_VERBOSE in the loader
imp [Mon, 7 Jan 2019 05:49:27 +0000 (05:49 +0000)]
Create MK_LOADER_VERBOSE and connect it to ELF_VERBOSE in the loader
code.

PR: 18498
Submitted by: mellon at pobox dot com

5 years agoFix use of busdma(9) KPI in ahci(4).
kib [Mon, 7 Jan 2019 02:39:40 +0000 (02:39 +0000)]
Fix use of busdma(9) KPI in ahci(4).

Use BUS_DMA_NOWAIT for loads at initialization time.
Report actual numeric error code if any problem occurs at the
initialization.

Reported and tested by: pho
Reviewed by: mav
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D18741

5 years agoClamp tuklib_physmem() return value to SIZE_T_MAX.
kib [Sun, 6 Jan 2019 23:59:04 +0000 (23:59 +0000)]
Clamp tuklib_physmem() return value to SIZE_T_MAX.

On 32bit platforms it is possible to have (much) more physical RAM
than is mappable into single address space.  In this case liblzma
scales the value into a request to mmap more address space than it is
theoretically possible.

Reported and tested by: pho
Reviewed by: delphij
Discussed with: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoasmc: Add support for Mac mini 4,1 (Mid-2010)
dab [Sun, 6 Jan 2019 23:43:12 +0000 (23:43 +0000)]
asmc: Add support for Mac mini 4,1 (Mid-2010)

MFC after: 1 week

5 years agogetconf(1): Minor mdoc fix
jilles [Sun, 6 Jan 2019 21:43:14 +0000 (21:43 +0000)]
getconf(1): Minor mdoc fix

MFC after: 1 week

5 years agothr_wake(2): Minor mdoc fixes
jilles [Sun, 6 Jan 2019 21:34:05 +0000 (21:34 +0000)]
thr_wake(2): Minor mdoc fixes

MFC after: 1 week

5 years agoRemove ipsd (IP Scan Detetor). It is unused and to my knowledge has
cy [Sun, 6 Jan 2019 21:24:44 +0000 (21:24 +0000)]
Remove ipsd (IP Scan Detetor). It is unused and to my knowledge has
never been used on any platform that ipfilter has been on. However
it looks like it could be a useful utility, therefore there are plans
to make it a port one day. It lacks a man page as well.

MFC after: 1 month

5 years agoRemove unneeded assert.h (there is no assertion in this file).
delphij [Sun, 6 Jan 2019 20:42:09 +0000 (20:42 +0000)]
Remove unneeded assert.h (there is no assertion in this file).

MFC after: 2 weeks

5 years agoRemove unneeded headers.
delphij [Sun, 6 Jan 2019 20:39:23 +0000 (20:39 +0000)]
Remove unneeded headers.

MFC after: 1 month