From owner-freebsd-security@freebsd.org Tue Aug 24 20:52:50 2021 Return-Path: Delivered-To: freebsd-security@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4708B660AC5 for ; Tue, 24 Aug 2021 20:52:50 +0000 (UTC) (envelope-from security-advisories@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GvLsY5Yx7z4ps1; Tue, 24 Aug 2021 20:52:49 +0000 (UTC) (envelope-from security-advisories@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1629838369; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=SLTFutSfddXhbGN47tHpCiqeYUNc4DsBUilA4PTzyag=; b=TNctCfgz6Qx4H75MPF95If/gMDqhJjS8VopgUNrJdtV/70nyMxJ/ig15IybcS5tdykZUnH ltCt9UkjCSpcVbzJNn80Mu11WJ1DFhhN5U7GPSOp/xCrIbcMhfYtA6b5HShcLLOxvYHGZP oy+L/6g5fRA7oltYIwf4D6ZJRJxwP14DqE9LbdACyHfP5a4bsVDJmfE0aw3A0w5Kjyu1Y4 PgRrGsAg8VIv6itmP/ulb/jjm/I3Q/F8FgyQ0j8X0JjAHFX7wwlm7VXJn7h1t7wc1pOqRO lP8PbcXPdwuQvzzFXq73LzaFNrQf5k92UkPp4mi7d4q5rkbI5yVVLk/HSM3UoA== Received: by freefall.freebsd.org (Postfix, from userid 945) id 6B61A743E; Tue, 24 Aug 2021 20:52:49 +0000 (UTC) From: FreeBSD Security Advisories To: FreeBSD Security Advisories Subject: FreeBSD Security Advisory FreeBSD-SA-21:14.ggatec Reply-To: freebsd-security@freebsd.org Precedence: bulk Message-Id: <20210824205249.6B61A743E@freefall.freebsd.org> Date: Tue, 24 Aug 2021 20:52:49 +0000 (UTC) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1629838369; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=SLTFutSfddXhbGN47tHpCiqeYUNc4DsBUilA4PTzyag=; b=XY/WXaXY4Nc2Rsu20joeXd2/RV8BOcTuP9CHOJIQjKSG3fF1TVR29z/7qYzUxWKcnrcH5D ohDBUb0n4EneDJDeKZj/A6bWW4erjrfRXscYe/hi3IhQ+lyc9+7rTr1hUFWwiCkcU2+A/A p9/eFZxZX0kbTYusy+drAaPelxnxBh7o+2O3BxMysZpLGTqcRawdQ75edMnBsMqBxCbfBf hPBDeLWqUq2yumFkirGCL3brvV3oyMU71oPL3sgvR7+Coa6tIRJfdLpImb0W2JOZwMD+uY jzl1doVvv+V6KVEC0Lu/iHZDMdCNVyShzMkm7nCecXxTARmApaNHRjgGudmiRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1629838369; a=rsa-sha256; cv=none; b=n6v9p+/oqSyonhvgh1ONanm+hGoZhA3ZWabTr60Mr/zSkAYXnbCvNTP5jhIZMjpfrzS2b2 5tUxBRtVJDXWUMMY63MOyvdbX7iJ+QxVzfsVkXzpEIDR82JJl33IxetaQzXKNkcbKRhxYK 445pzBpIwEd8jKNgBI9KVhYISeyArHwS9s2vf25Ty7E/liVkYG0lYPo/UB3W+oj1ZC+pBt q8yrZ+biHtAaIPllUSECpU0o6NxUwrT2p4q/P68T9OVp/d5juX9jWmLTvfNXjTArPkCeo8 vcJ3demtm/zLnaKNhpuEQzithrr70kzpa0WlHN4/+T4G70XBMvtO/2R6uQoigQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.34 List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2021 20:52:50 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ============================================================================= FreeBSD-SA-21:14.ggatec Security Advisory The FreeBSD Project Topic: Remote code execution in ggatec(8) Category: core Module: ggatec Announced: 2021-08-24 Credits: Johannes Totz Affects: All supported versions of FreeBSD. Corrected: 2021-08-24 17:50:50 UTC (stable/13, 13.0-STABLE) 2021-08-24 17:37:45 UTC (releng/13.0, 13.0-RELEASE-p4) 2021-08-24 18:30:13 UTC (stable/12, 12.2-STABLE) 2021-08-24 18:32:15 UTC (releng/12.2, 12.2-RELEASE-p10) 2021-08-24 18:29:35 UTC (stable/11, 11.4-STABLE) 2021-08-24 18:31:29 UTC (releng/11.4, 11.4-RELEASE-p13) CVE Name: CVE-2021-29630 For general information regarding FreeBSD Security Advisories, including descriptions of the fields above, security branches, and the following sections, please visit . I. Background GEOM Gate is a GEOM module that reflects I/O requests into user mode where the ggatec(8) daemon fowards those requests to ggated(8), possibly over the network to another machine. II. Problem Description The ggatec(8) daemon does not validate the size of a response before writing it to a fixed-sized buffer. This allows to overwrite the stack of ggatec(8). III. Impact A malicious ggated(8) or an attacker in a priviledged network position can overwrite the stack with crafted content and potentially execute arbitrary code. IV. Workaround No workaround is available but systems not using ggatec(8) are not affected. Neither ggatec(8) nor ggated(8) are enabled by default and need explicit configuration by the super-user. V. Solution Upgrade your vulnerable system to a supported FreeBSD stable or release / security branch (releng) dated after the correction date. Restart any ggatec(8) instances. Existing ggate devices can be kept alive and restarted with `ggatec rescue`. Perform one of the following: 1) To update your vulnerable system via a binary patch: Systems running a RELEASE version of FreeBSD on the amd64, i386, or (on FreeBSD 13 and later) arm64 platforms can be updated via the freebsd-update(8) utility: # freebsd-update fetch # freebsd-update install 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. # fetch https://security.FreeBSD.org/patches/SA-21:14/ggatec.patch # fetch https://security.FreeBSD.org/patches/SA-21:14/ggatec.patch.asc # gpg --verify ggatec.patch.asc b) Apply the patch. Execute the following commands as root: # cd /usr/src # patch < /path/to/patch c) Recompile the operating system using buildworld and installworld as described in . Restart the applicable daemons, or reboot the system. VI. Correction details This issue is corrected by the corresponding Git commit hash or Subversion revision number in the following stable and release branches: Branch/path Hash Revision - ------------------------------------------------------------------------- stable/13/ 0729ba2f49c9 stable/13-n246938 releng/13.0/ c8a2cc4ba845 releng/13.0-n244757 stable/12/ r370383 releng/12.2/ r370394 stable/11/ r370381 releng/11.4/ r370387 - ------------------------------------------------------------------------- For FreeBSD 13 and later: Run the following command to see which files were modified by a particular commit: # git show --stat Or visit the following URL, replacing NNNNNN with the hash: To determine the commit count in a working tree (for comparison against nNNNNNN in the table above), run: # git rev-list --count --first-parent HEAD For FreeBSD 12 and earlier: Run the following command to see which files were modified by a particular revision, replacing NNNNNN with the revision number: # svn diff -cNNNNNN --summarize svn://svn.freebsd.org/base Or visit the following URL, replacing NNNNNN with the revision number: VII. References The latest revision of this advisory is available at -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/A6HiuWv54gCjWNV05eS9J6n5cIFAmElV14ACgkQ05eS9J6n 5cKyqBAAi7eHUJ5Ud4dNJac8zbaj5uIlYF1XUPBfm5XlevfW1b1vgrfrs0QM3Sw5 9efTVTESFUC+T9wVMYO3s9POEwiu3x0A/eRsH2tq9oaZPQKdpAhkEEQ/uqnNRKfm qHZ8YuSJGT+EWEFp1ib5O4Y78TvjL7ST0+IG/O5vBMKqgsxy29o6tOAy3q9+RVqj hNQNo7KbXBXEns/I7HN4JssQSjeWOmK65Ty5YAp1VsNGbD/7rSqsCp4P/CatvRQ7 0kzVMb/hkaDn1G7jYOXbAPk+XrUr9cFriChjLuAAyZRBfWcNlPmoxRgNoDVDY44x elnBAEmSPD9adwy2hoHeusiiUnN7Vrz6DJeox7BSnbQx1lbU+j6qev0EBaMAmEUJ POxn9wjfth3hdfRSx5p2jSVaD/086BBpMQ9KXojVONgqE7hFF402+ooCnorA2XTh s08cIy38TEyHoW/rqr3SoXwyvkM3vAjQBmYzocDqocfufQ7UCH+SDFSsORuof+4N 9T2j/UvGqmrQvnMhAsRfbdFImvwUut+ZLJzNqTEjYWlZv58QEKocU0OOvrd2Wb5i ok2CRIhCy08UnDItFSYI28TaMv8ZiCoWLx7H0+20mQeLaPF45dQWXz1o4FrFHVjx EdMZpmh9tFU8j5bm0J5l8CpoiTZsqZ41gTrFyEdSnOnS1uvT8jQ= =6Z2C -----END PGP SIGNATURE-----