From nobody Fri Dec 13 01:44:10 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 4Y8XF64qY9z5h1vF; Fri, 13 Dec 2024 01:44:10 +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 4Y8XF62gPHz4k2C; Fri, 13 Dec 2024 01:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734054250; 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=lhlvP8H880S/q94osCbPHjVxRkof1GkdTHIO+sqAJM8=; b=dOUARolIA5q2EhG11wnxQxLTVEtWFNxgE1EJFR597sgFfVc9SxgIfwsBCW74ZEJbwpkNdC ogBh8jXnOwjJNN6g/IPCaGzuDqK+hae0zV6BDSwJ5QyeXW0NvFaMgG189QIW0vUmrODQKx j/ax7VAL84thlEvxlbm6XeJUaoAxJrQisbO4EYbt3tLzQkaSYt60BbIy0uYJ9SFk2hlNkm YU7K9o0NdOoh8bzrJn6g0W+dTQFLLbjNsrHCimf9BnDQlKMOJUFK1Epxz8DtiedYycVRhG dltIGBI7wsY1NgKEPFbugjHobA4K2SicmEBt9uav/VarJ2qe21c+pEPTW+I2JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734054250; 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=lhlvP8H880S/q94osCbPHjVxRkof1GkdTHIO+sqAJM8=; b=NAzaH3zhHEE9TPVkoyELTpgrt6oPsqMm2n8THcd2gR3CUz0uAGPnm+8rSrhRVwtu3UPYSv omp7CJnuiiZ7spdBXSxGZZmsGRwKUI7QXM6ZPAxGC5hMnx5ozdDlECa/1Wqs955Jdac55s O3vLLW7OzRifZEq2ONKT1RB9Lnssw4nJhdDXS5WaJDsKza8mozrPTj2RuZ02yj7diTCksf NfE3EGe9iNMY7QDcdaN+cOthGgkEhnpNgwWFdSWZ1KPK/q8LZdssvDj4FFMmSzQQO2yz8I b5+D0r8mzfPzaLIa8OzvFg9NMMqUqS6AsJDf0e/Rw2F52pg7hVWwPshUxLtMlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734054250; a=rsa-sha256; cv=none; b=tc5YJ52T9G5sRzODJxP5CH7HTRiKUooPLfTGeBT1JTHTNipy8W5tq3ept3wUdPza77kpyU J+Wt2a0uiGWXhbHJA8Xwuo39wtdzWO0t6ljoIvbiisiE8KG6ppk0cyW31LNMCQBmhasKZo FhooNWbJ+B/tcF7J5ITMAgPFaUI+KFY5gC0TmZ1adWat3zwrHSejga/4LB+nuuGbf6t28j Lb7yj45rmuAxHwaIx3ecJp+HIxR7ye+51Zri9E33VX/xf11lfN1Wi5ULc6uyPaY1VEREFZ 863WikAOONLIIfX3i0K5T8nRh4/TBy0GwVL0hTRdO1UWT3pup1JzgmBvcnUTzQ== 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 4Y8XF62Hf8zH9x; Fri, 13 Dec 2024 01:44:10 +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 4BD1iAM7034096; Fri, 13 Dec 2024 01:44:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BD1iApp034093; Fri, 13 Dec 2024 01:44:10 GMT (envelope-from git) Date: Fri, 13 Dec 2024 01:44:10 GMT Message-Id: <202412130144.4BD1iApp034093@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: cd597b4bb194 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: cd597b4bb194f7a0bd756b5299b40ad3607b1baf Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cd597b4bb194f7a0bd756b5299b40ad3607b1baf commit cd597b4bb194f7a0bd756b5299b40ad3607b1baf Author: Mark Johnston AuthorDate: 2024-12-06 02:03:59 +0000 Commit: Mark Johnston CommitDate: 2024-12-13 01:39:46 +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 9598ecdd7712..60b33fa9a493 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -826,6 +826,9 @@ cd9660_pathconf(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))