Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp238344lqs; Thu, 13 Jun 2024 08:46:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVH/gOwZeWn1GhCz448X0ZR3XBLuDQ+TpZ3fz5/6LSSQLob3AVDX4JEJCchSb714zga474l2iXg+/tZoPSyeJzsFUazvQLs84kyRnQyTw== X-Google-Smtp-Source: AGHT+IH4Zmj+F6eZydH1N5VgxiWoM/VEr1lkiWmX6pZ4nhC7tJVstrbD/GQzoTgYah9AjKfqvONo X-Received: by 2002:a05:622a:347:b0:440:645a:a209 with SMTP id d75a77b69052e-4415ac4f840mr60266111cf.49.1718293606138; Thu, 13 Jun 2024 08:46:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718293606; cv=pass; d=google.com; s=arc-20160816; b=VGSaIbqTg/GkJLj9bPRLENsoGxDSF+M8QmR5e433vbindmXshlKoxG3BaUrJWySv0c I3Yl65n7YjstiPPdYKNO30hiPa3bEuUH0xZSIwPFNYnCfgdoNXZS2aVaGgQnmI1WaQlI h9tkw7xVrNbbw303EiJXA1H9976tmE76XDNdiuhhnkikx/+WtDs4ExWnOfZQAUH8VUj+ NWkExIgydaBu2jy1dTOUZ+qOoEg7ER588V2G1ux0URXlYn3NSFt+V5I2ySDDXmG0vMP9 jXDoJ7b/DEFC/otEFcg2cBaB6psXk/sL4PJPQptSX42qyjbGdWKqmU3XceS9GHf6CPPP T8yw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=lwqEGphQg9/N4AE+qTFRbf/COwqV90p8RxwOJfRaDvM=; fh=TQATEbdDZNcnk8L2eDP6eFL9HlexFaHIexhR1TH2IlY=; b=Uhlvxdy3XdDAqzlZHOHr0zuoiWM4vVzc3MB1nn+YL1RXuC35+SoxK6J7cWH1fApJTg rwLG4Dj4iCRTh8t0JrtklcbPWZzNcSXcCOCZBup65HoHXoyybMWThmzZgenQdg/D6fUu W1J9ZNzCeINsKXdemYDfaYQjXuWOKi/bi1yaYer19hUYZjgcdKX+8OTxDyXRNPHis2OP LC0pq/12IzMjc6az80+f6nbDRgY4XULLeljSF8MtIxFAgTzENO1qo7Gx7d5NMp1dx7zZ nQazgrzPoQOenEkryEunTzC9/hPhEYcm0Jh7y3exKv+e6sfctTPoyDjjFk4T5QcZEET0 5e6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=UNq2L3ci; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-213590-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-441f30f9d91si16090301cf.688.2024.06.13.08.46.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 08:46:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213590-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=UNq2L3ci; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-213590-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AD5F91C24577 for ; Thu, 13 Jun 2024 15:46:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 157421591E2; Thu, 13 Jun 2024 15:40:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="UNq2L3ci" 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 smtp.subspace.kernel.org (Postfix) with ESMTPS id C668C158844; Thu, 13 Jun 2024 15:40:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718293225; cv=none; b=nEH0URh/RfK+BxK1jMGJOdKmrbKwKX4ZHSPOKJ/1XzhlwlpdRT7zfZkbKd56lmYFFk4OUHTVJspF6w6CIaNnU9ySbT8I4UhS0Uj1gH0CrX7Aw2fpYt7/GHzAAim/zyXcaHgIA8LHDJCnVHHfaBc5fx3CGBHEs9EytNlfMv9WQD0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718293225; c=relaxed/simple; bh=d2/rW4z5JA+hWF6GGLxIeeVunzjSAZfwoQbx7SnQ6OE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PWyNidPmGDosjL35o5wiqfLYuS4404hh6L4zL5fbhVRkSmIWI+OFRSBlHaJ/mgkhbOU0OTXyZedtKDSnYtr7knvxqyRkPiyZPqSlnzlJQb6mg2QwW28owmPPjGJC5fkRrn3oqVBE7CN85/h+5WPiLnX563WqGy3WoMPR6m6qQ18= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=UNq2L3ci; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45DDPs1w029160; Thu, 13 Jun 2024 15:39:56 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=lwqEGphQg9/N4 AE+qTFRbf/COwqV90p8RxwOJfRaDvM=; b=UNq2L3ciAeXeg+Kl5XrEnosDMTAs8 Fo0GmDd0p2UK4sKNA+8i22Z8U/Dtg8kijuN9KTRbaw7Onv3/SzsxFjcX8m9szLB9 k2Djo/VBBYJIKWkLW8HNMFMz2b3mt/mhnRiTwtdqipTrQ+CjALv9hB9Da/8mVwSC ond/9p61WCawUt2YtMJPw3EW0SbA+5kxbGVdLvnSE3NyrNainusnb4tf5ycXcIWy 7qMIEUhdiGKj2xB5XJ+3lJgwZtP3+rKwTq2nT9lbIgkk4Z0uyDouP9RGbFq5zoNI apQbgPmsZ+J8hgHp+LPiNO59yOAMgMlkJ8Ouu7nMw/dY8imTQ5EE05BvA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yqq4rt37b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:56 +0000 (GMT) Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45DFdt6d026856; Thu, 13 Jun 2024 15:39:55 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yqq4rt377-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:55 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45DF54oG020086; Thu, 13 Jun 2024 15:39:54 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yn34nh0d0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:53 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45DFdl5E31982318 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2024 15:39:50 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BC8BB20063; Thu, 13 Jun 2024 15:39:47 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 49DC72005A; Thu, 13 Jun 2024 15:39:47 +0000 (GMT) Received: from black.boeblingen.de.ibm.com (unknown [9.155.200.166]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 13 Jun 2024 15:39:47 +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 v4 27/35] s390/ftrace: Unpoison ftrace_regs in kprobe_ftrace_handler() Date: Thu, 13 Jun 2024 17:34:29 +0200 Message-ID: <20240613153924.961511-28-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240613153924.961511-1-iii@linux.ibm.com> References: <20240613153924.961511-1-iii@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 2CzzALgI92z2xp9DoNxArLwRD-45DbUj X-Proofpoint-GUID: vaNzi9dxYUytn-myd3xb7t8cTOvep84K X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-13_08,2024-06-13_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 adultscore=0 spamscore=0 mlxscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406130109 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 Acked-by: Heiko Carstens 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 ddf2ee47cb87..0bd6adc40a34 100644 --- a/arch/s390/kernel/ftrace.c +++ b/arch/s390/kernel/ftrace.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -303,6 +304,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.45.1