From nobody Mon Mar 27 23:47:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PlqHC31QYz42GG6; Mon, 27 Mar 2023 23:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PlqHC2W80z45CC; Mon, 27 Mar 2023 23:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679960839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tX98V3d+YYt0n6zyua9bjYGHL4up4KfvEXiubmFEyT4=; b=yTT3P3Inv5xoDxYNSWyHN7iuvKlaae515Rmgvy3Seby1stHcRNnlF1tg0GUNT0nY4V2Swe TtEWn4HegoQzSS5SymctKOIEXLUcqAegd7naKf50loWC31K3yqBgpYOJRuTXATFXg1IDCY nnP0ggjlG32OFUqjFnSF8VYGI0gnNH4To/6C+51W/fp3s5mSJ6HFQK2ZLwHIcUHq7iP4O6 eCY9Wy4tgseMLqculmiZIRF8yScXzMjW4oFlGxlGbRl/a5ZL//hiT92uZictdmb+CUyH/7 GWe7QtkMq7/PTbaKb75jRH55uTRJEHHoPfjg8qzSmwp6iAv/Bf0vbQOaJcX7iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679960839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tX98V3d+YYt0n6zyua9bjYGHL4up4KfvEXiubmFEyT4=; b=nlhS9ENM2hMot7xfsQ7Lo5Mf2dpZEkz2YoTdq1Pbd72T0hEJo/HcnS9KBtt8+ViGatb3He 9ymABkndZ86nM8EMqmmvlJbeRHhJlk+DKCQ+lAx0qagH1VlPghHaJ9rXTyiiivB16CxCuh 9dY66kvU+o+5wKK7+NHYpD0jG1syVKQ2Q4tuEZWr54jjdLnxXTKeXaIV4GgRQyVNEHiTr6 K8lEX5v1XXIZq3KnJ53GuG0s1NSl85pxGjJvhGRd2s42TI0PXU+xIT/LvQ4AY+i6wmIW44 952TOchoDOaNwt9SyTiIzGmu2yOZjnT8EOpPdhQPY/5cECPnFl+MWfgv+as1ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679960839; a=rsa-sha256; cv=none; b=y0u/Dbrm9wLK4PzNLpq3REGEYS1CRqpFd5na6qNyTlLUGwigg2Ogu0jESGRUj4SoR7J/zW jpEXSXp85G0nOT7zolDvk+M7US6er9Ydij612Vz/3VSFw3TDiLZd1Lr2sGJ/+NGCtgS1Hn rYz+vdgAty0p4EeI58w22HZrm/OQ5IWnacPRa7Sr3BV4Lb73D2xhHJqRBmxmJ1o5564XmK 6wV9PAzGN/hwN0ZS1a58NIny+FXE5sYHFil6wLKwMsJH+3xPohf33RGxsTCoKC9IjjKjEO 9/ZuPyJl4li5htBIvYE9Wx+IEqnem5FkB8FshGlFTdsLlt7dyQgKGI+D4/Wwyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PlqHC1Zt6zhrL; Mon, 27 Mar 2023 23:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32RNlJVF080196; Mon, 27 Mar 2023 23:47:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32RNlJVI080195; Mon, 27 Mar 2023 23:47:19 GMT (envelope-from git) Date: Mon, 27 Mar 2023 23:47:19 GMT Message-Id: <202303272347.32RNlJVI080195@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 4660b60a00c3 - stable/13 - Updates to UFS/FFS superblock integrity checks when reading a superblock. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4660b60a00c3120ddecd94b3f308d39bcb6d085a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=4660b60a00c3120ddecd94b3f308d39bcb6d085a commit 4660b60a00c3120ddecd94b3f308d39bcb6d085a Author: Kirk McKusick AuthorDate: 2023-03-27 23:45:59 +0000 Commit: Kirk McKusick CommitDate: 2023-03-27 23:46:40 +0000 Updates to UFS/FFS superblock integrity checks when reading a superblock. Have to add a check that the computed cylinder group size does not exceed the block size of the filesystem. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38668 (cherry picked from commit 0eabe33087d8cb69ae800daae322f12a8f16bd10) --- sys/ufs/ffs/ffs_subr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index d847373a8cde..2f69965aba7e 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -446,6 +446,7 @@ validate_sblock(struct fs *fs, int isaltsblk) CHK(fs->fs_old_cgoffset, <, 0, %jd); CHK2(fs->fs_old_cgoffset, >, 0, ~fs->fs_old_cgmask, <, 0, %jd); CHK(fs->fs_old_cgoffset * (~fs->fs_old_cgmask), >, fs->fs_fpg, %jd); + CHK(CGSIZE(fs), >, fs->fs_bsize, %jd); /* * If anything has failed up to this point, it is usafe to proceed * as checks below may divide by zero or make other fatal calculations.