]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoRemove nsp(4) driver
imp [Mon, 22 Oct 2018 02:35:38 +0000 (02:35 +0000)]
Remove nsp(4) driver

nsp(4) is marked as gone in 12. Remove it. There are no sightings of
it in the nycbug dmesg database. It was for an obscure SCSI card that
sold mostly in Japan, and was especially popilar among pc98 hackers in
the 4.x time frame. It was also only enabled on i386.

Relnote: Yes

5 years agoRemove ncv(4) driver
imp [Mon, 22 Oct 2018 02:35:26 +0000 (02:35 +0000)]
Remove ncv(4) driver

ncv(4) is marked as gone in 12. Remove it. There are no sightings of
it in the nycbug dmesg database. It was for an obscure SCSI card that
sold mostly in Japan, and was especially popilar among pc98 hackers in
the 4.x time frame..

Relnote: Yes

5 years agoRetire dpt(4)
imp [Mon, 22 Oct 2018 02:35:12 +0000 (02:35 +0000)]
Retire dpt(4)

Marked as gone in 12 and not relevant since the early 90s. No
sightings in nycbug's dmesg database.

Relnotes: yes

5 years agoRemove bt(4) driver
imp [Mon, 22 Oct 2018 02:34:59 +0000 (02:34 +0000)]
Remove bt(4) driver

The buslogic scsi driver has been tagged as gone in 12 for some time
now. Remove it. The nycbug dmesg database shows only one sighting in 6
for this driver. It was very popular in the early days of the project,
but that popularity seems to have died by 2004 when the nycbug
database started up.

Relnotes: yes

5 years agoRemove adv(4) and adw(4)
imp [Mon, 22 Oct 2018 02:34:47 +0000 (02:34 +0000)]
Remove adv(4) and adw(4)

Remove the advanssy drivers (both adv and adw). They were tagged as
gone in 12 a while qgo. The nycbug dmesg database shows this was last
seen in 6 and there were only a few adv sightings then (none for adw).

Relnotes: yes

5 years agoRemove aic(4) driver
imp [Mon, 22 Oct 2018 02:34:35 +0000 (02:34 +0000)]
Remove aic(4) driver

aic was marked to be gone in 12 a while ago. Go ahead and remove it.
nycbug's dmesg database shows this was last seen in 6 and one more
time in 4.x. It never was popular, and what popularity it had was over
before the nycbug databse got going in 2004.

Relnotes: yes

5 years agoRemove aha(4) from the tree.
imp [Mon, 22 Oct 2018 02:34:25 +0000 (02:34 +0000)]
Remove aha(4) from the tree.

We tagged aha as gone in 12 a while ago. Proceed with its removal.
Data from nycbug's database shows the last sighting of this driver in
6, with the prior one in 4.x show its popularity had died prior to
4.x.

Relnotes: yes

5 years agoRemove mse(4) from tree
imp [Mon, 22 Oct 2018 02:34:10 +0000 (02:34 +0000)]
Remove mse(4) from tree

Remove mse and all support for bus and inport devices from the tree.
Data from nycbug's dmesg database shows the last sighting of this
driver was in 4.10 on only one machine.

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D17628

5 years agoRemove joy(4) driver.
imp [Mon, 22 Oct 2018 02:34:00 +0000 (02:34 +0000)]
Remove joy(4) driver.

This driver was marked as gone in 12. We're at 13 now. Remove it.
Data from nycbug's dmesg cache shows only one potential user,
suggesting it never was used much.

RelNotes: yes
Differential Revision: https://reviews.freebsd.org/D17629

5 years agoRemove the gone_in(12) devices.
imp [Mon, 22 Oct 2018 02:28:18 +0000 (02:28 +0000)]
Remove the gone_in(12) devices.

We're planning on removing adv, adw, aha, aic, bt, ncv, nsp, and stg
soon. They have been tagged for removal in 12. At least get them out
of GENERIC.

MFC after: 3 days
Relnotes: yes

5 years agoAdd explicit copyright text to trivial header
cem [Mon, 22 Oct 2018 01:27:11 +0000 (01:27 +0000)]
Add explicit copyright text to trivial header

Reported by: rgrimes

5 years agopowerpc: stash off srr0 in si_addr for signals
jhibbits [Mon, 22 Oct 2018 00:27:37 +0000 (00:27 +0000)]
powerpc: stash off srr0 in si_addr for signals

si_addr is the address of the instruction executing at the time the
signal was sent.  Populate this field with srr0, which, though not
always the case, is most often the instruction that triggered the fault.

5 years agopowerpc/booke: Turn tlb*_print_tlbentries() into 'show tlb*' DDB commands
jhibbits [Mon, 22 Oct 2018 00:21:27 +0000 (00:21 +0000)]
powerpc/booke: Turn tlb*_print_tlbentries() into 'show tlb*' DDB commands

debugf() is unnecessary for the TLB printing functions, as they're only
intended to be used from ddb.  Instead, make them full DDB 'show'
commands, so now it can be written as 'show tlb1' and 'show tlb0'
instead of calling the function, hoping DEBUG has been defined.

5 years agoNew sysctl: net.inet.icmp.error_keeptags
eugen [Sun, 21 Oct 2018 21:29:19 +0000 (21:29 +0000)]
New sysctl: net.inet.icmp.error_keeptags

Currently, icmp_error() function copies FIB number from original packet
into generated ICMP response but not mbuf_tags(9) chain.
This prevents us from easily matching ICMP responses corresponding
to tagged original packets by means of packet filter such as ipfw(8).
For example, ICMP "time-exceeded in-transit" packets usually generated
in response to traceroute probes lose tags attached to original packets.

This change adds new sysctl net.inet.icmp.error_keeptags
that defaults to 0 to avoid extra overhead when this feature not needed.

Set net.inet.icmp.error_keeptags=1 to make icmp_error() copy mbuf_tags
from original packet to generated ICMP response.

PR: 215874
MFC after: 1 month

5 years agotcpdump: Log uid on pflog interfaces
kp [Sun, 21 Oct 2018 21:17:42 +0000 (21:17 +0000)]
tcpdump: Log uid on pflog interfaces

If pf logs the user id ('pass out log (user)') have tcpdump also print
this.

Example output:
 00:00:00.000000 rule 0/0(match) [uid 1001]: pass out on vtnet0: (tos 0x0, ttl 64, id 57539, offset 0, flags [none], proto UDP (17), length 55)
    172.16.2.2.18337 > 172.16.2.1.53: [bad udp cksum 0x5c58 -> 0x16e4!] 40222+ A? google.be. (27)

PR: 122773
Differential Revision: https://reviews.freebsd.org/D17625

5 years agoInclude <sys/eventhandler.h> to fix the build.
ae [Sun, 21 Oct 2018 18:39:34 +0000 (18:39 +0000)]
Include <sys/eventhandler.h> to fix the build.

MFC after: 1 month

5 years agoFollow the fix in r339532 (by glebius):
ae [Sun, 21 Oct 2018 18:30:27 +0000 (18:30 +0000)]
Follow the fix in r339532 (by glebius):
  Fix exiting an epoch(9) we never entered. May happen only with MAC.

MFC after: 1 month

5 years agoRework if_ipsec(4) to use epoch(9) instead of rmlock.
ae [Sun, 21 Oct 2018 18:24:20 +0000 (18:24 +0000)]
Rework if_ipsec(4) to use epoch(9) instead of rmlock.

* use CK_LIST and FNV hash to keep chains of softc;
* read access to softc is protected by epoch();
* write access is protected by ipsec_ioctl_sx. Changing of softc fields
  is allowed only when softc is unlinked from CK_LIST chains.
* linking/unlinking of softc is allowed only when ipsec_ioctl_sx is
  exclusive locked.
* the plain LIST of all softc is replaced by hash table that uses ingress
  address of tunnels as a key.
* added support for appearing/disappearing of ingress address handling.
  Now it is allowed configure non-local ingress IP address, and thus the
  problem with if_ipsec(4) configuration that happens on boot, when
  ingress address is not yet configured, is solved.

MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17190

5 years agoAdd handling for appearing/disappearing of ingress addresses to if_me(4).
ae [Sun, 21 Oct 2018 18:18:37 +0000 (18:18 +0000)]
Add handling for appearing/disappearing of ingress addresses to if_me(4).

* register handler for ingress address appearing/disappearing;
* add new srcaddr hash table for fast softc lookup by srcaddr;
* when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface,
  and set it otherwise;

MFC after: 1 month
Sponsored by: Yandex LLC

5 years agoAdd handling for appearing/disappearing of ingress addresses to if_gre(4).
ae [Sun, 21 Oct 2018 18:13:45 +0000 (18:13 +0000)]
Add handling for appearing/disappearing of ingress addresses to if_gre(4).

* register handler for ingress address appearing/disappearing;
* add new srcaddr hash table for fast softc lookup by srcaddr;
* when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface,
  and set it otherwise;

MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17214

5 years agoAdd handling for appearing/disappearing of ingress addresses to if_gif(4).
ae [Sun, 21 Oct 2018 18:06:15 +0000 (18:06 +0000)]
Add handling for appearing/disappearing of ingress addresses to if_gif(4).

* register handler for ingress address appearing/disappearing;
* add new srcaddr hash table for fast softc lookup by srcaddr;
* when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface,
  and set it otherwise;
* remove the note about ingress address from BUGS section.

MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17134

5 years agoAdd KPI that can be used by tunneling interfaces to handle IP addresses
ae [Sun, 21 Oct 2018 17:55:26 +0000 (17:55 +0000)]
Add KPI that can be used by tunneling interfaces to handle IP addresses
appearing and disappearing on the host system.

Such handling is need, because tunneling interfaces must use addresses,
that are configured on the host as ingress addresses for tunnels.
Otherwise the system can send spoofed packets with source address, that
belongs to foreign host.

The KPI uses ifaddr_event_ext event to implement addresses tracking.
Tunneling interfaces register event handlers and then they are
notified by the kernel, when an address disappears or appears.

ifaddr_event_compat() handler from if.c replaced by srcaddr_change_event()
in the ip_encap.c

MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17134

5 years agoman: fix vale(4) port naming
vmaffione [Sun, 21 Oct 2018 17:15:09 +0000 (17:15 +0000)]
man: fix vale(4) port naming

The current documentation describing the syntax of a VALE port is wrong.
This patch fixes it to make it consistent.

Approved by: bcr, gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D17411

5 years agovlan: Fix panic with lagg and vlan
kp [Sun, 21 Oct 2018 16:51:35 +0000 (16:51 +0000)]
vlan: Fix panic with lagg and vlan

vlan_lladdr_fn() is called from taskqueue, which means there's no vnet context
set. We can end up trying to send ARP messages (through the iflladdr_event
event), which requires a vnet context.

PR: 227654
MFC after: 3 days

5 years agoRemove stray refernce to pdq. Like the infamous twenty first of Johan
imp [Sun, 21 Oct 2018 16:49:49 +0000 (16:49 +0000)]
Remove stray refernce to pdq. Like the infamous twenty first of Johan
Sebastian Bach's twenty children, it hasn't been seen in many years.

5 years agoDo not decrement RST life time if keep_alive is not turned on.
ae [Sun, 21 Oct 2018 16:44:57 +0000 (16:44 +0000)]
Do not decrement RST life time if keep_alive is not turned on.

This allows use differen values configured by user for sysctl variable
net.inet.ip.fw.dyn_rst_lifetime.

Obtained from: Yandex LLC
MFC after: 3 weeks
Sponsored by: Yandex LLC

5 years agoCall inet_ntop() only when its result is needed.
ae [Sun, 21 Oct 2018 16:37:53 +0000 (16:37 +0000)]
Call inet_ntop() only when its result is needed.

Obtained from: Yandex LLC
MFC after: 3 weeks
Sponsored by: Yandex LLC

5 years agoRemove stray fatm reference.
imp [Sun, 21 Oct 2018 16:29:32 +0000 (16:29 +0000)]
Remove stray fatm reference.

5 years agoRetire IPFIREWALL_NAT64_DIRECT_OUTPUT kernel option. And add ability
ae [Sun, 21 Oct 2018 16:29:12 +0000 (16:29 +0000)]
Retire IPFIREWALL_NAT64_DIRECT_OUTPUT kernel option. And add ability
to switch the output method in run-time. Also document some sysctl
variables that can by changed for NAT64 module.

NAT64 had compile time option IPFIREWALL_NAT64_DIRECT_OUTPUT to use
if_output directly from nat64 module. By default is used netisr based
output method. Now both methods can be used, but they require different
handling by rules.

Obtained from: Yandex LLC
MFC after: 3 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D16647

5 years agoComment -DNDEBUG in head after r339436 when head was switched
gjb [Sun, 21 Oct 2018 15:54:38 +0000 (15:54 +0000)]
Comment -DNDEBUG in head after r339436 when head was switched
from 12.0-ALPHA10 to 13.0-CURRENT.  This edit was a mistake,
and should have been applied to stable/12 upon branching, not
head.

Reported by: jbeich, dim
Sponsored by: The FreeBSD Foundation

5 years agoSplit out the virtio mmio FDT attachment and add an ACPI attachment.
andrew [Sun, 21 Oct 2018 15:43:20 +0000 (15:43 +0000)]
Split out the virtio mmio FDT attachment and add an ACPI attachment.

This allows the memory mapped I/O virtio driver to attach when we boot
with ACPI tables, for example in some cases with QEMU emulating arm64.

MFC after: 1 month

5 years agoAdd IPFW_RULE_JUSTOPTS flag, that is used by ipfw(8) to mark rule,
ae [Sun, 21 Oct 2018 15:10:59 +0000 (15:10 +0000)]
Add IPFW_RULE_JUSTOPTS flag, that is used by ipfw(8) to mark rule,
that was added using "new rule format". And then, when the kernel
returns rule with this flag, ipfw(8) can correctly show it.

Reported by: lev
MFC after: 3 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17373

5 years agoTag this obsolete driver. It was obsolete in 3.x when the sym driver
imp [Sun, 21 Oct 2018 15:09:42 +0000 (15:09 +0000)]
Tag this obsolete driver. It was obsolete in 3.x when the sym driver
supported all the "old" chips it did, so we should have killed it in
4, but 12 will do. It's a bit outside of the normal deprecation
process, but given the extreme age, it's obsolete status for 8 major
releases and the fact that I couldn't find any users who posted dmesgs
with ncr0: in them after 2000 or 3.4. It may be too late for 12 (this
change will be merged, but maybe not the next one to remove it), but
it will be removed in 13 with the first round of other drivers tagged
to be gone in 12.

MFC after: 3 days

5 years agoAdd ifaddr_event_ext event. It is similar to ifaddr_event, but the
ae [Sun, 21 Oct 2018 15:02:06 +0000 (15:02 +0000)]
Add ifaddr_event_ext event. It is similar to ifaddr_event, but the
handler receives the type of event IFADDR_EVENT_ADD/IFADDR_EVENT_DEL,
and the pointer to ifaddr. Also ifaddr_event now is implemented using
ifaddr_event_ext handler.

MFC after: 3 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17100

5 years agoFix grammar.
ae [Sun, 21 Oct 2018 14:48:40 +0000 (14:48 +0000)]
Fix grammar.

Reported by: yuripv
MFC after: 3 weeks

5 years agoDo not allow use `create` keyword as hostname when ifconfig(8) is invoked
ae [Sun, 21 Oct 2018 14:40:45 +0000 (14:40 +0000)]
Do not allow use `create` keyword as hostname when ifconfig(8) is invoked
for already existing interface.

It appeared, that ifconfig(8) assumes `create` keyword as hostname and
tries to resolve it, when `ifconfig ifname create` invoked for already
existing interface. This can produce some unexpected results, when hostname
resolving has successfully happened. This patch adds check for such case.
When an interface is already exists, and create is only one argument,
return error message. But when there are some other arguments, just remove
create keyword from the arguments list.

Obtained from: Yandex LLC
MFC after: 3 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17171

5 years agopw: fix the checks in boolean_str() after r326738. Add related test
yuripv [Sun, 21 Oct 2018 14:23:56 +0000 (14:23 +0000)]
pw: fix the checks in boolean_str() after r326738.  Add related test
cases for `pw useradd -D -w`.

PR: 231649
Reviewed by: eugen
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17299

5 years agoAdd sadb_x_sa2 extension to SADB_ACQUIRE requests.
ae [Sun, 21 Oct 2018 14:19:16 +0000 (14:19 +0000)]
Add sadb_x_sa2 extension to SADB_ACQUIRE requests.

SADB_ACQUIRE requests are send by kernel, when security policy doesn't
have corresponding security association for outbound packet. IKE daemon
usually registers its handler for such messages and when the kernel asks
for SA it can handle this request. Now such requests will contain
additional fields that can help IKE daemon to create SA. And IKE now
can create SAs using only information from SADB_ACQUIRE request, this
is useful when many if_ipsec(4) interfaces are in use and IKE doesn track
security policies that was installed by kernel.

Obtained from: Yandex LLC
MFC after: 3 weeks
Sponsored by: Yandex LLC

5 years agoFix exiting an epoch(9) we never entered. May happen only with MAC.
glebius [Sun, 21 Oct 2018 12:39:00 +0000 (12:39 +0000)]
Fix exiting an epoch(9) we never entered. May happen only with MAC.

5 years agoamd64: tidy up memset to have rax set earlier for small sizes
mjg [Sun, 21 Oct 2018 10:46:00 +0000 (10:46 +0000)]
amd64: tidy up memset to have rax set earlier for small sizes

5 years agoRecognize LAN in Lenovo USB-C and TB3 docks
phk [Sun, 21 Oct 2018 09:36:12 +0000 (09:36 +0000)]
Recognize LAN in Lenovo USB-C and TB3 docks

5 years agoImplement ECMA-48 "REP", some Linuxen have started emitting them recently.
phk [Sun, 21 Oct 2018 08:29:36 +0000 (08:29 +0000)]
Implement ECMA-48 "REP", some Linuxen have started emitting them recently.

Approved by: ed

5 years agoRemove all the really old junk that never would be used with an OCTEON
imp [Sun, 21 Oct 2018 07:56:58 +0000 (07:56 +0000)]
Remove all the really old junk that never would be used with an OCTEON
CPU. Most of them were here just to test build mips versions of
things, even though many of them have never been tested on mips, let
alone the Octeon.

5 years agoAdd Lenovo USB-C and TB3 docks
phk [Sun, 21 Oct 2018 07:32:35 +0000 (07:32 +0000)]
Add Lenovo USB-C and TB3 docks

5 years agoUpdate example to something people less than 40 years old have heard about.
phk [Sun, 21 Oct 2018 07:30:26 +0000 (07:30 +0000)]
Update example to something people less than 40 years old have heard about.

5 years agoUse BROKEN_OPTIONS for NVME, HYPERV, CXGBETOOL and MLX5TOOL instead of
imp [Sun, 21 Oct 2018 06:52:10 +0000 (06:52 +0000)]
Use BROKEN_OPTIONS for NVME, HYPERV, CXGBETOOL and MLX5TOOL instead of
__DEFAULT_YES/NO. These options simply cannot work where we were using
__DEFAULT_NO. The proper thing to do in that case is to use the
BROKEN_OPTIONS knob instead.

5 years agoAdd missing options.
imp [Sun, 21 Oct 2018 06:33:35 +0000 (06:33 +0000)]
Add missing options.

WITHOUT_LOADER_LUA is only needed since we turned it off by default on
powerpc and sparc64 in r338203. Same with
WITHOUT_LOADER_GEIL. WITH_NVME, WITHOUT_NVME, WITH_LOADER_FORCE_LE
have been needed since they were added.

5 years agoAdd amdgpio, driver for GPIO controller on AMD-based x86_64 platforms
gonzo [Sun, 21 Oct 2018 04:52:37 +0000 (04:52 +0000)]
Add amdgpio, driver for GPIO controller on AMD-based x86_64 platforms

Submitted by: Rajesh Kumar <rajbsd@gmail.com>
Differential Revision: https://reviews.freebsd.org/D16865

5 years agopowerpc/mpc85xx: Make Freescale PCI bridge driver a subclass of ofw_pcib_pci
jhibbits [Sun, 21 Oct 2018 02:39:13 +0000 (02:39 +0000)]
powerpc/mpc85xx: Make Freescale PCI bridge driver a subclass of ofw_pcib_pci

This driver was already 99% identical to the ofw_pcib_pci driver, except for
the attachment.  Since ofw_pcib_pci is already a subclass of pcib, this
creates a private declaration of that class, to use for the base class for
this driver.

At some point in the future, ofw_pcib_pci_driver should probably be exported
to a header, so we're not tracking the softc struct contents, but for now,
since there's only this one other driver, it's not a pressing issue.

5 years agopowerpc64/powernv: Add pnpinfo strings to opal device children
jhibbits [Sun, 21 Oct 2018 02:30:34 +0000 (02:30 +0000)]
powerpc64/powernv: Add pnpinfo strings to opal device children

This makes it easier to see what's left unattached as new drivers are
written, and to see what drivers get attached to what nodes.

5 years agopowerpc64/pmap: Correct the logic for minidump KVA chunk
jhibbits [Sun, 21 Oct 2018 02:28:04 +0000 (02:28 +0000)]
powerpc64/pmap: Correct the logic for minidump KVA chunk

r279252 inverted the logic in moea64_scan_init, such that instead of
terminating when reaching a dead page, it terminates when reaching a live
page, ostensibly preserving exactly one page of KVA.

5 years agopowerpc64/xics: Fix comment typo
jhibbits [Sun, 21 Oct 2018 02:25:56 +0000 (02:25 +0000)]
powerpc64/xics: Fix comment typo

5 years agopowerpc64/powernv:opal_pci: Fix the alignment of the TCE table
jhibbits [Sun, 21 Oct 2018 02:24:37 +0000 (02:24 +0000)]
powerpc64/powernv:opal_pci: Fix the alignment of the TCE table

The TCE table need only be aligned to the size of the table, not the size of
the TCE segment.

5 years agoarm generic_timer: fix armv8 timer desc
jchandra [Sun, 21 Oct 2018 02:12:26 +0000 (02:12 +0000)]
arm generic_timer: fix armv8 timer desc

In the FDT based probe, check for "arm,armv8-timer" before "arm,armv7-timer".
This gets the description right when the timer node has both entries in
compatible list.

5 years agopowerpc/dtrace: Use explicit bit numbers to mask out PSL_EE
jhibbits [Sun, 21 Oct 2018 02:08:57 +0000 (02:08 +0000)]
powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE

There seems to be a race in CI, such that dtrace_asm.S might be assembled
before the genassym is completed.  This causes a build failure when PSL_EE
doesn't exist, and is read as 0.  Get around this by explicitly specifying
the bits in the mask instead.

5 years agopwd_mkdb: retire -B and -L endianness options
emaste [Sun, 21 Oct 2018 00:48:38 +0000 (00:48 +0000)]
pwd_mkdb: retire -B and -L endianness options

Legacy v3 db support was retired in r333133, and it was v3 support that
required the -B and -L options.  The options were retained temporarily,
but now that stable/12 has branched they can be removed.

Sponsored by: The FreeBSD Foundation

5 years agopowerpcspe: Implement SPE exception handling
jhibbits [Sun, 21 Oct 2018 00:43:27 +0000 (00:43 +0000)]
powerpcspe: Implement SPE exception handling

The Signal Processing Engine (SPE) found in Freescale e500 cores (and
others) offloads IEEE-754 compliance (NaN, Inf handling, overflow,
underflow) to software, most likely as a means of simplifying the APU
silicon.  Some software, like AbiWord, needs full IEEE-754 compliance,
including NaN handling.  Implement the necessary bits to enable it.

Differential Revision: https://reviews.freebsd.org/D17446

5 years agoAdd some tom-thumb vt font glyphs
emaste [Sun, 21 Oct 2018 00:35:54 +0000 (00:35 +0000)]
Add some tom-thumb vt font glyphs

Primarily missing glyphs used by mandoc.

Added:
U+2010 hyphen
U+2011 non-breaking hyphen
U+2012 figure dash
U+2013 en dash
U+2014 em dash
U+2018 left single quotation mark
U+2019 right single quotation mark
U+2020 dagger
U+2021 double dagger
U+203E overline
U+2122 trade mark sign
U+2502 box drawings light vertical
U+25A1 white square
U+25CA lozenge
U+25CB circle
U+2660 black spade suit
U+2663 black club suit
U+2665 black heart suit
U+2666 black diamond suit
U+FFFD replacement char

Sponsored by: The FreeBSD Foundation

5 years agoregen src.conf after r339477 and r339511
emaste [Sun, 21 Oct 2018 00:32:59 +0000 (00:32 +0000)]
regen src.conf after r339477 and r339511

5 years agoIntroduce src.conf knob to build userland with retpoline
emaste [Sun, 21 Oct 2018 00:27:59 +0000 (00:27 +0000)]
Introduce src.conf knob to build userland with retpoline

WITH_RETPOLINE enables -mretpoline vulnerability mitigation in userland
for CVE-2017-5715.

Reported by: Peter Malcom
Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17421

5 years agoANSIfy libc/quad
emaste [Sun, 21 Oct 2018 00:20:40 +0000 (00:20 +0000)]
ANSIfy libc/quad

Some of these routines exist in both lib/libc/quad/ and sys/libkern/.
r325988 ANSIfied sys/libkern.  Update libc/quad to match.

PR: 223641
Reported by: bde
Sponsored by: The FreeBSD Foundation

5 years agoRestore the ability to prevent the user from interrupting the boot process
dteske [Sun, 21 Oct 2018 00:15:51 +0000 (00:15 +0000)]
Restore the ability to prevent the user from interrupting the boot process
without first entering the password stored in loader.conf(5).

PR: kern/207069
Reported by: david@dcrosstech.com
MFC after: 3 days
Sponsored by: Smule, Inc.

5 years agoUnindent vm_map_simplify_entry() after r339506.
kib [Sun, 21 Oct 2018 00:11:56 +0000 (00:11 +0000)]
Unindent vm_map_simplify_entry() after r339506.

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

5 years agoamd64: flush L1 data cache on syscall return with an error.
kib [Sat, 20 Oct 2018 23:17:24 +0000 (23:17 +0000)]
amd64: flush L1 data cache on syscall return with an error.

The knob allows to select the flushing mode or turn it off/on.  The
idea, as well as the list of the ignored syscall errors, were taken
from https://www.openwall.com/lists/kernel-hardening/2018/10/11/10 .

I was not able to measure statistically significant difference between
flush enabled vs disabled using syscall_timing getuid.

Reviewed by: bwidawsk
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D17536

5 years agoReduce code duplication in merging vm_entry neighbors.
kib [Sat, 20 Oct 2018 23:08:04 +0000 (23:08 +0000)]
Reduce code duplication in merging vm_entry neighbors.

Submitted by: Doug Moore <dougm@rice.edu>
Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D17610

5 years agomcount: tidy up ANSIfication
emaste [Sat, 20 Oct 2018 22:39:35 +0000 (22:39 +0000)]
mcount: tidy up ANSIfication

libc/gmon's mcount was ANSIfied in r124180, with libkern following over
a decade later, in r325988, but some minor discrepancies remained.
Update libc/gmon's mexitcount to an ANSI C function definition, and use
(void) for libkern-only functions that take no arguments.

Reported by: bde

5 years agolibi386: remove CLANG_NO_IAS workaround
emaste [Sat, 20 Oct 2018 22:35:06 +0000 (22:35 +0000)]
libi386: remove CLANG_NO_IAS workaround

Clang's Integrated Assembler was previously disabled for i386 with the
note that it "doesn't grok .codeNN directives yet."  This is no longer
the case (and hasn't been for some time), and the assembled output .text
is identical between gas and IAS.

MFC after: 2 months
Sponsored by: The FreeBSD Foundation

5 years agoImport tzdata 2018f
philip [Sat, 20 Oct 2018 22:32:10 +0000 (22:32 +0000)]
Import tzdata 2018f

Changes: https://github.com/eggert/tz/blob/2018f/NEWS

MFC after: 3 days

5 years agoAdd link to the setproctitle_fast function.
oshogbo [Sat, 20 Oct 2018 22:25:57 +0000 (22:25 +0000)]
Add link to the setproctitle_fast function.

MFC after: 1 week

5 years agonetdump: Zone mbufs should be allocated before dump
cem [Sat, 20 Oct 2018 22:24:58 +0000 (22:24 +0000)]
netdump: Zone mbufs should be allocated before dump

Reviewed by: markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17306

5 years agoEmbedded chacha: Remove some harmless dead stores in keystream mode
cem [Sat, 20 Oct 2018 22:17:16 +0000 (22:17 +0000)]
Embedded chacha: Remove some harmless dead stores in keystream mode

(From r338059.)

Sponsored by: Dell EMC Isilon

5 years agoEmbedded chacha: Distinguish via dedicated macro
cem [Sat, 20 Oct 2018 22:14:29 +0000 (22:14 +0000)]
Embedded chacha: Distinguish via dedicated macro

Set embedding expectations via CHACHA_EMBED macro rather than _KERNEL
definition.

No functional change.

Sponsored by: Dell EMC Isilon

5 years agocrypto/chacha: Split header into separate _chacha.h
cem [Sat, 20 Oct 2018 22:12:53 +0000 (22:12 +0000)]
crypto/chacha: Split header into separate _chacha.h

Sponsored by: Dell EMC Isilon

5 years agoZSTDIO: Correctly initialize zstd context with provided 'level'
cem [Sat, 20 Oct 2018 21:49:44 +0000 (21:49 +0000)]
ZSTDIO: Correctly initialize zstd context with provided 'level'

Prior to this revision, we allocated sufficient context space for 'level'
but never actually set the compress level parameter, so we would always get
the default '3'.

Reviewed by: markj, vangyzen
MFC after: 12 hours
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17144

5 years agogetentropy(3): Trap non-API errnos from getrandom(2) and abort
cem [Sat, 20 Oct 2018 21:45:17 +0000 (21:45 +0000)]
getentropy(3): Trap non-API errnos from getrandom(2) and abort

Additionally, reconcile our abort behavior with arc4random(3).  Unlike
SIGABRT, SIGKILL cannot be caught by the user program.  These failures
are fatal conditions and should not return to the caller, as they did in
the instance that resulted in D17049.

While here, fix some minor typos in a comment.

Reviewed by: delphij
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17050

5 years agoBring back the WARNS level to what it used to be to please gcc arches at least
bapt [Sat, 20 Oct 2018 21:33:34 +0000 (21:33 +0000)]
Bring back the WARNS level to what it used to be to please gcc arches at least

5 years agomdmfs(8): Check for other types of helper-program failure
cem [Sat, 20 Oct 2018 21:33:00 +0000 (21:33 +0000)]
mdmfs(8): Check for other types of helper-program failure

Exiting with a signal should not be treated the same as successful exit with
zero status.

Return signal exit information to the callers via negative integers, to
enable distinction from normal exit statuses.  (All consumers that check for
errors don't care what the exact non-zero exit value is -- in such a case
they print a diagnostic message and either continue or bail.)

Additionally, check for unexpected sources of waitpid() wakeup and bail if
we encounter them.

Reported by: lev@
Reviewed by: kib, lev, markj (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17035

5 years agoFix typo
imp [Sat, 20 Oct 2018 21:13:57 +0000 (21:13 +0000)]
Fix typo

The vendor name wds should have been wdc. Add wdc and keep the wds for
script compat.

MFC after: 3 days

5 years agoFortuna: Fix a race to prevent reseed spamming
cem [Sat, 20 Oct 2018 21:09:12 +0000 (21:09 +0000)]
Fortuna: Fix a race to prevent reseed spamming

If multiple threads enter fortuna_pre_read contemporaneously, such as via
read(2) or getrandom(2), they could race to check how long it has been since
the last update due to a TOCTOU problem with 'now'.

Here is an example problematic execution:

Thread A:                       Thread B:
now_A = getsbinuptime();
                                now_B = getsbinuptime();  // now_B > now_A
                                RANDOM_RESEED_LOCK();
                                if (now - fs_lasttime > SBT_1S/10) {
                                        fs_lasttime = now;
                                        ... // reseed
                                }
                                RANDOM_RESEED_UNLOCK();
RANDOM_RESEED_LOCK();
if (now_A - fs_lasttime > SBT_1S/10)  // now_A - fs_lasttime underflows
        fs_lasttime = now_A;
        ... // reseed again, despite less than 100ms elapsing
}
RANDOM_RESEED_UNLOCK();

To resolve the race, simply check the current time after we win the lock
race.

If getsbinuptime is perceived to be expensive, another option might be to
just accept the race and validate that fs_lasttime isn't "in the future."
(It should be within the last ~2^31 seconds out of ~2^32 seconds
representable duration.)

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16984

5 years agorandom(4): Correct a bare zero to the appropriate enum
cem [Sat, 20 Oct 2018 21:06:15 +0000 (21:06 +0000)]
random(4): Correct a bare zero to the appropriate enum

The convention for updating hc_destination[] is to index with a
random_entropy_source.  Zero happens to match RANDOM_CACHED, which is
correct for this source (early random data).  Spell the zero value as the
enum name instead of the magic constant.

No functional change.

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16983

5 years agoAdd an assertion to pmap_enter().
markj [Sat, 20 Oct 2018 20:53:35 +0000 (20:53 +0000)]
Add an assertion to pmap_enter().

When modifying an existing managed mapping, we should find a PV entry
for the old mapping.  Verify this.

Before r335784 this would have been implicitly tested by the fact that
we always freed the PV entry for the old mapping.

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17626

5 years agoAdd -b/-l options to localedef(1) to specify output endianness and use
yuripv [Sat, 20 Oct 2018 20:51:05 +0000 (20:51 +0000)]
Add -b/-l options to localedef(1) to specify output endianness and use
it appropriately when building share/ctypedef and share/colldef.

This makes the resulting locale data in EL->EB (amd64->powerpc64) cross
build and in the native EB build match.  Revert the changes done to libc
in r308170 as they are no longer needed.

PR: 231965
Reviewed by: bapt, emaste, sbruno, 0mp
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17603

5 years agoUpdate libdialog to 1.3-20180621
bapt [Sat, 20 Oct 2018 20:49:46 +0000 (20:49 +0000)]
Update libdialog to 1.3-20180621

5 years agorandom(4): Translate a comment requirement into a compile-time invariant
cem [Sat, 20 Oct 2018 20:49:37 +0000 (20:49 +0000)]
random(4): Translate a comment requirement into a compile-time invariant

In various places, random represents the set of sources as a 32-bit word
bitmask.  It assumes all sources fit within this, i.e., the maximum valid
source number is 31.

There was a comment specifying this limitation, but we can actually refuse
to compile if our assumption is violated instead.  We still have a few spare
random source slots, but sooner or later someone may need to convert the
masks used from raw 32-bit words to bitset(9) APIs.

This prevents some kinds of developer foot-shooting when adding new random
sources.  No functional change.

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16982

5 years agoddb: Enable 'thread <address>'
cem [Sat, 20 Oct 2018 20:45:49 +0000 (20:45 +0000)]
ddb: Enable 'thread <address>'

Currently, the 'thread' command (to switch the debugger to another thread)
only accepts decimal-encoded tids.  Use the same parsing logic as 'show
thread <arg>' to accept hex-encoded thread pointers in addition to
decimal-encoded tids.

Document the 'thread' command in ddb.4 and expand the 'show thread'
documentation to cover the tid usage.

Reported by: bwidawsk
Reviewed by: bwidawsk (earlier version), kib (earlier version), markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16962

5 years agoAdd a dev_refthread.9 document.
cem [Sat, 20 Oct 2018 20:41:25 +0000 (20:41 +0000)]
Add a dev_refthread.9 document.

Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential: https://reviews.freebsd.org/D16897

5 years agobsd-family-tree: Announce two new releases
eadler [Sat, 20 Oct 2018 20:34:36 +0000 (20:34 +0000)]
bsd-family-tree: Announce two new releases

- OpenBSD 6.4; NetBSD 7.2

5 years agoImport dialog 1.3-20180621
bapt [Sat, 20 Oct 2018 20:32:57 +0000 (20:32 +0000)]
Import dialog 1.3-20180621

5 years agoFortuna: trivial static variable cleanup
cem [Sat, 20 Oct 2018 20:15:06 +0000 (20:15 +0000)]
Fortuna: trivial static variable cleanup

Remove unnecessary use of function-local static variable.  32 bytes is
small enough to live on the stack.

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16937

5 years agoFortuna: Add trivial assert to match FS&K definition
cem [Sat, 20 Oct 2018 20:12:57 +0000 (20:12 +0000)]
Fortuna: Add trivial assert to match FS&K definition

FS&K GenerateBlocks function asserts C (counter) != 0.  This should also
be true in our implementation.

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16936

5 years agoFortuna: Clean up reseeding key material to closer match FS&K
cem [Sat, 20 Oct 2018 19:44:59 +0000 (19:44 +0000)]
Fortuna: Clean up reseeding key material to closer match FS&K

When reseeding, only incorporate actual key material.  Do not include e.g.
the derived key schedules or other AES context.

I don't think the extra material was harmful here, just not beneficial.

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16934

5 years agodev_refthread: Do not initialize *ref when reference was not acquired
cem [Sat, 20 Oct 2018 19:42:38 +0000 (19:42 +0000)]
dev_refthread: Do not initialize *ref when reference was not acquired

Like the companion API devvn_refthread, leave *ref uninitialized when a
reference was not acquired.  Initializing to 1 provides a vaguely
correct-looking but bogus value for broken callers to (mistakenly) pass to
dev_relthread() when refthread fails.

Make it even more clear to consumers that dev_relthread is only valid when
dev_refthread succeeds.

Reviewed by: kib, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16885

5 years agoNow that we've branched, turn off building DRM and DRM2 by default.
imp [Sat, 20 Oct 2018 19:18:30 +0000 (19:18 +0000)]
Now that we've branched, turn off building DRM and DRM2 by default.

We no longer build the drm/drm2 modules by default. See UPDATING for
which package to install instead. drm and drm2 have been completely
unsupported abandonware for a long time now. Please report issues with
the pkg modules to x11@freebsd.org.

Approved by: FreeBSD Graphics Team

5 years agoAdd a MINIMAL config for i386, based on amd64
cem [Sat, 20 Oct 2018 19:16:43 +0000 (19:16 +0000)]
Add a MINIMAL config for i386, based on amd64

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D17560

5 years agoAdd updating entry for DRM
imp [Sat, 20 Oct 2018 19:14:46 +0000 (19:14 +0000)]
Add updating entry for DRM

Update messaging for which drm module to install. Add guidance on what
hardware is supported (which should be copied into the release
notes). Note: the in tree drivers are abandonware. There has been no
organized support for them for many years, and the plan is to still
remove them for all but arm once the transition to drm-*kmod is
complete. Also note that WITHOUT_MODULE_DRM and WITHOUT_MODULE_DRM2
should generally be added to src.conf for anybody using the drm-*kmod
ports. That will become default in 13 soon, however.

Approved by: FreeBSD Graphics Team
Relnotes: Yes
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D17451

5 years agostty.1: Document kern.tty_info_kstacks behavior (r339471)
cem [Sat, 20 Oct 2018 18:53:32 +0000 (18:53 +0000)]
stty.1: Document kern.tty_info_kstacks behavior (r339471)

Reported by: bdrewery
Reviewed by: bdrewery
Sponsored by: Dell EMC Isilon

5 years agolibelf: also test for 64-bit ELF in _libelf_is_mips64el
emaste [Sat, 20 Oct 2018 18:47:45 +0000 (18:47 +0000)]
libelf: also test for 64-bit ELF in _libelf_is_mips64el

Although _libelf_is_mips64el is only called in contexts where we've
already checked that e_class is ELFCLASS64 but this may change in the
future.  Add a safety belt so that we don't access an invalid e_ehdr64
union member if it does.

Reported by: jkoshy (in review D17380)

5 years agorc.initdiskless: fix commentary grammar after r339465
eugen [Sat, 20 Oct 2018 18:46:36 +0000 (18:46 +0000)]
rc.initdiskless: fix commentary grammar after r339465

MFC after: 1 month

5 years agotty info (^T): Add optional kernel stack(9) traces
cem [Sat, 20 Oct 2018 18:42:28 +0000 (18:42 +0000)]
tty info (^T): Add optional kernel stack(9) traces

It is often useful for developers and administrators to determine a running
thread's stack for debugging purposes.  With this feature, using ^T will
print that information

For now, the feature is disabled by default.  Enable with sysctl
kern.tty_info_kstacks=1.

Discussed with: markj
Reviewed by: oshogbo
Relnotes: yes
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17621

5 years agopf synproxy will do the 3WHS on behalf of the target machine, and once
kp [Sat, 20 Oct 2018 18:37:21 +0000 (18:37 +0000)]
pf synproxy will do the 3WHS on behalf of the target machine, and once
the 3WHS is completed, establish the backend connection. The trigger
for "3WHS completed" is the reception of the first ACK. However, we
should not proceed if that ACK also has RST or FIN set.

PR: 197484
Obtained from: OpenBSD
MFC after: 2 weeks