From nobody Sat Jan 15 00:51:36 2022 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 7FC9F1951204; Sat, 15 Jan 2022 00:51:37 +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 4JbKP45drRz4k9k; Sat, 15 Jan 2022 00:51:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642207896; 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=d8+cq6wHps/oXxp0bK4/JY/m9yB6/LKTbW8yx2vtX/c=; b=O8jcCmsopTeJYVzzGnHUaNAYY3VRFPpAZVoJTHTNooW14rUyoO1jnnJybhodkVUwxyH3LQ qXWfs3iLM1Yk9oZJqs435RFx2Y9cYXgY6zxpThhhceM5cZE8sRbLlnm8rDB1vTzFkFAqvR 3LQ5llfIz7bztekuY1WkdC8SyZB8zkIHeMMQ3boMS1I21xA2PZQTcHP45lxzwLe5tDtc+L Kc96Vw0WIxGD2rFgJqEhoyxsRyyBa/leDLw876xcj15savmlWahaD4y4Zr/TQrqKawMfiv wm6h6DUQXTLe7z60JFiz8kOGhlT5P90jj6FT23kaRsBulgA5lnWqwq6FiGYZww== 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 9304D1D76A; Sat, 15 Jan 2022 00:51:36 +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 20F0pa38031097; Sat, 15 Jan 2022 00:51:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20F0paBI031096; Sat, 15 Jan 2022 00:51:36 GMT (envelope-from git) Date: Sat, 15 Jan 2022 00:51:36 GMT Message-Id: <202201150051.20F0paBI031096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: bbab525fc11b - stable/13 - msdosfs: handle inconsistently hashed denodes 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bbab525fc11b7c71e92908d0c646944f36da60ec Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642207896; 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=d8+cq6wHps/oXxp0bK4/JY/m9yB6/LKTbW8yx2vtX/c=; b=NwG3NQ1HU/PQjAPM6l7qltmyMsj0R42U2aSG9YrYR2Y8yqJw6p4/i0bTwzw/V8Fdh45EUL F+46i6ONWsoKUm4beMHTh6BJJk6zwZaVy/aMuHcE2zjnereQJ1ymUY1yY72t/8vKAzTvNw cbfAFUptpO6rrKVDNjbpRVe6nyXXb3L7fqUXJOF+X9nGbE4UZjju/3OaDOIg1jZ4HHuRfQ XWo/D9L6TQSNm+raUu6fg8+11I+0sD6HPYWArIkuzGKXN5dZxdeuovDXBtIM2ZlEXyvjq1 CrWz3Sl0bKh/WKkx6nUFvFroeiPd1p1RBrxVFgN5AC0+vUVKR3GV/UrRyBhdRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642207896; a=rsa-sha256; cv=none; b=HMueNbBdRYtVdBQ+tCCilElHLfuekqY7UGEvKO6HYQ5h89frS/sRSBJharhT/VKnMjsXOc P1kZd0YWjUxdVqXvVXZzpcwS+j6BpONWfBzAovugwnZh6X1vlj2XWuldBR9jl74YkY7SNM zOHTr3wehwz9KnFoMg19Z3ie20FKo4STj98LpzaPoxPVgzChJ8BvOKsW4SKiTye2+4V5yP PUEDI9PmPINScKukZ8XB/b1YNUMzShibeLtfUDguBiQHBOlQ1OEowifaQXL7PqhLO3rU5H FwydZVWzX9s8rD9kQHdgkCWKHC+ALBWiNHgvgtOaQl0zdJrDHW7lwf/QzVI4Iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bbab525fc11b7c71e92908d0c646944f36da60ec commit bbab525fc11b7c71e92908d0c646944f36da60ec Author: Konstantin Belousov AuthorDate: 2021-12-23 23:21:53 +0000 Commit: Konstantin Belousov CommitDate: 2022-01-14 18:11:01 +0000 msdosfs: handle inconsistently hashed denodes (cherry picked from commit 595ed4d76713c1e9cab7d8a160ed59f8f4e5ecb4) --- sys/fs/msdosfs/msdosfs_denode.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index de73579c7d16..bdc7436079ea 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -142,9 +142,23 @@ deget(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset, return (error); if (nvp != NULL) { *depp = VTODE(nvp); - KASSERT((*depp)->de_dirclust == dirclust, ("wrong dirclust")); - KASSERT((*depp)->de_diroffset == diroffset, ("wrong diroffset")); + if ((*depp)->de_dirclust != dirclust) { + printf("%s: wrong dir cluster %lu %lu\n", + pmp->pm_mountp->mnt_stat.f_mntonname, + (*depp)->de_dirclust, dirclust); + goto badoff; + } + if ((*depp)->de_diroffset != diroffset) { + printf("%s: wrong dir offset %lu %lu\n", + pmp->pm_mountp->mnt_stat.f_mntonname, + (*depp)->de_diroffset, diroffset); + goto badoff; + } return (0); +badoff: + vgone(nvp); + vput(nvp); + return (EBADF); } ldep = malloc(sizeof(struct denode), M_MSDOSFSNODE, M_WAITOK | M_ZERO);