From nobody Sat Jul 16 17:33:12 2022 X-Original-To: dev-commits-src-main@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 4Llb0m37p5z4X3xh; Sat, 16 Jul 2022 17:33:12 +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 4Llb0m2WZ9z3rqY; Sat, 16 Jul 2022 17:33:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657992792; 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=J72J+SBlcx12Ra/wmpK/eV9TsnFpEkQFuKDx4lFGxmE=; b=CsphcsTrNMCz8PxXBe2gp9dN6esWTI9tZsxucDKApXovFmYTFCgNQWNDnduie8/R6MiY9s ky6Ixb29pflnBX+i8Md+pjo6LTiy6fNmHkTPiUkF1J4bpFvaUuT1+HGxNs2r7Q2qPyLYbd J+Cu6zO2Eglnj2UdcFmNPwINIuWa2D+FY/MzBulQWAd0uf6k6IuRU0dfwqp4aSFD3xp7bm urbK4sppgneXDt2uR2CtiH4qNcjHkOhgdKNJt42d1nPXM1p+lAPi1DnZxo0bL13x5VG/Im 1+FeBCX02RrxCG7CDcmKcSjE0QtA0TvlvkX2InjXffByKFzjOz/8ugPF381dWg== 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 4Llb0m1YK2zVhd; Sat, 16 Jul 2022 17:33:12 +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 26GHXCcX068314; Sat, 16 Jul 2022 17:33:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26GHXCrN068313; Sat, 16 Jul 2022 17:33:12 GMT (envelope-from git) Date: Sat, 16 Jul 2022 17:33:12 GMT Message-Id: <202207161733.26GHXCrN068313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 904347a00c1f - main - Additional check for UFS/FFS superblock integrity checks. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 904347a00c1f9a29f3b17e6e676805036d2494f1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657992792; 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=J72J+SBlcx12Ra/wmpK/eV9TsnFpEkQFuKDx4lFGxmE=; b=BQdTDCdliQvaHpVX4w8NALy5uu4l3fKjYE8vs7CDLqRG9tumcN8p59RMisTNqVXwoteLgI 3RJw15vvgIwZJouQ8U9aPjRxe7Vx1tlIGlOi6edEPXFZ2273hQqMu5obPg8/QyjiqZFq0n ZA+RhlpYZCihUXggAQ09IY55xtIsBrm7TCIW462+EFxtQmpMfyFL1z2RhBgF3iaIjjtstf qgkTPeI07uGDIZMpwoBQ68iFjbHz+57/Wx6UbaPGJCv1pjdkl3XD8ejKr4zVlLH06Hg2ic lwFFMDSMQ9KK+R+R4wnNTdao9jr8oCymdsUn3PilZLRf/0k7133ntaXzVBf8Bg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657992792; a=rsa-sha256; cv=none; b=r7j6h/U2570vY01ftlDlt/MuBAh8/Ibipw60O8xR+fMoBLE1YRXrebm4UskNKuOZyLevvv pp3rEIWEyEuwd0dojYpYz+H/0XI4gOvHkJuEnsWDEi3xEouAeGXu7dC6f4CRGgtaWiZLOL 2CAQFOVtAQ6Ux/DudFYLpZ66E0SvvxLoxbfvW1FpI0QjGRfc0GdeC+pXfY53YbrV/i+oYS GeNAoj/aZ/r0YY04Yf2D+5GKRTDXeyb4RLiuu45yUKIq2HejuSYTFAeh502+Uujv96nQKJ liw/qcFuR59DQNTi1DckNygKaSC8FzOoI2SYQ623b75FdHMn7NO5T8DqOmWY5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=904347a00c1f9a29f3b17e6e676805036d2494f1 commit 904347a00c1f9a29f3b17e6e676805036d2494f1 Author: Kirk McKusick AuthorDate: 2022-07-16 17:31:52 +0000 Commit: Kirk McKusick CommitDate: 2022-07-16 17:31:52 +0000 Additional check for UFS/FFS superblock integrity checks. Tested by: Peter Holm PR: 265162 --- 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 25657a00894f..21daa44de4d8 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -458,6 +458,7 @@ validate_sblock(struct fs *fs, int isaltsblk) CHK(fs->fs_size, >, fs->fs_ncg * fs->fs_fpg, %jd); CHK(fs->fs_cssize, !=, fragroundup(fs, fs->fs_ncg * sizeof(struct csum)), %jd); + CHK(dtog(fs, fs->fs_csaddr), >, fs->fs_ncg, %jd); cgnum = dtog(fs, fs->fs_csaddr); CHK(fs->fs_csaddr, <, cgdmin(fs, cgnum), %jd); CHK(dtog(fs, fs->fs_csaddr + howmany(fs->fs_cssize, fs->fs_fsize)), >,