Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5653830rdb; Wed, 13 Dec 2023 15:36:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcNRM8zTeGQuHL5aHQYXKRjK+wbxeEzcjOTfeWpArhAkTd2VGJbtqhcpu/KEwAKK8GFn9z X-Received: by 2002:a05:6a00:2301:b0:6ce:f81c:a436 with SMTP id h1-20020a056a00230100b006cef81ca436mr9579392pfh.21.1702510606758; Wed, 13 Dec 2023 15:36:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702510606; cv=none; d=google.com; s=arc-20160816; b=EHfjE7WiYJXQhy9ypppJyzTcZ7kNqJx8XK32HV97Fbty7ml/p3VfutYEUpHMtaBd3c wkfIlvMyQH4SoN0986Ey9FzkGscQtHy7pK0MliVHR+6OxkWNSBJJkA9y7yTdiegfAy8r PUXEvHKVi0RcFjmnKNUcXvo8oD94QAWJPbiH4+NXNGwG6S+OMnmlL60GfL2W33gQHds5 SH7xx5j9b9tbq2CBIAejUfXWV0gY1fn5+QwXgCRGVpWvqj4CejRvk3zlZmPZ2PaDX3jX Vo6Pp/Egj8TaVAR6PzC6YzPFUdqDkPL9miMwpNxetmYyxmWpzHb+MpM44yBYPsOivkXJ fSYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HCJ4ovbZnIIhG/tz7ek6pM+enuYe8MKDEM9fD4TOUak=; fh=TQATEbdDZNcnk8L2eDP6eFL9HlexFaHIexhR1TH2IlY=; b=P0T1xVegRMq3YeihWBjvry5QvcrLwAax/JWY+8EGwckAsEZylTGP4DcFLoYp9A+ofP oyFUUqrArKMIfK2CMgqYr+QeYRyfrlJaR83ax/O3ES06t9nyZ5OGPqA6aMd3m4Ewi9gC CpLL7pABSIu4ly5lWn8RUuP6NXLN5syWT2u64RuETf2ZYP/y4QAZh0i/W5+VpCAh2iyq K6ZiSlN2npQNJWDvUsXg+Jna5wrKYMFYCvT8ZrRj4P17GS1idIp4WquFVVUulDh7hMer CK/irOYQYQnJyOqlYahIJNsnLm7qmluu97jvfIqppViyym4fT1Cbngj3tHHtuSuNPps+ +2eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=K18a8ymh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id o16-20020a056a00215000b006ce4207c516si10145881pfk.388.2023.12.13.15.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 15:36:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=K18a8ymh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 651998033DE3; Wed, 13 Dec 2023 15:36:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230050AbjLMXgb (ORCPT + 99 others); Wed, 13 Dec 2023 18:36:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbjLMXg3 (ORCPT ); Wed, 13 Dec 2023 18:36:29 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA681DD; Wed, 13 Dec 2023 15:36:35 -0800 (PST) Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BDMNOxK009329; Wed, 13 Dec 2023 23:36:16 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=HCJ4ovbZnIIhG/tz7ek6pM+enuYe8MKDEM9fD4TOUak=; b=K18a8ymhua5yCPu8uJrOswvViNqKfMR8+6hF0wkFlRekc25ZLI3drA8mJSn8cb3/btq9 QdE3huxKShDrnljdnT59EL+T6fRR3Hw/t5BnoLpK1ih57683jgHbtZ+Z40Id1QL1/xQf m9G9cC7YvR7oOB3sNnUZZnNDZHbf1FWaTtIsO9xK52y6uHgYjzIuSX6L/oulAmCWvs0n 260KcBtlSa4mak4YbglgmS4IrzdLU1T4OBZ5Ifv44TzsDA/A4pHIWd/o21qLcT/N/Koe dWpN1sW6808GKBb9M/j4BRTbdjDwyTbAQ5s7O1cfix4ZXV1UDUckRn5O1ulvX7aV9/YI PQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uynbt1crg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:16 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BDNNrDs011977; Wed, 13 Dec 2023 23:36:15 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uynbt1cqt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:15 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3BDKnidd008455; Wed, 13 Dec 2023 23:36:14 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3uw2jtmvjg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:14 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BDNaBEJ45220106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Dec 2023 23:36:11 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9C28020043; Wed, 13 Dec 2023 23:36:11 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3484320040; Wed, 13 Dec 2023 23:36:10 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.171.70.156]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 13 Dec 2023 23:36:10 +0000 (GMT) From: Ilya Leoshkevich To: Alexander Gordeev , Alexander Potapenko , Andrew Morton , Christoph Lameter , David Rientjes , Heiko Carstens , Joonsoo Kim , Marco Elver , Masami Hiramatsu , Pekka Enberg , Steven Rostedt , Vasily Gorbik , Vlastimil Babka Cc: Christian Borntraeger , Dmitry Vyukov , Hyeonggon Yoo <42.hyeyoo@gmail.com>, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Mark Rutland , Roman Gushchin , Sven Schnelle , Ilya Leoshkevich Subject: [PATCH v3 01/34] ftrace: Unpoison ftrace_regs in ftrace_ops_list_func() Date: Thu, 14 Dec 2023 00:24:21 +0100 Message-ID: <20231213233605.661251-2-iii@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231213233605.661251-1-iii@linux.ibm.com> References: <20231213233605.661251-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: vwgPzb35f7_0sFL9c7WaIyD4dFBVqbRG X-Proofpoint-ORIG-GUID: DHoU4-V1fZhM-XryCwlBGJOxj1RlRN2I 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-13_14,2023-12-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 clxscore=1015 bulkscore=0 mlxscore=0 spamscore=0 suspectscore=0 impostorscore=0 mlxlogscore=999 phishscore=0 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312130166 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 15:36:44 -0800 (PST) Architectures use assembly code to initialize ftrace_regs and call ftrace_ops_list_func(). Therefore, from the KMSAN's point of view, ftrace_regs is poisoned on ftrace_ops_list_func entry(). This causes KMSAN warnings when running the ftrace testsuite. Fix by trusting the architecture-specific assembly code and always unpoisoning ftrace_regs in ftrace_ops_list_func. Acked-by: Steven Rostedt (Google) Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- kernel/trace/ftrace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 8de8bec5f366..dfb8b26966aa 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -7399,6 +7399,7 @@ __ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip, void arch_ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip, struct ftrace_ops *op, struct ftrace_regs *fregs) { + kmsan_unpoison_memory(fregs, sizeof(*fregs)); __ftrace_ops_list_func(ip, parent_ip, NULL, fregs); } #else -- 2.43.0