Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5654474rdb; Wed, 13 Dec 2023 15:38:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/gi12sY4juA0aR4coscDOj3ZmOtE+uGRd6M+VOSaf2H3Mav7e/m+9zG8kz+BncuNh0znw X-Received: by 2002:a05:6a20:3d1c:b0:190:6ee:3e8a with SMTP id y28-20020a056a203d1c00b0019006ee3e8amr12252029pzi.74.1702510699403; Wed, 13 Dec 2023 15:38:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702510699; cv=none; d=google.com; s=arc-20160816; b=gwm9AO8Pv/yE3MJQYjCPQEyxAGMaw4ymQXXsWZVPq+TfcD5ANCJ6Lh5Hz1L75RS+gV 5Wh/zM36GuslCiY2pxyxws753b2OhJdfw67r36Nqxb6XXcCIWYyYoEPugBLZ1b6m0/dW 37B5dTGgfV9CP0vXmELICAkaRKF1GXUOseSo0pGavhSeYPZuQj0eCEOKhMqjK/DFgrUe aGAYSnJVZCC+8F248StupyudaLrZpiydB8281oCNsBI37LO5H5nD3OqyHw+X3V/4pwqx NH6wDC1kPn/gUsBGQox4iG9MKAoAxTmtMqA4+p8V/x9BB1CjKU5qS0i5QhW2Fqn2ArIM 0bNg== 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=yXd/QnBGUJdt/j+AbcYrFLYUstfppznpbRVZrbXz5bE=; fh=TQATEbdDZNcnk8L2eDP6eFL9HlexFaHIexhR1TH2IlY=; b=MlvyT8X6GYtJt5SwY04fXzi79YkBD64K07PpdW6E96iEhutILOYNAix03P7mxoC8I4 Z0PK/jNS1hSkvDF6SHkexQEUiEVf2w/Axv1aXXIISccxDEPxmOVJ+/qoC/tTsvbd0bKs hDgevFKQofLc4wShEWeYPAGIuuQisOI1e4VtEv+ODn0ur5wPOVg94hSkT+VIp0VOdRbj E0QWEYUFVP1nXq2B815XhWkD4vRLJrYhhKH7wIZQhMiuuXxgbBqKNNJ5A/5TM3YR4cFE uCeSKng1Re09VrwLJKKPVPYkrnOpJJRX48gxLLjN4k8xjDCJJQfwZKAIUSIGi7N69cOw GXTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=UQvBPDce; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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. [23.128.96.32]) by mx.google.com with ESMTPS id z12-20020a65610c000000b005c6b955fb87si10223341pgu.128.2023.12.13.15.38.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 15:38:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=UQvBPDce; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 E29D280320D5; Wed, 13 Dec 2023 15:38:15 -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 S1442959AbjLMXhv (ORCPT + 99 others); Wed, 13 Dec 2023 18:37:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442843AbjLMXhS (ORCPT ); Wed, 13 Dec 2023 18:37:18 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8727198; Wed, 13 Dec 2023 15:37:11 -0800 (PST) Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BDNHdSQ002591; Wed, 13 Dec 2023 23:36:55 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=yXd/QnBGUJdt/j+AbcYrFLYUstfppznpbRVZrbXz5bE=; b=UQvBPDcea3puQkUDr9wt0UBQ8RXcT08t8A8hO5Qp4gzH7DQ7A4kSdvnrddpVEdDm+CQd 13ncLmH6hbeGKdy3MfTA22PXCXXw3GqugwRdjqeqvT0LVktqosG6EsOqFJLyyGf0v5LA Mnvm/hgauslQOllRTBIjMCJQjfEwWe1aE7JLUHnoqpq3Rh0MPWnJkOfbJGrx6Ww8D+cE zWAnS2D49lZHCaqaz0ec2INscaXR770yaUnBXT0CvrmtcytX+pkZZkDu4QF+om51BSPO 5L4QSCCAvF8BjIQwm79jmcZvGfyyjBZH+c/TMxIWYcF46MAfs2VV6mM+hvlOc1aEB+jU kQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uyp5cgb9n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:55 +0000 Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BDNKIc6008783; Wed, 13 Dec 2023 23:36:54 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 3uyp5cgb9b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:54 +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 3BDM1JcH012599; Wed, 13 Dec 2023 23:36:53 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uw3jp4nat-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:53 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BDNaoQW3801838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Dec 2023 23:36:50 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 369B720040; Wed, 13 Dec 2023 23:36:50 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C2CFF20043; Wed, 13 Dec 2023 23:36:48 +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:48 +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 26/34] s390/ftrace: Unpoison ftrace_regs in kprobe_ftrace_handler() Date: Thu, 14 Dec 2023 00:24:46 +0100 Message-ID: <20231213233605.661251-27-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-ORIG-GUID: ACOAldVmTa-efSmw5zkfDa-w6Y17kTOe X-Proofpoint-GUID: 5ND1Qb23N4iVSC6c3VM8EXMJso6wjXqM 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 impostorscore=0 mlxscore=0 spamscore=0 malwarescore=0 mlxlogscore=990 bulkscore=0 suspectscore=0 phishscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312130167 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:38:16 -0800 (PST) s390 uses assembly code to initialize ftrace_regs and call kprobe_ftrace_handler(). Therefore, from the KMSAN's point of view, ftrace_regs is poisoned on kprobe_ftrace_handler() entry. This causes KMSAN warnings when running the ftrace testsuite. Fix by trusting the assembly code and always unpoisoning ftrace_regs in kprobe_ftrace_handler(). Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/kernel/ftrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c index c46381ea04ec..3cc5e6d011a9 100644 --- a/arch/s390/kernel/ftrace.c +++ b/arch/s390/kernel/ftrace.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -300,6 +301,7 @@ void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, if (bit < 0) return; + kmsan_unpoison_memory(fregs, sizeof(*fregs)); regs = ftrace_get_regs(fregs); p = get_kprobe((kprobe_opcode_t *)ip); if (!regs || unlikely(!p) || kprobe_disabled(p)) -- 2.43.0