From patchwork Fri Jun 21 11:35:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707348 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8FF4C27C4F for ; Fri, 21 Jun 2024 11:38:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE8B28D0165; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C4A1D8D0164; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E09B8D0165; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 4D6B78D0164 for ; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 01A4380D93 for ; Fri, 21 Jun 2024 11:37:47 +0000 (UTC) X-FDA: 82254696216.28.BC183A4 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf20.hostedemail.com (Postfix) with ESMTP id B81531C0005 for ; Fri, 21 Jun 2024 11:37:45 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=s5vlhwXl; spf=pass (imf20.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718969860; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7JeBzaeHcq491tpoSsSSp7r/Korv/EUFDTbEVwfZL58=; b=dSzIFcAphSrvZOg4GlmalP/f+x2Zy4sRdbUjzd9bTICThqGSsA0nKzLPstlEN0u98iJZTn cTY+iP2wgOSfaTI63TFgdzM8CgBfOIF0wOPAmwXdb10HE0sn6k0Em1DSoU2Uc3YkFGJQEk RMOyKmjwhP2x0ImWPgboSEEzh5PXo6Q= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=s5vlhwXl; spf=pass (imf20.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969860; a=rsa-sha256; cv=none; b=ZFV51PD3r6h9v+l/VCbexJcaz1f7xiVrtCVCe0ojX2DJoC/xH8Ypc6yS0zNdisqqCnKswy 4GkLTKi+qSyBWT3jPYcTgq0o1/Tto2grdp/x0W2an8d/e89v5VntysjKWDiaLEs/WbdZbY +FZ1palB8CZ8BGtSmfnMAMZrX4FwOx0= Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBSf2G028853; Fri, 21 Jun 2024 11:37:39 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=7JeBzaeHcq491 tpoSsSSp7r/Korv/EUFDTbEVwfZL58=; b=s5vlhwXl9wcRJ78l5AoKPLD1xUoE2 BgOfZopVqX8JnGi6cHhbjVxOau3T16ESVnMOumd6KcT+Rqq2dDW8n9G5BYz4smcv +eL7G52p7Q7/YJJEKKQgjsQlOpKjnxplqXDNPK4kg8/WG5n0iFygfz2sVrIOTkB+ 5TKUTJua/59ZE8iy1kaFGn7+o/J2snkLIV3J0Tq7nTA+aMUL1f1a/Av6VAoi/i8q 3v44u7GbABBmXUJnp0iUOoNhNuLUeJ6Al9f3qn1qJzghV48+RoJuIlWaHhksy5qS zLy2wWuW2n9ocfZEC0kP6O7pX4JHUp+6KY/vnaopls5AkDS7H4cGF2n5A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw8p080nb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:39 +0000 (GMT) Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbGeE008753; Fri, 21 Jun 2024 11:37:38 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw8p080n7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:38 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L95u7T030896; Fri, 21 Jun 2024 11:37:37 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrssxvc1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:36 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbVT348038282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:33 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2E31C2004D; Fri, 21 Jun 2024 11:37:31 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 97F572006E; Fri, 21 Jun 2024 11:37:30 +0000 (GMT) Received: from black.boeblingen.de.ibm.com (unknown [9.155.200.166]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 21 Jun 2024 11:37:30 +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 v7 36/38] s390/unwind: Disable KMSAN checks Date: Fri, 21 Jun 2024 13:35:20 +0200 Message-ID: <20240621113706.315500-37-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240621113706.315500-1-iii@linux.ibm.com> References: <20240621113706.315500-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: zSzxBnNiRLG-D4DcHEnxIzI8xLfICJN1 X-Proofpoint-ORIG-GUID: PuVSxHAzakVrVjiND7EYgdN9hTCqZmCa 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-21_04,2024-06-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 suspectscore=0 priorityscore=1501 spamscore=0 malwarescore=0 clxscore=1015 impostorscore=0 phishscore=0 mlxlogscore=896 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: B81531C0005 X-Stat-Signature: jpzir7hr7oowz5iih1coss3o36duqmrn X-Rspam-User: X-HE-Tag: 1718969865-690893 X-HE-Meta: U2FsdGVkX19ILSx/p32VlRLfPv2rpxbd1qKBTL7N5MVGasqYcIJIqN0TjHgHb2YuDaONAjjaSUCyPoBwSlo/uhMeuTpp4krnhDY/Ry4CVZO/cI8czKExzdrd5qa3tum+/qFRYrI9DrtlxSfCcqHGFONiUy7xg75I/SEH3EyQJPXSgh6PSDQRtkx1AhVHcbkIf0PmrxTrt8pC1YX8/v+Sh9KVg77KOstWYKRLyzXWSl3/gqD0Ehc/1+0OXgzIH91PuwfhIe8TiX9ItkKXjRwZF5om3bNTDe1czElykHiEv2LDrdazvVknaafVqDQ0RjsYgYCFN+YocTd/agPavfjK/81LS37zMnajs+UGtwZsutWUBBfyT3avXfFFqerSAZZPLDc5fAnG9I1pI5cThGnZ8QUz9Z1Ue5XStksjE2dj6jDueDBQJQpM/SCjIv/ZnYLmaUHIDxVePf2tNp+8AObc8E7gGKeK/xTPzbQCMhimaGIs6llTx85l18Fa4K8SanKPp1ZsnqmCf7nOZjf5xut1OvWHWPfCdoEABxjNSjENGeph41qSixXpalx/LU0cdBjjIdQptMVqozufk2RKob2+FfJ0OVkQzmq7WYmi9nF6iJP1Sb8Tbr7Ibm4qtp5TK30i3jItl2vwTJAyhhCMJEHgnAHZIyE1t7F8VASdnaPFbolt+m8h4pV0DpzKZI2xhn/EsiMgXikMmw6jt2m2ztcCOqtL26kt1tLa2vgM1e32mPNst93gp0Ls++IZqaqHYmc+Dgus/+6ITjC3qKXBaGcqru9U0HD0FCXi6AA6lr+mHyEfKod0+WNMuMQN1WsuwmAavkztq867M2jOdu6thmxQKH1TQcYjxWIIFJfuyI/w463Q3no4wxfYTuyhw+AZV6zxmxwas2xyyIE9z1xHNFQwo84VBTkSS+LQTqvMQA8bowqAJ6mrGxJvaXjJ2sZViD3Cu9uuZsY4c+JbunS8MLU 5xCZlepp k2xmhWRqoGSE1S+mf460qnrmSjSMDJzz3leZE5Jmdml8Rh7gZXYeuikTgm7h+Co9GRUKohyKR42my5+i5c14yDM8sA+PBCJnepZlM1NoKj2qRufeT1EJzv22qRSa4BjSp0ExRl0/FNMJAUbRgZNHqpsCrHnOrnCO7bPdaE5Isq2kIfnEyvrnA2cp7N9cLu1ga96vnoLqaxhtzjjFS91q4byxcXZw8dzGEji7E+RmxxIr3npuLBm8nhGIubEdJuqsbC+1kFDyiGSyVeZCGces1aGQVHLP/F8WdxpeyYzU2dEKsCxiNx7nL76NArRqxGFuNxZtK X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The unwind code can read uninitialized frames. Furthermore, even in the good case, KMSAN does not emit shadow for backchains. Therefore disable it for the unwinding functions. Reviewed-by: Alexander Potapenko Acked-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich --- arch/s390/kernel/unwind_bc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/s390/kernel/unwind_bc.c b/arch/s390/kernel/unwind_bc.c index 0ece156fdd7c..cd44be2b6ce8 100644 --- a/arch/s390/kernel/unwind_bc.c +++ b/arch/s390/kernel/unwind_bc.c @@ -49,6 +49,8 @@ static inline bool is_final_pt_regs(struct unwind_state *state, READ_ONCE_NOCHECK(regs->psw.mask) & PSW_MASK_PSTATE; } +/* Avoid KMSAN false positives from touching uninitialized frames. */ +__no_kmsan_checks bool unwind_next_frame(struct unwind_state *state) { struct stack_info *info = &state->stack_info; @@ -118,6 +120,8 @@ bool unwind_next_frame(struct unwind_state *state) } EXPORT_SYMBOL_GPL(unwind_next_frame); +/* Avoid KMSAN false positives from touching uninitialized frames. */ +__no_kmsan_checks void __unwind_start(struct unwind_state *state, struct task_struct *task, struct pt_regs *regs, unsigned long first_frame) {