eadler [Mon, 19 Mar 2018 03:49:54 +0000 (03:49 +0000)]
MFC r328640:
psm: Add a kludge to support 0x46 identity middle byte Synaptics touchpads
Most synaptics touchpads return 0x47 in middle byte in responce to identify
command as stated in p.4.4 of "Synaptics PS/2 TouchPad Interfacing Guide".
But some devices e.g. found on HP EliteBook 9470m return 0x46 here.
Allow them to be identified as Synaptics as well as 0x47.
ExtendedQueries return incorrect data on such a touchpads so we ignore
their result and set conservative defaults.
eadler [Mon, 19 Mar 2018 03:47:46 +0000 (03:47 +0000)]
MFC r328638:
psm(4): Reduce psm watchdog verbosity
Modern touchpads do not issue interrupts on inactivity so "lost interrupt"
message became annoying spam nowadays. This change quiets the message
if debug.psm.loglevel=5 (or less) is set in /boot/loader.conf
eadler [Mon, 19 Mar 2018 03:46:12 +0000 (03:46 +0000)]
MFC r328636:
psm(4): Add support for HP EliteBook 1040 ForcePads.
ForcePads do not have any physical buttons, instead they detect click
based on finger pressure. Forcepads erroneously report button click
if there are 2 or more fingers on the touchpad breaking multifinger
gestures. To workaround this start reporting a click only after
4 consecutive single touch packets has been received. Skip these packets
in case more contacts appear.
eadler [Mon, 19 Mar 2018 03:22:43 +0000 (03:22 +0000)]
MFC r320210:
join(1): Fix field ordering for -v output
Per POSIX, join(1) (in modes other than -o) is a concatenation of selected
character fields. The joined field is first, followed by fields in the
order they occurred in the input files.
Our join(1) utility previously handled this correctly for lines with a match
in the other file. But it failed to order output fields correctly for
unmatched lines, printed in -a and -v modes.
A simple test case is:
$ touch a
$ echo "2 1" > b
$ join -v2 -2 2 a b
1 2
eadler [Sun, 18 Mar 2018 22:24:29 +0000 (22:24 +0000)]
MFC r319274:
- Add a simple example to uname(1) manual page to show how the hardware
platform (returned by -m) can be different from the machine's processor
architecture (-p)
- Document that make(1) sets universal MACHINE and MACHINE_ARCH variables
based on these values
indent(1): avoid calling write(2) with a negative second parameter.
indent(1): Avoid out of bound access of array codebuf.
indent(1): Avoid potential use-after-free.
indent(1): Fix breakage caused by single comment following "else".
indent(1) simply wasn't taught that "else" may be followed by a comment
without any opening brace anywhere on the line, so it was very confused
in such cases.
indent(1): fix struct termination detection.
indent(1): fix struct termination detection.
indent(1): Removed whitespace shouldn't be considered in column calculations.
indent(1): Support "f" and "F" floating constant suffixes.
indent(1): Use NULL instead of zero for pointers.
indent(1): Attempt to preserve some consistent style.
indent(1): Yet more style issues.
indent(1): Consistently indent declarations.
indent(1): Bail out if there's no more space on the parser stack.
indent(1): Remove dead code relating to unix-style comments.
indent(1): Simplify pr_comment().
indent(1): Fix wrapping of some lines in comments.
indent(1): Untangle the connection between pr_comment.c and io.c.
indent(1): Don't newline on cpp lines like #endif unless -bacc is on.
indent(1): replace function call to bzero with memset.
indent(1): Rearrange option parsing code to squelch clang's static analyzer.
indent(1): Use a dash in the license headers.
indent(1): accept offsetof(3) as a keyword.
indent(1): add some comments to quiet down Coverity.
indent(1): remove dead assignments.
indent(1): have the memset invocation somewhat more canonical.
indent(1): Capsicumify
indent(1): minor off-by-one error.
indent(1): fix regression introduced in r303596.
indent(1): Avoid out of bound access of array in_buffer
indent(1): Don't ignore newlines after comments that follow braces.
indent(1): Don't unnecessarily add a blank before a comment ends.
indent(1): Do not define opchar unless it will be used.
indent(1): Optimize parser stack usage.
indent(1): Remove an extra newline added in a previous commit.
indent(1): Avoid out-of-bound accesses of arrays.
indent(1): Avoid out-of-bound accesses of array ps.p_stack.
indent(1): Avoid out of bounds access of array ps.paren_indents
indent(1): add a piece missed in r311138.
indent(1): Support binary integer literals.
indent(1): don't produce unnecessary blank lines.
indent(1): rename the profile file.
indent(1): better alignment of comments on code.
imp [Sun, 18 Mar 2018 19:05:06 +0000 (19:05 +0000)]
Direct commit to stable
Remove libstand32 here. pc98 is a 32-bit platform, so it shouldn't compile
the extra 32-bit copy of libsa. The copy built in libstand is already 32-bit.
Add a comment saying we need an empty Makefile.pc98 since otherwise it would
pull in Makefile.i386 and there is no EFI on pc98, and the machines are too
old to have ZFS or GELI be a viable option (and besides, those don't compile).
Note: We also need r331140 to be MFC'd for pc98 build to work in all cases.
kp [Sun, 18 Mar 2018 11:25:39 +0000 (11:25 +0000)]
MFC r329950:
pf: Cope with overly large net.pf.states_hashsize
If the user configures a states_hashsize or source_nodes_hashsize value we may
not have enough memory to allocate this. This used to lock up pf, because these
allocations used M_WAITOK.
Cope with this by attempting the allocation with M_NOWAIT and falling back to
the default sizes (with M_WAITOK) if these fail.
PR: 209475
Submitted by: Fehmi Noyan Isi <fnoyanisi AT yahoo.com>
eadler [Sun, 18 Mar 2018 02:59:14 +0000 (02:59 +0000)]
MFC r330843:
efirtc: Pass a dummy tmcap pointer to efi_get_time_locked
As noted in the comment, UEFI spec claims the capabilities pointer is
optional, but some implementations will choke and attempt to dereference it
without checking. This specific problem was found on a Lenovo Thinkpad X220
that would panic in efirtc_identify.
dim [Sat, 17 Mar 2018 19:04:36 +0000 (19:04 +0000)]
Revert r330471 (MFC of r311861), since it results in compile errors
like:
sys/net80211/ieee80211_tdma.c:179: error: 'IEEE80211_MODE_VHT_2GHZ' undeclared (first use in this function)
sys/net80211/ieee80211_tdma.c:180: error: 'IEEE80211_MODE_VHT_5GHZ' undeclared (first use in this function)
The IEEE80211_MODE_VHT_2GHZ and IEEE80211_MODE_VHT_5GHZ enum values are
defined in r310147, but that commit cannot be MFCd as-is, because it
likely breaks ABI.
dim [Sat, 17 Mar 2018 18:55:46 +0000 (18:55 +0000)]
Repair obvious mismerge in r330897, resulting in misleading gcc error
messages like "sys/net/if_fddisubr.c:1: error: expected '=', ',', ';',
'asm' or '__attribute__' before '-' token".
eadler [Sat, 17 Mar 2018 01:27:54 +0000 (01:27 +0000)]
MFC r326959:
arc lint: ignore /tests/ in chmod
shell scripts in scripts don't need
to be chmod +x to work. In fact most are not.
Of the tests I found from a simple search:
65 are chmod +x
84 are chmod -x
patch(1): replace strnlen() with a simpler strlen().
patch(1): add support for git generated diffs.
patch: rejname[] is also -r option buffer, and should be PATH_MAX.
patch: further cleanup to git-style diffs.
The Genesys chip is failing when issueing READ_CAP(16) command.
Force a quirk to disable it and use READ_CAP(10) instead.
Also, depending on used firmware, GL3224 can be recognized
either as 'storage device' or 'mass storage class' -
enable both variants in scsi_quirk_table.
marius [Thu, 15 Mar 2018 23:02:49 +0000 (23:02 +0000)]
MFC: r327929
Use the correct revision specifier (EXT_CSD revision rather than
system specification version) for deciding whether the EXT_CSD
register includes the EXT_CSD_GEN_CMD6_TIME field.
marius [Thu, 15 Mar 2018 23:01:00 +0000 (23:01 +0000)]
MFC: r327355, r327926
- Don't allow userland to switch partitions; it's next to impossible
to recover from that, especially when something goes wrong.
- When userland changes EXT_CSD, update the kernel copy before using
relevant EXT_CSD bits in mmcsd_switch_part().
marius [Thu, 15 Mar 2018 22:58:31 +0000 (22:58 +0000)]
MFC: r327339, r327924
- There is no need to keep the tuning error and re-tuning interrupts
enabled (though, no interrupt generation enabled for them) all the
time as soon as (re-)tuning is supported; only enable them and let
them generate interrupts when actually using (re-)tuning.
- Also disable all interrupts except SDHCI_INT_DATA_AVAIL ones while
executing tuning and not just their signaling.
- Set the tuning error and re-tuning interrupt enable bits based on
the SDHCI_TUNING_ENABLED rather than the SDHCI_TUNING_SUPPORTED flag,
i. e. only when (re-)tuning is actually used. Currently, this change
makes no net difference, though.
kevans [Thu, 15 Mar 2018 19:31:39 +0000 (19:31 +0000)]
MFC r322278,324177: EFIRT Improvements
r322278 (imp): Fail to open efirt device when no EFI on system.
libefivar expects opening /dev/efi to indicate if the we can make efi
runtime calls. With a null routine, it was always succeeding leading
efi_variables_supported() to return the wrong value. Only succeed if
we have an efi_runtime table. Also, while I'm hear, out of an
abundance of caution, add a likely redundant check to make sure
efi_systbl is not NULL before dereferencing it. I know it can't be
NULL if efi_cfgtbl is non-NULL, but the compiler doesn't.
r324177 (andrew):
To prepare for adding EFI runtime services support on arm64 move the
machine independent parts of the existing code to a new file that can be
shared between amd64 and arm64.
Care has been taken to ensure that the MFC of r324177 did not clobber
cherry-picked MFC's.
emaste [Thu, 15 Mar 2018 12:56:22 +0000 (12:56 +0000)]
MFC r329370, r330239: Rationalize license text on Linuxolator files
Many licenses on Linuxolator files contained small variations from the
standard FreeBSD license text. To avoid license proliferation switch to
the standard 2-clause FreeBSD license for those files where I have
permission from each of the listed copyright holders.
Approved by: dchagin, kan, marcel, rdivacky, sos
Sponsored by: The FreeBSD Foundation
eadler [Thu, 15 Mar 2018 09:43:38 +0000 (09:43 +0000)]
MFC r305139:
df(1): Allow duplicate -l flags gracefully
Rather than producing a misleading error message when duplicate -l flags are
provided to df(1), simply ignore extra flags and proceed as if only one was
specified. This seems most reasonable given the usage for -l:
-l Only display information about locally-mounted file systems.
- add ñ, ', and _
- remove lint support
- add missing header for ioctl
- fix two typod
- Use `-r` for "reverse" mode and to match DragonFlyBSD.
- Move defines around to clear up logic
- use `errx` instead of `fprintf` and `exit`
- Use copyright comment header
- Make it easier to compile on !FreeBSD
- Diff reduction against DragonFlyBSD
- bump Dd
- use 'r' instead of 'D' from the original submission
eadler [Thu, 15 Mar 2018 09:04:23 +0000 (09:04 +0000)]
MFC r303036,r303038,r306822,r307923,:
makefs: reorder 'usage' alphabetically
From NetBSD, Mon Aug 15 14:45:01 2011 +0000 (wiz)
Re-order `usage' alphabetically;
rename option arguments in the manpage's `SYNOPSIS' section to
match those from `usage' (not the other way around; the `usage'-line
(and other parts of makefs.c) contain the correct names);
minor punctuation improvements.
makefs: sync NetBSD IDs with upstream for changes that we already have
May 22 21:51:39 2011 +0000 (christos):
From Nathan Whitehorn (nwhitehorn at freebsd dot org):
Add code to generate bootable ISOs on Powermac and CHRP systems.
Synthesize some partition maps (APM and MBR, respectively) pointing
to (a) the whole disk, and (b) relevant El Torito boot images that
have been added by other code. These partition maps are a little
bit funny looking, but they seem to work. FreeBSD has been using
this successfully in their release generation on powerpc, as well
as generating all non-SPARC install media. SPARC support could
probably be added as an extension of this patch.
makefs.8 1.33
Tue Aug 23 17:09:11 2011 +0000 (christos):
PR/45285: Martin Matuska: makefs does not properly convert ISO level 1 and 2
filenames (buffer overflow)
makefs does not properly verify the maximum filename length in the
special "." case for both ISO level 1 and ISO level 2 filename
conversion. This creates broken images or causes a buffer overflow
(ISO level 2).
ISO level 1:
If a filename contains only dots or up to 8 characters followed by
dots the 8+3 limit check doesn't work.
ISO level 2:
If a filename contains a dot in the first 30 characters and a dot
on the 30th character, the length limit check doesn't work and the
buffer is overflowed.
Allow building makefs(8) from another Makefile (such as one in
a seperate directory hierarchy used to build tools). This boils
down to replacing the use of ${.CURDIR} with either ${SRCDIR}
or ${SRCTOP}. SRCDIR is defined as the directory in which the
Makefile lives that bmake(1) is currently reading. Use SRCTOP
when reaching outside of makefs's directory.
eadler [Thu, 15 Mar 2018 02:20:06 +0000 (02:20 +0000)]
MFC r302525,r302526:
Do allow auditing of read(2) and write(2) system calls, by assigning
those system calls audit event identifiers AUE_READ and AUE_WRITE.
While auditing file-descriptor I/O is not required by the Common
Criteria, in practice this proves useful for both live and forensic
analysis.
NB: freebsd32 already assigns AUE_READ and AUE_WRITE to read(2) and
write(2).
In process-descriptor close(2) and fstat(2), audit target process
information. pgkill(2) already audits target process ID.
marius [Wed, 14 Mar 2018 23:59:50 +0000 (23:59 +0000)]
MFC: 327314
With the advent of interrupt remapping, Intel has repurposed bit 11
(now: Interrupt_Index[15]) and assigned the previously reserved bits
55:48 (Interrupt_Index[14:0] goes into 63:49 while Destination Field
used 63:56 and bit 48 now is Interrupt_Format) in the IO redirection
tables (see the VT-d specification, "5.1.5.1 I/OxAPIC Programming").
Thus, when not using interrupt remapping, ensure that all previously
reserved bits in the high part of the RTEs are zero instead of doing
a read-modify-write for their Destination Field bits only.
Otherwise, on machines based on Apollo Lake and its derivatives such
as Denverton, typically some of the previously preserved bits remain
set after boot when not employing interrupt remapping. The result is
that INTx interrupts are not getting delivered.
Note: With an AMD IOMMU, interrupt remapping apparently bypasses the
IO APIC altogether.
eadler [Wed, 14 Mar 2018 08:45:19 +0000 (08:45 +0000)]
MFC r302509:
Fix heap overflow in bhnd(4) SPROM parsing.
The bus_region_* APIs accept the number of data items to be read, while
the code was passing the total number of bytes, resulting in an overflow
of the SPROM parser's buffer.