Ed Maste [Tue, 17 Mar 2020 19:53:03 +0000 (19:53 +0000)]
MFC r358512: Move ELF feature note tool to usr.bin/elfctl
elfctl is a tool for modifying the NT_FREEBSD_FEATURE_CTL ELF note,
which contains a set of flags for enabling or disabling vulnerability
mitigations and other features.
Also merge follow-on commits:
r358518 elfctl: initialize features
r358546 elfctl: tiny style(9) cleanup, use bool where appropriate
r358622 elfctl: style(9): use C99 uintX_t types
r358623 elfctl: check read return value
r358889 elfctl: remove memory leak
Bjoern A. Zeeb [Mon, 16 Mar 2020 21:12:46 +0000 (21:12 +0000)]
MFC r358992:
kern_jail: missing \0 termination check on osrelease parameter
If a user spplies a non-\0 terminated osrelease parameter reading it back
may disclose kernel memory.
This is a problem in case of nested jails (children.max > 0, which is not
the default). Otherwise root outside the jail has access to kernel memory
by other means and root inside a jail cannot create a child jail.
Add the proper \0 check at the end of a supplied osrelease parameter and
make sure any copies of the field will be \0-terminated.
Submitted by: Hans Christian Woithe (chwoithe yahoo.com)
wmt(4): Reapply r358872 (by hselasky) modified to use
maximal input report size instead of wMaxPacketSize.
If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
will pack multiple touch events in the packet and the current code will only
process the first touch event.
As a result some important events are lost like releasing the finger from the
touchscreen.
Use the maximal input report size as buffer size instead.
Navdeep Parhar [Sat, 14 Mar 2020 02:11:34 +0000 (02:11 +0000)]
MFC r357606:
cxgbe(4): Add native netmap support to the main interface.
This means that extra virtual interfaces (VIs) created with
hw.cxgbe.num_vis are no longer required to use netmap. Use this
tunable to enable native netmap support on the main interface:
Navdeep Parhar [Sat, 14 Mar 2020 01:28:53 +0000 (01:28 +0000)]
MFC r355730:
cxgbe(4): Use the _XT variant of the CPL used to transmit NIC traffic.
CPL_TX_PKT_XT disables the internal parser on the chip and instead
relies on the driver to provide the exact length of the L2 and L3
headers. This allows hw checksumming and TSO to be used with L2 and
L3 encapsulations that the chip doesn't understand directly.
Note that netmap tx still uses the old CPL as it never uses the hw
to generate the checksum on tx.
Navdeep Parhar [Sat, 14 Mar 2020 00:57:20 +0000 (00:57 +0000)]
MFC r355107 and r355597.
r355107:
cxgbe(4): Allow the driver to specify multiple FECs that the firmware
should try in order to link up with the peer.
Various FEC variables within the driver can now have multiple bits set
instead of being powers of 2. 0 and -1 in the user knobs still mean no
FEC and auto (driver decides) respectively for backward compatibility,
but no-FEC and auto now have their own bits in the internal
representation. There is a new bit that can be set to request the FEC
recommended by the cable/transceiver module.
Add sysctls to display link related capabilities of the local side as
well as the link partner.
Note that all this needs a new firmware and the documentation for the
driver FEC knobs will be updated after that firmware is added to the
driver.
r355597:
cxgbe(4): Man page updates to go with r355107.
Improve documentation of bootconfig and PARTITIONS
- Mention bootconfig target in TARGETS section.
- Document PARTITIONS variable, which is only mentioned in the examples,
but doesn't have its own point.
mixer(8): Report an error if the passed value is an empty string
This patch fixes a bug that made the mixer command enter
an infinite loop when instructed to set the value of a device
to an empty string (e.g., `mixer vol ""`).
Additionally, some tests for mixer(8) are being added.
- Use Xr to reference other manual pages.
- Reference execve(2) instead of exec(2) as exec(2) does not exist.
- Remove the deprecated "Tn" macro.
- Improve the formatting of the etime description.
- Fix some typos.
- Remove redundant semicolons from the synopsis section.
- Stylize variable names and types with Vt and Va respectively.
- Use a list to present non-implemented functions.
- Sort the order of the sections.
- Add a history section.
- Use Nm when "libefivar" is mentioned.
mount_smbfs(8): Add the STANDARDS and HISTORY sections
- Document that mount_smbfs(8) only supports SMB1 and that SMB2 and SMB3
are not supported at the moment. Suggest users to browse ports for
software compatible with newer versions of the protocol.
- Copy supported servers list from README.
- Add a SEE ALSO section and reference the chapter about Samba in the
FreeBSD Handbook.
- Add a HISTORY section.
- Style changes:
- Use Dq instead of Em in the EXAMPLES section.
- Mark command modifiers with Cm.
Reviewed by: bcr
Approved by: bcr (mentor)
Approved by: krion (mentor, implicit), mat (mentor, implicit)
Sponsored by: Bally Wulff Games & Entertainment GmbH
Differential Revision: https://reviews.freebsd.org/D17798
MFC r358537:
Expose the ACPI power button, sleep button and LID state as evdev's.
This allows libinput to disable touchpads when the lid is closed and
various desktop environments can show power-off dialogs when the power
button is pressed. While the latter is doable with devd a
cross-platform solution is nicer.
MFC r358629:
Implement a detaching flag for the sound(4) subsystem to take
appropriate actions when we are trying to detach an audio device,
but cannot because someone is using it.
This avoids applications having to wait for the DSP read data
timeout before they receive any error indication.
Tested with virtual_oss(8).
MFC r358738:
Remove the power bit from the super speed root hub port status register
because it clobbers the super speed link status when a device is in super
speed mode. Currently the power bit is not needed for anything in the USB
hub driver.
This fixes USB warm reset for super speed devices.
Pedro F. Giffuni [Wed, 11 Mar 2020 05:45:33 +0000 (05:45 +0000)]
MFC r358154 (by delphij)
Bump PROTOMAX: this matches the value on NetBSD and will be necessary for
future updates.
MFC r r358448;
/etc/services: attempt to bring the database to this century.
This is the result of splitting r358153 in two, in order to avoid a build
system bug and being able to merge the change to previous releases..
Document better this file, updating the URL to the IANA registry and closely
match the official services.
For system ports (0 to 1023) we now try to follow the registry closely, noting
some historical differences where applicable.
As a side effect: drop references to unofficial Kerberos IV which was EOL'ed
on Oct 2006[1]. While it is conceivable some people may still use it in some
very old FreeBSD machines that can't be replaced easily, the use of it is
considered a security risk. Also drop the unofficial netatalk, which we
supported long ago in the kernel but was dropped long ago.
Leave for now smtps, even though it conflicts with IANA's submissions.
The change should have very little visibility, if any, but should be a
step closer to the current IANA database.
Alexander Motin [Tue, 10 Mar 2020 15:18:53 +0000 (15:18 +0000)]
MFC r358580: Increase number of write completion threads, matching ZoL.
Our iSCSI benchmarks on a large 80-core system show that previous limit
of 8 threads can be a bottleneck. At some points this change increases
write IOPS by as much as 50%. I am still not sure that so many threads
is really required, but we tested lower amounts and got no significant
benefits, while latencies were a bit worse, so decided to not diverge.
Ed Maste [Mon, 9 Mar 2020 14:13:40 +0000 (14:13 +0000)]
MFC r358299: muge: fix rxcsum enable test
if_capabilities indicates capabilities supported by the hardware;
if_capenable which are enabled. Note that rx checksum is still disabled
in the driver at compile time.
Ed Maste [Mon, 9 Mar 2020 13:33:58 +0000 (13:33 +0000)]
MFC r346273: correct readlinkat(2) return type
r176215 corrected readlink(2)'s return type and the type of the last
argument. readlink(2) was introduced in r177788 after being developed
as part of Google Summer of Code 2007; it appears to have inherited the
wrong return type.
Man pages and header files were already ssize_t; update syscalls.master
to match.
Ed Maste [Mon, 9 Mar 2020 13:04:47 +0000 (13:04 +0000)]
MFC r358554: Add deprecation notices to ctau and cx drivers
These support outdated or obsolete ISA WAN (T1/E1) sync serial cards,
and these drivers haven't really been touched (other than in tree-wide
sweeps to keep them building) for 15+ years.
Related PCI devices ce and cp are still in the tree.
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Dimitry Andric [Mon, 9 Mar 2020 07:12:02 +0000 (07:12 +0000)]
MFC r358711:
Merge commit f75939599 from llvm git (by Erich Keane):
Reland r374450 with Richard Smith's comments and test fixed.
The behavior from the original patch has changed, since we're no
longer allowing LLVM to just ignore the alignment. Instead, we're
just assuming the maximum possible alignment.
This fixes 'Assertion failed: (Alignment != 0 && "Invalid Alignment"),
function CreateAlignmentAssumption', when building recent versions of
v8, which invoke __builtin_assume_aligned() with its alignment argument
set to 4GiB or more.
Clang will now report a warning, and show the maximum possible alignment
instead, e.g.:
huge-align.cpp:1:27: warning: requested alignment must be 536870912 bytes or smaller; maximum alignment assumed [-Wbuiltin-assume-aligned-alignment]
void *f(void *g) { return __builtin_assume_aligned(g, 4294967296); }
^ ~~~~~~~~~~
Upstream PR: https://bugs.llvm.org/show_bug.cgi?id=43839
Reported by: cem
Ed Maste [Sun, 8 Mar 2020 23:22:18 +0000 (23:22 +0000)]
MFC r350468: pf: zero (another) output buffer in pfioctl
Avoid potential structure padding leak. r350294 identified a leak via
static analysis; although there's no report of a leak with the
DIOCGETSRCNODES ioctl it's a good practice to zero the memory.
Suggested by: kp
Sponsored by: The FreeBSD Foundation
Ed Maste [Sun, 8 Mar 2020 21:10:16 +0000 (21:10 +0000)]
MFC r343610: elfdump: include note type names
Based on a patch submitted by Dan McGregor.
-
MFC r343611: elfdump: fix build after r343610
-
MFC r343613: elfdump: use designated array initialization for note types
This ensures the note type name is in the correct slot.
Submitted by: kib
-
PR: 228290
Sponsored by: The FreeBSD Foundation
Ed Maste [Sun, 8 Mar 2020 20:05:34 +0000 (20:05 +0000)]
MFC r348347 (jhibbits): libdwarf: add missing powerpc64 relocation support
Due to missing relocation support in libdwarf for powerpc64, handling of
dwarf info on unlinked objects was bogus.
Examining raw dwarf data on objects compiled on ppc64 with a modern compiler
(in-tree gcc tends to hide the issue, since it only rarely generates
relocations in .debug_info and uses DW_FORM_str instead of DW_FORM_strp for
everything), you will find that the dwarf data appears corrupt, with
repeated references to the compiler version where things like types and
function names should appear.
This happens because the 0 offset of .debug_str contains the compiler
version, and without applying the relocations, *all* indirect strings in
.dwarf_info will end up pointing to it.
This corruption then propogates to the CTF data, as ctfconvert relies on
libdwarf to read the dwarf info, for every compiled object (when building a
kernel.)
However, if you examine the dwarf data on a compiled executable, it will
appear correct, because during final link the relocations get applied and
baked in by the linker.
Ed Maste [Sun, 8 Mar 2020 18:21:04 +0000 (18:21 +0000)]
MFC r349751: Update Linux compat version to 2.6.36
New system calls between 2.6.32 and 2.6.26 are already implemented.
This should be mostly NFC as far as contemporary Linux applications are
concerned though, as Linux kernel 3.2 is the oldest supported by a
number of popular distros today; work is in progress by others to enable
support for those applications.