From nobody Thu Aug 15 21:47:13 2024 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 4WlJcf0glVz5Swy0; Thu, 15 Aug 2024 21:47:14 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlJcd6JrDz4CgM; Thu, 15 Aug 2024 21:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723758433; 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=RhzWBMYWfLwjjyUtuaD4z64vFSPnDYSxdZ8D+CtrKm4=; b=huvIqLXNAihyTWuG+LUpXgGHR0oSAn32oJnRKscVr2Ya6HY5Ml3VD3I4v1plmo2C6tQNef AMubEXDiG45e5wmi9fokrjKS/2EizvZoWG5V0Ne9qw6syovmoQrAWOEplSzdpjMk+ScVZh pQ5RDhPf6JMa3BNBWT10vs296IUg4hYD+re+fmta2V3/7wnZ1afrgTv2ZY0zeJqdHMb8kD PLz6CIns8iHMNzr26bK3qifa0Ly0FZMsPLrhY8bvIb5FCxU1Ps1gRu+ypWWbNPpZTlFstu OsH/7vBzm+21tob9X0uIFxigbiGZiBbL+rAZeo08XgGTJKzwdW7OCbrFOsZi7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723758433; a=rsa-sha256; cv=none; b=ZAeY5DvHJBDwLipBltt0uqZHxR0FjmElsbrxoeT1N5YjELf5Cp+gTVN81fYSE2QnQvU8/v uVhv4ZMcjOhkBOWMmbJUqprg5Onew5yrZ1xp3ty+fcJRJNXmZ9PPv55Z9Ito5GhNnwsjRM 2MPirNHG6BsFEemeG6SqnK9rdBHIG6FKCZRsLhUPvQcQ8r/XQlHsurQ9TbmJ0RjTOZGUwN BJu+S4JOoZEFT/W0H0voi+Qfi7mnjceNCjM6VD/kz9WpXHx7gOsSRWggHtRg1DsdNQndl3 cnuhRrOwPiPuwPL7Aq6hGL5xb7MB4sciQra5EG+693Ga05jZSfRwt0AYQ+3Cmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723758433; 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=RhzWBMYWfLwjjyUtuaD4z64vFSPnDYSxdZ8D+CtrKm4=; b=ZpPwCeOWdrWMhYUgWZa+NA2alEl9mcmF35uCngfe/razxsMf8qOH6OJkKz86RcpaqIH6I1 3n9dC+PHuwRGzskCPAwjr3lqGLj00L+LE93W2WMNZQnjbDejaaPr6qFwBqXkQz0PGvBxup waCL6tov9MrevHcwwHKGdgzVt1STZUIc54RozqZqv0ODvV9FmsYfdzn7yEmIKRlI5zpR6A X/Nm7txbWEJgltewwtvJC2MjKrm0YsRW3ducMQ9YZKvq0KWlR08QYkYbdidfVx6I3Bq+X/ saXOU90STJ0WjcXi8h6HVovTDoB+ad9150mKTM6LsZe2+5zonfa2zUrIMXwKhA== 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 4WlJcd5wDKzgKk; Thu, 15 Aug 2024 21:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47FLlDum063503; Thu, 15 Aug 2024 21:47:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47FLlDc3063500; Thu, 15 Aug 2024 21:47:13 GMT (envelope-from git) Date: Thu, 15 Aug 2024 21:47:13 GMT Message-Id: <202408152147.47FLlDc3063500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: d5c1fa0ec09e - releng/13.4 - msdosfs: fix cluster limit when mounting FAT-16 file systems 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: d5c1fa0ec09e34040c9c9941c27e38b583c60d86 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=d5c1fa0ec09e34040c9c9941c27e38b583c60d86 commit d5c1fa0ec09e34040c9c9941c27e38b583c60d86 Author: Stefan Eßer AuthorDate: 2024-08-09 17:26:27 +0000 Commit: Stefan Eßer CommitDate: 2024-08-15 21:46:57 +0000 msdosfs: fix cluster limit when mounting FAT-16 file systems The maximum cluster number was calculated based on the number of data cluters that fit in the givem partition size and the size of the FAT area. This limit did not take into account that the highest 10 cluster numbers are reserved and must not be used for files. Approved by: re PR: 280347 Reported by: pho@FreeBSD.org (cherry picked from commit 45d4e82bf61f91792142a2b9e2af657dab8500fd) (cherry picked from commit e8f52a86ee279a1270e31bc5bad436939e44f555) --- sys/fs/msdosfs/msdosfs_vfsops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index b5392e62b578..4326dc1f0a6d 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -724,7 +724,9 @@ mountmsdosfs(struct vnode *odevvp, struct mount *mp) } } - clusters = (pmp->pm_fatsize / pmp->pm_fatmult) * pmp->pm_fatdiv ; + clusters = (pmp->pm_fatsize / pmp->pm_fatmult) * pmp->pm_fatdiv; + if (clusters >= (CLUST_RSRVD & pmp->pm_fatmask)) + clusters = CLUST_RSRVD & pmp->pm_fatmask; if (pmp->pm_maxcluster >= clusters) { #ifdef MSDOSFS_DEBUG printf("Warning: number of clusters (%ld) exceeds FAT "