From nobody Sun Dec 28 02:43:32 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A478C4332F for ; Thu, 14 Dec 2023 05:56:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235288AbjLNF4p (ORCPT ); Thu, 14 Dec 2023 00:56:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235192AbjLNF4f (ORCPT ); Thu, 14 Dec 2023 00:56:35 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D104610D for ; Wed, 13 Dec 2023 21:56:40 -0800 (PST) Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BE5a2AN017874; Thu, 14 Dec 2023 05:56:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=JH7THuNQc9cqEmJHzHndMkqRs+bt6nd5xJ0k6Nbi28M=; b=H6Vi0Q4usYMkIqkUo24VvSEVx1cldTN8bVLS7Fr9K9/CjsNqNAecFNEVRpCWuSYA1OGY YQuMrooCHAJ5aIBRdFr+jcPvy5anB1FNlx1OUOKKV4XnREzUnInmWJpge7eAbXOSMn2/ H+MQtSSYKXgBJRa6ilw6al0C5779QUq+LtLJcVVuvktZ8aWT+NLLKnEMSwTknfAp6vZO /WwTZpgwIbK/XoR87LxmawbMyEjZWa3vvHdYNnJ0t25MICVuZgdHZRzc/EOD/w5szyd4 wypwz2Ae903gB8Sjhs4jTNL9vwMg3t+uDggEu5iDOSXhPqsSxj1kffmjP7kF7Uj/auJW nA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uypke6ev0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Dec 2023 05:56:28 +0000 Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BE5tX92001374; Thu, 14 Dec 2023 05:56:27 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uypke6eu4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Dec 2023 05:56:27 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3BE3UgCH012585; Thu, 14 Dec 2023 05:56:26 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uw3jp6eg0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Dec 2023 05:56:26 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BE5uOkC22151736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Dec 2023 05:56:24 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3AD7C2004D; Thu, 14 Dec 2023 05:56:24 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B30AD20040; Thu, 14 Dec 2023 05:56:23 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 14 Dec 2023 05:56:23 +0000 (GMT) Received: from nicholasmvm.. (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 8B77D606E8; Thu, 14 Dec 2023 16:56:19 +1100 (AEDT) From: Nicholas Miehlbradt To: glider@google.com, elver@google.com, dvyukov@google.com, akpm@linux-foundation.org, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu Cc: linux-mm@kvack.org, kasan-dev@googlegroups.com, iii@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Nicholas Miehlbradt Subject: [PATCH 08/13] powerpc: Unpoison pt_regs Date: Thu, 14 Dec 2023 05:55:34 +0000 Message-Id: <20231214055539.9420-9-nicholas@linux.ibm.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231214055539.9420-1-nicholas@linux.ibm.com> References: <20231214055539.9420-1-nicholas@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 2HFK1yGgvChNjyDg91ZhydhLex1GS7Qz X-Proofpoint-ORIG-GUID: lBPTZrRlZWZzO3fKbGz6ydwaSFhSPO_j X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-14_02,2023-12-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 clxscore=1015 malwarescore=0 bulkscore=0 mlxlogscore=484 priorityscore=1501 suspectscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312140035 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" pt_regs is initialized ppc_save_regs which is implemented in assembly and therefore does not mark the struct as initialized. Unpoison it so that it will not generate false positives. Signed-off-by: Nicholas Miehlbradt --- arch/powerpc/include/asm/interrupt.h | 2 ++ arch/powerpc/kernel/irq_64.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/as= m/interrupt.h index a4196ab1d016..a9bb09633689 100644 --- a/arch/powerpc/include/asm/interrupt.h +++ b/arch/powerpc/include/asm/interrupt.h @@ -68,6 +68,7 @@ =20 #include #include +#include #include #include #include @@ -170,6 +171,7 @@ static inline void interrupt_enter_prepare(struct pt_re= gs *regs) __hard_RI_enable(); } /* Enable MSR[RI] early, to support kernel SLB and hash faults */ + kmsan_unpoison_entry_regs(regs); #endif =20 if (!arch_irq_disabled_regs(regs)) diff --git a/arch/powerpc/kernel/irq_64.c b/arch/powerpc/kernel/irq_64.c index 938e66829eae..3d441f1b8c49 100644 --- a/arch/powerpc/kernel/irq_64.c +++ b/arch/powerpc/kernel/irq_64.c @@ -45,6 +45,7 @@ #include #include #include +#include =20 #include #include @@ -117,6 +118,7 @@ static __no_kcsan void __replay_soft_interrupts(void) local_paca->irq_happened |=3D PACA_IRQ_REPLAYING; =20 ppc_save_regs(®s); + kmsan_unpoison_entry_regs(®s); regs.softe =3D IRQS_ENABLED; regs.msr |=3D MSR_EE; =20 --=20 2.40.1