From patchwork Thu Dec 14 05:55:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Miehlbradt X-Patchwork-Id: 1875977 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=H6Vi0Q4u; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SrMCk6M56z23nF for ; Thu, 14 Dec 2023 17:00:50 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=H6Vi0Q4u; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4SrMCk596Gz3vc3 for ; Thu, 14 Dec 2023 17:00:50 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=H6Vi0Q4u; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=nicholas@linux.ibm.com; receiver=lists.ozlabs.org) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4SrM6w27lMz3bPV for ; Thu, 14 Dec 2023 16:56:40 +1100 (AEDT) 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 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 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 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: iii@linux.ibm.com, linux-kernel@vger.kernel.org, Nicholas Miehlbradt , linux-mm@kvack.org, kasan-dev@googlegroups.com, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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/asm/interrupt.h index a4196ab1d016..a9bb09633689 100644 --- a/arch/powerpc/include/asm/interrupt.h +++ b/arch/powerpc/include/asm/interrupt.h @@ -68,6 +68,7 @@ #include #include +#include #include #include #include @@ -170,6 +171,7 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs) __hard_RI_enable(); } /* Enable MSR[RI] early, to support kernel SLB and hash faults */ + kmsan_unpoison_entry_regs(regs); #endif 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 #include #include @@ -117,6 +118,7 @@ static __no_kcsan void __replay_soft_interrupts(void) local_paca->irq_happened |= PACA_IRQ_REPLAYING; ppc_save_regs(®s); + kmsan_unpoison_entry_regs(®s); regs.softe = IRQS_ENABLED; regs.msr |= MSR_EE;