From nobody Thu Aug 10 02:58:37 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 4RLs7f5LcWz4pw5r; Thu, 10 Aug 2023 02:58:38 +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 4RLs7d61Pmz3Hvd; Thu, 10 Aug 2023 02:58:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691636317; 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=+f7nkp+o2rperOtat2I9RURAK2xOqA77r5Rv7FnkYUI=; b=ysLGOW8rebhfQbve60AzBgFsw3FV2M1oeLpmfZig0kDfGa9WGdtBN+9mCufXZ59ytcLuhh eTEKm2TIbMWNlf3J9UXFCmbfYWP9cv6CD5Wye2H27r9O/VGUwHBHUUt+HNUYFiJqzqe2cD WNND6ldO6hoyFHMS/bHVZ9MxUyqoZyruDiEH8f+MZF6KE5fJRD5mZoCeuUuExcnGcGhoNe 0qcvc1lXo8x80WG0Iqnyrh59MPT5vPIygqnyEHNmjL5Yj5wdB5igMEI0xjpNdDVJol0wwR zN6TYv77xXkWvpacehlqWmMTgIJ3V3QsxFtSMKI5pqiWm5ID0/uT0p20JVuVfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691636317; 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=+f7nkp+o2rperOtat2I9RURAK2xOqA77r5Rv7FnkYUI=; b=MuqL8HuTuli254IEvzi87nDrvO+U+imfKOpHQ/pqedsWIs3hcEYPzBNDQGloM2/afJHqiv TY/tvXY+IfML1qRTakeZbcN6n5acIpviN/co3CXVvi23yfB2M3nAEkkeQQDu7vmtfrA58Z 9u8BimBeF/9ntGyoiH5ALoiMcLgmMpyoWZvaSk+4jVowkmbTmtmoYD6p2QCJ+/CW2rM9zm ZIsC2EcwPfr6XNnDV51cY/Qw8+B3FByiDYG2a81OBHTIO/F2CvRpmQZlZ/YBBLkQ8PGi4h +GyCOFggRPMicaheznfyA1yjGa1P1Xb9G46poUYl+RBCiLtcOftOoyKpM39vjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691636317; a=rsa-sha256; cv=none; b=FLnVv/FXJr6kiigRweuMKzMSOvqEOLxs5hLFD1TBPFVcMq8pH5dYJUT97vzlFaGCK73PFO pbUbezFHo0INiOTBYEUCwcVG5FdOO2JD/mAUlDp/7k4YopXwWRHibHiNVwyDZgbLAK5S4s TEzk+JBaiisCdsbd/n0f6GzBZ+lhNVOymF8mDkPoSq05zumcZde70jOls/TYGBk8T9Jni2 ztkp1Ecg/T4KdXy43Q8p4EkH4eVaGlCvrEkxBItAH9D+tWrsx0kKti2ZRnQgfERmg164t/ mxOl4+FdggwPGL4ThE9lTgLQMNL+4SOC8P2WzC7mVClggIRJ6CfzBoP7KtZ28g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RLs7d57ThzgVh; Thu, 10 Aug 2023 02:58:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37A2wbUV074654; Thu, 10 Aug 2023 02:58:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37A2wbLA074651; Thu, 10 Aug 2023 02:58:37 GMT (envelope-from git) Date: Thu, 10 Aug 2023 02:58:37 GMT Message-Id: <202308100258.37A2wbLA074651@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: 21a943407e99 - stable/13 - udf: reject invalid block sizes from lvd 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 21a943407e9992a219a5fe572ee27fea9f5d2c69 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=21a943407e9992a219a5fe572ee27fea9f5d2c69 commit 21a943407e9992a219a5fe572ee27fea9f5d2c69 Author: Konstantin Belousov AuthorDate: 2023-08-04 22:47:09 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-10 02:57:29 +0000 udf: reject invalid block sizes from lvd PR: 272893 (cherry picked from commit 9e6941a2c7a393aefe6a123952c6eacbc23098a6) --- sys/fs/udf/udf_vfsops.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c index 3f6f481dfd6b..65b2ff5b2699 100644 --- a/sys/fs/udf/udf_vfsops.c +++ b/sys/fs/udf/udf_vfsops.c @@ -413,6 +413,11 @@ udf_mountfs(struct vnode *devvp, struct mount *mp) lvd = (struct logvol_desc *)bp->b_data; if (!udf_checktag(&lvd->tag, TAGID_LOGVOL)) { udfmp->bsize = le32toh(lvd->lb_size); + if (udfmp->bsize < 0 || udfmp->bsize > maxbcachebuf) { + printf("lvd block size %d\n", udfmp->bsize); + error = EINVAL; + goto bail; + } udfmp->bmask = udfmp->bsize - 1; udfmp->bshift = ffs(udfmp->bsize) - 1; fsd_part = le16toh(lvd->_lvd_use.fsd_loc.loc.part_num);