diff: Tweak range of -C and -U arguments
POSIX uses the terms “positive decimal integer” for -C and “non-negative
decimal integer” for -U, which translates into lower bounds of 1 for -C
and 0 for -U.
POSIX does not specify a minimum upper bound for either mode, but as of
5fc739eb5949 both our backends support context sizes up to and including
INT_MAX, so use that.
Having had the opportunity to consult the Unix System Test Suite, the
diff test cases found therein happen to precisely match these bounds.
While here, switch to using strtonum() to parse numerical arguments, and
try to be more consistent in how we report usage errors.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
[3 lines not shown]
nvme: Use __diagused instead of __unused
Reviewed by: imp
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
(cherry picked from commit 1c09ae2be059da0b945a2543ac7dd0bd5198d0e3)
timeout: Clean up
* Annotate logv() and fix format string bug.
* Don't reinvent str2sig(3).
* Reorganize kill_self() so we unblock signals as late as possible, and
use raise(2) instead of kill(2).
* Explicitly close unused pipe descriptors.
* Use correct type to collect result of read(2) and write(2).
* Compare return values to 0, not -1.
* Sort local variables according to style(9).
* Reduce unnecessary nesting.
[10 lines not shown]
diff: Tweak recursion tests
The -r flag is not required to compare two directories; it is only
required to compare them recursively, i.e. descend into their common
subdirectories. Adjust tests that use -r needlessly, and adjust the
dirloop test to verify that these two cases remain distinct.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55262
(cherry picked from commit b2532432971fbd9339a9a49eca1b532978bb6d48)
nvme: Use size_t for payload size
Using uint32_t here can cause spurious compiler warnings. I assume it
was done to constrain the range; use a KASSERT instead.
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D55279
(cherry picked from commit be7e4dc878eab090cd411c9ef28880e4f62116f5)
tests: Simplify libarchive tests
The ATF tests work by first running the test program with an invalid
flag, which causes it to print an error message, a summary of options,
and a list of available test cases. Switch to the new -l option which
simply prints the list, and simplify the awk script used to parse the
output. No functional change.
MFC after: 1 week
(cherry picked from commit 394201ce5b4e2f84f1e39a7ce8bdc3f5a5ef8390)
vfs_mount.c: Don't call VFS_MOUNT() if only exports are being updated
PR#293198 reports a hang within ZFS when exports
are being updated concurrently with a VOP_SETEXTATTR().
The hang appears to be caused by mishandling of the
z_teardown_lock, but fixing handling of this lock appears
to be a major effort. Since the hang occurs when
VFS_MOUNT() acquires a write/exclusive z_teardown_lock,
which rarely occurs, except when exports are being updated,
this patch avoids the VFS_MOUNT() call for this case.
Avoiding a VFS_MOUNT() call fixes the hang for the case
reported by PR#293198 and is also an optimization.
As such, this patch avoids the VFS_MOUNT() call when only exports
are being updated similar to what was already being done
within vnet prisons.
PR: 293198
Reviewed by: kib, markj
[2 lines not shown]
ObsoleteFiles: Deduplicate
Since we dropped support for profile libraries, all optional entries for
them are now non-optional. Most of them were already duplicated there,
a few were not.
MFC after: 3 days
Reviewed by: jhb, emaste
Differential Revision: https://reviews.freebsd.org/D55329
HBSD: Opt zlib kernel module into -ftrivial-var-auto-init=zero
Recent CVEs in the zlib project demonstrate the need to apply additional
protections.
Signed-off-by: Shawn Webb <shawn.webb at hardenedbsd.org>
See-Also: https://7asecurity.com/reports/pentest-report-zlib-RC1.1.pdf
MFC-to: 15-STABLE
sdt: Disable SDT probes in kernel modules for GCC on aarch64
For PIC code, the existing assembly constraints do compile on aarch64.
Some kernel modules build ok using the 'p' constraint with the 'a'
operand modifier, but not all.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55166
vchiq: Fix return type of vchiq_copy_from_user
Change the function definition to map the declaration and consistently
return an enum value. This fixes the following error reported by GCC:
sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c:322:1: error: conflicting types for 'vchiq_copy_from_user' due to enum/integer mismatch; have 'int(void *, const void *, int)' [-Werror=enum-int-mismatch]
322 | vchiq_copy_from_user(void *dst, const void *src, int size)
| ^~~~~~~~~~~~~~~~~~~~
In file included from sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.h:38,
from sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c:61:
sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h:647:1: note: previous declaration of 'vchiq_copy_from_user' with type 'VCHIQ_STATUS_T(void *, const void *, int)'
647 | vchiq_copy_from_user(void *dst, const void *src, int size);
| ^~~~~~~~~~~~~~~~~~~~
Differential Revision: https://reviews.freebsd.org/D55163
arm bcm2835: Appease a warning from GCC
No code currently uses the vc_audio_msg_type_names array of strings.
Reported by: -Wunused-variable
Differential Revision: https://reviews.freebsd.org/D55162
arm64: Explicitly use movz
This appeases GNU as which doesn't map the mov alias to movz.
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D55160
bus: Renumber global IVAR ranges
Use a more consistent scheme for allocating shared IVAR index ranges.
Differential Revision: https://reviews.freebsd.org/D54161
bus: Drop a couple of unused IVAR indices
This changes the in-kernel ABI, but that is permitted across major
versions and is cleaner than leaving these around forever.
Differential Revision: https://reviews.freebsd.org/D54160
bus: Change a few bus drivers to use consistent IVAR ranges
A few bus drivers used 1 instead of 0 as the starting index of their
private IVARs. Fix those drivers to start at BUS_IVARS_PRIVATE for
consistency.
Differential Revision: https://reviews.freebsd.org/D54934
bus: Document special ranges of IVARs
Some IVAR indices are special in that they have global meaning across
multiple buses where as other IVARs are always private to the local bus.
Try to document this a bit and add constants for the various ranges to
avoid future conflicts.
This is a no-op, but IVAR indices are now generally defined as enums
as that makes it easier to define them in terms of ranges.
Reviewed by: imp, royger, andrew
Differential Revision: https://reviews.freebsd.org/D54159
acpi_gpiobus: Reuse the existing IVAR index for an ACPI handle
ACPI_IVAR_HANDLE is a global index shared across multiple busses,
there is no need for a unique constant here.
Reviewed by: vexeduxr, imp
Differential Revision: https://reviews.freebsd.org/D54155
evdev: Drop comments from input-event-codes.h
They were copied intact from the Linux GPL-only file.
Requested by: imp, glebius
MFC after: 1 week
(cherry picked from commit 89aa8a94053fdd22ed716fdf424a2d10e70b3188)
msconvd(8): Drop mentions of Bus/InPort mouse support in manual page
mse(4) was removed long ago.
MFC after: 1 month
(cherry picked from commit dc6f609685a9bc41c67d3c1219311e0096982865)
hid: Make game controllers accessible to members of the game group
Their events have to be accessible by unprivileged users via e.g. libsdl.
MFC after: 1 month
(cherry picked from commit b6cad334e649f49c57da52b139de353ad9078985)
psm: Fix three finger tap on elantech v4 touchpads
Fix an issue where a three finger tap would generate additional events
when fingers moved slightly during the tap.
Signed-off-by: Robert Wahlberg <freebsd at robertwahlberg.se>
Pull Request: https://github.com/freebsd/freebsd-src/pull/1792
Reviewed by: wulf
MFC after: 1 month
(cherry picked from commit e3201cec8381c0582374f93991eff4a71bb95e9b)
evdev: Allow setting of character device ownership and access mode
by device driver. That is required as game pad and joystick events have
to be accessible by ordinary users.
MFC after: 1 month
(cherry picked from commit ecccc9d99901dd874e8d122853026d7c28fa4fcf)