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 6A5DE1DF73C; Tue, 29 Apr 2025 17:10:19 +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=1745946619; cv=none; b=EVz/8PCir2bxY3Vvytbord97Fv+47DLgPnQjIDp69FZtmaczMNHN1MqYVbVs4mocHYefXN7LHVv6T42k+rwIkenCRfIF/dfdB+ekbI3GPUPeog6xJvPKUhx/FdDDg4lPp9JvB3HkiHFrhgsPt8y7DdYm+1LR+pzw4r8Bih+5x0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745946619; c=relaxed/simple; bh=ujXrskDNZHgj626E99wTkIz+7xP0UBqFdz7sY1XuAGk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DyDbxpdTe0hMt6YaLRxq2vOHPgLxrYRUmPMneGnZhEmRN7bNt/TKacN4K0UVZdOuaeq50TeGExfPyAG+82pEju46H1H8A1QOwtQDy8SSi0aiDUfGUKLt3RJAgsr0cJz6QvNcReB8e7hQTjtEOu8ZgMlE99LnpRt3Pv5tGM9/O38= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oqEEudFz; 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="oqEEudFz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE9D2C4CEE3; Tue, 29 Apr 2025 17:10:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1745946619; bh=ujXrskDNZHgj626E99wTkIz+7xP0UBqFdz7sY1XuAGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oqEEudFz3qDRdkTCuQkShg6i9f9D0YI5z+w5aWy4xD10KCEg/KmhN9YDDV3myyCoI 3Y0Jh+R/eUM+PAoSoKiN/avGb+1SCxhV0JPCf06rcpiQJi635OCOjSr4coHqu2YCnh KIRzFm/1tbfk0XZAhlg3/VoXrD13nqQLr0lEvE00= 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 5.10 015/286] xen/mcelog: Add __nonstring annotations for unterminated strings Date: Tue, 29 Apr 2025 18:38:39 +0200 Message-ID: <20250429161108.478251295@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250429161107.848008295@linuxfoundation.org> References: <20250429161107.848008295@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-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 7483a78d24251..20a3b320d1a58 100644 --- a/include/xen/interface/xen-mca.h +++ b/include/xen/interface/xen-mca.h @@ -371,7 +371,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