From nobody Sat Feb 7 20:04:38 2026 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) (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 E6F1B2F5467 for ; Fri, 12 Dec 2025 19:28:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.143.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765567730; cv=none; b=nZFCgcVfWSDBRRVXP9/Rs/nhKK2QFlhCU+gNUwssZtNHiLmYy/M5yfANtbRznj9+6mP0wD+96mF58m276hI8H+I8uTCN5ExTEUzJ83e/fzB0tyNrNCMJ9eE2l8fAogiWQaRw6mAhStgTuJQh50ADexdIx0B/VRhe22C4QfOBgZU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765567730; c=relaxed/simple; bh=3bFfhG5WM80bwgyGROT5iVh6Cb9LO/X7asyh7rpFwwI=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=cP0vK7Oc0s72vJJFGcRFJhjHC1QTdjFDiweoImMlo2ciAbS/OLxKSKOEmReGwQEVOYIeLFA0aviMl3kJkNyFLiCv9Wh2+XGVVWcxbJ5DiArw7rgEQJ5KVesvqH+dxp+EoLf6yepqJ8yLUm/Wwke+I7prOwKn6KGs33qn15L7LXg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=hpe.com; spf=pass smtp.mailfrom=hpe.com; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b=ot3JcjPs; arc=none smtp.client-ip=148.163.143.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=hpe.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hpe.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b="ot3JcjPs" Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BCGCcD91881390; Fri, 12 Dec 2025 18:53:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=cc :content-type:date:from:message-id:mime-version:subject:to; s= pps0720; bh=SoaAyr+dncHKF/N2wHm6Nw+Q5u7thvvcgHyZXsu/oAw=; b=ot3J cjPsboI7wSf6eAYApc/qKfs+QjJrtOlHtjhoRRtzWsgu7PhrvYHi9gBItlpVLdPa oGFKeTprbUYLNF+uXHRjGp5gxG+grIdk2nYMWpmGksFhTSiDNEXv0RqZo66WnKvH lbXl74i/tGB9qrleQtcjmUshz72tyASURzSuEaz1fee9m2X8ET1xZj1asko/A8To us6GKl1VG3tISAYF7PnmUY5omXbb94WiZhduuL57IKvnJuL8THYgaFqlsQzE89rM hqbpyoMfdKBvhnu0jTtISwsutP4s6WicK7AD0pSwxyjrawAMMZgs3VQzMlTFvmkZ UXjGxLkYXvDBwmgUSQ== Received: from p1lg14879.it.hpe.com (p1lg14879.it.hpe.com [16.230.97.200]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 4b0pc9sc4s-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 12 Dec 2025 18:53:44 +0000 (GMT) Received: from p1lg14886.dc01.its.hpecorp.net (unknown [10.119.18.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14879.it.hpe.com (Postfix) with ESMTPS id C801812EB5; Fri, 12 Dec 2025 18:53:42 +0000 (UTC) Received: from HPE-5CG20646DK.localdomain (unknown [16.231.227.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by p1lg14886.dc01.its.hpecorp.net (Postfix) with ESMTPS id BB53F800EB5; Fri, 12 Dec 2025 18:53:38 +0000 (UTC) Date: Fri, 12 Dec 2025 12:53:36 -0600 From: Kyle Meyer To: steve.wahl@hpe.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: justin.ernst@hpe.com, kyle.meyer@hpe.com, dimitri.sivanich@hpe.com, russ.anderson@hpe.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND] x86/platform/uv: Fix UBSAN array-index-out-of-bounds Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Proofpoint-ORIG-GUID: E-U8JXSl_9b5Ku0W8CERf9Z9cZM_cSRG X-Authority-Analysis: v=2.4 cv=WcQBqkhX c=1 sm=1 tr=0 ts=693c64b8 cx=c_pps a=5jkVtQsCUlC8zk5UhkBgHg==:117 a=5jkVtQsCUlC8zk5UhkBgHg==:17 a=kj9zAlcOel0A:10 a=wP3pNCr1ah4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=MvuuwTCpAAAA:8 a=SGYSIu6c0qZUy9TjlaIA:9 a=CjuIK1q_8ugA:10 a=phs4urI-Bf8A:10 X-Proofpoint-GUID: E-U8JXSl_9b5Ku0W8CERf9Z9cZM_cSRG X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjEyMDE1MSBTYWx0ZWRfXzzKeQvU3XiWJ wL3OSWgONCpCD53penpqGO2OUgTnHRziBuZgYUJRqI2zUoukJwjgHxjg+/N7zTIR1xtBax8ZOUU FiMk2hibAfz+CMC4W7QhpZIZeQfnUo0xfj6ogI+PtMJLXASRm0m6Pjq+pYQ5bQp/qJZibdzuLFP z2tCJYR6d++YUWyCJQuPwwRDGkmMfmsGgdqMR+ocvibRK9qx8csdQnxIx4N3mqGewt7l3i0kOtG In8IADADNE0JDr4nvHmzm3M8kjhDWw6vOUiifuclG5F6IjJkw+uUnyQ98C5ubPHtj5liFTAKbYy ViVvDmQ5cl+fnYX5Syf6oxoavHk68EMhSpsTKWVH8Em3cg6GaxktMYIALjuDUkaQVfjB771lzr1 Zzr1df2GlZo/rL2hebe5FhRAoQjsDQ== X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-12_05,2025-12-11_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 spamscore=0 bulkscore=0 clxscore=1011 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512120151 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When UBSAN is enabled, multiple array-index-out-of-bounds messages are printed: [ 0.000000] [ T0] UBSAN: array-index-out-of-bounds in arch/x86/kerne= l/apic/x2apic_uv_x.c:276:23 [ 0.000000] [ T0] index 1 is out of range for type ' [1]' ... [ 0.000000] [ T0] UBSAN: array-index-out-of-bounds in arch/x86/kerne= l/apic/x2apic_uv_x.c:277:32 [ 0.000000] [ T0] index 1 is out of range for type ' [1]' ... [ 0.000000] [ T0] UBSAN: array-index-out-of-bounds in arch/x86/kerne= l/apic/x2apic_uv_x.c:282:16 [ 0.000000] [ T0] index 1 is out of range for type ' [1]' ... [ 0.515850] [ T1] UBSAN: array-index-out-of-bounds in arch/x86/kerne= l/apic/x2apic_uv_x.c:1344:23 [ 0.519851] [ T1] index 1 is out of range for type ' [1]' ... [ 0.603850] [ T1] UBSAN: array-index-out-of-bounds in arch/x86/kerne= l/apic/x2apic_uv_x.c:1345:32 [ 0.607850] [ T1] index 1 is out of range for type ' [1]' ... [ 0.691850] [ T1] UBSAN: array-index-out-of-bounds in arch/x86/kerne= l/apic/x2apic_uv_x.c:1353:20 [ 0.695850] [ T1] index 1 is out of range for type ' [1]' One-element arrays have been deprecated [1]. Switch entry in struct uv_systab to a flexible array member to fix UBSAN array-index-out-of-bounds messages. [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-ele= ment-arrays Signed-off-by: Kyle Meyer --- sizeof(struct uv_systab) is passed to early_memremap() and ioremap(). The flexible array member is not accessed until the UV system table size is used to remap the entire UV system table, so changes to sizeof(struct uv_systab) have no impact. --- arch/x86/include/asm/uv/bios.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/uv/bios.h b/arch/x86/include/asm/uv/bios.h index 6989b824fd32..d0b62e255290 100644 --- a/arch/x86/include/asm/uv/bios.h +++ b/arch/x86/include/asm/uv/bios.h @@ -122,7 +122,7 @@ struct uv_systab { struct { u32 type:8; /* type of entry */ u32 offset:24; /* byte offset from struct start to entry */ - } entry[1]; /* additional entries follow */ + } entry[]; /* additional entries follow */ }; extern struct uv_systab *uv_systab; =20 --=20 2.52.0