Commit Graph

281949 Commits

Author SHA1 Message Date
Dmitry Chagin
8d6dd96d50 linux(4): Add net epoch assert to the linux_ifhwaddr, linux_ifflags
Now this functions are intended to use in the net epoch.

Reviewed by:		emaste, melifaro
Differential Revision:	https://reviews.freebsd.org/D38795
2023-03-04 12:11:38 +03:00
Dmitry Chagin
f9b0675b01 linux(4): Refactor socket ioctl path to avoid referencing an unstable interfaces
Split the linux_ioctl_socket() function on two counterparts, where
the linux_ioctl_socket_ifreq() intended to use in a code path which
requires the struct ifreq manipulation, i.e., translating in/out
values of the struct, while the linux_ioctl_socket() function is left
as is, it calls sys_ioctl() without touching in/out values.

Due to structures ifreq, sockaddr difference between FreeBSD and Linux
the linux_ioctl_socket_ifreq() calls kern_ioctl() directly, converting
in and out values to FreeBSD and to Linux accordingly.

Finally, modify the ifname_linux_to_bsd() to return error code, not
an unstable reference to the interface.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D38794
2023-03-04 12:11:38 +03:00
Dmitry Chagin
9e7f03e9c6 linux(4): Drop unncessary struct l_ifconf declaration from amd64/linux
Its needed only for amd64/linux32 Linuxulator.

Differential Revision:	https://reviews.freebsd.org/D38793
2023-03-04 12:11:38 +03:00
Dmitry Chagin
a927409ce8 linux(4): Rename struct l_ifreq members names to avoid conflicts with FreeBSD
For now we are using mixed names to access struct ifreq members, some
of Linux (ifr_name, ifr_ifindex), others of FreeBSD. To avoid conflicts
switch to use FreeBSD names.

Reviewed by:		jhibbits
Differential Revision:	https://reviews.freebsd.org/D38792
2023-03-04 12:11:38 +03:00
Dmitry Chagin
cabbfb60d0 linux(4): Reduce code duplication between MD files
Move struct ifnet definitions under compat/linux.

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D38791
2023-03-04 12:11:38 +03:00
Dmitry Chagin
5d5b633dde linsysfs(4): Refactor to avoid referencing an unstable interfaces
Enter the net epoch when traversing a list of interfaces. For that
split the ifname_linux_to_bsd() function on two counterparts, where
the ifname_linux_to_ifp() intended to use in epoch, while the
ifname_linux_to_bsd() intended to be a self-contained.
Until the linux_ioctl_coket() function is refactored, the
ifname_linux_to_bsd() temporarily returns interface outside
of the net epoch.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D38790
2023-03-04 12:11:38 +03:00
Dmitry Chagin
130383f2f1 linux(4): Make linux_ifflags return a value
To simplify the use of the function in the printf-like statements.

Differential Revision:	https://reviews.freebsd.org/D38830
2023-03-04 12:11:38 +03:00
Dmitry Chagin
6c5786fd37 linux(4): Migrate to IfAPI
Migrate linux and linprocfs to use the IfAPI interfaces instead of
direct ifnet accesses.
The code initially writed by jhibbits@, and adapted by me to 3ab3c9c2.

Reviewed by:		jhibbits
Differential Revision:  https://reviews.freebsd.org/D38735
2023-03-04 12:11:38 +03:00
Fidaullah Noonari
290f7f4a09 in_mcat.c: change multicast not member condition
If there is no source filter entry => block if that's SSM ("exclude"
mode per RFC 3678 clause 3).  If there is an entry => check its action &
block if the action is "exclude".

It would be nice if the test case in this PR were converted into an ATF
test case, but not blocking on that.

Reviewed by: imp, melifaro
Pull Request: https://github.com/freebsd/freebsd-src/pull/601
2023-03-03 22:25:17 -07:00
Gleb Smirnoff
7fc82fd1f8 ipfw: garbage collect ip_fw_chk_ptr
It is a relict left from the old times when ipfw(4) was hooked
into IP stack directly, without pfil(9).
2023-03-03 10:30:15 -08:00
Kyle Evans
d2ae03bae2 arm64: disable the physical timer for now if HCR_EL2.E2H is set
On some hardware, we can't clear HCR_EL2.E2H so accesses to the physical
timer hopelessly trap to EL2.  Stash off the value of HCR_EL2 and use it
in has_hyp() to avoid this.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D38884
2023-03-03 11:02:34 -06:00
Mark Johnston
577b62c2ba pkgbase: Put termcap.small in the same package as termcap
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D36951
2023-03-03 12:01:22 -05:00
Brooks Davis
c2285a7b09 ng_atmllc: deprecate
With the deprecation of NgATM, ng_atmllc is the last vestage of ATM
support so deprecate it too.

MFC after:	3 days
Relnotes:	yes

Reviewed by:	manu, emaste
Differential Revision:	https://reviews.freebsd.org/D38878
2023-03-03 16:47:36 +00:00
Brooks Davis
211c302f10 NgATM: deprecate
Support for ATM NICs was removed prior to FreeBSD 12.  At the time it
was unclear if this code was still useful without it.  Now the time has
come to finish removing support.

Add DREPRECATION NOTICEs to the manpages and gone_in(14, ...) warnings
in the constructors (or module init for ngatmbase).

MFC after:	3 days
Relnotes:	yes

Reviewed by:	manu, emaste
Differential Revision:	https://reviews.freebsd.org/D38877
2023-03-03 16:47:36 +00:00
Brooks Davis
f0c4b42c60 nanobsd: remove comment about keeping C++ enabled
It's no longer possible to disable C++ so there's no need to comment
on it.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D38883
2023-03-03 16:47:36 +00:00
Mark Johnston
560f9cd5e1 posixshm tests: Correct page size index checks
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Juniper Networks, Inc.
2023-03-03 11:16:51 -05:00
Mark Johnston
831601773e deadlkres: Make parameters settable with tunables
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Juniper Networks, Inc.
2023-03-03 11:16:41 -05:00
Mark Johnston
ad43dd69ce bhyveload: Address compiler warnings and bump WARNS
Mostly sprinkle __unused.  Also duplicate strings passed to addenv() so
that constant string literals can be passed.  No functional change
intended.

Reviewed by:	corvink, rew, jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38840
2023-03-03 11:13:22 -05:00
Mark Johnston
3f5d875a27 bhyvectl: Address compiler warnings and bump WARNS
Avoid unaligned accesses in cpu_vendor_intel() and address a few other
nits.  No functional change intended.

Reviewed by:	corvink, rew, jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38839
2023-03-03 11:13:22 -05:00
Alexander V. Chernikov
ce9f95bd83 netlink: fix vlan interface creation
MFC after:	2 weeks
2023-03-03 16:02:05 +00:00
Alexander V. Chernikov
61507ae30b netlink: add u8/u64 attribute fetcher accessors to snl(3).
MFC after:	2 weeks
2023-03-03 14:05:40 +00:00
Ed Maste
4530e0c3e7 bsnmp: Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2023-03-03 08:11:39 -05:00
Mateusz Piotrowski
0ea0a371d2 dtrace_proc.4: Fix the description of pr_sname
MFC after:	2 weeks
Sponsored by:	Klara Inc.
Sponsored by:	ELW – Entsorgungsbetriebe der Landeshauptstadt Wiesbaden
2023-03-03 11:16:45 +01:00
John-Mark Gurney
144661f941
note that some arch independent code can live in dev (e.g. SMBios) 2023-03-03 01:54:07 -08:00
Emmanuel Vadot
5ea96be40b src.conf.5: Regen after switching to WITHOUT_ATM
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38846
2023-03-03 08:52:41 +01:00
Emmanuel Vadot
66a175980e Add description for WITH_ATM
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38845
2023-03-03 08:52:39 +01:00
Emmanuel Vadot
d43812b173 Disable ATM programs by default
ATM is an old technology, remove build of related programs by default

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38844
Reviewed by:	brooks, imp, emaste
2023-03-03 08:52:35 +01:00
Ihor Antonov
f907027b49 daemon: set supervise_enabled during argument processing
Now when supervsion mode has it's own variable there is really no
reason to set it separately from the rest of the variables. Move
initialization of supervise_enabled var to the argument processing
switch loop, where it belongs.

Reviewed by:	kevans
Pull Request:	https://github.com/freebsd/freebsd-src/pull/672
2023-03-02 23:17:02 -06:00
Ihor Antonov
e781739084 daemon: decouple restart variable
The 'restart' variable was responsible for enablement of restart
behavior and for restart delay. While it may seem convenient it
leads to cluttering the exit/restart logic

Reviewed by:	kevans
Pull Request:	https://github.com/freebsd/freebsd-src/pull/672
2023-03-02 23:17:02 -06:00
Ihor Antonov
d6c398d882 daemon: add braces to while loop
Reviewed by:	kevans
Pull Request:	https://github.com/freebsd/freebsd-src/pull/672
2023-03-02 23:17:02 -06:00
Ihor Antonov
cd1e6e70d0 daemon: simplify if/else chain
Reviewed by:	kevans
Pull Request:	https://github.com/freebsd/freebsd-src/pull/672
2023-03-02 23:17:02 -06:00
Ihor Antonov
bc43a9a715 daemon: change type of listen_child() to C99 bool
Reviewed by:	kevans
Pull Request:	https://github.com/freebsd/freebsd-src/pull/672
2023-03-02 23:17:02 -06:00
Ihor Antonov
75f61ca920 daemon: flatten and simplify fork() logic
Reviewed by:	kevans
Pull Request:	https://github.com/freebsd/freebsd-src/pull/672
2023-03-02 23:17:02 -06:00
Ihor Antonov
39ea4280e4 daemon: style changes
This is not a functional change.
- Clean up whitespace (spaces where there should be tabs)
- Break up lines that are longer than 80

Reviewed by:	kevans
Pull Request:	https://github.com/freebsd/freebsd-src/pull/672
2023-03-02 23:17:01 -06:00
Jessica Clarke
dda4d97289 Makefile.inc1: Support building with macOS Ventura's AMFI Launch Constraints
As of macOS Ventura, Apple-signed binaries cannot be run if copied away from
their system location. This security feature doesn't really make sense for
boring things like sh(1), more so for applications with special entitlements,
but it's universally present, and results in the following error:

  >>> Install check world
  bmake[2]: "/Users/Jess/cheri/freebsd/Makefile.inc1" line 572: warning: "MAKEFLAGS= CPUTYPE=dummy /Users/Jess/cheri/build/freebsd-riscv64-build/bmake-install/bin/bmake -f /dev/null  -m /Users/Jess/cheri/freebsd/share/mk MK_AUTO_OBJ=no -V CPUTYPE" exited on a signal
  bmake[2]: "/Users/Jess/cheri/freebsd/Makefile.inc1" line 575: CPUTYPE global should be set with ?=.

As with host-symlinks, we don't actually need to copy the files on macOS, since
we're not updating the current machine, so copy its approach and just symlink
them instead.

MFC after:	1 week
2023-03-03 02:15:30 +00:00
Ed Maste
398b12691b mergemaster: add deprecation notice to man page
Reviewed by:	bapt, gjb, kevans (all earlier)
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23327
2023-03-02 20:43:34 -05:00
John-Mark Gurney
13597be965
length for the 64-bit entry is 32-bits, not 16-bits.
Reported by:	Jérôme Duval  (korli on github)
2023-03-02 17:03:57 -08:00
John-Mark Gurney
2fee875629
abstract out the vm detection via smbios..
This makes the detection of VMs common between platforms that
have SMBios.

Reviewed by:		imp, kib
Differential Revision:	https://reviews.freebsd.org/D38800
2023-03-02 16:54:21 -08:00
Brooks Davis
cfe244cb37 src.conf.5: regen for KBOOT and KTLS changes
kboot was enabled for aarch64 in 4601064126 and KTLS was added for
powerpc64* in e552cac3d7.
2023-03-03 00:50:36 +00:00
Ed Maste
e27ded83c7 freebsd-update: use grep -E instead of egrep
GNU egrep emits a warning that it is obsolescent and suggests grep -E
instead.  Switch to grep -E in case we end up invoking GNU (e)grep (and
for consistency with other invocations in this file).

Reported by:	Steffen Nurpmeso
Sponsored by:	The FreeBSD Foundation
2023-03-02 18:58:58 -05:00
Brooks Davis
3518a5bbd9 netgraph.4: remove obsolete ng_atm.4 reference
MFC After:	3 days

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D38876
2023-03-02 23:40:05 +00:00
Brooks Davis
bd32aedeee NgATM: Remove useless NGATM_ATM option
MFC after:	3 days

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D38875
2023-03-02 23:40:05 +00:00
Brooks Davis
3746e90118 NATM: Remove useless NETGRAPH_ATM_ATMPIF option
This code was removed as part of the NATM removal in 2017 and somehow
this option was missed.

MFC after:	3 days

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D38874
2023-03-02 23:40:05 +00:00
Rick Macklem
cbbb22031f kern_jail.c: Remove #ifdefs for VNET_NFSD
The consensus was that VNET_NFSD was not needed.
This patch removes it from kern_jail.c.

With this patch, support for the "allow.nfsd"
jail parameter is enabled in the kernel for
kernels built with "options VIMAGE".

Reviewed by:	markj
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D38808
2023-03-02 13:13:24 -08:00
Rick Macklem
4bbbd5875d vfs_mount.c: Allow mountd(8) to do exports in a vnet prison
To run mountd in a vnet prison, three checks in vfs_domount()
and vfs_domount_update() related to doing exports needed
to be changed, so that a file system visible within the
prison but mounted outside the prison can be exported.

I did all three in a minimal way, only changing the checks for
the specific case of a process (typically mountd) doing exports
within a vnet prison and not updating the mount point in other
ways.  The changes are:
- Ignore the error return from vfs_suser(), since the file
  system being mounted outside the prison will cause it to fail.
- Use the priv_check(PRIV_NFS_DAEMON) for this specific case
  within a prison.
- Skip the call to VFS_MOUNT(), since it will return an error,
  due to the "from" argument not being set correctly.  VFS_MOUNT()
  does not appear to do anything for the case of doing exports only.

Reviewed by:	markj
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D37741
2023-03-02 13:09:01 -08:00
Val Packett
c7a8502bdf open.2: describe O_RESOLVE_BENEATH errors correctly
The behavior is the same as in capability mode, it does not actually
return EINVAL for absolute lookups:

    openat(AT_FDCWD,"/tmp/test",O_RDONLY|O_DIRECTORY,00) = 3 (0x3)
    openat(3,"../../",O_RDONLY|0x800000,00)          ERR#93 'Capabilities insufficient'
    openat(3,"/etc/passwd",O_RDONLY|0x800000,00)     ERR#93 'Capabilities insufficient'

Fixes:          1f305be43 ("Document {O,AT}_RESOLVE_BENEATH...")
Reviewed by:    kib, pauamma (manpages), emaste
Sponsored by:   https://www.patreon.com/valpackett
Pull Request:	https://github.com/freebsd/freebsd-src/pull/680
Differential Revision: https://reviews.freebsd.org/D38675
2023-03-02 15:58:00 -05:00
Val Packett
939b24b0ab xlocale: garbage collect references to strtoq_l/strtouq_l
These were explicitly never implemented (see
lib/libc/locale/DESIGN.xlocale), but were referenced in the
manpage and the symbol map.

Fixes:          3c87aa1d3d ("Implement xlocale APIs from Darwin")
Reported by:    ld.lld 16 being --no-undefined-version by default
Reviewed by:    theraven, emaste
Sponsored by:   https://www.patreon.com/valpackett
Pull Request:	https://github.com/freebsd/freebsd-src/pull/679
Differential Revision: https://reviews.freebsd.org/D38408
2023-03-02 15:53:29 -05:00
Alan Somers
72aad3f902 Fix kernel memory disclosures in mpr and mps
In every mpr and mps ioctl that copies kernel data to userland, validate
that the requested length does not exceed the size of the kernel's
buffer.

Note that all of these ioctls already required root access.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D38842
2023-03-02 13:31:06 -07:00
Emmanuel Vadot
0fed8288c3 arm: Tag VHYBRID kernel as NO_UNIVERSE
All drivers are already either in GENERIC or in the other arches LINT
so no need to build this one too.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38851
2023-03-02 19:59:28 +01:00
Emmanuel Vadot
79ec3b10b4 arm: Tag SOCFPGA kernel as NO_UNIVERSE
All drivers are already either in GENERIC or in the other arches LINT
so no need to build this one too.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38850
2023-03-02 19:59:23 +01:00