From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19B8A254AF0; Thu, 17 Apr 2025 18:41:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744915273; cv=none; b=Tpa0Hq04gKuBL5kiUSaB08P1HSpDzVNQv0vkg/42gLv/1Fizb7IiWMuLnY9aX2zdncpucEgqOWymbV72WCv/LSLvfucZb3nVG1SSHA6E16u8DU2x+0t2T80RTMxrudQ18hIos0aLJfpr0ZrcRJxiiSout0i4eu4aHyjc7cypZM8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744915273; c=relaxed/simple; bh=rKoW00D4NBEEOYkxUCE4vnUn5yxrioEpk/o3/TB3uAo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iBaRfI2MOKJJYRelAmNFayCVhcV0WW3MF/l+8n3YdObZXDp7Z3jWjp+77WUKwN+YIiwMYHuVTfgrHDSCt+4kFppyg/O7KNzCIRYDEgr1RFKEA07tItR4z9CiFtR4/rizXuQn8WYIE9cWIFvQNxS6DXQT9oVkNmzEkkjqErDx6ec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=awdEebjj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="awdEebjj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A966C4CEE4; Thu, 17 Apr 2025 18:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744915273; bh=rKoW00D4NBEEOYkxUCE4vnUn5yxrioEpk/o3/TB3uAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=awdEebjjlmpEsa6sp62s+7Q3BzcI8BCogxDTARxRHcWlPwT3wddQ/1gkAAkp/5X8C 0nA2MYbqrJ7ylG9PXuo9Ii32LfOZ8FgslzklSs7cz4/JCfQAMbsR/LB5qlvKnslucY qID6CDLwOdWLNy6fKVdrRpReX8bcldTwBLFeHaVA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , xen-devel@lists.xenproject.org, Kees Cook , Sasha Levin Subject: [PATCH 6.12 057/393] xen/mcelog: Add __nonstring annotations for unterminated strings Date: Thu, 17 Apr 2025 19:47:46 +0200 Message-ID: <20250417175109.882985709@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250417175107.546547190@linuxfoundation.org> References: <20250417175107.546547190@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kees Cook [ Upstream commit 1c3dfc7c6b0f551fdca3f7c1f1e4c73be8adb17d ] When a character array without a terminating NUL character has a static initializer, GCC 15's -Wunterminated-string-initialization will only warn if the array lacks the "nonstring" attribute[1]. Mark the arrays with __nonstring to and correctly identify the char array as "not a C string" and thereby eliminate the warning. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178 [1] Cc: Juergen Gross Cc: Stefano Stabellini Cc: Oleksandr Tyshchenko Cc: xen-devel@lists.xenproject.org Signed-off-by: Kees Cook Acked-by: Juergen Gross Message-ID: <20250310222234.work.473-kees@kernel.org> Signed-off-by: Juergen Gross Signed-off-by: Sasha Levin --- include/xen/interface/xen-mca.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/xen/interface/xen-mca.h b/include/xen/interface/xen-mca.h index 464aa6b3a5f92..1c9afbe8cc260 100644 --- a/include/xen/interface/xen-mca.h +++ b/include/xen/interface/xen-mca.h @@ -372,7 +372,7 @@ struct xen_mce { #define XEN_MCE_LOG_LEN 32 struct xen_mce_log { - char signature[12]; /* "MACHINECHECK" */ + char signature[12] __nonstring; /* "MACHINECHECK" */ unsigned len; /* = XEN_MCE_LOG_LEN */ unsigned next; unsigned flags; -- 2.39.5