Commit Graph

237922 Commits

Author SHA1 Message Date
Kirk McKusick
4391a9c0e9 Bring up to date with recently added functions berase(3), getinode(3),
putinode(3), sbget(3), and sbput(3).

Sponsored by: Netflix
2018-11-26 23:09:45 +00:00
Warner Losh
1759fd7798 Minor tweaks to the formatting
Tweak the format of the trim + read bias code. Add similar debug to
the read + writes case.

Spondored by: Netflix
2018-11-26 22:50:30 +00:00
Mark Murray
70bfe7f7a8 Add dependency to allow if_muge device to be only ethernet device in stripped-down RPI3 kernel. 2018-11-26 22:45:58 +00:00
Mark Johnston
423700997b Check for an allocation failure before dereferencing the pointer.
Reported by:	Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by:	np
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18310
2018-11-26 22:42:52 +00:00
Martin Matuska
d28d5e1457 libarchive configuration changes
- move HAVE_BZLIB_H, HAVE_LIBLZMA and HAVE_LZMA_H to config_freebsd.h
- activate support for multi-threaded lzma encoding [1]

PR:		233543 [1]
Reported by:	cem
MFC after:	1 week
2018-11-26 21:45:27 +00:00
Eric van Gyzen
607a0eb2f1 Remove superfluous bzero in getcontext/swapcontext/sendsig
We zero the whole structure; we don't need to zero the __spare__ field again.

Remove trailing whitespace.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2018-11-26 20:56:05 +00:00
Eric van Gyzen
4d5a108409 Prevent kernel stack disclosure in signal delivery
On arm64 and riscv platforms, sendsig() failed to zero the signal
frame before copying it out to userspace.  Zero it.

On arm, I believe all the contents of the frame were initialized,
so there was no disclosure.  However, explicitly zero the whole frame
because that fact could inadvertently change in the future,
it's more clear to the reader, and I could be wrong in the first place.

MFC after:	2 days
Security:	similar to FreeBSD-EN-18:12.mem and CVE-2018-17155
Sponsored by:	Dell EMC Isilon
2018-11-26 20:52:53 +00:00
Eric van Gyzen
f5e7d8bdb5 Prevent kernel stack disclosure in getcontext/swapcontext
Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc.

MFC after:	2 days
Security:	FreeBSD-EN-18:12.mem
Security:	CVE-2018-17155
Sponsored by:	Dell EMC Isilon
2018-11-26 20:50:55 +00:00
Ben Widawsky
ec60b7f929 acpi/ec: Fix regression caused by r340644
After r340644 there were two things wrong in cases where there is both
an ECDT, and an EC device exposed via acpica. The first is a rather
trivial situation where the device desc would say ECDT even when it was
not implicitly created via ECDT (not really sure why the compiler
doesn't seem to warn about this).

The other more pervasive issue is that the code is designed to
essentially not do anything for EC probe when its uid was already
created an EC based on the ECDT's uid. The issue was that probe would
still return 0 in this case, and so we'd end up with some weird
duplication. Now to be honest, I'm not actually sure what exactly broke,
but it was definitely not working as intended. To fix this, all that is
really needed is to make sure we return ENXIO when we're probing the
device already added for the ECDT entry. While here though, move the
check for this earlier to avoid wasted cycles when we know after
obtaining the uid that it's duplicative.

There remains one questionable bit here which I don't want to touch -
when doing probe for PNP0C09, if acquiring _UID for the device fails, 0
is assumed, which is a valid UID used by the implicit ECDT.

Reported by:	Charlie Li, et al.
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D18311
2018-11-26 19:41:13 +00:00
Yuri Pankov
ea22b5bd75 Add ga_IE.UTF-8 locale.
PR:		228587
Submitted by:	Micil <micheal.maclochlainn@oegaillimh.ie> (LC_TIME)
Reviewed by:	bapt
Approved by:	kib (mentor, implicit)
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D17997
2018-11-26 19:39:49 +00:00
Ed Maste
4f7c9c3e4e stand/i386/libi386: rename .s file to .S to use Clang IAS
As part of the migration away from obsolete binutils we want to retire
GNU as.  Most assembly files used on amd64 have a .S extension and are
assembled with Clang's Integrated Assembler (IAS); rename pxetram.s to
.S to use IAS as well.

The generated .text is identical (the entire .o file is not, as Clang
adds debug info.)

PR:		205250, 233094
Sponsored by:	The FreeBSD Foundation
2018-11-26 19:29:18 +00:00
Ed Maste
e5b8bced3f btx: rename .s files to .S to use Clang IAS
As part of the migration away from obsolete binutils we want to retire
GNU as.  Most assembly files used on amd64 have a .S extension and are
assembled with Clang's integrated assembler; rename two files in
stand/i386/btx/lib to .S to use IAS as well.

The generated .text is identical (the entire .o files are not, as Clang
adds debug info).

PR:		205250, 233094
Discussed with:	imp
Sponsored by:	The FreeBSD Foundation
2018-11-26 19:14:33 +00:00
Emmanuel Vadot
3cb36739ce regulator_fixed: Do not disable fixed regulator at probe
If the regulator is unused it will be disabled by the regulator_shutdown sysinit.

Tested on pinebook where the backlight is controlled by a fixed-regulator.
The regulator doesn't have a regulator-boot-on param (I'm gonna upstream this) and so we disable it at probe.
We later enable it but this cause the screen to go black.
Linux doesn't disable regulator at boot (at least for fixed-regulator) so better match this to have the same UX.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D17978
2018-11-26 18:46:15 +00:00
Alan Somers
72bce9fff6 vfs_aio.c: rename "physio" symbols to "bio".
aio has two paths: an asynchronous "physio" path and a synchronous path.
Confusingly, physio(9) isn't actually used by the "physio" path, and never
has been.  In fact, it may even be called by the synchronous path!  Rename
the "physio" path to the "bio" path to reflect what it actually does:
directly compose BIOs and send them to character devices.

MFC after:	2 weeks
2018-11-26 18:31:00 +00:00
Emmanuel Vadot
6bff96c117 arm64: Add evdev support to GENERIC 2018-11-26 17:59:25 +00:00
Ed Maste
df27a97e56 UPDATING: add note for r340984 (ld.bfd removal)
Sponsored by:	The FreeBSD Foundation
2018-11-26 17:22:23 +00:00
Ed Maste
0179c8351b src.conf.5: regen after r340984 (and r340841) 2018-11-26 17:11:50 +00:00
Ed Maste
eda7d3bec4 Do not install GNU ld if lld is /usr/bin/ld
GNU binutils ld.bfd 2.17.50 does not support ifuncs and produces broken
binaries when ifuncs are in use.  When LLD_IS_LD is default we have an
ifunc-capable system linker and can just avoid installing ld.bfd.

Reported by:	theraven
Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18340
2018-11-26 17:07:35 +00:00
Glen Barber
6b26cacc52 Fix NTP query on GCE due to unresolved hostname.
PR:		232456
Submitted by:	Lucas Kanashiro
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2018-11-26 17:00:39 +00:00
Emmanuel Vadot
9848333b6c release: arm64: Add PINEBOOK config
Add a configuration for PINEBOOK image.
Pinebook is a arm64 laptop based on a Pine64 board.

Since the usb trackpad need a quirk, add a common function for adding
quirk for arm board.
A default one is supplied as most board to not need quirks.

Reviewed by:	gjb
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D18337
2018-11-26 16:38:39 +00:00
Eugene Grosbein
3b78397008 Small language fix after r340978.
MFC after:	3 days
2018-11-26 16:10:20 +00:00
Eugene Grosbein
3a498c2e8a ipfw.8: add new section to EXAMPLES:
SELECTIVE MIRRORING
     If your network has network traffic analyzer connected to your host
     directly via dedicated interface or remotely via RSPAN vlan, you can
     selectively mirror some ethernet layer2 frames to the analyzer.
     ...
2018-11-26 16:02:17 +00:00
Yuri Pankov
f2dfec1ffb vi: fix UTF-8 detection.
PR:		202290
Submitted by:	lampa@fit.vutbr.cz
Reviewed by:	bapt
Approved by:	kib (mentor, implicit)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D17950
2018-11-26 15:33:55 +00:00
Ed Maste
6b31818dee llvm-objdump.1: fix igor / mandoc -Tlint warnings
Accidentally omitted from r340972.
2018-11-26 15:12:58 +00:00
Yuri Pankov
52ee41b778 bectl: sync usage with man page, removing stray multibyte characters
in the process.

PR:		233526
Submitted by:	tigersharke@gmail.com (original version)
Reviewed by:	kevans
Approved by:	kib (mentor, implicit)
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D18335
2018-11-26 15:11:32 +00:00
Ed Maste
7a1772ed42 llvm-objdump.1: remove invalid options
Some options appear in llvm-objdump's usage information as a side effect
of its option parsing implementation and are not actually llvm-objdump
options.  Reported in LLVM review https://reviews.llvm.org/D54864.

Reported by:	Fangrui Song
Sponsored by:	The FreeBSD Foundation
2018-11-26 14:45:58 +00:00
Ed Maste
801cfbaa3f llvm-objdump: initial man page
Based on llvm-objdump's online documentation and usage information.
This serves as a starting point; additional detail and cleanup still
required.

Also being submitted upstream in LLVM review D54864.  I expect to use
this bespoke copy while we have LLVM 6.0 or 7.0 in FreeBSD; when we
update to LLVM 8.0 it should be upstream and we will switch to it.

PR:		233437
Reviewed by:	bcr (man formatting)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18309
2018-11-26 14:34:30 +00:00
Emmanuel Vadot
198e1deb5f aw_usbphy: Do not error if it's not phy 0
Only phy0 can switch between host/otg, do not error if we request
host mode on phy != 0.

MFC after:	1 month
X-MFC with:	r340846
2018-11-26 14:27:13 +00:00
Ed Maste
cac83db9b7 revert r340640 "libc: forcibly disable BIND_NOW"
When immediate bind mode is requested, as of r340675 rtld processes
irelocs in PLT immediately after other PLT relocs.  That addresses the
libc + BIND_NOW startup crash the workaround is no longer needed.

PR:		233333
2018-11-26 13:56:19 +00:00
Mark Johnston
d25f8522be Plug routing sysctl leaks.
Various structures exported by sysctl_rtsock() contain padding fields
which were not being zeroed.

Reported by:	Thomas Barabosch, Fraunhofer FKIE
Reviewed by:	ae
MFC after:	3 days
Security:	kernel memory disclosure
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18333
2018-11-26 13:42:18 +00:00
Martin Matuska
7d69e4cde7 MFV r340938:
Sync libarchive with vendor.

Relevant vendor changes:
  Issue #1096: Support extracting ACLs with in-entry comments (GNU tar)
  PR #1023: Support extracting extattrs as non-root on non-user-writeable
            files

MFC after:	1 week
2018-11-26 11:04:35 +00:00
Martin Matuska
09d835e31d Update vendor/libarchive/dist to git 2c5e9bdbb62eeb56a37776f796c15ed16727193e
Relevant vendor changes:
  Issue #1096: Support extracting ACLs with in-entry comments (GNU tar)
  PR #1023: Support extracting extattrs as non-root on non-user-writable files
2018-11-26 11:01:51 +00:00
Baptiste Daroussin
6bbd1d19fd libedit: improve multibyte support
Until this commit libedit only supported UTF-8 for multibyte charset
Improve it to support other multibyte charsets

Tested with eucJP and SJIS charsets.
Note that this change as been review and committed in upstream libedit
as well via christos@NetBSD

Submitted by:	naito.yuichiro _at_ gmail.com
Reviewed by:	bapt, pfg, yuripv, 0mp
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D17903
2018-11-26 08:16:33 +00:00
Andrew Rybchenko
acc84f29fe sfxge(4): add 3.3V and 12.0V current sensors
Automatically generated using mkconfig.py.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18138
2018-11-26 07:42:52 +00:00
Andrew Rybchenko
cdf90d6e3c sfxge(4): fix incorrectly set svn properties
File name was used by the svn property value since
real value was lost in the command.
2018-11-26 07:30:47 +00:00
Andrew Rybchenko
9ed106d0b4 sfxge(4): update autogenerated headers from firmwaresrc
Pick up Medford2 interfaces.

Split AOE operations out into own header.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18137
2018-11-26 07:23:02 +00:00
Andrew Rybchenko
208539a4f7 sfxge(4): regenerate files with genfwdef after ID update
Add security level to image boot header.

Submitted by:   Andrew Jackson <ajackson at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18289
2018-11-26 07:15:19 +00:00
Andrew Rybchenko
fdbe38cf9d sfxge(4): add API to control UDP tunnel ports
HW needs to know which UDP packets should be treated as tunnel
encapsulation to do inner packet recognition, classification and
offloads.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18134
2018-11-26 06:20:13 +00:00
Kirk McKusick
a02bd3e38c Move the check for the filesystem having been run on a kernel that
predates metadata check hashes so that it is done before deciding
whether to compute a check-hash of the superblock.

Reported by:  Rick Macklem <rmacklem@uoguelph.ca>
Sponsored by: Netflix
2018-11-26 00:58:07 +00:00
Vladimir Kondratyev
a0e9218c01 evdev: Fix pause key release event in AT keyboard set 1 to evdev xlat-or.
MFC after:	2 weeks
2018-11-25 19:37:00 +00:00
Kirk McKusick
038c170fc2 Properly recover from superblock check-hash failures. Specifically,
report the check-hash failure and offer to search for and use
alternate superblocks.  Prior to this fix fsck_ffs would simply
report the check-hash failure and exit.

Reported by:  Julian H. Stacey <jhs@berklix.com>
Tested by:    Peter Holm
Sponsored by: Netflix
2018-11-25 18:09:39 +00:00
Kirk McKusick
ade67b509c Calculate updated superblock check-hash before writing it into the snapshot.
This corrects a bug that prevented snapshots from being mounted due to a
superblock check-hash failure.

Reported by:  Brennan Vincent <brennan@umanwizard.com>
Tested by:    Peter Holm (pho@)
Sponsored by: Netflix
2018-11-25 18:01:15 +00:00
Konstantin Belousov
6e00f3a311 Avoid unneeded check in vmspace_alloc().
All vmspace_alloc() callers know which kind of pmap they allocate.

Reviewed by:	alc, markj (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D18329
2018-11-25 17:56:49 +00:00
Guangyuan Yang
2dfc267231 Update pxeboot(8) manual page to reflect the next-server change in the ISC DHCP v3 server.
PR:		123484
Submitted by:	edwin@mavetju.org
Reviewed by:	AllanJude
MFC after:	1 week
2018-11-25 09:37:57 +00:00
Alan Cox
ee73fef96e blist_meta_alloc assumes that mask=scan->bm_bitmap is nonzero. But if the
cursor lies in the middle of the space that the meta node represents, then
blanking the low bits of mask may make it zero, and break later code that
expects a nonzero value.  Add a test that returns failure if the mask has
been cleared.

Submitted by:	Doug Moore <dougm@rice.edu>
Reported by:	pho
Tested by:	pho
X-MFC with:	r340402
Differential Revision:	https://reviews.freebsd.org/D18058
2018-11-24 21:52:10 +00:00
Vladimir Kondratyev
80203ccefd psm(4): Add minimal support for active AUX port multiplexers
Active PS/2 multiplexing is a method for attaching up to four PS/2
pointing devices to a computer. Enabling of multiplexed mode allows
commands to be directed to individual devices using routing prefixes.
Multiplexed mode reports input with each byte tagged to identify
its source. This method differs from one currently supported by psm(4)
where so called guest device (trackpoint) is attached to special
interface located on the host device (touchpad) and latter performs
guest protocol conversion to special encapsulation packet format.

At present time active PS/2 multiplexing is used in some models of
HP laptops e.g. EliteBook 8560w, 9470m. Enabling of absolute operation
mode on such touchpads is connected with following problems:
1. Touchpad's port priority is lower than trackpoint's. That blocks
   information queries thus prevents touchpad detection and configuration.
2. Touchpad and trackpoint have different protocol packet sizes and
   sync bytes.

As PS/2 usage is on decline only minimal possible set of changes to
support Synaptics touchpad and generic mouses is implemented.
Active multiplexing mode is enabled only at probe stage to scan through
attached PS/2 devices to query and configure Synaptics touchpad.
After touchpad has been configured, mux is switched back to legacy
(hidden multiplexing) mode to perform normal interrupt-driven input
data processing. Overflow bit values rather than tags are used to
separate packets produced by different devices. Switching back to
legacy mode allows to avoid psm(4) and atkbd(4) rework to support
4 instances of mouse driver.

Note: While in hidden multiplexing mode KBC does some editing of the
packet stream. It remembers the button bits from the last packet
received from each device, and replaces the button bits of every
packet with the logical OR of all devices’ most recent button bits.
This sort of button crosstalk results in spurious button events
which are inhibitted with various tricks. E.g. trackpoint middle
button events are suppressed while trackpad surface is touched and
touchpad left and right button events are suppressed if corresponding
trackpoint buttons are pressed.

PR:		231058
Reported by:	Michael Figiel <mifigiel@gmail.com>
Tested by:	Michael Figiel <mifigiel@gmail.com>
MFC after:	2 weeks
2018-11-24 21:23:12 +00:00
Vladimir Kondratyev
512430923c Revert r328640: Add kludge for 0x46 identity middle byte Synaptics touchpads.
It appeared that "0x46 identity middle byte" response is caused by so called
"Active PS/2 multiplexing controller" presence. Support for it will be added
in next commit.
2018-11-24 21:17:51 +00:00
Andrew Turner
266900be14 Re-enable the dynamiclib tests. These should be fixed by r340910. 2018-11-24 18:25:00 +00:00
Andrew Turner
e5c0fd4be6 Add the missing 0 at the end of the .jcr section.
Without this the dynamic library test was failing as it was calling
_Jv_RegisterClasses multiple times.
2018-11-24 18:23:53 +00:00
Cy Schubert
aca1c28a0a Combine two lines into one following unifdef for r255332.
MFC after:	1 week
2018-11-24 18:23:05 +00:00