From nobody Fri Dec 13 01:44:00 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 4Y8XDw3xjdz5h22D; Fri, 13 Dec 2024 01:44:00 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y8XDw2N0Rz4jfg; Fri, 13 Dec 2024 01:44:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734054240; 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=e/mILR7LNT+bnyBcxwJ0PXxCE/cBQufLXC8+GSA1Wx0=; b=ksqLV8gMCwzw4/aD9/Z2QFwDnbN7Gdz9VSWWz62Qi8XjOcwpiD/uo3GE69bXnIEEl7g3LN yWoNysY3giktkE7tIBeoqj+GSvazL6U9amUN8hOgPgW8rt6cEKQz1YrtotXnzMcBAMYOf5 9OOBI8Ai2fHrGadIhwiSR/7+icbH+Jho8IX1kBJhxVfpUQ1yCvBiKLk7b+0UMpE4lyb6EZ o/cbP6/2G3xiTcFqNfpnbecMt5B6lH2gM/jYV0+TC1IxvIB2n1apwBYHAZwEfy+FbYvqUm ZoWCTKBLrqZVKx+vtYAhniO2Cs/WlgBKCeWiRRpf066OJx0b8Ipu4Qi+nrT79A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734054240; 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=e/mILR7LNT+bnyBcxwJ0PXxCE/cBQufLXC8+GSA1Wx0=; b=mITxffzKVaffUrWOsAeF56QUP7z+sqABktbsw+H7zyneWLe6CB8mA6MaWESt83Efl+R4KS naSv+fgdZmnVfoXDW2cINpWIGQkg0vYkiIbmBQOEyr87LaGZj8MpuWgBsjBeCIMlBk58hx QbKykznDYJbgGQrr8SpaJ5AW5hFLHCj9bjX95txA+V/u7NBgj3Wx7OJDab+a7A/p9WBpOG SvkJc1S5w0cUuHGoYLbnjORzv8JkZ11IJWpz9vQVRYEr6sfinBw+v+J4sspKCf6E21cJ5w sFZpqDxDLnl/awHdi91jEu79kF7NP27DGFem1WtdRuSFIqsyXNjWkP4M1J2SDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734054240; a=rsa-sha256; cv=none; b=PbtO/Z/XEM96gfLvWw0L+qqCy/RG/HiIkvzJlqCAPigofH3b/RmSagNNOPGdzByypd2C/O gQsKzuOLf/mUkvig5NZrOaJWEuRL0TD57l4plSrZQhSc1aWkS7/a9sOvnrm4P2QLt3D4VP 2f7r5/x16qmRc6a+qzIBoCER9bwhQszDbPSukVKfJ7/Hu+kJVMMuxb3IhwHCRbVMs2IpQ2 GKQjzE9HhzkJuFP/8LAjV+nZQfHyExwrxh2dH/1wb+60nnzWgnmChGCRGR76Cf9M5kkcRv 1qCewGMWCxp6EPRCMIUqUR5HW3hFdSRh8RNzY7YqB8cKyV+9QrmMsiCmIMr6Ww== 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 4Y8XDw1ykqzHn0; Fri, 13 Dec 2024 01:44:00 +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 4BD1i0ij033872; Fri, 13 Dec 2024 01:44:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BD1i0Ij033869; Fri, 13 Dec 2024 01:44:00 GMT (envelope-from git) Date: Fri, 13 Dec 2024 01:44:00 GMT Message-Id: <202412130144.4BD1i0Ij033869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 54974e731f27 - stable/14 - cd9660: Make sure that struct ifid fits in generic filehandle structure 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 54974e731f279941ef7aebd7d30ba2e9299a4056 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=54974e731f279941ef7aebd7d30ba2e9299a4056 commit 54974e731f279941ef7aebd7d30ba2e9299a4056 Author: Mark Johnston AuthorDate: 2024-12-06 02:03:59 +0000 Commit: Mark Johnston CommitDate: 2024-12-13 01:34:17 +0000 cd9660: Make sure that struct ifid fits in generic filehandle structure File system specific *fid structures are copied into the generic struct fid defined in sys/mount.h. As such, they cannot be larger than struct fid. This patch packs the structure and checks via a __Static_assert(). Reported by: Kevin Miller Reviewed by: olce, imp, kib, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47879 (cherry picked from commit 205659c43d87bd42c4a0819fde8f81e8ebba068e) --- sys/fs/cd9660/cd9660_vnops.c | 3 +++ sys/fs/cd9660/iso.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index cb619379e2cc..31dacb392a6b 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -761,6 +761,9 @@ cd9660_pathconf(struct vop_pathconf_args *ap) /* NOTREACHED */ } +_Static_assert(sizeof(struct ifid) <= sizeof(struct fid), + "struct ifid must be no larger than struct fid"); + /* * Vnode pointer to File handle */ diff --git a/sys/fs/cd9660/iso.h b/sys/fs/cd9660/iso.h index bf98e75c42d9..b54f5f8e5cf4 100644 --- a/sys/fs/cd9660/iso.h +++ b/sys/fs/cd9660/iso.h @@ -269,7 +269,7 @@ struct ifid { u_short ifid_pad; cd_ino_t ifid_ino; long ifid_start; -}; +} __packed; #define VFSTOISOFS(mp) ((struct iso_mnt *)((mp)->mnt_data))