Commit Graph

281050 Commits

Author SHA1 Message Date
Phil Shafer
e1e2080fc1 Import Juniper libxo-1.6.0
PR:		262332
2023-01-30 13:37:33 -05:00
Cameron Katri
c8abb673a5 man(1): Support zstd compressed manpages using zstdcat
Reviewed by:	emaste, markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32296
2023-01-30 13:12:36 -05:00
Mark Johnston
92b7d1db92 bridge: Fix whitespace
No functional change intended.

MFC after:	1 week
2023-01-30 13:12:36 -05:00
Sebastian Huber
c7c53e3ca6 Clarify hardpps() parameter name and comment
Since 32c203577a by phk in 1999 (Make even more of the PPSAPI
implementations generic), the "nsec" parameter of hardpps() is a time
difference and no longer a time point.  Change the name to "delta_nsec"
and adjust the comment.

Remove comment about a clock tick adjustment which is no longer in the code.

Pull Request: https://github.com/freebsd/freebsd-src/pull/640
Reviewed by: imp
2023-01-30 11:07:40 -07:00
Jose Luis Duran
df949e762c kern_environment: Partially apply style(9)
Sort include files, remove duplicates and remove trailing whitespce.

Pull Request:	https://github.com/freebsd/freebsd-src/pull/589
Reviewed by:	imp
2023-01-30 10:47:56 -07:00
John Baldwin
9a93b6cf3d zfs: Disable -Wunused-variable for environ in main in zfs_main.c.
There is an extern declaration of the global variable environ (which
has no portable header that defines it) that is unused on FreeBSD due
to zfs_setproctitle_init() being a stub.

Reviewed by:	emaste
Reported by:	GCC
Differential Revision:	https://reviews.freebsd.org/D38231
2023-01-30 09:31:19 -08:00
Dmitry Chagin
2058f075b4 cpuset: Handle CPU_WHICH_TIDPID wherever cpuset_which() is called.
cpuset_which() resolves the argument pair which and id and returns references
to an appropriate resources. To avoid leaking resources or accessing unresolved
references to a resources handle new which CPU_WHICH_TIDPID wherever
cpuset_which() is called.
To avoid code duplication cpuset_which2() has been added.

Reported by:		syzbot+331e8402e0f7347f0f2a@syzkaller.appspotmail.com
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D38272
MFC after:		2 weeks
2023-01-30 19:28:54 +03:00
Warner Losh
bf2dc42d0b UPDATING: Add missing blank line between entries 2023-01-30 08:28:28 -07:00
Alexander V. Chernikov
6eaaed4294 netlink: add UPDATING entry on linux_common(4) reliance on netlink.
Reviewed by:	dchagin
2023-01-30 15:13:38 +00:00
Alexander V. Chernikov
7fc9cfa57c netlink: add "netlink" to the list of kernel features
Reduce the amount of debug messages on module init/detach.

MFC after:	1 week
2023-01-30 11:23:53 +00:00
Boris Lytochkin
ee49c5d33d carp: turn net.inet.carp.allow into a RW tunable
Currently CARP starts announcing its state when initialised, regardless
of the state of the other services provided by the server.
As a result, the device can become master while still loading the
firewall ruleset or initialising long-starting service.

This change adds the way to request delayed CARP start by setting the
  net.inet.carp.allow=0 in the loader.conf.

Differential Revision: https://reviews.freebsd.org/D38167
MFC after:	2 weeks
2023-01-30 11:23:53 +00:00
Peter Holm
bbe0def9b0 stress2: Added a syzkaller reproducer 2023-01-30 09:50:19 +01:00
Peter Holm
bbdd27f9d7 stress2: Avoid unrelated disk full messages from tests 2023-01-30 09:32:43 +01:00
Peter Holm
349aac52ac stress2: Added a test scenario for "out of inodes" issue with UFS+SU 2023-01-30 09:28:37 +01:00
Phil Shafer
34b867ca30 Merge commit '7087c8de43b0d5d27c52da6ba2ba4957b7e336ff' into new_merge 2023-01-30 00:04:21 -05:00
Xin LI
4bbf45cf56 etcupdate: Chase test case after pwd_mkdb(8) no longer copies comments.
MFC after:	3 days
2023-01-29 20:40:58 -08:00
Phil Shafer
7087c8de43 Vendor import of Juniper libxo at 1.6.0 2023-01-29 23:10:53 -05:00
Jessica Clarke
d4fdfd3f90 Makefile.inc1: Restore adding tzsetup to _basic_bootstrap_tools
ITOOLS is only the list of programs to make a copy of during install, it
doesn't cause anything to be bootstrapped. Thus, by removing tzsetup
from _basic_bootstrap_tools, we end up without it on non-FreeBSD, and so
we error out trying to copy it to INSTALLTMP.

Note that _basic_bootstrap_tools is only used for BOOTSTRAP_ALL_TOOLS
(which is why zic was moved away from it). Should tzsetup evolve such
that the host version is insufficient on older FreeBSD it can be moved
to be more like zic, but that seems unnecessary for what is likely to
remain a simple tool.

This partially reverts commit 7a4a520064.

Fixes:	7a4a520064 ("Fix cross-build from STABLE or older CURRENT.")
2023-01-29 23:53:04 +00:00
Jessica Clarke
4ebd18cf35 Makefile.inc1: Print the right PATH for missing install tool error
We override PATH for which but then go and print the non-overridden
PATH, which leads to rather confusing messages.

Fixes:	5bb9250e0a ("Add necessary Makefile.inc1 infrastructure for building on non-FreeBSD")
2023-01-29 23:53:04 +00:00
Jessica Clarke
b78ae0367f Revert "tools/build: Unbreak bmake bootstrap on Linux"
Now that make.py no longer has the described hack on Linux we can drop
this ugly workaround.

This reverts commit fba998a3d8.
2023-01-29 23:53:04 +00:00
Jessica Clarke
35921bba73 tools/build/make.py: Drop problematic Linux hack for bmake bootstrap
Since e2eeea75eb ("Merge bmake-20201117") missing/sys/cdefs.h has
been present in bmake, and _GNU_SOURCE seems to have been defined by
config.h for much longer than that, possibly for the entire time OS
cross-build support has been in-tree, so these are obsolete. Moreover,
since 79e02149fc ("Fix dtrace tools bootstrap on non-FreeBSD after
OpenZFS import"), HAVE_STRLCAT and HAVE_STRLCPY have been defined by our
cross-build headers in order to placate DTrace tools (which is not the
right way to solve that problem, but motivates fixing this one). Commit
4fde40d9b5 ("Merge/update to bmake-20230126") changed the strlcpy.c in
bmake from including config.h directly to including make.h, which means
it includes string.h and thus sees these bogus definitions, causing it
to not define the strlcpy compat function on Linux even though it needs
to and thus failing to link. Thus, fix this whole mess by removing the
hack we no longer need.
2023-01-29 23:53:04 +00:00
Xin LI
195ec47b47 sbin/ping6: Remove remains of ping6.
MFC after:	2 weeks
2023-01-29 15:21:25 -08:00
Kirk McKusick
ad055467be Fix for getmntpoint(3) when checking for NFS mount points.
Only attempt to add /dev/ to f_mntfromname names that result in a
valid character device.

MFC after:    1 week
Reported by:  Bjoern A. Zeeb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37907
2023-01-29 15:14:43 -08:00
John Grafton
ea34aa4780 rescue: Add fetch(1) to the rescue tool.
After a failed upgrade, having fetch(1) on a system that is
physically unnreachable would be very useful to download files
required to get the OS back up and functional.

On my system this adds 589,824 bytes (3.8%) to the binary size.

PR:		266224
Reported by:	Dan Mahoney
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D38193
2023-01-29 15:05:15 -08:00
Jamie Landeg-Jones
37399d5bcf usr.bin/stat: Fix error message formatting.
PR:		bin/261657
MFC after:	3 days
2023-01-29 14:37:25 -08:00
Andrew Turner
7ca55fcc54 Only call SMCCC init on arm64
We don't build the smccc code on arm so don't call into it there.
2023-01-29 19:33:41 +00:00
Alexander V. Chernikov
15dbf5a241 netstat: export weight for single-path routes.
* Parse and export newly-added NL_RTA_WEIGHT attribute, providing path
 weight for a non-multipath route. This fixes a number of tests in
 sys/net/routing which rely on this data.
* Remove handling of NL_RTA_KNH_ID in multipath routes, as it is
 not provided.
* Improve kernel/user nexthop index export. As a result,
 for multipath routes:
  * nhg-kidx attribute represents kernel nhg index (always provided)
  * nhg-uidx attribute represents user-provided nhg index (if set)
 for non-multipath routes:
  * nhop-kidx attribute represents kernel nhop index (always provided)
  * nhop-udx attribute represents user-provided nexthop index (if set)
2023-01-29 16:27:31 +00:00
Alexander V. Chernikov
3ebccb20d5 netlink: allow path weight manipulations for single-path routes.
Add support for the scenario when user adds/deletes paths for a single
 prefix one-by-one, all with different weights.
This change adds a new FreeBSD-specific RTA attribute, NL_RTA_WEIGHT.
When dumping non-multipath routes, this attribute is added if the
 route weight is not RT_DEFAULT_WEIGHT.
When adding a new route, this attribute is parsed as a relative path
 weight.

MFC after:	2 weeks
2023-01-29 16:04:10 +00:00
Andrew Turner
0600af1ff1 Make SMCCC usable by device drivers
To allow device drivers to call into SMCCC we need to initialise it
earlier. As it depends on PSCI, and that is detected via ACPI or FDT
move the call to smccc_init to the PSCI driver.

Add a function for drivers to read the smccc version, or 0 if smccc
is not present.
2023-01-29 14:58:24 +00:00
Andrew Turner
c57694ce94 Disable the arm physical timer when an irq exists
Some firmware leaves the timers enabled. Ensure they are disabled if
there are any physical timer interrupt resources to ensure we don't
receive any unexpected interrupts from them.
2023-01-29 14:58:24 +00:00
Dmitry Chagin
290afc5d55 mp_x86: Trim trailing whitespaces.
MFC after:		1 week
2023-01-29 16:18:39 +03:00
Dmitry Chagin
e4754c8036 subr_smp: Trim trailing whitespaces.
MFC after:		1 week
2023-01-29 16:18:17 +03:00
Dmitry Chagin
c21b080f3d cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux.
Under Linux to sched_[g|s]etaffinity() functions the value returned from a call
to gettid(2) (thread id) can be passed in the argument pid. Specifying pid as 0
will set the attribute for the calling thread, and passing the value returned
from a call to getpid(2) (process id) will set the attribute for the main thread
of the thread group.

Native cpuset(2) family of system calls has "which" argument to determine how
the value of id argument is interpreted, i.e., CPU_WHICH_TID is used to pass
a thread id and CPU_WHICH_PID - to pass a process id.

For now native sched_[g|s]etaffinity() implementation is wrong as uses "which"
CPU_WHICH_PID to pass both (process and thread id) to the kernel. To fix this
adding a new "which" CPU_WHICH_TIDPID intended to handle both id's.

Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D38209
MFC after:		1 week
2023-01-29 16:17:33 +03:00
Dmitry Chagin
f8660ea4b1 libthr: Trim trailing whitespaces in pthread_attr_affinity.
MFC after:	1 week
2023-01-29 15:38:04 +03:00
Dmitry Chagin
2b87addf52 libthr: Fix pthread_attr_[g|s]etaffinity_np manual.
Fix my fault in f35093f8.

MFC after:		1 week
2023-01-29 15:37:18 +03:00
Dmitry Chagin
62801712df libthr: Fix pthread_[g|s]etaffinity_np manual.
Since f35093f8 semantics of a thread affinity functions is changed to be a
compatible with Linux:
In case of getaffinity(), the minimum cpuset_t size that the kernel permits is
the maximum CPU id, present in the system, / NBBY bytes, the maximum size is not
limited.
In case of setaffinity(), the kernel does not limit the size of the user-provided
cpuset_t, internally using only the meaningful part of the set, where the upper
bound is the maximum CPU id, present in the system, no larger than the size of
the kernel cpuset_t.

Reviewed by:		jhb, kib
Differential Revision:	https://reviews.freebsd.org/D38111
MFC after:		1 week
2023-01-29 15:36:25 +03:00
Dmitry Chagin
01f74ccd5a libthr: Fix pthread_attr_[g|s]etaffinity_np to match it's manual and the kernel.
Since f35093f8 semantics of a thread affinity functions is changed to be a
compatible with Linux:

In case of getaffinity(), the minimum cpuset_t size that the kernel permits is
the maximum CPU id, present in the system, / NBBY bytes, the maximum size is not
limited.
In case of setaffinity(), the kernel does not limit the size of the user-provided
cpuset_t, internally using only the meaningful part of the set, where the upper
bound is the maximum CPU id, present in the system, no larger than the size of
the kernel cpuset_t.

To match pthread_attr_[g|s]etaffinity_np checks of the user-provided cpusets to
the kernel behavior export the minimum cpuset_t size allowed by running kernel
via new sysctl kern.sched.cpusetsizemin and use it in checks.

Reviewed by:
Differential Revision:	https://reviews.freebsd.org/D38112
MFC after:		1 week
2023-01-29 15:35:18 +03:00
Dmitry Chagin
02f7670ed2 sched.h: Fix _S macros for better compatibility with glibc.
In e2650af157 was added "_S" macros for compatibility with glibc, but it's still
incompatible as under glibc the macros whose names end with "_S" operate on the
dynamically allocated CPU set(s) whose size is in bytes, not in bits.

While here remove limiting ifdef to non-kernel case.

Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D38110
MFC after:		1 week
2023-01-29 15:34:10 +03:00
Dmitry Chagin
6fdf04a2be smp: Drop confusing braces and return statement as panic() is never returns.
Reviewed by:		imp, kib
Differential Revision:	https://reviews.freebsd.org/D38235
MFC after:		1 week
2023-01-29 15:33:16 +03:00
Fedor Uporov
56242a4c65 Add extended attributes
The extattrs follows semantic of ufs, mean it cannot
be set to char/block devices and fifos. The attributes
are allocated using regular malloc with M_WAITOK
allocation with the own malloc tag M_TMPFSEA. The memory
consumed by extended attributes is limited to avoid OOM
triggereing by tmpfs_mount variable tm_ea_memory_max,
which is set initialy to 16 MB. The extended attributes
entries are stored as linked list in the tmpfs node.
The mount point lock is required only under setextattr
and deleteextattr to update extended attributes
memory-inuse counter, all other operations are doing
under vnode lock.

Reviewed by:    kib
MFC after:      2 week
Differential revision:  https://reviews.freebsd.org/D38052
2023-01-29 11:13:14 +03:00
Fedor Uporov
0de4895aac Fix pjfstest issue tests/rename/23.t
This test creates two files like file0 and file1,
then creates link to file1 and checks ctime on it.
Then renames file0 to file1. Then checks ctime on
link again. It is expected, that second ctime will
be higher then first ctime, because rename happen.
Add ctime updating for directory entry,
which will be deleted on rename.

Reviewed by:    kib
MFC after:      2 week
Differential revision:  https://reviews.freebsd.org/D38051
2023-01-29 11:12:32 +03:00
Fedor Uporov
9ad2d4c490 Fix pjfstest issue tests/rename/19.t
The rename call with args like:
"./dir0/dir1/.." "./dir2" will cause MPASS failure.
The tmpfs_dir_lookup() does not accept names like
'.' and '..' for lookup. Move the '.' and '..' entry
check before tmpfs_dir_lookup() call.

Reviewed by:    kib
MFC after:      2 week
Differential revision:  https://reviews.freebsd.org/D38051
2023-01-29 11:11:23 +03:00
Fedor Uporov
344243fc92 Fix block bitmap end position computation
PR:                     261850
Reported by:            chenguang.wang
MFC after:              2 weeks
2023-01-29 11:11:02 +03:00
Fedor Uporov
509ee39ff2 Fix developer second name. 2023-01-29 11:10:39 +03:00
Stefan Eßer
fdd4c35832 usr.bin/gh-bc: update Makefiles for version 6.2.2
The sources of this program are in contrib/bc, but built using the
Makefiles touched in this commit, which had to be adapted to comply
with changed made to the build system of this software, which is
not used when building in the base system.
2023-01-28 23:48:34 +01:00
Stefan Eßer
d101cdd6ed contrib/bc: merge from vendor release 6.2.2
This update fixes a few issues in history editing and the processing
of the "quit" function. The "quit" function will no longer cause bc
to exit when encountered in a script file (before any command from
the script has been executed).

New functions is_number(), is_string return 1 if the passed argument
is a number resp. a string. The asciify() function has been extended
to support the conversion of an array of numbers into a string.

Merge commit '1a63323d17fedb05b6962853e821c9d7c6b9853e'
2023-01-28 22:26:22 +01:00
Stefan Eßer
1a63323d17 vendor/bc: import version 6.2.2
This is a production release that fixes a bug.

The bug was that if an array element was used as a parameter, and then
a later parameter had the same name as the array whose element was
used, bc would grab the element from the new array parameter, not the
actual element from before the function call.
2023-01-28 21:08:43 +01:00
Stefan Eßer
3c2ba19f6b vendor/bc: import version 6.2.1
This fixes one bug  in the history editing functions.
2023-01-28 21:06:20 +01:00
Stefan Eßer
e7017237c9 vendor/bc: import version 6.2.0
This is a production release with a new feature and a few bug fixes.

The bug fixes include:

 - A crash when bc and dc are built using editline, but history is not
   activated.
 - A missing local in the uint*() family of functions in the extended
   math library.
 - A failure to clear the tail call list in dc on error.
 - A crash when attempting to swap characters in command-line history
   when no characters exist.
 - SIGWINCH was activated even when history was not.

The new feature is that stack traces are now given for runtime errors.
In debug mode, the C source file and line of errors are given as well.
2023-01-28 21:02:27 +01:00
Stefan Eßer
0b671e8cf1 vendor/bc: import version 6.1.0
This is a production release that fixes a discrepancy from the bc
standard, a couple of memory bugs, and adds new features.

The discrepancy from the bc standard was with regards to the behavior
of the quit command. This bc used to quit whenever it encountered quit
during parsing, even if it was parsing a full file. Now, bc only quits
when encountering quit after it has executed all executable statements
up to that point.

This behavior is slightly different from GNU bc, but users will only
notice the difference if they put quit on the same line as other
statements.

The first memory bug could be reproduced by assigning a string to a
non-local variable in a function, then redefining the function with
use of the same non-local variable, which would still refer to a
string in the previous version of the function.

The second memory bug was caused by passing an array argument to the
asciify() built-in function. In certain cases, that was wrongly
allowed, and the interpreter just assumed everything was correct and
accessed memory. Now that arrays are allowed as arguments (see below),
this is not an issue.

The first feature was the addition of the is_number() built-in
function (u in dc) that returns 1 if the runtime argument is a number
and 0 otherwise.

The second feature was the addition of the is_string() built-in
function (t in dc) that returns 1 if the runtime argument is a string
and 0 otherwise.

These features were added because I realized that type-checking is
necessary now that strings can be assigned to variables in bc and
because they've always been assignable to variables in dc.

The last added feature is the ability of the asciify() built-in
function in bc to convert a full array of numbers into a string. This
means that character-by-character printing will not be necessary, and
more strings than just single-character ones will be able to be
created.
2023-01-28 20:59:18 +01:00