Mono Gateway (NXP LS1046A) fork of OPNsense src: DPAA/LS1046A kernel support, rebased on upstream release tags
Find a file
Olivier Certner 89958992b6
MAC/do: Check executable path from the current jail's root
Contrary to my initial belief, vn_fullpath() does return a vnode's path
from the current chroot, and not from the global root (which would have
been a bug also, but without security consequences).  This enables
a "confused deputy"-like scenario where a chroot(2) can change which
executable can be authorized by MAC/do, which is even more problematic
for unprivileged chroot(2).

This was found by re-examining the code following two close events:
1. Shawn Webb sent a mail to freebsd-hackers@ on 08/05 saying that in
   HardenedBSD they had added a check on P2_NO_NEW_PRIVS (in
   mac_do_priv_grant()), which I responded to on 08/20 saying that
   P2_NO_NEW_PRIVS was not necessary for mac_do(4), with a correct
   reasoning but based on the wrong above-mentioned assumption about
   vn_fullpath().
2. I reviewed some code by Kushagra Srivastava (GSoC 2025 student
   working on mac_do(4)/mdo(1)) adding the ability to specify which
   executables can spawn processes that mac_do(4) may decide to
   authorize (others are simply ignored), which currently is hardcoded
   to '/usr/bin/mdo'.

MFC after:      3 days
Event:          EuroBSDCon 2025
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52758

(cherry picked from commit 9f269a0a771aff4f0a735211907a52c52fc0661b)
2025-10-02 18:57:19 +02:00
.cirrus-ci
.github .github: Use make.py's --cross-toolchain option on macOS 2025-08-06 16:14:37 -04:00
bin pwait: Fix timeout unit parser 2025-10-02 08:19:23 +00:00
cddl packages: Move ctf-tools to ctf 2025-10-01 11:36:58 +01:00
contrib MFC: MFV: expat 2.7.3. 2025-10-02 09:37:58 -07:00
crypto openssh: blocklist: Use NetBSD probes 2025-09-30 23:17:21 +00:00
etc virtual_oss: Port to base 2025-10-02 09:31:27 +02:00
gnu build: remove the last vestiges of lint support 2025-06-06 00:55:34 +01:00
include tzcode: Expose and document offtime() and offtime_r() 2025-10-02 08:19:23 +00:00
kerberos5 kerberos5: Fix the Heimdal pkgbase build 2025-09-04 14:53:02 +01:00
krb5 krb5: Enable PRINC_LOOK_AHEAD in ksu 2025-09-14 08:20:53 -07:00
lib MFC: MFV: expat 2.7.3. 2025-10-02 09:37:58 -07:00
libexec rc.subr: Move the sleep in wait_for_pids 2025-10-02 08:19:22 +00:00
release pkgbase: move ncurses into its own package 2025-10-02 08:32:32 -05:00
rescue nvmf: Switch several ioctls to using nvlists 2024-12-30 13:52:21 -05:00
sbin snd_hda: Implement automatic redirection between associations 2025-10-02 09:31:29 +02:00
secure openssl: Disable KTLS in bootstrap libraries 2025-09-04 13:28:39 +00:00
share vfs cache: Add vn_fullpath_jail(), factor out common code 2025-10-02 18:57:19 +02:00
stand stand/man: Fix mdoc typos for emails, tag spdx 2025-09-23 14:02:18 -04:00
sys MAC/do: Check executable path from the current jail's root 2025-10-02 18:57:19 +02:00
targets zfsboot: Remove zfsboot(8) program used to boot ZFS from MBR + BIOS 2025-07-28 10:58:02 -04:00
tests pf: Fix interface counters for af-to rules 2025-10-01 18:00:47 +02:00
tools Remove ftpd(8) 2025-10-01 11:28:40 +01:00
usr.bin mktemp.1: Document TMPDIR in ENVIRONMENT 2025-10-01 18:32:17 +02:00
usr.sbin mixer(8): Update virtual_oss path 2025-10-02 09:31:28 +02:00
.arcconfig
.arclint
.cirrus.yml .cirrus.yml: Reenable CI with pre-commit CI scripts 2025-08-27 12:50:02 +02:00
.clang-format clang-format: Minor tweaks 2024-04-30 17:33:43 -04:00
.clean_build_epoch build: introduce the notion of a build epoch 2025-08-14 23:43:42 -05:00
.git-blame-ignore-revs git-blame-ignore-revs: witness white space cleanup and style(9) tweeks 2025-08-29 18:01:43 +08:00
.gitattributes Remove SVN related Git attributes 2023-12-26 10:28:28 -07:00
.gitignore src.sys.mk: Support src.conf in SRCTOP 2025-09-16 13:27:43 +00:00
.mailmap mailmap: Add Joyu Liao 2025-06-26 14:13:21 +02:00
CONTRIBUTING.md CONTRIBUTING: Tweak the language 2025-08-08 11:16:13 -06:00
COPYRIGHT copyright: Happy New Year 2025 2025-01-01 00:04:28 +00:00
LOCKS Update LOCKS for Git 2023-12-26 10:28:25 -07:00
MAINTAINERS man filesystems: fix more xrefs after move to s4 2024-06-27 18:32:05 -06:00
Makefile powerpc: Disconnect 32-bit powerpc from make universe 2025-07-14 11:01:09 -04:00
Makefile.inc1 Makefile.inc1: Fix package-pkg with a non-default LOCALBASE 2025-09-25 02:00:41 +01:00
Makefile.libcompat Makefile.libcompat: Use same PATH for _lc_build-tools as _build-tools 2025-08-22 21:46:15 +01:00
Makefile.sys.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ObsoleteFiles.inc Remove ftpd(8) 2025-10-01 11:28:40 +01:00
README.md Update README.md to add pointer to release page. 2024-05-09 20:40:46 -06:00
RELNOTES RELNOTES: Fix another typo 2025-08-26 10:01:31 -07:00
UPDATING Remove ftpd(8) 2025-10-01 11:28:40 +01:00

FreeBSD Source:

This is the top level of the FreeBSD source directory.

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), FreeBSD handbook on building userland, and Handbook for kernels for more information, including setting make(1) variables.

For information on the CPU architectures and platforms supported by FreeBSD, see the FreeBSD website's Platforms page.

For official FreeBSD bootable images, see the release page.

Source Roadmap:

Directory Description
bin System/user commands.
cddl Various commands and libraries under the Common Development and Distribution License.
contrib Packages contributed by 3rd parties.
crypto Cryptography stuff (see crypto/README).
etc Template files for /etc.
gnu Commands and libraries under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see gnu/COPYING and gnu/COPYING.LIB for more information.
include System include files.
kerberos5 Kerberos5 (Heimdal) package.
lib System libraries.
libexec System daemons.
release Release building Makefile & associated tools.
rescue Build system for statically linked /rescue utilities.
sbin System commands.
secure Cryptographic libraries and commands.
share Shared resources.
stand Boot loader sources.
sys Kernel sources (see sys/README.md).
targets Support for experimental DIRDEPS_BUILD
tests Regression tests which can be run by Kyua. See tests/README for additional information.
tools Utilities for regression testing and miscellaneous tasks.
usr.bin User commands.
usr.sbin System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see FreeBSD Handbook.