FreeBSD Security Advisory FreeBSD-SA-21:04.jail_remove
24 February, 2021 by email@example.com | freebsd
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ============================================================================= FreeBSD-SA-21:04.jail_remove Security Advisory The FreeBSD Project Topic: jail_remove(2) fails to kill all jailed processes Category: core Module: jail Announced: 2021-02-24 Credits: Mateusz Guzik Affects: All supported versions of FreeBSD. Corrected: 2021-02-19 01:22:08 UTC (stable/13, 13.0-STABLE) 2021-02-19 21:53:07 UTC (releng/13.0, 13.0-BETA3-p1) 2021-02-19 21:46:31 UTC (stable/12, 12.2-STABLE) 2021-02-24 01:43:39 UTC (releng/12.2, 12.2-RELEASE-p4) 2021-02-19 21:50:26 UTC (stable/11, 11.4-STABLE) 2021-02-24 01:41:41 UTC (releng/11.4, 11.4-RELEASE-p8) CVE Name: CVE-2020-25581 For general information regarding FreeBSD Security Advisories, including descriptions of the fields above, security branches, and the following sections, please visit <URL:https://security.FreeBSD.org/>. I. Background The jail(2) system call allows a system administrator to lock a process and all of its descendants inside an environment with a very limited ability to affect the system outside that environment, even for processes with superuser privileges. It is an extension of, but far more powerful than, the traditional UNIX chroot(2) system call. The jail_remove(2) system call, which was introduced in FreeBSD 8.0, allows a non-jailed process to remove a jail, which includes terminating all the processes running in that jail. II. Problem Description Due to a race condition in the jail_remove(2) implementation, it may fail to kill some of the processes. III. Impact A process running inside a jail can avoid being killed during jail termination. If a jail is subsequently started with the same root path, a lingering jailed process may be able to exploit the window during which a devfs filesystem is mounted but the jail's devfs ruleset has not been applied, to access device nodes which are ordinarily inaccessible. If the process is privileged, it may be able to escape the jail and gain full access to the system. IV. Workaround The problem is limited to scenarios where a jail containing an untrusted, privileged process is stopped, and a jail is subsequently started with the same root path. Users not running jails are not affected, and the problem can be avoided by not starting a jail with the same path as a previously stopped jail. V. Solution Upgrade your vulnerable system to a supported FreeBSD stable or release / security branch (releng) dated after the correction date and reboot. Perform one of the following: 1) To update your vulnerable system via a binary patch: Systems running a RELEASE version of FreeBSD on the i386 or amd64 platforms can be updated via the freebsd-update(8) utility: # freebsd-update fetch # freebsd-update install # shutdown -r +10min "Rebooting for a security update" 2) To update your vulnerable system via a source code patch: The following patches have been verified to apply to the applicable FreeBSD release branches. a) Download the relevant patch from the location below, and verify the detached PGP signature using your PGP utility. [FreeBSD 13.x] # fetch https://security.FreeBSD.org/patches/SA-21:04/jail_remove.13.patch # fetch https://security.FreeBSD.org/patches/SA-21:04/jail_remove.13.patch.asc # gpg --verify jail_remove.13.patch.asc [FreeBSD 11.x, FreeBSD 12.x] # fetch https://security.FreeBSD.org/patches/SA-21:04/jail_remove.patch # fetch https://security.FreeBSD.org/patches/SA-21:04/jail_remove.patch.asc # gpg --verify jail_remove.patch.asc b) Apply the patch. Execute the following commands as root: # cd /usr/src # patch < /path/to/patch c) Recompile your kernel as described in <URL:https://www.FreeBSD.org/handbook/kernelconfig.html> and reboot the system. VI. Correction details The following list contains the correction revision numbers for each affected branch. Branch/path Revision - ------------------------------------------------------------------------- stable/13/ 894360bacd42f021551f76518edd445f6d299f2e releng/13.0/ 9f00cb5fa8a438e7b9efb2158f2e2edc730badd1 stable/12/ r369312 releng/12.2/ r369353 stable/11/ r369313 releng/11.4/ r369347 - ------------------------------------------------------------------------- [FreeBSD 13.x] To see which files were modified by a particular revision, run the following command in a checked out git repository, replacing NNNNNN with the revision hash: # git show --stat NNNNNN Or visit the following URL, replace NNNNNN with the revision hash: <URL:https://cgit.freebsd.org/src/commit/?id=NNNNNN> [FreeBSD 11.x, FreeBSD 12.x] To see which files were modified by a particular revision, run the following command, replacing NNNNNN with the revision number, on a machine with Subversion installed: # svn diff -cNNNNNN --summarize svn://svn.freebsd.org/base Or visit the following URL, replacing NNNNNN with the revision number: <URL:https://svnweb.freebsd.org/base?view=revision&revision=NNNNNN> VII. References <URL:https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-25581> The latest revision of this advisory is available at <URL:https://security.FreeBSD.org/advisories/FreeBSD-SA-21:04.jail_remove.asc> -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/A6HiuWv54gCjWNV05eS9J6n5cIFAmA15dYACgkQ05eS9J6n 5cK69Q//UI2SeHrGXytm6ScQzCIbFPlUXlhkCX51WSOJmr/LUXpF9bcUhW73qqov /c70VGF876woMXHkbfYnCVdB4ETLIqTbGOl2aw/c8fuwrmFdtyeDEQ4SRRfWgdC4 L6jEgMvB/fMO9e662k19f6RFXrdMspK4rOz3/aowTFbOEvD3Q0HpBUnFbWWg3Iiy I190M0jbytFuZ2EJQ563bbRFFjEafZ51SKYz1FcR3cJAbVo/q75G3uDrjeNhnHxZ 0VqcTGHmF4Lh+RocUeW0v/1wHL8lBpoAKXmo4IL+FhFIR8fjVpKbGSm/IHSueatT Tr6xOg93Ef+sETWVn9Jv26BAU06LEM/ZuXz+HS7T7DwnJJeKa3d74KTJnnGauE24 67OO0i4Fok9Yyy2ArBH8V8mnzdW96dJyHrwdG0UUBddYlEyzArxkUQZyoIdj1Gb1 fns8ndY8t5tky2fxHZG2UMBWwQKBtbMZY027JRylAJWExsG6wH7DcUJ51FpcnbNe r3QvCB+ifOBGzFd2S4PduttxHW+xldWknah8513u9mRNCwnSFbY9ZXTpSeDmJaPo hYAZ2WlDodkaJxbTTMbJ+4fr6wMkmWf32g5pRh+wDfMAd0Wvbzmu/+fUQVf54FNU Qb91AAtVBuIE0J8jKqZxw+dtno+e6etmO1pXoZXvPHUr2N2BJmI= =yxgm -----END PGP SIGNATURE----- _______________________________________________ firstname.lastname@example.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-announce To unsubscribe, send any mail to "email@example.com"