From nobody Wed Jun 7 23:15:41 2023 X-Original-To: dev-commits-src-branches@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 4Qc39V0HBWz4bhd8; Wed, 7 Jun 2023 23:15:42 +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 4Qc39T3nMVz3DFW; Wed, 7 Jun 2023 23:15:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179741; 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=lZqlqeDQB5ao7y/pXatcDzeSyxnaEWf2AgN40cq0Sx0=; b=YbDyU09RjixcllURSnTj9AOtTJkthR3zdik2TCe8GJ63NmsZdpidHBPpkP2Fwc/8S3hExy 5TYbHCBPogjyvVClKr8uYLouTlYsidvKf0dG2lAIUPrU+4i4dl7oKOQfUZw+cUwuZQl75o CcGkQO7prZgvds2DfpW8igyeWaN8NAOXNEgZR+URfuxI152ktnQXddH7M/QsRQcjxMs4Gc eVuTDqIwbEyi6EEagS1s/bSn2SMKuOZnjhBkbNPJmRi7NQk0VPhfLxzzAnyhaXNIiJYULK 6nG8vFYzZ1HeJFpIfbLs5WMjsMYhTjOSFmh/lwb96Ap5Lo5K69rLnTdk5oGmaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179741; 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=lZqlqeDQB5ao7y/pXatcDzeSyxnaEWf2AgN40cq0Sx0=; b=CcdYbTHIX+AzCWKpE6Id3NBfJ2mSb1wEDCJb8N6FUADMrfmye41ECjCUxj2h8E2Fx4RdSM ZhuQffxIqNHbrubG9tA/GfOmhdVr24nPgzY0zZ4hC7bSAk7O5DtKKFUqVxIEtFWmrJazLc xESQUu49P0VWGPtr0dVI9OpwXpMFsWEkGKgirj8Tb4GCNIRzEvj1u2WFBdJZz1KkDAuOK/ xf19mZaPkFKczZ+Yf/AOAKb/H+Qa6nW2fAtQ9rsDqd7RB1iCUqayjQ1SRLckpRM3vYpQz8 eroFhQ++hfsmX/G8ldZBIdgkvptM6Yw12uLVhxCrx+OIYDejEauocIoTgxE+Zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179741; a=rsa-sha256; cv=none; b=rrJxSjAdIxg6NmCIUlebtTBUqGkwAymTbveB7meWeXoxZa8vxZHa8vAPtVJPgSQmZBAvbU nh+eXcrWED4JhSwYgjW0IAjU/jcCJgAnuPfIRXTD3E1UggIHUcO3L/2qvDDre+z/okacH1 vGXwtBqxAhuFHq7WXOpGlQ4o5tp084kdVxoxbqWlJZRrarrIawzKmmsHe5R5H+4nV2fx9u tluFVWexmc++e1dDTeVNM/aiTOqbWonPGVx+2l7jQdDubAW8+PCSsgvqGorr1PKGuOoxmw k1GxuNGfbfepu8EL+GT2ydY1Xz1XuWgOAGD1PTIZeNls6kVIGe8Yvj1hFK/Smw== 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 4Qc39T2tPTzWQv; Wed, 7 Jun 2023 23:15:41 +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 357NFfZX048505; Wed, 7 Jun 2023 23:15:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFfup048504; Wed, 7 Jun 2023 23:15:41 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:41 GMT Message-Id: <202306072315.357NFfup048504@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: 95fc911fe9f2 - stable/13 - Updates to UFS/FFS superblock integrity checks when reading a superblock. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 95fc911fe9f258ab9baa6b9fa1b1643f86b103b6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=95fc911fe9f258ab9baa6b9fa1b1643f86b103b6 commit 95fc911fe9f258ab9baa6b9fa1b1643f86b103b6 Author: Kirk McKusick AuthorDate: 2023-06-07 23:12:12 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 23:12:12 +0000 Updates to UFS/FFS superblock integrity checks when reading a superblock. Reported-by: Robert Morris PR: 271351 Sponsored-by: The FreeBSD Foundation (cherry picked from commit c79a1416955a260424a5dd2013b114ff864bc926) --- sys/ufs/ffs/ffs_subr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 4ba452b05ec9..813736c9d070 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -505,7 +505,8 @@ validate_sblock(struct fs *fs, int isaltsblk) CHK(fs->fs_csaddr, <, 0, %jd); CHK(fs->fs_cssize, !=, fragroundup(fs, fs->fs_ncg * sizeof(struct csum)), %jd); - CHK(dtog(fs, fs->fs_csaddr), >, fs->fs_ncg, %jd); + CHK(fs->fs_csaddr + howmany(fs->fs_cssize, fs->fs_fsize), >, + fs->fs_size, %jd); CHK(fs->fs_csaddr, <, cgdmin(fs, dtog(fs, fs->fs_csaddr)), %jd); CHK(dtog(fs, fs->fs_csaddr + howmany(fs->fs_cssize, fs->fs_fsize)), >, dtog(fs, fs->fs_csaddr), %jd);