Commit Graph

259156 Commits

Author SHA1 Message Date
Fedor Korotkov
225605ec16 Cirrus-CI: Use the default Git history depth
Which is `50`.  I saw a few errors like
`Failed to force reset to SHA: object not found!` which seems is
happening because the SHA is not available because there were two
commits pushed almost simultaneously and the second from the top fails
with this error because the SHA is not in the history.

Pull Request:	https://github.com/freebsd/freebsd-src/pull/454

Comments on re-commit from emaste:

Originally committed as fcb4797c90 and reverted in 80a840b8ba due
to the clone operation taking significantly longer.  However, I have
seen many failures due to the "object not found" issue recently.
7 of 37 recent runs failed because of this, and intermittent failures
like this makes CI much less useful.

Prefer longer-running runs to intermittent failures.
2021-06-07 18:50:18 -04:00
Rick Macklem
03c81af249 nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems
Pre-r318997 the code looked like:
if (vp->v_mount->mnt_stat.f_fsid.val[0] != (uint32_t)np->n_vattr.na_filesid[0])
         vap->va_fsid = (uint32_t)np->n_vattr.na_filesid[0];
Doing this assignment got lost by r318997 and, as such, NFSv4 mounts
of servers with trees of file systems on the server is broken, due to duplicate
fileno values for the same st_dev/va_fsid.

Although I could have re-introduced the assignment, since the value of
na_filesid[0] is not guaranteed to be unique across the server file systems,
I felt it was better to always do the hash for na_filesid[0,1].
Since dev_t (st_dev/va_fsid) is now 64bits, I switched to a 64bit hash.

There is a slight chance of a hash conflict where 2 different na_filesid
values map to same va_fsid, which will be documented in the BUGS
section of the man page for mount_nfs(8).  Using a table to keep track
of mappings to catch conflicts would not easily scale to 10,000+ server file
systems and, when the conflict occurs, it only results in fts(3) reporting
a "directory cycle" under certain circumstances.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30660
2021-06-07 13:48:25 -07:00
Mark Johnston
887c753c9f Fix handling of D_GIANTOK
It was meant to suppress only the printf(), not the subsequent injection
of Giant-protected thunks for various file operations.

Fixes:		fbeb4ccac9
Reported by:	pho
Tested by:	pho
MFC after:	6 days
Pointy hat:	markj
2021-06-07 16:45:50 -04:00
Greg V
05c2d94a08 LinuxKPI: add pr_err_once
Reviewed by:	hselasky, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30672
2021-06-07 10:31:48 -04:00
Stefan Eßer
35b8fd0b69 usr.bin/calendar: do not treat // in text as comment
The C++-style comment marker "//" has been added with the rewrite of
the preprocessor features. Since this character sequence occurs	in
ULRS, the reminder of the URL was considered a comment and stripped
from the calendar line.

Change parsing of "//" to only start a comment at the begin of a line
or when	preceeded by a white-space character.

PR:		256455
Reported by:	Philippe Michel (philippe.michel7 at free.fr)
MFC after:	3 days
2021-06-07 15:55:23 +02:00
Edward Tomasz Napierala
dd869341b1 Install the linux(4) man page also for aarch64
Previously it was only installed on i386 and amd64.

Reviewed By:	emaste, gbe (manpages)
Sponsored By:	EPSRC
Differential Revision: https://reviews.freebsd.org/D30546
2021-06-07 11:50:50 +01:00
Edward Tomasz Napierala
128a1db806 linux: improve FUSE support
This fixes a number of AppImages; tested with
scribus-1.5.6.1-linux-x86_64.AppImage.

Reported By:	@probonopd
Reviewed By:	asomers, emaste
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30606
2021-06-07 10:43:28 +01:00
Poul-Henning Kamp
aaa28628a3 fifolog: Rename yyparse() to getdate_yyparse().
Remove config file for obsolete static analyzer FlexeLint
2021-06-07 06:31:50 +00:00
Peter Holm
201434ecac stress2: Added two test scenarios based on Bug 256205 2021-06-07 07:35:10 +02:00
Peter Holm
b3b695604d stress2: Added a few syzkaller reproducers 2021-06-07 07:33:32 +02:00
Mark Johnston
e755e2776d ngatm: Handle errors from uni_msg_extend()
uni_msg_extend() may fail due to a memory allocation failure.  In this
case, though, the message is freed, so callers shouldn't touch it.

PR:		255861
Reviewed by:	harti
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30611
2021-06-06 16:44:47 -04:00
Mark Johnston
62ba0def55 arm: Remove last_fault_code
It is unused since the removal of pmap-v4.c in commit b88b275145.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-06-06 16:44:47 -04:00
Radosław Chmielarz
03d4b58fee iwn: adjust EEPROM read timeout for Intel 4965AGN M2
Reading EEPROM from Intel 4965AGN M2 takes 60 us which was causing panic
on system startup.

PR:		255465
Reviewed by:	markj
MFC after:	1 week
2021-06-06 16:44:47 -04:00
Mark Johnston
317113bb12 riscv: Rename pmap_fault_fixup() to pmap_fault()
This is consistent with other platforms, specifically arm and arm64.  No
functional change intended.

Reviewed by:	jrtc27
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30645
2021-06-06 16:44:46 -04:00
Mark Johnston
c05748e028 riscv: Handle hardware-managed dirty bit updates in pmap_promote_l2()
pmap_promote_l2() failed to handle implementations which set the
accessed and dirty flags.  In particular, when comparing the attributes
of a run of 512 PTEs, we must handle the possibility that the hardware
will set PTE_D on a clean, writable mapping.

Following the example of amd64 and arm64, change riscv's
pmap_promote_l2() to downgrade clean, writable mappings to read-only, so
that updates are synchronized by the pmap lock.

Fixes:		f6893f09d
Reported by:	Nathaniel Filardo <nwf20@cl.cam.ac.uk>
Tested by:	Nathaniel Filardo <nwf20@cl.cam.ac.uk>
Reviewed by:	jrtc27, alc, Nathaniel Filardo
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30644
2021-06-06 16:44:46 -04:00
Mark Johnston
4e4035ef1f arm64: Fix pmap_copy()'s handling of 2MB mappings
When copying mappings from parent to child, we clear the accessed and
dirty bits.  This is done for both 4KB and 2MB PTEs.  However,
pmap_demote_l2() asserts that writable superpages must be dirty.  This
is to avoid races with the MMU setting the dirty bit during promotion
and demotion.  pmap_copy() can create clean, writable superpage
mappings, so it violates this assertion.

Modify pmap_copy() to preserve the accessed and dirty bits when copying
2MB mappings, like we do on amd64.

Fixes:		ca2cae0b4d
Reported by:	Jenkins via mhorne
Reviewed by:	alc, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30643
2021-06-06 16:44:46 -04:00
Mark Johnston
a48f51b3d3 arm64: Use the right PTE when downgrading perms in pmap_promote_l2()
When promoting a run of small mappings to a superpage, we have to
downgrade clean, writable mappings to read-only, to handle the
possibility that the MMU will concurrently mark one of the mappings as
dirty.

The code which performed this operation for the first PTE in the run
used the wrong PTE pointer.  As a result, the comparison would always
fail, aborting the promotion.  This only occurs when promoting writable,
clean mappings.

Fixes:		ca2cae0b4d
Reviewed by:	alc, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30642
2021-06-06 16:44:46 -04:00
Mark Johnston
1ea87e2a70 stand: Fix __elfN(loadimage) return value
Caller functions expect __elfN(loadimage) to return a value of zero on
failure and the file size on success.

PR:		256390
Reviewed by:	markj
MFC after:	2 weeks
2021-06-06 16:44:46 -04:00
Mark Johnston
fbeb4ccac9 Suppress D_NEEDGIANT warnings for some drivers
During boot we warn that the kbd and openfirm drivers are Giant-locked
and may be deleted.  Generally, the warning helps signal that certain
old drivers are not being maintained and are subject to removal, but
this doesn't really apply to certain drivers which are harder to
detangle from Giant.

Add a flag, D_GIANTOK, that devices can specify to suppress the
misleading warning.  Use it in the kbd and openfirm drivers.

Reviewed by:	imp, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30649
2021-06-06 16:44:46 -04:00
Konstantin Belousov
62b8258a7e Change the return type of sv__setid_allowed from bool to int
to please some userspace code using sys/sysent.h.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-06-06 23:38:48 +03:00
Konstantin Belousov
598f6fb49c linuxolator: Add compat.linux.setid_allowed knob
PR:	21463
Reported by:	kris
Reviewed by:	dchagin
Tested by:	trasz
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28154
2021-06-06 21:43:00 +03:00
Konstantin Belousov
2d423f7671 sysent: allow ABI to disable setid on exec.
Reviewed by:	dchagin
Tested by:	trasz
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D28154
2021-06-06 21:42:52 +03:00
Konstantin Belousov
19e6043a44 kern_exec.c: Add execve_nosetid() helper
Reviewed by:	dchagin
Tested by:	trasz
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D28154
2021-06-06 21:42:41 +03:00
Dmitry Chagin
66e73ce737 linux(4): Fix clock_nanosleep return value for unsupported clockid.
The Linux clock_nanosleep() returns ENOTSUP for CLOCK_THREAD_CPUTIME_ID.
This silence one of the LTP clock_nanosleep tests.

MFC after:	2 weeks
2021-06-07 06:22:25 +03:00
Dmitry Chagin
f4e801085b linux(4): optimize ksiginfo to siginfo conversion.
Retire ksiginfo_to_lsiginfo function, use siginfo_to_lsiginfo instead.
Convert rt_sigtimedwait siginfo variables to well known names.

MFC after:	2 weeks
2021-06-07 06:06:17 +03:00
Dmitry Chagin
9c1045ff00 linux(4): Properly convert linux siginfo to native siginfo
add input validation.

MFC after:	2 weeks
2021-06-07 05:55:34 +03:00
Dmitry Chagin
e29ea22f70 Regen for ('0f8dab45404f347752470579feccc6d2739b9570') Linux
rt_sigtimedwait system call.

MFC after:	2 weeks
2021-06-07 05:39:29 +03:00
Dmitry Chagin
0f8dab4540 linux(4): Fix timeout parameter of rt_sigtimedwait syscall, which is
timespec not a timeval.

MFC after:	2 weeks
2021-06-07 05:35:35 +03:00
Dmitry Chagin
56b187005c Regen for ('6501370a7dfb358daf07555136742bc064e68cb7') Linux
clock_nanosleep_time64 system call.

MFC after:	2 weeks
2021-06-07 05:29:27 +03:00
Dmitry Chagin
6501370a7d linux(4): Implement clock_nanosleep_time64 system call.
MFC after:	2 weeks
2021-06-07 05:26:48 +03:00
Dmitry Chagin
773d9153c3 Regen for ('187715a420237e1ed94dd5aef158eada7dcdc559') Linux
clock_getres_time64 system call.

MFC after:	2 weeks
2021-06-07 05:21:48 +03:00
Dmitry Chagin
187715a420 linux(4): Implement clock_getres_time64 system call.
MFC after:	2 weeks
2021-06-07 05:21:32 +03:00
Bjoern A. Zeeb
a3c2c06bc9 Make LINT NOINET and NOIP kernel builds warning free.
Apply #ifdef INET or #if defined(INET6) || defined(INET) to make
universe NOINET and NOIP LINT kernels warning free as well again.
2021-06-06 14:03:06 +00:00
Dmitry Chagin
82e3848654 Regen for ('19f9a0e4df54f8d1e99234146024422bdcfa09ce') Linux
clock_settime64 system call.

MFC after:	2 weeks
2021-06-07 05:14:04 +03:00
Dmitry Chagin
19f9a0e4df linux(4): Implement clock_settime64 system call.
MFC after:	2 weeks
2021-06-07 05:11:25 +03:00
Dmitry Chagin
9e07ae7a09 Regen for ('99b6f430698fa00a33184dd61591d8b6518ed9d3') Linux
clock_gettime64 system call.

MFC after:	2 weeks
2021-06-07 05:08:11 +03:00
Dmitry Chagin
99b6f43069 linux(4): Implement clock_gettime64 system call.
MFC after:	2 weeks
2021-06-07 05:04:42 +03:00
Dmitry Chagin
ea7fa5583c Regen for ('e4bffb80bbc6a2e4b3be89aefcbd5bb2c2fc0ba0') Linux
utimensat_time64 syscall.

MFC after:	2 weeks
2021-06-07 04:56:58 +03:00
Dmitry Chagin
e4bffb80bb linux(4): Implement utimensat_time64 system call.
MFC after:	2 weeks
2021-06-07 04:54:30 +03:00
Dmitry Chagin
bfcce1a9f6 linux(4): add struct timespec64 definition and conversion routine for
future use.

MFC after:		2 weeks
2021-06-07 04:47:12 +03:00
Justin Hibbits
d7bfb412a7 powerpc64le/pmap: Fix superpage promotions
The page table is always big endian.  Without byte swapping on LE, the
promotion ability checks were invalid, and superpage promotions always
failed.
2021-06-05 21:49:42 -05:00
Jason A. Harmening
59409cb90f Add a generic mechanism for preventing forced unmount
This is aimed at preventing stacked filesystems like nullfs and unionfs
from "losing" their lower mounts due to forced unmount.  Otherwise,
VFS operations that are passed through to the lower filesystem(s) may
crash or otherwise cause unpredictable behavior.

Introduce two new functions: vfs_pin_from_vp() and vfs_unpin().
which are intended to be called on the lower mount(s) when the stacked
filesystem is mounted and unmounted, respectively.
Much as registration in the mnt_uppers list previously did, pinning
will prevent even forced unmount of the lower FS and will allow the
stacked FS to freely operate on the lower mount either by direct
use of the struct mount* or indirect use through a properly-referenced
vnode's v_mount field.

vfs_pin_from_vp() is modeled after vfs_ref_from_vp() in that it uses
the mount interlock coupled with re-checking vp->v_mount to ensure
that it will fail in the face of a pending unmount request, even if
the concurrent unmount fully completes.

Adopt these new functions in both nullfs and unionfs.

Reviewed By:	kib, markj
Differential Revision: https://reviews.freebsd.org/D30401
2021-06-05 18:20:36 -07:00
Rick Macklem
a5df139ec6 nfsd: Fix when NFSERR_WRONGSEC may be replied to NFSv4 clients
Commit d224f05fcf pre-parsed the next operation number for
the put file handle operations.  This patch uses this next
operation number, plus the type of the file handle being set by
the put file handle operation, to implement the rules in RFC5661
Sec. 2.6 with respect to replying NFSERR_WRONGSEC.

This patch also adds a check to see if NFSERR_WRONGSEC should be
replied when about to perform Lookup, Lookupp or Open with a file
name component, so that the NFSERR_WRONGSEC reply is done for
these operations, as required by RFC5661 Sec. 2.6.

This patch does not have any practical effect for the FreeBSD NFSv4
client and I believe that the same is true for the Linux client,
since NFSERR_WRONGSEC is considered a fatal error at this time.

MFC after:	2 weeks
2021-06-05 16:53:07 -07:00
Bjoern A. Zeeb
002cbc89c3 arm64/rk805: remove RTC Set logging
When ntpd is synchronizing the system time, it also periodically (30m)
syncs the the RTC time.  Remove printf in rk805_settime which triggers
every 30m, as settime_task_func() will log errors under bootverbose.
We leave the RTC Read logging, which should happen only once at boot.

Commit message by:	imp
Reviewed by:		manu, imp
MFC after:		2 weeks
Differential Revision: https://reviews.freebsd.org/D30361
2021-06-05 17:07:56 +00:00
Bjoern A. Zeeb
b5d37e5a20 net80211/LinuxKPI: add more radiotap definitions
Add more raditap definitions based on "names" found in actual drivers
and based on documentation from radiotap.org (where avail).

Leave one specific "duplicate" in the LinuxKPI implementation but
otherwise manage it all in net80211.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	hselasky, adrian, sam
Differential Revision: https://reviews.freebsd.org/D30641
2021-06-05 16:21:49 +00:00
Bjoern A. Zeeb
57af163c8e arm64/rk_pcie_phy: handle assigned-clock*
Nanopi4 based SoCs (NanoPC-T4, NanoPi M4*, and NanoPi Neo4) have
assigned-clock* in the pcie_phy node.  Handle them but only fail
in case clk_set_assigned() returns an error other than
"no assigned-clock*" (as it would for all other SoCs).

Reviewed by:	manu
MFC After:	2 weeks
Differential Revision: https://reviews.freebsd.org/D30363
2021-06-05 16:16:29 +00:00
Bjoern A. Zeeb
65a226b41d dtb: rockchip: Add NanoPC-T4 to the build. 2021-06-05 15:19:26 +00:00
Konstantin Belousov
fe7d7ac408 hyperv: register intr handler as usermode-mapped if loaded as module
Normally raw interrupt handler is provided by the kernel text.  But
vmbus module registers its own handler that needs to be mapped into
userspace mapping on PTI kernels.

Reported and reviewed by:	whu
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D30310
2021-06-05 18:03:18 +03:00
Allan Jude
c6a311678d nextboot: Improve the shell code used to figure out the zpool name
Reported by:	imp
Reviewed by:	imp, tsoome
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D30650
2021-06-05 14:32:18 +00:00
Ryan Moeller
c5a2d8c5f5 sockstat: Use libcasper to capsicumize
Drop rights we do not need. This has to be done after jail_attach.

Reviewed by:	oshogbo
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D26958
2021-06-05 08:36:55 -04:00