From patchwork Fri Jun 21 11:34:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707326 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 062B3C2BBCA for ; Fri, 21 Jun 2024 11:37:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F189A6B0110; Fri, 21 Jun 2024 07:37:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EBFD28D0157; Fri, 21 Jun 2024 07:37:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C22B86B0113; Fri, 21 Jun 2024 07:37:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 75E0A6B0111 for ; Fri, 21 Jun 2024 07:37:30 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2CEF9160D9A for ; Fri, 21 Jun 2024 11:37:30 +0000 (UTC) X-FDA: 82254695460.17.B60360E Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf18.hostedemail.com (Postfix) with ESMTP id 46BF61C0011 for ; Fri, 21 Jun 2024 11:37:26 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=TmuWzqBj; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf18.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969840; a=rsa-sha256; cv=none; b=CAeNtuuhUZu/tlK82d5VbHqUdgoIUlon1jY8Qv96ylpiSDkj6VAicdesCmXtXfmEGmLsjP nGfmFfvoV6Lj39e4W+/UxcJzlgCwdIdPsgbWnshBs1s8ZUuM6hL5UuG4CgIt4hQM7LUIzj 7BTiuPBSCi9v8Z7hLAF6kAMrwvu61ss= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=TmuWzqBj; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf18.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718969840; 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=v73BMs0EqfMCwxJniJdo3jdaknlggr5A1qJ50X9w6PM=; b=1jtS7H6gjbGKjabEvE9MdqxtpOiUyo8LV5uBCWHwZgTxtkjD4Rb8/oZy/OMkB4DA26F5sd W0YILVCDUQ1f+8bvOTmIaYKuZ7ZplZqCVi5aFLyFi8IaXKnXKouZ6PV0LtV2BNMCArqExU 0H0DkqgqshTaH65j6UtChC+ik4Rl/rg= Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45L9vTqn003912; Fri, 21 Jun 2024 11:37:18 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=v73BMs0EqfMCw xJniJdo3jdaknlggr5A1qJ50X9w6PM=; b=TmuWzqBjxXu+yhewQzmvVT1ExN5fn YnQ2LW0HgiqqKwtBUnyRqOX0dY6a8+UmSJ7hjoq78KAhxl0kn0BaB1VjLrjEYlpL lBXpQ0Bo7R8Q94erE9yy1KqlovSY/AmlwqUGzNAhm0iMCTvCyfWotXyCT5oxCzhE KeBtBFaDfDPzu19RvlMXz3gQcSmtKYF2xZrjYMLVZKAOyp60a6gAsgcJtz2D8TW+ 8XmiG4QEj/J+JaI6AtNSlP/h5t99BQ9wQTYrgTNng+lk7dOY/yVmUQJnwwOiq8kM YeEdENWkKZ65WHQUwH8P++VYwaqSiQA5SqA+FZo2DH4psrJ0RNnspWLKA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw49cgpw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:18 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBXCYC017744; Fri, 21 Jun 2024 11:37:17 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 3yw49cgpvy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:17 +0000 (GMT) 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 45L9ITH9019974; Fri, 21 Jun 2024 11:37:16 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrqupvyh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:16 +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 45LBbAq548628064 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:12 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4FADC2004D; Fri, 21 Jun 2024 11:37:10 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BB2742004F; Fri, 21 Jun 2024 11:37:09 +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:09 +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 02/38] kmsan: Make the tests compatible with kmsan.panic=1 Date: Fri, 21 Jun 2024 13:34:46 +0200 Message-ID: <20240621113706.315500-3-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: z80Vy_rqUrEB7pD3VgizD3Nec6VCI77p X-Proofpoint-ORIG-GUID: 73JqdirNA9Gc3nOItCCEysTgBSv4zoyr 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 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 phishscore=0 impostorscore=0 malwarescore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Queue-Id: 46BF61C0011 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ujnrqng559ojhjuupmurnmxnka558jjt X-HE-Tag: 1718969846-371553 X-HE-Meta: U2FsdGVkX18qG4XLsmSkD7aK0uYlz77gdsD/BMZvmUiTsDWmlx6yIpjmqM5+CsyA3MhZTQewOZFuKDDAmCrya0gIBb15InyWW9j85SmPOtJX2OZ2pgilQU3kfb6XkFMFc5SMzThfOCLeQzKL43bcxq3vDe7ZUgdqvwPzVlJFeTD1iT3dJ+Tzxudy47Mitaprtp6+lfW1bVaUfClF6vMb2A2a/zczJZVmbTor9LbNEdXUatAi6+mQ3dgZglCd5N1fHBOIKA5AGBvdE+COA9dIy7wnbY55RCptBf+yttZGKfy3GuoBxg+AJMEnaZIhA2Ca5ploLBU/stT/L/EiPHswZJN55MbtTU8DwneFAnAwHZYDSM0d4EmVzx7IAvzlHK2gZpcqdq2GfoYoj9nCGw43SYj5UGdplO33QaSQ4+DYI44SshkX5A38Zj0VVIMesLVBMmmMSKjY3LcyZMxnf8WvFJiwBpoGFqzO+caV8rE19Sx7t/XWXhMaARC8YHQDNDzvxDKtpBXekPPX+rWagX/OgqjjvLfLUWp9Z+eMQ6ulHOX/IKUEAAxi1UzzALk/FY6/nRJ04BAgOUs40RUf2rJBCyXvcuGqBdrVQmoi7/CHlCmokxhyCz7HLUiMUaeyPCVKd0wQIcmwICb0FK1fibA7tEwEyDmPwBXvSPkPtmhvmTsk68ija/OotlQ6BEe9hZt6Aom9baEeMFfM/z7rSo9p/w3pcJfZXxcE8BaFn94Z8Zzt/NTUd3Wa5bDXHKC5Rcs7pIzwiQBXaHpqaEDhE/hA20ctDwsHr+RtJl8WCbEIGTd11mL8V5KMP5l8HgeWagwWlpTArmqh8SPjYdT8C1C1I6AgKU50JqFTtWzzqHEcu9+J+IV22e8g0hrdC/Q3dykT09442IkLEtd3AQrM0dmsrat7ngA0dN7AdD81OfGvnjnA5Cxk6ZTbQ0bMBJifx0FFCjed0kiXYvIuIwRu9Mf xElp9rRk afcHXamM4B718L3SP038r97ST2HUGCWy503OyzgFJmkNUbGdTUyzpeS7AXHuwmzA4YVvG2Aj3FmcG6DaQ8XpdQocCw29FiD59zBmrlFoxWsv5zhaLc7BkmoFCRn7G65yf8QySuSlqbNbjp+0gWhU5bwPnQxpoNiedPBxUWx8mufYhcRanO0hV+6lhCDIK6d2Ixex1tPEm8YG+5yjCLkCk4Y8EygmpkUxnFLZapYfH+kO02t7ToFqcyjnnJ95TMdfcGGqNwFoGphV93waBWtF4xe9C8VF+qTpm/znaVQLGxpNRLlyyvcnMZApQEQ3RH7ULevR2fdUUaT8JqLUoe8JHZsPpVJ9FQX0ZrzLV X-Bogosity: Ham, tests=bogofilter, spamicity=0.000026, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: It's useful to have both tests and kmsan.panic=1 during development, but right now the warnings, that the tests cause, lead to kernel panics. Temporarily set kmsan.panic=0 for the duration of the KMSAN testing. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/kmsan/kmsan_test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/kmsan/kmsan_test.c b/mm/kmsan/kmsan_test.c index 07d3a3a5a9c5..9bfd11674fe3 100644 --- a/mm/kmsan/kmsan_test.c +++ b/mm/kmsan/kmsan_test.c @@ -659,9 +659,13 @@ static void test_exit(struct kunit *test) { } +static int orig_panic_on_kmsan; + static int kmsan_suite_init(struct kunit_suite *suite) { register_trace_console(probe_console, NULL); + orig_panic_on_kmsan = panic_on_kmsan; + panic_on_kmsan = 0; return 0; } @@ -669,6 +673,7 @@ static void kmsan_suite_exit(struct kunit_suite *suite) { unregister_trace_console(probe_console, NULL); tracepoint_synchronize_unregister(); + panic_on_kmsan = orig_panic_on_kmsan; } static struct kunit_suite kmsan_test_suite = { From patchwork Fri Jun 21 11:34:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707327 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 9B662C2BA1A for ; Fri, 21 Jun 2024 11:37:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5C4916B011D; Fri, 21 Jun 2024 07:37:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E9A38D00DB; Fri, 21 Jun 2024 07:37:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D33A98D0155; Fri, 21 Jun 2024 07:37:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9E16F6B0114 for ; Fri, 21 Jun 2024 07:37:30 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 53F041C2006 for ; Fri, 21 Jun 2024 11:37:30 +0000 (UTC) X-FDA: 82254695460.08.79F8785 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf03.hostedemail.com (Postfix) with ESMTP id 07D7D20008 for ; Fri, 21 Jun 2024 11:37:27 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=cs9bGDLb; spf=pass (imf03.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=1718969838; 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=Scz6uta8wJUcmkDwOaiOL8UogdsQpVaK9UJlhoWG7HU=; b=y84Zlu0eri3QuvDnV0G+u7A6nczJUjo6iQ8hb2nqJgY0JHtujdOt6Bog49L6daPaLmIz/d iVk2LQCCn7D7kHjcnjcKq4JCv/zidhApxkuHzFi0i8X6mj7ooTz1tYbf9p9UWI73gWWHLX rtrUvE5iKNOlp8sjY1YhrbKZQbVhtow= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969838; a=rsa-sha256; cv=none; b=vU9QRcbLa0AgzF1srJi9SfWjHuOFIo5TJ/l7YKNeAG+2SMk0LpdnasZh0xsIXiJRImK20I hGM7SraopJv1Xd7SB6v5KPVtdiLgCotcXlOAPMSLuKwc2WSxONTEJyFkYAbeI5m/J45myr WX/SyUsDFLR2iDTzFfxoUDkZu5UeX2g= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=cs9bGDLb; spf=pass (imf03.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 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBQwae018581; Fri, 21 Jun 2024 11:37:19 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=Scz6uta8wJUcm kDwOaiOL8UogdsQpVaK9UJlhoWG7HU=; b=cs9bGDLbNr75bSEtSCFKfu+8mc/7f oPv3JU6q6qgeO0hi9gQNwS5O0I+3mVeSh5/dXj64sA4nYIi9KiFdzl9IouDYmLi4 ByG1zBxAd2aVUQ+0zuiVDUn2ue58IZFSrk98kIJCR8vU9NI0kXGIeO1d/nlNAZJC fs9GEfvKjhcQM0NrxFReFqzsYuBvxZULkGd5okEwBrzCnHxOdMeVj61nzrKnv+8y vS6b+srj8GoBUyhp//DxBru+WfeQ6ccieMavQA/WYQUpjdyCX/cuYJAA1t4zaLpQ mM5BySOu3XiUIFHuFLbxVbxhRfvkY1cMDgILdXHJJO0pbWp36+GpXjCZQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw6ws09b9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:18 +0000 (GMT) Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbIND001489; Fri, 21 Jun 2024 11:37:18 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 3yw6ws09b5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:18 +0000 (GMT) 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 45L9L3lJ007687; Fri, 21 Jun 2024 11:37:17 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrspeupg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:16 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbBuE21037512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:13 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 888FE20040; Fri, 21 Jun 2024 11:37:11 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F30A82004B; Fri, 21 Jun 2024 11:37:10 +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: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 v7 04/38] kmsan: Increase the maximum store size to 4096 Date: Fri, 21 Jun 2024 13:34:48 +0200 Message-ID: <20240621113706.315500-5-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-ORIG-GUID: wZIRW_dUwx-rNNfZ5WtyHnlnrpg7gkD4 X-Proofpoint-GUID: 7MrfeCQ_u52NejmfJE-8AosTU22Np6aR 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 lowpriorityscore=0 clxscore=1015 suspectscore=0 malwarescore=0 spamscore=0 phishscore=0 priorityscore=1501 adultscore=0 mlxlogscore=742 impostorscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 07D7D20008 X-Stat-Signature: 7di3nqir6jjjedy7whzseryte888wy77 X-HE-Tag: 1718969847-544293 X-HE-Meta: U2FsdGVkX19bUCrT4GPuHtx6M5BQLXLd2n91dWDx70yaSzMJZpw0QpMMefrenE3NUqrMypuPXJMFCZG8dotWwKD1JUXe7hFHNpbMPkenIlHb7MunvS9iLn/25tLox8vrQe3FfsLgwZnyUzEX3w0IoOT12xtNNpY1AlVhD5Scv5gaK6cLMWynkc8BFf3gL4hGMW4KSXo18RWOifxx4bBRabRn+LMU6Qj6BEz/3A9E+3KgEIdYUoqMAXXCvi5AjpPF5H4X8+WKW+4Bl0didfMFLv8DlX2qf4v798sGZoUjV0L0NKiaYs+ec5KAywl2kyJggNYk2Lztol1VQK5NIRBdInjn0GA9K4Us4AH+J4ElJbMPXy8fbx70nSJ1ELLFEY4eKoG34aPlQjfvn9/eYQy5KuihJUAuZmc/7H23Va5OaTFvjBtvWGEHkWxx79McBDMmbO/TfgrP2VGohCtYH4ObTlNz9PwyO+43gXhzFFq/SGqKBEzs9p2xLmwjwHQtT7W14ZPj1zMunpb0eUUExl/4ZrsG1amnK8cnj/bMg9HxFWbGBFjhjXOTSUikvKizw36XaaYh8q2xnGurBu35OQyjY1VL5cYxwpin+bP5tPzuYivAwOhF0a0leEduBi8gtyOijFwt4m7dddvGKMy6oD5vwYudA5aOvNtNCnCB7YTWQE1+pZk+N8RDGEOH60vlSVbcGwubdGSuGXrVHEPiN1JaJC7pE4y/qyCe10Ysvqph/90kHSDPTsxT3uBOqqw6xWBm3iz7B6dw+kjsEKlMb7Do1Br0cB3D2fQxGi2+yn96DDkpjVcCn0fTcuSBI0GIfMzwWbmO11bfJETYD2vnMYywTD2Myu8j9IzVjBufXdCEqfRPRP81PbzM3qQnZmG8mKc2DR5V2rdW5P1y2NEp8tQ+JFI2InLjBuA8Pk7avxCIdGECnIS5SA0eCo0IXsLq71IBtQLqEdSIUck/TxWUQRr Bis8Kvfy Pw0Mh/Za86eETxmLWRcFBzIiEqS14XHvy0Pv2n/SHkjQkNp6IPUcgv5h26PowxmyKA4V+u2NtVcTkj4z7jaFx5tbglPDbvFJiIbFkR4O1JTk2+3MC/7zGsBGbQeqYRUl6ofIVCpPP4jwE4pnPtD4irS6WW0xZjOFeM/e6FlAGLPrYNpaIEibsP2oXE45YO0/Dy3kwZ3SBghWl2ohU+WxZR1I1cCtOBBkW/CT2Haflqy9+Fl1iwhZkOlOFapdmUd/hBzVi/jJsW0zYj2LRjB+ALc1HXUZJTL+R0TzVlOshvyBlvizDoX9fn/68ixS94bKuonE1k5f2Solbhib4W5dXKOlCJqJhFcwPkqoXqDoeGwe0TLK0uDyJ+2zbKwykDY2nbWE5H0F10puwBDcq5WZXBh83tQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000016, 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 inline assembly block in s390's chsc() stores that much. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/kmsan/instrumentation.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/kmsan/instrumentation.c b/mm/kmsan/instrumentation.c index cc3907a9c33a..470b0b4afcc4 100644 --- a/mm/kmsan/instrumentation.c +++ b/mm/kmsan/instrumentation.c @@ -110,11 +110,10 @@ void __msan_instrument_asm_store(void *addr, uintptr_t size) ua_flags = user_access_save(); /* - * Most of the accesses are below 32 bytes. The two exceptions so far - * are clwb() (64 bytes) and FPU state (512 bytes). - * It's unlikely that the assembly will touch more than 512 bytes. + * Most of the accesses are below 32 bytes. The exceptions so far are + * clwb() (64 bytes), FPU state (512 bytes) and chsc() (4096 bytes). */ - if (size > 512) { + if (size > 4096) { WARN_ONCE(1, "assembly store size too big: %ld\n", size); size = 8; } From patchwork Fri Jun 21 11:34:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707328 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 6E0AFC27C4F for ; Fri, 21 Jun 2024 11:37:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1582C8D0157; Fri, 21 Jun 2024 07:37:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B05F8D00DB; Fri, 21 Jun 2024 07:37:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 769386B0121; Fri, 21 Jun 2024 07:37:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2B4886B0116 for ; Fri, 21 Jun 2024 07:37:31 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id DCB1640D15 for ; Fri, 21 Jun 2024 11:37:30 +0000 (UTC) X-FDA: 82254695460.06.EABC054 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf17.hostedemail.com (Postfix) with ESMTP id 9ABC54000A for ; Fri, 21 Jun 2024 11:37:28 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=IS4ZtVj1; spf=pass (imf17.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=1718969841; 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=B2wiMcD3tdJRzJi1KnXmn1aGmTaVwcFVLNTdCb0XDUM=; b=H3F5m7ejt1CD+RhtDlht97Sb3h/a+ZuEMVCYup7pPRIHWFwqDL42uJj7j61rJ7BpNtz4Um 0/4pRHL+D7AzbS0O0L3zp5tqhAKB6JWF17P6Mf5F9CJ425BdWyu06GSekeO7lM2kO64pCt f515uP9quIwVQ1QtKdjrM8XNA82x7Gk= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=IS4ZtVj1; spf=pass (imf17.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=1718969841; a=rsa-sha256; cv=none; b=3a65z8owP0XJTefK/Pc98NfjZY9qtkwtNPgnnWea+QDRM1bx0lWOgK4wPfCVJCTI8Ac9Ja +9B5L4uBLmL0Adb4Tya2AStvf2OxyL9TVfg8uMvz0eugCPWVPz8vdCQHEM1DWleqA7OKxy QCCaXZ40yWr69Wbil4wnX5K6r8KH9SA= Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBT2fX021960; Fri, 21 Jun 2024 11:37:20 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=B2wiMcD3tdJRz Ji1KnXmn1aGmTaVwcFVLNTdCb0XDUM=; b=IS4ZtVj1AfvkUG7483Tgmr0DrzGsg H/yVfozsu61QHrsNj1KI+Q7OnIGCKzl3S6xWaImCS6mSKVlcmuoWjeMu4+RE83Da gBpGfdd6AzxJJTvkZr5hVOweY8PnLmFbKgKiAo1tMc95v1E3fV5TLExrgKUV6jnM 7aeYd0j75CQHwBZoNQIYtoz7xgCso1KJOBf6oQyYtv4nifZkGCeNWsn0D8z6S8GK uCRFaSSFxgsU+Hfa1VcTUETZTPSgZUQ8sI+8uxERh91AtMTFyPNWSQRXPM97JS4G KBHi/LlomHjU0AfPNcathcAfIijMU8k4D/qokj8DInEpcs/pc1QoccGpg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw6ws09bd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:20 +0000 (GMT) Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBaJmL000419; Fri, 21 Jun 2024 11:37:19 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 3yw6ws09b6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:19 +0000 (GMT) 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 45L9EjD0019980; Fri, 21 Jun 2024 11:37:18 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrqupvym-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:17 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbC4S45613482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:14 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2A8B62004B; Fri, 21 Jun 2024 11:37:12 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 92E262005A; Fri, 21 Jun 2024 11:37:11 +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:11 +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 05/38] kmsan: Fix is_bad_asm_addr() on arches with overlapping address spaces Date: Fri, 21 Jun 2024 13:34:49 +0200 Message-ID: <20240621113706.315500-6-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-ORIG-GUID: _QxgKIXm-H474SZgRMjPUkGWFJ3XjBZb X-Proofpoint-GUID: yGqjU0FWgkV47EzU5yDvoLI2eE9WBVok 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 lowpriorityscore=0 clxscore=1015 suspectscore=0 malwarescore=0 spamscore=0 phishscore=0 priorityscore=1501 adultscore=0 mlxlogscore=952 impostorscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Stat-Signature: nfnse859iptzu4kaqqqu15rft3fcjm6b X-Rspam-User: X-Rspamd-Queue-Id: 9ABC54000A X-Rspamd-Server: rspam02 X-HE-Tag: 1718969848-312641 X-HE-Meta: U2FsdGVkX1/P6BS9uEUQhHBjsDVoCRY9k24WRm7cEFJvUqr7N4laxqZ8datxPK8kM2y5CdlSvfAQnTfmtHb7xLPAGN5kbUIeZxv1GBL9bUdie6kDSPPkvTGso38hqLIS87kVw4E1BcjdKLUqinPcRwR4N+H8r4Sj4qul4b4K0kI+3mFqm6TZ3fI+vSG5oJrYPWXPrSWBZlDE+Cq9eMX5UxofQApB0qW+fOAUbFvf4MBm0Vz70NRFK7bkHWajFkktKIw3YRmka2Mt1076ej3xS/HGDs9UiPk6bpGG6IZ5g0Dq4c1yQfLNXGXQ1l2KKbg6cP16lMN65MClB0ZlQu2CNp5AwLodXH+hQydf9fC8AL7Myu+jZEudDxf36e9y3OKDHFqiqz55/Sm1EAaelYPXkaw8o5XqaXKvJ7wTqpQ0chOR8svCAigpbaNNuOPUf5LlHjWFs+EWyjGve8Lg/1u9SLwAgsPffT22pWFn9q39+7Ve1Tn8PEoA836BXB5x+8C5qyQx56IuMOdBDrhc+03tmioUIrdQyzVqFmJQ7PwMvJzA5NV4FOwSmaD5Qh+FiMuKAp+CThiaNP5RaR0Xe9Jmqdr8p0XjFN94MM2onmhDp3clP8pPyV/2G4oawk80unBuWmFcleiBYmWBtIes4GM0belZ+QAH1xpBMTUx3TT3WNx2rneqpxEEvSgU5FSjqekBvBFnvqCIkxy0P1jeM+sMh7Rcnrybf9H3ZlIL/K00zh2Ub6J9I004qOQ0jsw55nTwH9iBuQs+bQzR5qV3x9vISD2t8Z/CmOzwPgZhJCzhHxSiEvf1IHlr4AulDEznS10N0JP1daC6Q6H472EeCPjfdTp977kG4L3G32Xh6sBeT5XKbuHoCBr/gFYe7q/RP5bKfOY8yDBH9cJEHzPNmFQbzXvHoqPBSvF+H9RbkxGr6RFUc7fCb10wlfOwggromDtT0a+rmHX/09jmP5e2XnX Xs+mFrsz jGfbre0VEQxZ2plTAsjaxiZI5+C2+FPr8ogL8JB5eDXb3yIMWT3tPdOD5ylkSzN8d15dMlSA1yMDVddefw0F5bg9wEvBw9ztMW4zahdnA8R+6B1XVuBOBopfu6ImQEWJch+SdXpB9czd6rm4UNx8n/4B4U8y5iEhTBgXkdam8eABqXyXHCITmFSrkumI7DkbhftgNknKzfr3RlmMZQVE/o295RBZqKiSoPYvUlHv0PrV63wbALQfQOMhzGtJ7V36S/ruKieqY0Adb4/wUjAYPRkXvUxR22OaOpMqgk6QLYK7j08MZk66I9IcTDDi66ono1sy2SPQhqkclkFx9IgJLEoaI+Gbo0VcnVDMFBQEQlwdyio82hsT0LSK7AnTxTEW6UakGgQfv9WxuJ+c= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Comparing pointers with TASK_SIZE does not make sense when kernel and userspace overlap. Skip the comparison when this is the case. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/kmsan/instrumentation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/kmsan/instrumentation.c b/mm/kmsan/instrumentation.c index 470b0b4afcc4..8a1bbbc723ab 100644 --- a/mm/kmsan/instrumentation.c +++ b/mm/kmsan/instrumentation.c @@ -20,7 +20,8 @@ static inline bool is_bad_asm_addr(void *addr, uintptr_t size, bool is_store) { - if ((u64)addr < TASK_SIZE) + if (IS_ENABLED(CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE) && + (u64)addr < TASK_SIZE) return true; if (!kmsan_get_metadata(addr, KMSAN_META_SHADOW)) return true; From patchwork Fri Jun 21 11:34:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707324 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 2F7BDC2BA1A for ; Fri, 21 Jun 2024 11:37:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8FA8C6B0112; Fri, 21 Jun 2024 07:37:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 878998D00DB; Fri, 21 Jun 2024 07:37:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A3066B0112; Fri, 21 Jun 2024 07:37:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 442C26B0110 for ; Fri, 21 Jun 2024 07:37:30 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E7CE8A315B for ; Fri, 21 Jun 2024 11:37:29 +0000 (UTC) X-FDA: 82254695418.10.B3FDC0D Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf22.hostedemail.com (Postfix) with ESMTP id A40CCC001E for ; Fri, 21 Jun 2024 11:37:27 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=kHBtbAMz; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf22.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718969836; 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=3hDUyT9rvjh/uqttZeOy24s2Df+NNUjOmmqDaE5+6Vk=; b=2HjDHmbignbodHqx/yasVO40roIwY45Ufrl3GXRggK+ALOtjgKIQ8qos6bnm1DS/xAYwgV p+9J0Vf98is0Vtn4ta8VmSYXEVjwChcrrzDdy7tekkGauePfb1JYTEzqp8l63G5IBY3Ceu nsuBLtaz5KKxVsN+NR6Pc6tseztlfSE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969836; a=rsa-sha256; cv=none; b=7C8sKAZ+FBOsG8QmEpDZokU5KfSPkdvpE5vkt1qHs9O01nWHaGHXsmxrdN52aw9cFqqhBV Mn9R75xRukbslUVs1RybtumL+h8PZ7hALQuAd9Tv4bIKs36mara8uYXl1Lm6YoYqEXcCk4 4HJI5VwPSkBTHybPrdgE6CSMX7+ijug= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=kHBtbAMz; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf22.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBSei0031789; Fri, 21 Jun 2024 11:37:21 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=3hDUyT9rvjh/u qttZeOy24s2Df+NNUjOmmqDaE5+6Vk=; b=kHBtbAMzAkJCYKTs27vyxCRb9lPBr Vad5ZD61qzERd7uYenLzb1vDgaV28hZ+NGEWV7TkSykwXbm7AlCJJ+40CIFXA5I3 MHvX9PwhgoTnqwvc98rg95Uq7f2fvY4dm60lI0GCWAli23n3EoP0VaTP78SQ86Kx FRIFjTvIhsHopQ2S3xzLScX/z92CtlDQHf9aJfTv/gBrLWqRLBbsG3ekn26eWN22 kKNbT+cTZiI4xYuHJEIyk0PD7kQ4QjSMf0bwc4EDqUnm5a89b6YRC+gOcqNPVKo3 Oty/hjgffyzAnEoQAJOORY9TiLDBE1tSPnQHB1vuVI1SQJccwrIhgDN4w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw8p2g0hx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:20 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbKjP014093; Fri, 21 Jun 2024 11:37:20 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 3yw8p2g0hr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:20 +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 45L95u7O030896; Fri, 21 Jun 2024 11:37:19 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrssxvb8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:19 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbDV153019072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:15 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E0C120043; Fri, 21 Jun 2024 11:37:13 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C85B82004F; Fri, 21 Jun 2024 11:37:12 +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:12 +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 07/38] kmsan: Remove a useless assignment from kmsan_vmap_pages_range_noflush() Date: Fri, 21 Jun 2024 13:34:51 +0200 Message-ID: <20240621113706.315500-8-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: M26Qsv0wYYoY7ZdLYkxPUzFolJ_IdfF5 X-Proofpoint-ORIG-GUID: 7hAxF8dJwBBtEW9YMS-8PINNDm1huIJ0 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 mlxlogscore=999 spamscore=0 clxscore=1015 bulkscore=0 impostorscore=0 phishscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A40CCC001E X-Stat-Signature: apxuzjg8izyppfa3wnieqnumfabgcrod X-Rspam-User: X-HE-Tag: 1718969847-810601 X-HE-Meta: U2FsdGVkX194XyYyFkWfjxllgEvezrtUgPhlO7WrVbE0s0OWRSKbJx8MnAzGus1Hv4J6JbpgggspTXKpvgsfu5Zcp137yPM7y2tNb0x3pQ24RhOqG7/LnbGaOPitMlFS2ESS4tDVICeWsOqS7JyulAH6Cs3ArZqAg6kYqHBUxUV+tgRaQhyCL9yeGYp+B3lyePl3koBGpJDM4Q1HiEZ7z0UbOZiZMakJu31oswHGzzI3TSb/Jhm8EOSy9ZlB4vhiwQTwOZArTk7GJlzbxACLZzqTob5gcczzVCrKQp5fB1qGPbgM3wJ7FkvWu3Gct4dQfjDk2YCtE6ztM1VtrIY8K5L80s5rNREKi+54f0HfV080JVwrZNKXnGZgT5WJIcU+H5Wnwc2YQ+6MC1bud+gi5GhUlWIVRCbJsKs5fdCUvFcnrZq6w+BilP6UcprWiw6WduF3M/kVdp9TcrZxpZIjHG/Xdov/RIMyu3ZHWTIoRDBJQw1OQ8dR2v4WUUlsBztKKxXa43LoL/kqsA2Ycotr2WlNjbSCa/kLdSCMXqXroOqwtfvyM6tM31eppnhUUNoyLMW4FuLl37gTJwFWb/oUOGAOFnuZhM/yeNPvKUQwQ3u9IvyamIF+sKi8XbbPz5xJ/4Mvh5Pgd1h9GyQXk60bvN4Rfyb2Oc04RRiPbvdEYiNRgp0UGCnRLa9U/dWtRWHi30LO2gPyoVDFZT8EKr1YsXPwYQje8BQcYOwREF/6EbxF+fGGsHnlcRkSm2Vm+8yiRCmTgaUXuaAhHVh+aPZZysI10LUCgiFRzrTMI6ObdN0iMMUNna6p1XSfyKgZmrf9tpPq5qy1lgpnh8AhOc1zpC8QLXUDXxXfg5yTmEwKBdhEcMckJj+BunNpirdFuRQJ70omTk0bGFCY2JQCif5EMJOesdzrxt2y+fzDd/wwNPY9Nzv1GkMct9wpj17GTyiSSFNO70i4RXJXSGMtL7g KOJ7fgXN bmcOqDQrk+3nPu8qHiCMe2FN6qev+8Uhh321jgsS+NhRiwwXHJRnSVTR0ebwJDtmUrBKGHe0IKZ7N28oXCe3aqFruJIL1lqjbFJvkSa+w5wSd52li34XhBw2jK6mK2nKfym/OJUHSBuyzTz8wOB3k0ugVl2PQr4ygMQCilmka/YeOsWGYEEf6fv6LToWH59C92Mw0A/v8vzdw2mMpzioIxIygFitbgjziqYyvW5AWfjqCex7JHQ1jSLoMpwaYI9qY6bomgeWBIVDX4wmNUzuPE8tBe0Dpp3iH6DY3CNYr3WxMmT5dYwOWjyKKZEoGLczUm/APq2JryDUeCPd81rsyPvBJEu/Bt1pu/MGIwascah0Egh0zVYu8yIjlQUkPY70qZxAHECeXBWOhWdo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, 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 value assigned to prot is immediately overwritten on the next line with PAGE_KERNEL. The right hand side of the assignment has no side-effects. Fixes: b073d7f8aee4 ("mm: kmsan: maintain KMSAN metadata for page operations") Suggested-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/kmsan/shadow.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/kmsan/shadow.c b/mm/kmsan/shadow.c index b9d05aff313e..2d57408c78ae 100644 --- a/mm/kmsan/shadow.c +++ b/mm/kmsan/shadow.c @@ -243,7 +243,6 @@ int kmsan_vmap_pages_range_noflush(unsigned long start, unsigned long end, s_pages[i] = shadow_page_for(pages[i]); o_pages[i] = origin_page_for(pages[i]); } - prot = __pgprot(pgprot_val(prot) | _PAGE_NX); prot = PAGE_KERNEL; origin_start = vmalloc_meta((void *)start, KMSAN_META_ORIGIN); From patchwork Fri Jun 21 11:34:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707330 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 DA527C27C4F for ; Fri, 21 Jun 2024 11:37:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 75FED6B0151; Fri, 21 Jun 2024 07:37:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 399FD6B013E; Fri, 21 Jun 2024 07:37:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC08E6B0134; Fri, 21 Jun 2024 07:37:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 7DB156B0124 for ; Fri, 21 Jun 2024 07:37:31 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 352B7140CED for ; Fri, 21 Jun 2024 11:37:31 +0000 (UTC) X-FDA: 82254695502.14.10FD5B3 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf05.hostedemail.com (Postfix) with ESMTP id D641A100018 for ; Fri, 21 Jun 2024 11:37:28 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=Bj2BUCD9; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf05.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969841; a=rsa-sha256; cv=none; b=ySu2flY9DnVNPGz86GMMCJ7n3TciY57by5t772nPxQnd61wX219YwCFseV4PYCBbhSKRhT 8xP0RBG14kCvFRBGwK4yaqx3WHeBV7cddqbsiDOd1U2sdvvWEgfdZdlWMiQKmN+t7cN5S+ W4pSlHVXuLRwmQMSXdSZ2LXzhDXibXk= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=Bj2BUCD9; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf05.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718969841; 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=YaTjcojmIIYPSV3AqgAoZ8tGeMyuD+KvoajbKIBgv5I=; b=iHLavCg2rHL+HTn2d/DfRZxoWYvJD9hZijyhOWg1aQAKxvosreERGIer1uL3Z5yNQoTavZ iXJ0Muv8MG0uCagp2nAEsTRAgC7+tZuahEYOPPTCNTmF2x5cIfCD1yFxvOFrnOosV/TqYw xGxzsR69EcjfMcJApLl7vXbBCk5ehl8= Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBPWSM013251; Fri, 21 Jun 2024 11:37:21 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=YaTjcojmIIYPS V3AqgAoZ8tGeMyuD+KvoajbKIBgv5I=; b=Bj2BUCD94aJhhvJxmwGvwApntdpMR ApKI15CfWdPxmaZk/ljEhDWc04/w/K371TEriz35AVH38xTfKyEPeDH9iOCQ8IxQ vtX5w5OIfzFaCIs208L4uBsHKYZo1YQveFEvrFLZk9VNrzOVtLfAz/a/RB+n3kWK 8ghXYDyoO9/S2IbnddHO2TcBJyCBxB2UX5NVplFI1s8fz3XGJeV0GpWkjGAEAhSv j/SakZJv7EsncdWf3nrdL0/ij2URVtGzt3nYGVgcPMSFlzlcl4GY0LvcHWMLmyg+ 1SsZ1fnHFl1kyA4XQaGaES4EbrY3Di74M1X0OeLCs9ldCLY3uyu9Sq1xA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw7sv84ja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:21 +0000 (GMT) Received: from m0353727.ppops.net (m0353727.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBXowa027735; Fri, 21 Jun 2024 11:37:20 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw7sv84j7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:20 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L9F81K032326; Fri, 21 Jun 2024 11:37:19 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrsppv54-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:19 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbEG856558060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:16 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 00F3920065; Fri, 21 Jun 2024 11:37:13 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 682072004E; Fri, 21 Jun 2024 11:37:13 +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:13 +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 08/38] kmsan: Remove an x86-specific #include from kmsan.h Date: Fri, 21 Jun 2024 13:34:52 +0200 Message-ID: <20240621113706.315500-9-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-ORIG-GUID: BpILiJ84wfMQc4OyrWWYtqK9HSl8OMnP X-Proofpoint-GUID: DOan1dwqMWSOnCoi8hsLGLzYWLKMPAsY 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 bulkscore=0 mlxlogscore=999 adultscore=0 phishscore=0 clxscore=1015 mlxscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Queue-Id: D641A100018 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: fub68ewf6wiu6h18wzwsnh5g31bnqt9j X-HE-Tag: 1718969848-495279 X-HE-Meta: U2FsdGVkX1+R4//hV0o/BVxfKutcL6qiA77lFuvyKhSe4/CWk/IZAg/G70k+lkm/abGARR1eYgIZi/uGfchRrxkPBaOddtmlUvxQLHmwllIDg9v0ArN07LQOi0XAeoAsQ68F3DDyApxJX4beRzTpu5qu3gky/RFimXP7jbZ/bS/21z9cp5pySSpSc87VfSmfbVeJgSZaPa+oV9CICrX3Zpnvin7gAjo4AapY4TrmKZg5hnQKEIegb1P5R5R7h4aEqkNvx1r9j51cnpTByWBdL5hwESSCIXHpRL+o+9RzBWAycdl2A4LZ8PJ6LQ6+upxmo0eMsSOn1IfHE44ZrOM70zAY7F89t7vWBwiSYfbxbegDtog6QoF0wXVio4nvgCIQkSeEDYLP4rDFhWichcTt8Rb03Waxt+7wRKyors1DP/ZctQzA4I5ZRWbnGraPlj+NnTeY+Rgwj/t+kqfq8j6lsBL7ViCiyCFLWJcOYmecBCV+qdZGKmZKWWijZe5oxAeUNI++LpnWyPvI+AjhZ0dWguQaj0oH+3NjqQcuLtG/3P4kAsvd+Gs3sPBF4w0c4guMOaMkUiwpr5o89KLQqSgvgWdRBmQzkZMhOfGEGKjnxk78bX69FjtTiiS67YRn/h/9BF+scwXbsFQwhY6KRqbxDmpyanMMupqCGrdHVm7b40b/DC4wdafH18SZgudEkH+EHF/D+vV9v1GS8MlvUdXGCdyifn/5GXqfij1tHeWIhQqH/JF74L7d4u8aOjI6mHxA8iyQohkZKHISvZjZ603Mkeb1vTfsV/3WuBEJq5MCAflbY5vEarKCAK3qGOJUklBfL28MWS0+lgtACHR0LhQISs55j0c+nXbUe/X75V4QRbkRlqLgBHPMThVllFaXohH41zifNNvNP5BZf1y2rTIEY4nLGh6OrM3+ObFGnUd7Q5lTdyWqjs2Tw9YM/iPv1wzqjXtzdTNFgcb72J3gSl1 bba51aD+ AKBrXDCBQ5rH1FP68FDDWbzAhDh9TuGx+Utkbaba6Qu04PzgTKzDINk2QqAVAB6yVWO4tBu7/ubnUkDt/IJ9jo/NPziGwdJk/OwcvrBBHfmolGPECnMY0YYZOGYFuC5I2Zxxv85T6VaywW3vA4EWa6IRO5nYVTV32y683i4ARUAIFwZ2oL6mAmJKgABY6M5tFkYZgBVUj9M1FFST29Ip1t6NImLU03Ntht5NUrjkKLfYljmONZAybRlSXENNxD/a6dotSPpTl6et10kUnfADy8PP+vJL9c7YFTOW0/9gounyJW9URvLujTYVCZZSgacmooavqzR/o2G6rUa8U5xA7u1d/aOFl6V5rrgG5UF85BX7wv4v4as6ITSLFKcH6Mj/tTnpWco5w/AGJl/YiNjp9804qbuvZxWNz2S8Y8VarDLLn5spXF1FnxbjaRO5JkSiZU3No 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: Replace the x86-specific asm/pgtable_64_types.h #include with the linux/pgtable.h one, which all architectures have. While at it, sort the headers alphabetically for the sake of consistency with other KMSAN code. Fixes: f80be4571b19 ("kmsan: add KMSAN runtime core") Suggested-by: Heiko Carstens Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/kmsan/kmsan.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/kmsan/kmsan.h b/mm/kmsan/kmsan.h index a14744205435..adf443bcffe8 100644 --- a/mm/kmsan/kmsan.h +++ b/mm/kmsan/kmsan.h @@ -10,14 +10,14 @@ #ifndef __MM_KMSAN_KMSAN_H #define __MM_KMSAN_KMSAN_H -#include #include +#include +#include +#include +#include #include #include #include -#include -#include -#include #define KMSAN_ALLOCA_MAGIC_ORIGIN 0xabcd0100 #define KMSAN_CHAIN_MAGIC_ORIGIN 0xabcd0200 From patchwork Fri Jun 21 11:34:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707329 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 48A31C27C4F for ; Fri, 21 Jun 2024 11:37:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A9E46B0127; Fri, 21 Jun 2024 07:37:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F10308D0155; Fri, 21 Jun 2024 07:37:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4CA96B011F; Fri, 21 Jun 2024 07:37:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2A7FE6B0115 for ; Fri, 21 Jun 2024 07:37:31 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BE9C940D04 for ; Fri, 21 Jun 2024 11:37:30 +0000 (UTC) X-FDA: 82254695460.22.F32B100 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf30.hostedemail.com (Postfix) with ESMTP id 8958080002 for ; Fri, 21 Jun 2024 11:37:28 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=NwRG9w7a; spf=pass (imf30.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969838; 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=9fryXD6fg7ZWH/K5Ic2hWhXvK+X7HFTa6K6lMBwUrkw=; b=xxlplX2nP0GOnaEjtJAF5WxmcJnZOBynAAD2Dyb4YxvOCCWV6rNyptav7bz51EoRr9Ki1H ESOry5ZVSezhkK1TrOFH3dqak/A4okAebnNzZaeI/o8g0yRxlnUSi3AX+8mw5xCqUjeAz5 NUMaVpx4fV5i5lZbk3NbGuyAtnn1Qug= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969838; a=rsa-sha256; cv=none; b=A97N26QtywxZc+tKH+rp4ATQHZ9xJIamtnuGpqscZmEyGxnoDHctuycMeZLjylBDTJGRFp 7ujYtVbCqNH5IEP0fXDKYfaVVjMJCQJdYvuvtKZWRjeLWqC1yAIIbgvo8V+3TIi74CBxQD K1dpPgP+f20gHMiy1mCkkRx7OWoZ3KA= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=NwRG9w7a; spf=pass (imf30.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LATGSV018103; Fri, 21 Jun 2024 11:37:22 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=9fryXD6fg7ZWH /K5Ic2hWhXvK+X7HFTa6K6lMBwUrkw=; b=NwRG9w7aTDvCiDT1NR1MHIAJ2Wfko aTv2JwPOkeFIYtaDQfOQsmy8qMM8+vf83Zlve0tAG6GV7JLTUHSFD3d0SECrDV3z EZQvyzSp9+WL6v/AbnJX1v8t1fV8m482DVRnGx3nM30AKL0Pmn/gkkU25dGU3Ngf NBnOmUuk8zC1oIJA9h6ANNI2zLKe0ONkLM3rNvc1FW71aSldcS8RXOu8vzqlzWP5 lXuhS8CDBMnjyUq1/ixJ91xRrcpcBcwLuCwzTimBeTMehs4/GDj4aQrIQWGIVYef SrO2drN51NwtisNtPoXHsOYha4x88C5h/IGob2WA+JiybVHtTkJUSpLqQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw7t5045t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:22 +0000 (GMT) Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbLLw017458; Fri, 21 Jun 2024 11:37:21 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 3yw7t5045q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:21 +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 45L99jFH031338; Fri, 21 Jun 2024 11:37:20 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrrq6vfk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:20 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbEHR56754514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:16 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9D48E2004B; Fri, 21 Jun 2024 11:37:14 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0868B20067; Fri, 21 Jun 2024 11:37:14 +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:13 +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 09/38] kmsan: Expose kmsan_get_metadata() Date: Fri, 21 Jun 2024 13:34:53 +0200 Message-ID: <20240621113706.315500-10-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-ORIG-GUID: 2d2yzejn_5N3eie6A5aHac-WohbQjPgg X-Proofpoint-GUID: LxBKq5auC44MABsbauNQFbMiBqpPPcNl 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 lowpriorityscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 mlxlogscore=884 suspectscore=0 mlxscore=0 adultscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Stat-Signature: 8fasu1zw7jkg97r6n1oft3174bn91g75 X-Rspamd-Queue-Id: 8958080002 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1718969848-139416 X-HE-Meta: U2FsdGVkX1/xjxU3+tbzs8rjwFjUQ/t781M4zwk1zsGxOimoOCs/dm7P3dLFpw3gEg22o4os5bAmz4/fEpHFCPQej6RcmOP3Tj2H5g0FoRoE8kVIdgpKTjRq295kZcA1MCeZpzgGAfxIa1gUk0fpR8QgjRZMNGO4F0zZtql+XeA7ZBP2mpJOFiYATsUDaI9svnVdlB5zaVP62a3MFzNP04Z5SxZpv83c9piugpLw70cKIaOnqZZMxDBAOywcR2tVbHpS6TY/3V3wmHvTiboyurOhaQqFNWDSIB/fNDvRUtX/opswPuoFUdSARKHl3/v/Q8csWPvZHq1kloCyORXEloiw/oap8jAZwgZ2lqWP39jKNT2+2DTGTGI9xC6yqndvweKCX/Sj6mWfjlKVttBgxcJp3MZpuISy9OwAB3l3hYWQ0Q9Z5LHbHp/+CZhn+MWc9mRwneajSOEY2ZTD22gJwJaqFuAY6AkbXPxdfB6VgTTvRL65ZeZt2vJxDESdhi4D4n+IDY27QeCikudw+W3rRLwOH8olb9m4ldbaGSZjkNt6PsMlY/UNVAZHf+5QLhpd7yWozpnRRL+6K3X6oYT0aEpxOKYhzWCXZM8fxmVa0V5JhG/TYSFx96C3Yy/yKb/2HEBMnQBWYskXA+slymxKdafCSdOz8n62azhthX/qGRVATwPf5NybFllHl5Vm35Z6vvu+DHlvYRG6lej/5KFAiZMZS9EILjiYXzjbtjcXM3bufTOdcXUoWupd8O+ppQNxvox57OnsSFmjRpoe5birtmPOwDTKa5iSZxfR3JjvHOwp7Cy6i9EPEa4x9BgbhPBNrjI209C/mbaBKRkLYmIUpCnzEX2EV+PGmYy8c2myEMXbNmY3qEKwSKRsKU1J2YD2m4/5OxoOrY8Naq5taNqxgvmAmoEKohYG12LmjDNH3TGvutoW3CXdHmJx9lybFlFt2Q3hquvfLEvRo+iucKJ L4hct6Na mZsPb4Vs/p5PQPmCF8KaZq+RcHeEiWItNFBnGNQIowCDSCrrOLQJ1hjm1BZ3XPBOdYNIZ/C4E7pd3D8vThx5V48UY6Iryoz2TsZtEjVefbeRX8oiia568XkOQTad+o93YjkZ/rVs+hVzs0z53ltETuSzGt3teG2nhDz5M3CruuxZT6vv3w0Z2ecCoMezJfvktrRded93rPQR9u6H5EQZFNpzHoqm6pCyvpmxk/WYtvTLle+g7wraNIqE4EADXuQS3D0uHLWXb3YE+7+6AVl7iCXPlEJHkpGKlZff1TgQAq+Fzc64x9a7tknug+vocNNHP6lXE 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: Each s390 CPU has lowcore pages associated with it. Each CPU sees its own lowcore at virtual address 0 through a hardware mechanism called prefixing. Additionally, all lowcores are mapped to non-0 virtual addresses stored in the lowcore_ptr[] array. When lowcore is accessed through virtual address 0, one needs to resolve metadata for lowcore_ptr[raw_smp_processor_id()]. Expose kmsan_get_metadata() to make it possible to do this from the arch code. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- include/linux/kmsan.h | 9 +++++++++ mm/kmsan/instrumentation.c | 1 + mm/kmsan/kmsan.h | 1 - 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/linux/kmsan.h b/include/linux/kmsan.h index e0c23a32cdf0..fe6c2212bdb1 100644 --- a/include/linux/kmsan.h +++ b/include/linux/kmsan.h @@ -230,6 +230,15 @@ void kmsan_handle_urb(const struct urb *urb, bool is_out); */ void kmsan_unpoison_entry_regs(const struct pt_regs *regs); +/** + * kmsan_get_metadata() - Return a pointer to KMSAN shadow or origins. + * @addr: kernel address. + * @is_origin: whether to return origins or shadow. + * + * Return NULL if metadata cannot be found. + */ +void *kmsan_get_metadata(void *addr, bool is_origin); + #else static inline void kmsan_init_shadow(void) diff --git a/mm/kmsan/instrumentation.c b/mm/kmsan/instrumentation.c index 8a1bbbc723ab..94b49fac9d8b 100644 --- a/mm/kmsan/instrumentation.c +++ b/mm/kmsan/instrumentation.c @@ -14,6 +14,7 @@ #include "kmsan.h" #include +#include #include #include #include diff --git a/mm/kmsan/kmsan.h b/mm/kmsan/kmsan.h index adf443bcffe8..34b83c301d57 100644 --- a/mm/kmsan/kmsan.h +++ b/mm/kmsan/kmsan.h @@ -66,7 +66,6 @@ struct shadow_origin_ptr { struct shadow_origin_ptr kmsan_get_shadow_origin_ptr(void *addr, u64 size, bool store); -void *kmsan_get_metadata(void *addr, bool is_origin); void __init kmsan_init_alloc_meta_for_range(void *start, void *end); enum kmsan_bug_reason { From patchwork Fri Jun 21 11:34:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707331 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 CAB38C27C4F for ; Fri, 21 Jun 2024 11:37:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE4848D0155; Fri, 21 Jun 2024 07:37:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E6EAF8D00DB; Fri, 21 Jun 2024 07:37:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BFE528D0155; Fri, 21 Jun 2024 07:37:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8CD9C8D00DB for ; Fri, 21 Jun 2024 07:37:33 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 53FC61C2000 for ; Fri, 21 Jun 2024 11:37:33 +0000 (UTC) X-FDA: 82254695586.17.F2C5852 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf27.hostedemail.com (Postfix) with ESMTP id 0F06240022 for ; Fri, 21 Jun 2024 11:37:30 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=c5DR5J3c; spf=pass (imf27.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=1718969837; 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=JyCixd63UT10LcLHBLxXvC3vYkg4ad8S/LeVZYMb+Kc=; b=7j6j+AP7+iT6xgH9fyhnkbHkbM9G10aoxAicBT9z5PZ4d3PQXkbLLO+ln7bvCZPVxVaMfO u6Ja2F4yV5uPBmtc0p4AKH1TQ7pfhU6L8J+rGr1PLGho60gRb9I+MseLpDs2yoZzRuEDz2 cZ+S9EV2cDKIhqXOcMs8J1IAN2IW+CE= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=c5DR5J3c; spf=pass (imf27.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=1718969837; a=rsa-sha256; cv=none; b=Gj+KBoqz2R323kRWEItM59szfwq1ytde7DJ40hLoaBHB1tBmwQuM0XjabJKBPmyNkigUgv nc6Zg1tov68wp+qIFmpTURDoJO63nFk5GOlMsWcDZIjpOR6fM+9ECC8p/UhFDkfCeFhHMb Uv5dD0bzGmYpQg/SikzNCC16n0fgsmw= Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBQuFV018507; Fri, 21 Jun 2024 11:37:23 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=JyCixd63UT10L cLHBLxXvC3vYkg4ad8S/LeVZYMb+Kc=; b=c5DR5J3chjF6XP8bKZets6fBuG+h+ YCNIYM12+RLl4OX7icx1Oeh617POY076QecPbrU1MtZeXsJxSDNurEbIsJuOXekX FfUeNNwZOJb0/scxfkv43AXBfdkuVGcvDDyU3kWndw1CUrOLP3lyRaOLrNH4u0hX pTzSQlFVDLDlLT/EvWIltEEYBkRFZ6/OTrdBthDj93MmFbjBS2x8tiPx/h0bpiE/ 11hDBY9u+Y+L9yRZ+KeoIzw//c0vELPrb8inCm1o5tmuUemu99yBx/FLk0vk/OnF Klo1L50BqKr5zKsCnpfHiK+lM3ERIN5G41WkOA34r8XfoKGJCRkq5q0CA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw6ws09bq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:23 +0000 (GMT) Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBXENT029185; Fri, 21 Jun 2024 11:37:22 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw6ws09bh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:22 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L97R4T025644; Fri, 21 Jun 2024 11:37:21 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrqv6vyr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:21 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbGwO30737090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:18 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E510C20043; Fri, 21 Jun 2024 11:37:15 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4F37A20067; Fri, 21 Jun 2024 11:37:15 +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:15 +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 11/38] kmsan: Allow disabling KMSAN checks for the current task Date: Fri, 21 Jun 2024 13:34:55 +0200 Message-ID: <20240621113706.315500-12-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-ORIG-GUID: xBEEimwpCOprxAXVdAos-Qmu2NP5Qg31 X-Proofpoint-GUID: DJB-acoyJ914G_wwdJYFoZ67c-BSzTg1 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 lowpriorityscore=0 clxscore=1015 suspectscore=0 malwarescore=0 spamscore=0 phishscore=0 priorityscore=1501 adultscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 0F06240022 X-Stat-Signature: x58knnfq836i83m399rsnbas6zi68gdd X-Rspam-User: X-HE-Tag: 1718969850-689719 X-HE-Meta: U2FsdGVkX1+l1k+HUYqtuMtvHBzF6/JwxVB0EIdKD/+uQW94gvbTWjrm8KDK+YUrHC0dloaImjQ+k54rsdBjI2D0PcO65fOTNYu06ArUvBUlbWsTgvuxyk8QkWbt/ip9TvzgEXFPFqx6YRg0PJD9kfKDwMmbZfDPFkc+XiBNcUSccNHfkQ9D4OjIYgd5xAImDKewEWaTRFRhGIu4UY8BOivnjKyVyMz7+uDLgXId9RKOPbaSnWfVdaQk+nJPv85Q+S+Jhvx7417nzf3HjKNbjFrUyZpXqWcanugODMxQ/Qos4nFUetAct9HbjlYOWp5CrwTh5mHv+e4FPgEIRGw6j10Es7IxDP9j+yAF2JNZaAaBzaW2WQXBzRXz62d3GOKkILVExtUchOQWP1XybkUM/2xaIrKhvqBGd3tOu7POrLxLLt2Bcto0NoFI/WDFoJW3wEjphBvr5yVwDOV2Rp67is+dL5Ff56MQEHGHMnfk/uhdN/TT1JK7qYWNmGg6x4D4WJ7b84en+XovbhFzFedRC+kE6fJiPwfdapEKAWNumZRPj/S1MeFDWZ/8YUofRpd24pRc0FQf9oh2yHMB2AIBdX/mbWJ8JtKE9isCjhkX6ZB7n8qKipNb2FS1WaQuEsMRc7vCcJiswag+GuMnRaVsA+DUr4zhIVBfWZzuc/7R8NyjO4dvfHTB6FwbNIbJPY1FwN0oDuaXWKBJfl6UkmORWaDmbN3sRvmEJoxJR1lgRn5KVpx1BxQ2s99cYvyT9WpRWx77Q3JUEhZ0i+W0BzOrqgMaZ73bvBh8pl/FiriL9o70jkQCnKsVpk+mt11VIl1UHdbmeUieADJmrUPYC4fsxsMACtucUh5nVOeJJyyOHwsHfDFTmE9O1eIUBcm00oJb1i8EMFGcppURszIkLLpLJls5ZioTx76CdRc6iEKrYk4pysZXv58lpQrw8iJGg/VupovTzDWwic/lMX3jXGK CG2z2Jiq R2zUnyQQUdXcHWHSu9Mh73Ou8VZ+7OxWzDfWu21vZPFnXhArcchChUMaSjiaZcuCMoJ3wytDAfz8nS9YS75mXNx19Y07ldY1AsavC3SDMP+gAalgHdIxqzBpsRXKFsNs7F6OW3vjH1s0jWhL3o24GrhQcq9n6wLqeBor1NfQ78lJPv2IB2yhZYoH0Ukj5ISNWyuSbRkAoTrTOv/w/CuFgVIowXuFIDCbH9x8+U0XVNwrcrslufqiYSiwzl/oY8LHgxcUAX9lkKsXlJrgaM1VQraBXki6FMFUwtpgIuuSQXL3Gxlephu0Jc+q+25MwMu9mw3yTh3Osod0oOG3bsNu00DdiY78naBdO7ZngDZXnffoMH2s= 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: Like for KASAN, it's useful to temporarily disable KMSAN checks around, e.g., redzone accesses. Introduce kmsan_disable_current() and kmsan_enable_current(), which are similar to their KASAN counterparts. Make them reentrant in order to handle memory allocations in interrupt context. Repurpose the allow_reporting field for this. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- Documentation/dev-tools/kmsan.rst | 11 +++++++++-- include/linux/kmsan.h | 24 ++++++++++++++++++++++++ include/linux/kmsan_types.h | 2 +- mm/kmsan/core.c | 1 - mm/kmsan/hooks.c | 18 +++++++++++++++--- mm/kmsan/report.c | 7 ++++--- tools/objtool/check.c | 2 ++ 7 files changed, 55 insertions(+), 10 deletions(-) diff --git a/Documentation/dev-tools/kmsan.rst b/Documentation/dev-tools/kmsan.rst index 323eedad53cd..6a48d96c5c85 100644 --- a/Documentation/dev-tools/kmsan.rst +++ b/Documentation/dev-tools/kmsan.rst @@ -110,6 +110,13 @@ in the Makefile. Think of this as applying ``__no_sanitize_memory`` to every function in the file or directory. Most users won't need KMSAN_SANITIZE, unless their code gets broken by KMSAN (e.g. runs at early boot time). +KMSAN checks can also be temporarily disabled for the current task using +``kmsan_disable_current()`` and ``kmsan_enable_current()`` calls. Each +``kmsan_enable_current()`` call must be preceded by a +``kmsan_disable_current()`` call; these call pairs may be nested. One needs to +be careful with these calls, keeping the regions short and preferring other +ways to disable instrumentation, where possible. + Support ======= @@ -338,11 +345,11 @@ Per-task KMSAN state ~~~~~~~~~~~~~~~~~~~~ Every task_struct has an associated KMSAN task state that holds the KMSAN -context (see above) and a per-task flag disallowing KMSAN reports:: +context (see above) and a per-task counter disallowing KMSAN reports:: struct kmsan_context { ... - bool allow_reporting; + unsigned int depth; struct kmsan_context_state cstate; ... } diff --git a/include/linux/kmsan.h b/include/linux/kmsan.h index fe6c2212bdb1..14b5ea6d3a43 100644 --- a/include/linux/kmsan.h +++ b/include/linux/kmsan.h @@ -239,6 +239,22 @@ void kmsan_unpoison_entry_regs(const struct pt_regs *regs); */ void *kmsan_get_metadata(void *addr, bool is_origin); +/** + * kmsan_enable_current(): Enable KMSAN for the current task. + * + * Each kmsan_enable_current() current call must be preceded by a + * kmsan_disable_current() call. These call pairs may be nested. + */ +void kmsan_enable_current(void); + +/** + * kmsan_disable_current(): Disable KMSAN for the current task. + * + * Each kmsan_disable_current() current call must be followed by a + * kmsan_enable_current() call. These call pairs may be nested. + */ +void kmsan_disable_current(void); + #else static inline void kmsan_init_shadow(void) @@ -338,6 +354,14 @@ static inline void kmsan_unpoison_entry_regs(const struct pt_regs *regs) { } +static inline void kmsan_enable_current(void) +{ +} + +static inline void kmsan_disable_current(void) +{ +} + #endif #endif /* _LINUX_KMSAN_H */ diff --git a/include/linux/kmsan_types.h b/include/linux/kmsan_types.h index 929287981afe..dfc59918b3c0 100644 --- a/include/linux/kmsan_types.h +++ b/include/linux/kmsan_types.h @@ -31,7 +31,7 @@ struct kmsan_context_state { struct kmsan_ctx { struct kmsan_context_state cstate; int kmsan_in_runtime; - bool allow_reporting; + unsigned int depth; }; #endif /* _LINUX_KMSAN_TYPES_H */ diff --git a/mm/kmsan/core.c b/mm/kmsan/core.c index 95f859e38c53..81b22220711a 100644 --- a/mm/kmsan/core.c +++ b/mm/kmsan/core.c @@ -43,7 +43,6 @@ void kmsan_internal_task_create(struct task_struct *task) struct thread_info *info = current_thread_info(); __memset(ctx, 0, sizeof(*ctx)); - ctx->allow_reporting = true; kmsan_internal_unpoison_memory(info, sizeof(*info), false); } diff --git a/mm/kmsan/hooks.c b/mm/kmsan/hooks.c index b408714f9ba3..267d0afa2e8b 100644 --- a/mm/kmsan/hooks.c +++ b/mm/kmsan/hooks.c @@ -39,12 +39,10 @@ void kmsan_task_create(struct task_struct *task) void kmsan_task_exit(struct task_struct *task) { - struct kmsan_ctx *ctx = &task->kmsan_ctx; - if (!kmsan_enabled || kmsan_in_runtime()) return; - ctx->allow_reporting = false; + kmsan_disable_current(); } void kmsan_slab_alloc(struct kmem_cache *s, void *object, gfp_t flags) @@ -424,3 +422,17 @@ void kmsan_check_memory(const void *addr, size_t size) REASON_ANY); } EXPORT_SYMBOL(kmsan_check_memory); + +void kmsan_enable_current(void) +{ + KMSAN_WARN_ON(current->kmsan_ctx.depth == 0); + current->kmsan_ctx.depth--; +} +EXPORT_SYMBOL(kmsan_enable_current); + +void kmsan_disable_current(void) +{ + current->kmsan_ctx.depth++; + KMSAN_WARN_ON(current->kmsan_ctx.depth == 0); +} +EXPORT_SYMBOL(kmsan_disable_current); diff --git a/mm/kmsan/report.c b/mm/kmsan/report.c index c79d3b0d2d0d..92e73ec61435 100644 --- a/mm/kmsan/report.c +++ b/mm/kmsan/report.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include @@ -158,12 +159,12 @@ void kmsan_report(depot_stack_handle_t origin, void *address, int size, if (!kmsan_enabled) return; - if (!current->kmsan_ctx.allow_reporting) + if (current->kmsan_ctx.depth) return; if (!origin) return; - current->kmsan_ctx.allow_reporting = false; + kmsan_disable_current(); ua_flags = user_access_save(); raw_spin_lock(&kmsan_report_lock); pr_err("=====================================================\n"); @@ -216,5 +217,5 @@ void kmsan_report(depot_stack_handle_t origin, void *address, int size, if (panic_on_kmsan) panic("kmsan.panic set ...\n"); user_access_restore(ua_flags); - current->kmsan_ctx.allow_reporting = true; + kmsan_enable_current(); } diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 0a33d9195b7a..01237d167223 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1202,6 +1202,8 @@ static const char *uaccess_safe_builtin[] = { "__sanitizer_cov_trace_switch", /* KMSAN */ "kmsan_copy_to_user", + "kmsan_disable_current", + "kmsan_enable_current", "kmsan_report", "kmsan_unpoison_entry_regs", "kmsan_unpoison_memory", From patchwork Fri Jun 21 11:34:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707332 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 93EF8C27C4F for ; Fri, 21 Jun 2024 11:37:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 091B28D0158; Fri, 21 Jun 2024 07:37:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F32AB8D00DB; Fri, 21 Jun 2024 07:37:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C26EE8D0158; Fri, 21 Jun 2024 07:37:34 -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 8E1F78D00DB for ; Fri, 21 Jun 2024 07:37:34 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 0DC00C0CC6 for ; Fri, 21 Jun 2024 11:37:34 +0000 (UTC) X-FDA: 82254695628.18.367B58C Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf14.hostedemail.com (Postfix) with ESMTP id D39DE100009 for ; Fri, 21 Jun 2024 11:37:31 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=BBq8CXP7; spf=pass (imf14.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969838; 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=fhyNLk4BgDYNJAsfSc8ftWCxz9OlL/4RiKPE6HJFalY=; b=IwIvT4IDpec9SVSgmwA6V5QDGx6MWPlDkZ/73HHHlF+lx+RV9iyv+pIm8wzKyoyGKf7XCu cjFtuw5Bxi+Zn9rrEUDULmIQhEYzqPRHGCAIiipTKNcpY2U/1gTWmVePtEPgVxKNf4oNk3 m/JRhC3uV4YPwNdZD2IG9L9+Q5B5e5M= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=BBq8CXP7; spf=pass (imf14.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969838; a=rsa-sha256; cv=none; b=Mhj5vmWljXoaSfrMFj9YnMEA8Lb41uwnLkXSn5BXI5P7a/IrP/pB7hcFrc5Y9Jr9rzGYtk sw7tfzK3CrnWKFFDqaP4Qvv4SCajTMcMh/NFBnHYlPFV0l7j1AWrNMqInDizs/sXRooxFD oMLn0SVsfnmWD76o6zpr/k28hVPmago= Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45L9amU5018280; Fri, 21 Jun 2024 11:37:25 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=fhyNLk4BgDYNJ AsfSc8ftWCxz9OlL/4RiKPE6HJFalY=; b=BBq8CXP70n/1p4j3af3cxv3A6JPRa JJRtQlbazTXmP/tMWrjcHhzj1H+bVvaaCkGoRDKQTmyAK+NrUyrasVGJ5CSBtbpb XKhQ7od+lT9C8TAKA7jc6SNwCoubn/9M+UBFXmko+O75K4uIHStP8zh1rScSmtLL x6ZXQMIf8/0sJ3ubEX/krvY3PsOd2zB4ck5QSeCdUhQD2XRT/X0bfjzJK85aF5Pi SXhQ8ugZciIpkES5vm5YgK3QKkbm0E/z6W4k+QostUsAeaM8MofLApbgiJ4AZ6O8 NbTAlIInkAchYeQvkB1/0gbmJbjK3OlxoGIvvQg6ikiM2ymY3UgXtRKCQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw5ksrguj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:25 +0000 (GMT) Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbOj0011150; Fri, 21 Jun 2024 11:37:24 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 3yw5ksrgue-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:24 +0000 (GMT) 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 45L9FiFL019922; Fri, 21 Jun 2024 11:37:23 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrqupvyw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:23 +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 45LBbHIG44433720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:19 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BA9482004D; Fri, 21 Jun 2024 11:37:17 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 313892004E; Fri, 21 Jun 2024 11:37:17 +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:17 +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 14/38] kmsan: Use ALIGN_DOWN() in kmsan_get_metadata() Date: Fri, 21 Jun 2024 13:34:58 +0200 Message-ID: <20240621113706.315500-15-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-ORIG-GUID: ZTHy7hzZX807u1u4MnUH3zt6Mpu1beHD X-Proofpoint-GUID: 6UW_Ok9wX5ovm0vK7_GLpJnRXxKeJn5E 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 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 clxscore=1015 mlxscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: D39DE100009 X-Stat-Signature: yxwi676sniu7weixezssn1gbei5tuhzj X-Rspam-User: X-HE-Tag: 1718969851-774964 X-HE-Meta: U2FsdGVkX19pzwIYJBt1aOzcotxF/zouqczUoWCOkpmm4bXsEveOjK5YkyXyCgws3XYoprZu2JT5d6NIei2zemJz/T6wXWI26Y9KTuht86uEx8z/zDaWGQGH+KzIHtoOQkEBWNSAb207y2Tp/52dRvQtZ7MZRRviV77dvADZpFp3nmlGTGCncU1IJMX1ni4QLv/dnjBit57kcXft8HkpwLwewx7Uc715bHDaS26ftZbVhwtZghVaGRFoU8PzYsaImLNok/xwJ7PhSI5frB7JJnecPcW/hX6DHoOxXTk0X7bXVt4qaU/n6ahqRYEE2n+l/L8MiVGSTjdLk4cUjT6FUnOcn2w+0tmUa+lX5XXAmVGnibZt92+IV/Yf1Lw13iofnjS3TNizx8FWobzuKhMsAGfnk5UYrRRfB+WT18qHN9qErz/GbLck79GF1c5xBnh23vC5nCxFkns3s3UCRBTpTIyRCEEkt2h2/qCoxUyqt4PTdC0MEawpdfoFwgeSTwtwEbdAKQn89WtnsCJuYlXyniZ+3iSWWJ7y8S4BKpKgCxO1y+ED/2+sUB6JKwsKYhSsWyb67B3BCAub829rJPIOi6umCkfAW7i3opFEw4ftK7SgsX9XpCEqK0bBE3CwPI9eBmosA4VNvVA+drTgp5ZXkrSKL0nlaFSzETd9xHEZh7bIJ/BgjS5/mQhtije36uebqNmeg16fCgZrJQj5Jb7mGGvJ582O2thZfwSn8choMgfCLwoLHrWsoqVqgGMlvyB98N9o80w4gxVUkyxxKgx6rUPOCEibKp/QUim993K8K/WTHyS+wwOukBVkDEvADE5yftOKiWUFO+CwOLSGFVh7RoeSJxjhY9mlT612/5uJxRbEW8U3mHhKi58Mo7DBKWZPUpaGXUjhlAN+t+s/0pygodaEeBUJ5lFrAde4fRr0MqgR/R2tbrnKpixtghgLTRb7qSYz0NnDt6vzCknv1kV 9TUtOYWm CjyQuJ+gWZ/bR2iAcpsAYA+wlw2ilt54Aqv+pJuWDfsS4rgWglUNwUbIQgoaHe6L6HPcbzXgANMa2TABhHPRdMON19SDymnekCrwHqoMA3YcmaDBRWI5V3salnfx9PYjTeXQ57geTVjecg0tSYb/Hjb9MyoHgsU+EnBMhVrzFUrfSk7Z8CDC5Ts99ztAdAdIlk3OXZCMythQ5lVUSoECiIrWEX+iOcv6Brrr1A/nWLVVe5Qhe07PuaEPpi2Po/MmKOHYkDbyBcNFL0DUUGqBelMvb0J1Vn24esLy/lPlpDZ4WIt3T02mKChnjojQ0238TX1G+wv0BoT0P/we3oIUGlLAP7zXZ5GtHLOBEzjTYKnnrnlLAg4Exc9RQOs6qireaHvwXVuZO77qwJzkZZSO0rYe7Nw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Improve the readability by replacing the custom aligning logic with ALIGN_DOWN(). Unlike other places where a similar sequence is used, there is no size parameter that needs to be adjusted, so the standard macro fits. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/kmsan/shadow.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/kmsan/shadow.c b/mm/kmsan/shadow.c index 2d57408c78ae..9c58f081d84f 100644 --- a/mm/kmsan/shadow.c +++ b/mm/kmsan/shadow.c @@ -123,14 +123,12 @@ struct shadow_origin_ptr kmsan_get_shadow_origin_ptr(void *address, u64 size, */ void *kmsan_get_metadata(void *address, bool is_origin) { - u64 addr = (u64)address, pad, off; + u64 addr = (u64)address, off; struct page *page; void *ret; - if (is_origin && !IS_ALIGNED(addr, KMSAN_ORIGIN_SIZE)) { - pad = addr % KMSAN_ORIGIN_SIZE; - addr -= pad; - } + if (is_origin) + addr = ALIGN_DOWN(addr, KMSAN_ORIGIN_SIZE); address = (void *)addr; if (kmsan_internal_is_vmalloc_addr(address) || kmsan_internal_is_module_addr(address)) From patchwork Fri Jun 21 11:35:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707333 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 9785CC27C4F for ; Fri, 21 Jun 2024 11:37:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E25428D0159; Fri, 21 Jun 2024 07:37:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DAA4C8D00DB; Fri, 21 Jun 2024 07:37:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD48B8D0159; Fri, 21 Jun 2024 07:37:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 933F78D00DB for ; Fri, 21 Jun 2024 07:37:36 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 4DDBD1C1F4C for ; Fri, 21 Jun 2024 11:37:36 +0000 (UTC) X-FDA: 82254695712.09.6DB6EBD Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf29.hostedemail.com (Postfix) with ESMTP id 24E08120017 for ; Fri, 21 Jun 2024 11:37:33 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=fbsMil0j; spf=pass (imf29.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969846; 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=Lus2RQSPSM7ilXLn7l1YCQD25SLYNKHC3cJu5hwIwnE=; b=2RfVeeX4pPDN/9WQAhDyp7uHV3xU7PQWXqJ8ZsrurxlHMcNdb26j7oypoAm4vQ1bewvBm1 OC2TH/02tWtHZiwN3+o8hCMspB5BpBVJR847+BKxXeBiJd7KE/XhF987RUq+gZRnoX8BRn rm2LVz7afnW5cjhZ1VcQH6QpN0SFgY8= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=fbsMil0j; spf=pass (imf29.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969846; a=rsa-sha256; cv=none; b=DGFwo1gIYjJK2gHPjsqZZyUHs7QR04fhGbOrwNW+VJQ+pD+CZ4pRwu39nrWRVi02FN+fEu HKjV/qjl8E8l5p9TjAhqKqzjPfRG3iyMNJn3uKV7IlsdB9uOdHfWfBHSOOS0SYdPjqZesu TpZ2tmMabxS0uU9XWj4x7RNxlTFyVaA= Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45L8gL1Y029535; Fri, 21 Jun 2024 11:37:26 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=Lus2RQSPSM7il XLn7l1YCQD25SLYNKHC3cJu5hwIwnE=; b=fbsMil0jBMI/y/i9//oigbamPhNLm xTAC38h662OGad4kCC2Jfc7YJfjRNfK6RnhCYK9pbA3MYqqqPtLCiH6br4lE6g+U hiki9rSBfKW5/tuI3QlEk49cuPL9kZJ0/T/r4AojkUaLtHTxoYe5w8X1vnqI9yH7 Mw30mz7ggQjMOH9kUvam+I+R6SjCuCANtFMGWwujGWMY2OzkcbmZCwrhjQlxyHAd RcvG+eNyHvi7HVc606Ajr8g1z4WQ0ixQdmlYEaf0LMK66zKYrKpIQzw1y2tD4aW4 AxSAFpnG7q7Z3SYxWrlpOwIVzmyfiyjoKNvvDbIxE0OmN5Xji9WxA1+oQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw5ksrgus-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:26 +0000 (GMT) Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbPNI011172; Fri, 21 Jun 2024 11:37:25 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 3yw5ksrgun-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:25 +0000 (GMT) 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 45L9ITHD019974; Fri, 21 Jun 2024 11:37:24 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrqupvyy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:24 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbJ4g48693522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:21 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EC6292004F; Fri, 21 Jun 2024 11:37:18 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 63F6A2004E; Fri, 21 Jun 2024 11:37:18 +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:18 +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 16/38] kmsan: Expose KMSAN_WARN_ON() Date: Fri, 21 Jun 2024 13:35:00 +0200 Message-ID: <20240621113706.315500-17-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-ORIG-GUID: KG3-KuwzimdCy9fz-zfFvPuK-LKymJ_g X-Proofpoint-GUID: 72jJRBL-nnrHizPPhKPV3cqq5Hp9wCZ2 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 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 clxscore=1015 mlxscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Stat-Signature: xg9dzgasigq6rrr9h5w45ksr3rddgptj X-Rspam-User: X-Rspamd-Queue-Id: 24E08120017 X-Rspamd-Server: rspam02 X-HE-Tag: 1718969853-9054 X-HE-Meta: U2FsdGVkX1/4hK7gBuHNj9Mr0WmTaOA7/JyaFLQEhFFGKjJ1rMjY2e6b2R2zqke7gbxOI2IliX4FGRYlXWxGWe2eLfTuKSyKemKZK+V0LJLyZyIgAz/SZSwUmbvUVJ8jVcSmoh6hF6STQUtJe+zgatHZicKYHKm/8qWwbK/Zojg7hvEq+DgjGiSeu/nOSO3XnFVDd8JisUZ8Lgxw+OftJKn9GpasUBX2mrlj0A6saV6+3srNal06/rTh+Pi7bxEQ/iMu/oaeopGXWeyctJXFlL2q91xmjsHB92R6y48ChxiOQl3irtNrHGngjpQXuv4uWcU8G3RLNdUOhTxmisfcolmWbps3zuvgII5mR2WnxgFL7c3VgAc6kza362FHs5hXkRapY1/Hc/UOka9ytCQS4naUvZrnKRHWTFCeSFLJX6cuyAXcUzmpOhJJ+J5vfvs6bBVM312tum8OfohmM+EIvhne3j91rrq2UWT+Q7HdemRA89NliXvx3VewBNCv9AgKfWSrwV3j25lSh1BLtLWhLX14U6qCq8JlONSs+r4WTv0s/tAfP1xbKYFDtqaUWW6gSM3XlIMoPh74jKMB/oSoSAjvqhDxl30cNy3Y2IOw+MloxfG3iaGdj2SCt39CBCaNPhx11Dbr7xxXBHZucM5wzdJx8yofWJZKx0XgrC1ZVmu+cIm6HUrJaUn6TusIxbOpmxZdPu0wNMxNhMccMev5QP6w9L/hEr4JYW8gpePckpx2F6HoX7diq41d73uRhhYK1W9QqivcGMT1Xu37C2rVtU3WQHUfEQhgBRLGGOv708gep1fvJ4kbiBlsUCQNPdhOlVQu6UcZHZtGKUo3OQOt5thiIoUHjsNnhP5mQ4uIskNCtLI7L3uNQe1rEH/Lf9Q0dIcRHtClFxixWQdfIfd7MaU8wA6A4j7alBLjTkYkobQ4Cuxf/RkiyvYXPJmASoIL722AVvGyOKYkrg/Hlr2 eGB6Jsw4 BGrQAd3Gjh7DclqwkdAAJaaNlx1zZEO2vgwhSSa8f+Cqo7t+BHCT2ZKxxBfl6OJS7unHUIDvumlFuCJeqhab6O4AcKDSQ/745tnL1YXr0ioaaUxv7YITJGuPqBqAAKbhzMvMbao+p+sx3Lu3X067piyMf8JzWrhTpP+Mn5MjkLhOUOdf/txiieJdGzAdHEFbmm0q3v9017AHeu1imboZGx4nyd26EDssHXBdHFUmROQY0SCbQ9gQIKph6kky7U72g0af5Y5FSXywbjpEoiI62tfJqZKq61Jt4mwqE X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: KMSAN_WARN_ON() is required for implementing s390-specific KMSAN functions, but right now it's available only to the KMSAN internal functions. Expose it to subsystems through . Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- include/linux/kmsan.h | 25 +++++++++++++++++++++++++ mm/kmsan/kmsan.h | 24 +----------------------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/include/linux/kmsan.h b/include/linux/kmsan.h index 7109644f4c19..2b1432cc16d5 100644 --- a/include/linux/kmsan.h +++ b/include/linux/kmsan.h @@ -268,6 +268,29 @@ static inline void *memset_no_sanitize_memory(void *s, int c, size_t n) return __memset(s, c, n); } +extern bool kmsan_enabled; +extern int panic_on_kmsan; + +/* + * KMSAN performs a lot of consistency checks that are currently enabled by + * default. BUG_ON is normally discouraged in the kernel, unless used for + * debugging, but KMSAN itself is a debugging tool, so it makes little sense to + * recover if something goes wrong. + */ +#define KMSAN_WARN_ON(cond) \ + ({ \ + const bool __cond = WARN_ON(cond); \ + if (unlikely(__cond)) { \ + WRITE_ONCE(kmsan_enabled, false); \ + if (panic_on_kmsan) { \ + /* Can't call panic() here because */ \ + /* of uaccess checks. */ \ + BUG(); \ + } \ + } \ + __cond; \ + }) + #else static inline void kmsan_init_shadow(void) @@ -380,6 +403,8 @@ static inline void *memset_no_sanitize_memory(void *s, int c, size_t n) return memset(s, c, n); } +#define KMSAN_WARN_ON WARN_ON + #endif #endif /* _LINUX_KMSAN_H */ diff --git a/mm/kmsan/kmsan.h b/mm/kmsan/kmsan.h index 34b83c301d57..91a360a31e85 100644 --- a/mm/kmsan/kmsan.h +++ b/mm/kmsan/kmsan.h @@ -11,6 +11,7 @@ #define __MM_KMSAN_KMSAN_H #include +#include #include #include #include @@ -34,29 +35,6 @@ #define KMSAN_META_SHADOW (false) #define KMSAN_META_ORIGIN (true) -extern bool kmsan_enabled; -extern int panic_on_kmsan; - -/* - * KMSAN performs a lot of consistency checks that are currently enabled by - * default. BUG_ON is normally discouraged in the kernel, unless used for - * debugging, but KMSAN itself is a debugging tool, so it makes little sense to - * recover if something goes wrong. - */ -#define KMSAN_WARN_ON(cond) \ - ({ \ - const bool __cond = WARN_ON(cond); \ - if (unlikely(__cond)) { \ - WRITE_ONCE(kmsan_enabled, false); \ - if (panic_on_kmsan) { \ - /* Can't call panic() here because */ \ - /* of uaccess checks. */ \ - BUG(); \ - } \ - } \ - __cond; \ - }) - /* * A pair of metadata pointers to be returned by the instrumentation functions. */ From patchwork Fri Jun 21 11:35:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707425 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 5F07DC27C4F for ; Fri, 21 Jun 2024 11:52:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF4ED8D0167; Fri, 21 Jun 2024 07:52:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A7CF08D0164; Fri, 21 Jun 2024 07:52:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8A7DF8D0167; Fri, 21 Jun 2024 07:52:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 630268D0164 for ; Fri, 21 Jun 2024 07:52:13 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id DEB4B140C46 for ; Fri, 21 Jun 2024 11:52:12 +0000 (UTC) X-FDA: 82254732504.11.BE4D952 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf18.hostedemail.com (Postfix) with ESMTP id 2ACED1C0003 for ; Fri, 21 Jun 2024 11:52:08 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=WVsuBQc0; spf=pass (imf18.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718970715; 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=MbSV/0QgndyxPpucafkqjoUk93XB7CWZmEyrMAmxEI4=; b=1Ax3vgi7u2TbkIb8N8tdaTY74oAIPupAXfgRJIl46bPa9e/5zMKcITZRnPlhlYelpr5O6R AG8NzrSrY+LSav3doU+9otOMXoQm/ZuTXIPU8B3BzO+JYXhona6MjGWqUDek4wkDbklBmY 89a7jRI4JgEfv1IgPhDZSzqItYaqBoY= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=WVsuBQc0; spf=pass (imf18.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718970715; a=rsa-sha256; cv=none; b=TNSNIYrj0QbCAyHR6dLEY+gxEAr5mMDRn2AqiB7I9613d+P6mnKUqdVTonQ3Kr24JdoVtU N0B83j1W5vL71Os6NyAPX0nS0sAVtsb/19nGMnMZCo/yONnq0LpHW1B8Gpupc5ysgZ9q5n IRt/gS41vFQIilL/l3FJAQzpjpfPdWM= Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBQuHD001093; Fri, 21 Jun 2024 11:37:26 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=MbSV/0QgndyxP pucafkqjoUk93XB7CWZmEyrMAmxEI4=; b=WVsuBQc056gBtU5qG4HrH2NNNlJUw 7Sr84S5rrk7rEEOfI8//Xw4Ct6YIlaW8FoEJWT6o1jfD6FGf55QjK++BWrXlPezA F1CRnI2JamA8da+d1pq0kb1P91Ond+QCZyub6XUEIO/Dz53dRzsnIum6yxaXqEqo K8+UsK5Jqv+7H+Uibn8v0Qlhg4wJKGbCm58gxyWYwOCRIwvoyCJA4I4tsSlQmP6I E1CtPGzLVMpfXgbmiMyEuC0TwiHzn48bZYddiSFTBrMBJRhK3fJ/pvQgFyh/Efxk mYYtlIibIC5v4/m5ZGk751f+I9Vt36bwbgXNYNVqs2gHOaY7RQwBLiZqw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw5krgf28-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:26 +0000 (GMT) Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbPwi016947; Fri, 21 Jun 2024 11:37:26 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 3yw5krgf25-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:25 +0000 (GMT) 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 45L9Ijck007683; Fri, 21 Jun 2024 11:37:25 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrspeupy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:25 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbJgX45613486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:21 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8B39D2004E; Fri, 21 Jun 2024 11:37:19 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 021142005A; Fri, 21 Jun 2024 11:37:19 +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:18 +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 17/38] mm: slub: Let KMSAN access metadata Date: Fri, 21 Jun 2024 13:35:01 +0200 Message-ID: <20240621113706.315500-18-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: VRoYVuf6wSjVVShG8oiBisGc_65CLQLh X-Proofpoint-ORIG-GUID: -PKd_YmlYz_4O4aDzcsYfKbEiXGbUZuR 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 impostorscore=0 clxscore=1015 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 suspectscore=0 adultscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 2ACED1C0003 X-Stat-Signature: 13hu9qzecm89eyjmkprnngxixiquzru1 X-Rspam-User: X-HE-Tag: 1718970728-157311 X-HE-Meta: U2FsdGVkX1+pPYTMSlt2MJ7s9HfxadiVeUC8zB3Tfpfr+MVlxg/SXlDWpMId05BprGpS7gTXBq8sCpGOvdLpZnR4WUCXPFVepQ0Y6N6+Ha267lnbX+4ItS8xugN0uHGB2I+6PeQmpARyIO1qEpzW2WhGAelkHiEylV3FS4jUhUfEr5Wq91U43dUC2RVJ5blOZB4Yw0TZm31ji82WGIuyfd8hHUYtliGm5FhdPMh7W9YfdnVwUZg8BRNdzEGP3LxgUOFLxqXZksWa4NSE9g62c5pf52rPT2D/zbyzg9021FQC/TLd79yNDQ+uaDATxmSmqcbXErdwlKVpO1OsBoNM0L4XSofaiUW7KYIuRd/IqRgzUxP3XaCR5neR4KFh787TFHM9Ki0G6Xv40VrSzi//YmVMkj4MGxyWWZVOjT8EdFhk8EKLp+R9QgxzBRm1Xa+umSH2s7FD/5ayKkw7oFZPf0hBJPCmGkOApM16qPOEezbozPvvJLq1WsntLz5e0d+Eb9nsqrUAj+9iYxIUtTXspu153R/RNKE/y+VwH6BM3JggYQI9pVVauGP/Or7/bURwAe+R7gl1bVha6qEV0vKfW9f3orUqjPUOSOKHFWmxsI+ZQ67AB9rM27Wabbo+iZWojiME3BGaDFEKKHchCXapWRv5VU0Hmwncj0zgit5yY0StNUQOYnsDgGoAVe1JgYp91ZjJgmktlog1viG9YjpANeKFxVSgqr9LRmxAbgYXTGVYRdi3jn8dTPynAii5kFxenyc/8Jh+C7K/Io18Yc9rSksRKmcToxhXhesb3F544QSHrZI6NIPnNgTBCPpwR7k5injUAWvx9R9eXkmR7FulspLucMPTncvDo9ga1sD0y6GvgLESBUcU6NrNnIyKv6FDqBnarhf+gOZavzb1cNczZkBJ5/b3wn546eaIvEiHad4/nOyubaT+sNotPM9TJOEOSMiW3Hc9HDuJkLAjBoz Qtg9IR3K y7pz3kbl7tG5kh7PS2EKpaeCSJ2YEPDY0yBDGqMjadZqrY4TWu3qJKjY17MuiryU0b2psltYIuYkkYqD317eOkkpPn/UT4fpTXWFayIryqcKYH9YN4vGKgBVEV1IjhNZoeZAqFI405RyTtz7JNNmCc6kbi1X8Pmb+uHU7SARiVW0u4DS4HJHriS3Kyq1Fo+7EWEmkR3+07/xzEFDvCV6vwt5mZ1xXUhEeOk659y0NFfdcGVUPDo55eftkirB8VNMh7++Pju+oJurJ9qzZiQ1qBYaIGmo5uJVWUZQk6gq0b0bU8C/QS/RGeyZ4ZHh/Qs1DMARC73KHOfYi3mLnvF7EexTxyTEe4EOK6MXvqUwUFjqwlBA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Building the kernel with CONFIG_SLUB_DEBUG and CONFIG_KMSAN causes KMSAN to complain about touching redzones in kfree(). Fix by extending the existing KASAN-related metadata_access_enable() and metadata_access_disable() functions to KMSAN. Acked-by: Vlastimil Babka Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/slub.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/slub.c b/mm/slub.c index 1134091abac5..b050e528112c 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -829,10 +829,12 @@ static int disable_higher_order_debug; static inline void metadata_access_enable(void) { kasan_disable_current(); + kmsan_disable_current(); } static inline void metadata_access_disable(void) { + kmsan_enable_current(); kasan_enable_current(); } From patchwork Fri Jun 21 11:35:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707334 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 ABF62C2BA1A for ; Fri, 21 Jun 2024 11:37:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 80DDD8D015A; Fri, 21 Jun 2024 07:37:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7673A8D00DB; Fri, 21 Jun 2024 07:37:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 573168D015A; Fri, 21 Jun 2024 07:37:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2FC528D00DB for ; Fri, 21 Jun 2024 07:37:37 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E119BA0DD8 for ; Fri, 21 Jun 2024 11:37:36 +0000 (UTC) X-FDA: 82254695712.19.FACABED Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf03.hostedemail.com (Postfix) with ESMTP id 95F9520015 for ; Fri, 21 Jun 2024 11:37:34 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b="gCmb/jd+"; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf03.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718969843; 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=DjuPcXR1BibZz5Ch991GiPtCxAY119xb/qfTqg6kigE=; b=vRIGGJ0mlpmXtykTCfy1hgLPDIwkKj27flwRq3yJTor4kgmAnHYzT+DlG3awMcHMlNtXxy CBdJ6uMb8Rp8zazgraSqiMoaDarJPS7jUmHfYCGvsT70E9Wyplh6Pfv96Y2vO8o+eVJwzi uHwVKo63fDpDO708ggbZxfBalSpnki4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969843; a=rsa-sha256; cv=none; b=UEzJtuAPaQLIJnty/4P65NLHUdajOjB1TMpqM1nK71nnLmQZUL3va/6HDkJqlqhyOjr+vD AWgaHw8gp5kP426/Gru0IHnTiDWwTa3cyaKR8RsLs+Vd7gS9PDoUm0y5w4q0CQWi+bKWSS dj/1q2+EWMW2iaoqU8FJvIF8SMg16cg= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b="gCmb/jd+"; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf03.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBZFfl019981; Fri, 21 Jun 2024 11:37:27 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=DjuPcXR1BibZz 5Ch991GiPtCxAY119xb/qfTqg6kigE=; b=gCmb/jd+tRaCgIblXL46fw3Ru9gvd 3CF3TjMMxMyVSfK1w6i3qjTcd6lVoOatzRayVDautrWNG5BYAR0oAEvUDpOyl6eM 1qytDXjek7pQv3nyZ2WYxSjrUmEndYwez31/qIt9IM0I/9yz73snsc1r37y++asY iTD8m3+dOt9kqx2xXJuIZ0IBZVnZRUbnkvwsS5/NE3Rp8KD4ozFspC0RczzV7XYl a/fUrV/AVQ5q9WbZjsGVRgMQprjN/eQd4TuKJ+/OhPpAy6oCpGFjybRPQgKjTRNg lCUWyKQl8DchFTWzVky4/8c0IMPHnEvynd0st6Y+3D2gN4iD5rkoS7Ilg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw49cgpwb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:27 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbQpQ022007; Fri, 21 Jun 2024 11:37:26 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw49cgpw6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:26 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L9H76V031933; Fri, 21 Jun 2024 11:37:25 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrsppv5n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:25 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbKJI51839450 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:22 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2B0822004D; Fri, 21 Jun 2024 11:37:20 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9548A20063; Fri, 21 Jun 2024 11:37:19 +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:19 +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 18/38] mm: slub: Disable KMSAN when checking the padding bytes Date: Fri, 21 Jun 2024 13:35:02 +0200 Message-ID: <20240621113706.315500-19-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: vituer1Uvt-m-Bx1xIgcKWanRH3GTkhf X-Proofpoint-ORIG-GUID: v4Bwds8AEd2AHVddJ8G2HfSGwp0WqKu- 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 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 phishscore=0 impostorscore=0 malwarescore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 95F9520015 X-Stat-Signature: gunab9hbts7fz1eur8myz5b6yx7jgxcg X-Rspam-User: X-HE-Tag: 1718969854-136421 X-HE-Meta: U2FsdGVkX1+OIMUaqfBRT9B+7ujhvVF/u7TOXjFKD2CXXPxSZ9lk5sxYeRIfVyakoIEqwBfyLoOvM9OKf6ByaHFgppv9uikkzTqmxngfA7K1lqlRB3Y/Lf3Hx5jvNOS1899jzVwwNo1HrIOPAwJ/6UhSRJbe36UJy8zqWKl0/Mf25OsPmWP4iU1keM3QcFmVpdH6HO8eTFgUAJqw4gUrSOi4GWjdU5XmxCzISM2Ewuk2umNTvz1bmSgBQzTyfUx3QLIpWXe9aJem0q5P3lUvIUg6xsmnpfYXNLzZyGuwhSaG2gp1LDV0LNb4+acy+x2IjkBIQFv7pz19dMZBA88CRza7vWTsWLLLVitz9HzxGAHsJ6u2JSqPO6uAckwTlHdrlU6XN4lb3rA3OMVBCU/sKYHJPP4LwYe9y0Se4luZAD5FyOSgFoA7b0F5kKLf+WK9Qdr7aKtMNWUhUkqBOD2rkWwF22VFDQLIsnmcrSFu3fNjr89fMe9nGlb5D2qwpNw9AXwa2s0ZaxFmGlP6I06Xo9rNjaiqn+pIGR6hdvsOyL2Mdcmm5jBbcD2brPx0E02HkDtZWbsUqoncTVxvbZLLfg8I7oum6GVQP0OkWZTFzcJQlxniRqMAZvqUSUsEuv3h7ATqPwZRszkTWP3o36zisZR8VYBn6vvRxpfEglnOuDY2NdQn2FD6rTMBJOeIvt0NnTA71WFhggnHCE67FEv4ZCoM8vS5zUdjF/Q9LDAdywtRwJ9vNl4VhIzco1bRp76bPEd5r8W+7e5f0KQmngq3u8Rws/Hdnxbh3WqdAaOh20u23fixNIe2DdEOoaVJIoqr80Rc8AlVHRTF8KqhjXN3Gn+pQDNNuP/yGdHzIbti3Uf2T6PzX/zqk2kglN5Q+UwZc8Bf7DiCQRb/vztyIj6zlBjZgzzjq+YvsZoHU7t1Rgs9zK7IvOstIr77QQu8Q62QGflEbwYdcrIHv54LXXK eAzgAlxI kkrtPErvjmYTpt2UssuNFefAwldSx5rEJD/WOXCLdHU4mYJx8IZjdlombxdleTwGDTl6kiXSYQPZiOfeFTB7DFTh/esVecRcNt2rpHZazSxiqTzODe+K1ikRLEYdJseV70UcIIPSa9n+XPHhfo7HTAZfT+dpBON4l0tXb6srwmrdBUXLLRcSJJ0zb8eYRhv28mlczkzoahsjwqfRw94DA0Ueg/FysuAAd7lvAMC4ztVAk3YMxegu9W/BDUVNwN+hVw04tiFG+5J0FSMj8TAA1PzLvDiznIfbYIdxAIqpLYpRvvs17YjDFAHRhc+cpeIqCNcAfQYHc0U4vSKanpt2n0UaiDvQym+zNYxsl1YoG0W+klnWy+7rS7rBfBw== 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: Even though the KMSAN warnings generated by memchr_inv() are suppressed by metadata_access_enable(), its return value may still be poisoned. The reason is that the last iteration of memchr_inv() returns `*start != value ? start : NULL`, where *start is poisoned. Because of this, somewhat counterintuitively, the shadow value computed by visitSelectInst() is equal to `(uintptr_t)start`. One possibility to fix this, since the intention behind guarding memchr_inv() behind metadata_access_enable() is to touch poisoned metadata without triggering KMSAN, is to unpoison its return value. However, this approach is too fragile. So simply disable the KMSAN checks in the respective functions. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich Acked-by: Vlastimil Babka --- mm/slub.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index b050e528112c..fcd68fcea4ab 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1176,9 +1176,16 @@ static void restore_bytes(struct kmem_cache *s, char *message, u8 data, memset(from, data, to - from); } -static int check_bytes_and_report(struct kmem_cache *s, struct slab *slab, - u8 *object, char *what, - u8 *start, unsigned int value, unsigned int bytes) +#ifdef CONFIG_KMSAN +#define pad_check_attributes noinline __no_kmsan_checks +#else +#define pad_check_attributes +#endif + +static pad_check_attributes int +check_bytes_and_report(struct kmem_cache *s, struct slab *slab, + u8 *object, char *what, + u8 *start, unsigned int value, unsigned int bytes) { u8 *fault; u8 *end; @@ -1270,7 +1277,8 @@ static int check_pad_bytes(struct kmem_cache *s, struct slab *slab, u8 *p) } /* Check the pad bytes at the end of a slab page */ -static void slab_pad_check(struct kmem_cache *s, struct slab *slab) +static pad_check_attributes void +slab_pad_check(struct kmem_cache *s, struct slab *slab) { u8 *start; u8 *fault; From patchwork Fri Jun 21 11:35:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707335 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 0DEEDC27C4F for ; Fri, 21 Jun 2024 11:38:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65E4E6B0184; Fri, 21 Jun 2024 07:37:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 46E0C6B017F; Fri, 21 Jun 2024 07:37:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1EECA8D015B; Fri, 21 Jun 2024 07:37:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id ED6CA8D00DB for ; Fri, 21 Jun 2024 07:37:37 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AA946140CB2 for ; Fri, 21 Jun 2024 11:37:37 +0000 (UTC) X-FDA: 82254695754.17.5368C23 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf11.hostedemail.com (Postfix) with ESMTP id 5A9594001D for ; Fri, 21 Jun 2024 11:37:35 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=EVMWG01B; spf=pass (imf11.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=1718969842; 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=o5OLh1G5igJ7wfCkEas83RRSlonR9xfZGMUuvDY/DE0=; b=QRiCcdkFR4g4baGzhNxsKc2bzoArJ2wCiop+O/O7RvTrTet8ykXUept8JPqS4DGv8c11iC rfGgPRsAWzGvYse+Zftrc+QYpM+wV4SzFEpLUwGmRpoiNZyouLCDIUJivd9UWFGdo8KZRK k5vwb2QbI6X3P2UfumHuKFN1kBglnRU= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=EVMWG01B; spf=pass (imf11.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=1718969842; a=rsa-sha256; cv=none; b=ExinAdLWNyoE3N1zNRHhyJomVppaMWuatqqRs04WZeToPv7ec2UiJaKUrloB+8Agu2Duzi qzs9zcue3aPbxJdIOIX9RMiVpdYrWDcdC6d2ZLPyjd54eJAf9I7Yt/2zdLA71dD1GJz464 1S47VUpvqLFN3p1ovAJjqVbPHFv3lhU= 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 45L9wphq019602; Fri, 21 Jun 2024 11:37:29 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=o5OLh1G5igJ7w fCkEas83RRSlonR9xfZGMUuvDY/DE0=; b=EVMWG01B2oC74lZBbL2kSPnMQZ5Ey GhloJsCiv+elwBctf7BhxcRrVcSkiv0g2G2V9yGfWYfTQfIaRc2bJdcrcGlvrJW3 OWxRPnp1WSA9rr55k6HJbN6/DoWp9IND7o4KAW7MoUK/O2qgZHk/fhTTnx+rCdyh 3H1BjfUk2clfA6ZZpiua3Fsjx+c9IS1AyXnw2+TXz1Jbi6G9VvrXnx7uefnK9+tM QL4sB0UUXmCVQ/8CPXpJ5DKAvAYkgmNOLl7pdqQlkSdxDg10GOL18ycxjPAS3Us6 89uo2XPPczKg1q1E04eP6VRSF8UKl+5IPEFuQvqd/KkHVkGaAfxQyUxkg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw7by86pd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:28 +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 45LBbS0q005032; Fri, 21 Jun 2024 11:37:28 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 3yw7by86p9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:28 +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 45L9KGho030990; Fri, 21 Jun 2024 11:37:26 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrssxvbh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:26 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbK5U55378330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:22 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BF09520043; Fri, 21 Jun 2024 11:37:20 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 351DF2005A; Fri, 21 Jun 2024 11:37:20 +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:20 +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 19/38] mm: kfence: Disable KMSAN when checking the canary Date: Fri, 21 Jun 2024 13:35:03 +0200 Message-ID: <20240621113706.315500-20-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: qNNzZXoNK5Jx7e0m-RV4t8XuUyzuBdnJ X-Proofpoint-ORIG-GUID: 9nqHha1GsHQHCk2fCPLnLz5EA_SBzbVx 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 clxscore=1015 impostorscore=0 lowpriorityscore=0 adultscore=0 spamscore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 5A9594001D X-Stat-Signature: yn3xx4nr994q5df8wp6x1qiy8jqp48gj X-Rspam-User: X-HE-Tag: 1718969855-878568 X-HE-Meta: U2FsdGVkX1/GMT3YJHPLpGUG6BGGyLD2pekKIHgXSWYTjD2MYMzt8dwoXVWY7JRxhTscokLUCJqAgkIndtA2cbyp24+WFbi7jAKejGgYIgayu4DYwhBNrtASxOWLJ7xVoxIwFRWwDSrJszqQergWYsAKVhmPn1y2Ght03RPL4Pu3BHk9Id8ecWCO1au+vIsD+V/I0tDa4mmNymFj0b81NfFcyQIobakXscgoM6KHOmnIbuKqtBblk/2bk0TiQG0QiCJV/m/D/9ZBPA4+b8n7SCcdXp9lyRurr5rLycVmJsSkC2G6WW9BK0iZV3PyGt4yf9/woUBPBLIFGZC/KPB92TlURnmC58Y+c8H9GWt+7CO3z7IhrUnN5OLNTmvTGMNknKa9IIVx1Tqn6duGyRUemEMXCmpZAugRJJMCLigOVuYbkUSv6ZWUlmQ7sco1dHqsWoTF/7BupGjNgH75cUCu4qWAqEH2JxIdkW+7n0R3q0gQZbtY4GU06TP7Fn0nZ/KHPYI/awPW42Z0Si+3hUSJBMWDZre9j85qgIACzxp12Q+IbiTpu2TOTWlxbLCxzsMk0AnR06OE+kWb3GM6WnRAIX45vrL96sRBRVRlCgtjhM+o6E5mG3TIDuEHS/IDqUOS2SWLRNK9fiQQxV5Jj7qcA+Ac0LU/+P/iJc7fZFVhQSFHaUkssq8imVQF1TmpDBY8P+wyXzYWbZ+/oZ1lO0vcXicDY6EqkntTzIr52BcRSTWMMVckicLjMSVPKjvNJG/9HXNEa6oKKKjDniS9kWP/a1HTeA0KU/oS3hfgcy2EE3krioRXJaNw9lsUvMFkSqic36lz0BXGf7Bv7eqB7h8Kxojopy/7spqO4I0/7n2K2772vmfsz8M7RyvtHMZlLPaWFy7TbGPW21obKIioL+fo9N5oW7drJqBDgQ7l9yQW8/RgZvknbQQhskqT5lu0BEKeXbl7lcfwJ+aa7MGfaHS TBfEJUfR mLaJXvF5rd3xpwwTm707Cqkz1RCV6WAnrW16xM6K4bEBsmnpBLl4v6keI7E151DoP+/E6spAb5uhpDCGCwlC86VFgB1DDvdNXDHYAbv9UXGn20G2DJH0s/29nhyiJBIJt7yElSEbS18uEl4nkcFxAPdh3l5wczUBn7+VNq+AQgrXC8/imT89aMqZnsV6LTMITyFd88w6bu6DDTRnWC57kDePSOrg+t/P2ncFfdK3QwqOTSeOhFO1B7oMFCPEvAbi4b8r5ab0DGqLhVbQ21HCaf/4JjHip1mUMQnInfT3LYkE7mAbIAUKUPsc/puP+7YNcaK9G X-Bogosity: Ham, tests=bogofilter, spamicity=0.000025, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: KMSAN warns about check_canary() accessing the canary. The reason is that, even though set_canary() is properly instrumented and sets shadow, slub explicitly poisons the canary's address range afterwards. Unpoisoning the canary is not the right thing to do: only check_canary() is supposed to ever touch it. Instead, disable KMSAN checks around canary read accesses. Reviewed-by: Alexander Potapenko Tested-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/kfence/core.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mm/kfence/core.c b/mm/kfence/core.c index 964b8482275b..83f8e78827c0 100644 --- a/mm/kfence/core.c +++ b/mm/kfence/core.c @@ -305,8 +305,14 @@ metadata_update_state(struct kfence_metadata *meta, enum kfence_object_state nex WRITE_ONCE(meta->state, next); } +#ifdef CONFIG_KMSAN +#define check_canary_attributes noinline __no_kmsan_checks +#else +#define check_canary_attributes inline +#endif + /* Check canary byte at @addr. */ -static inline bool check_canary_byte(u8 *addr) +static check_canary_attributes bool check_canary_byte(u8 *addr) { struct kfence_metadata *meta; unsigned long flags; @@ -341,7 +347,8 @@ static inline void set_canary(const struct kfence_metadata *meta) *((u64 *)addr) = KFENCE_CANARY_PATTERN_U64; } -static inline void check_canary(const struct kfence_metadata *meta) +static check_canary_attributes void +check_canary(const struct kfence_metadata *meta) { const unsigned long pageaddr = ALIGN_DOWN(meta->addr, PAGE_SIZE); unsigned long addr = pageaddr; From patchwork Fri Jun 21 11:35:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707426 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 6DCD2C27C4F for ; Fri, 21 Jun 2024 11:54:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EC4788D0168; Fri, 21 Jun 2024 07:54:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E758E8D0164; Fri, 21 Jun 2024 07:54:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC69B8D0168; Fri, 21 Jun 2024 07:54:44 -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 AD7FB8D0164 for ; Fri, 21 Jun 2024 07:54:44 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 527EB80D86 for ; Fri, 21 Jun 2024 11:54:44 +0000 (UTC) X-FDA: 82254738888.23.68AE58F Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf07.hostedemail.com (Postfix) with ESMTP id 1A47F40007 for ; Fri, 21 Jun 2024 11:54:41 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=KK5KFmUq; spf=pass (imf07.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718970877; 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=pcK1rMwKAY+PK8Ytyz/2vRX/RRHh9XTkiYTIv46ktrM=; b=z5SSiqAxiOrDeKuaXbPB3U3YAHHI4GwXXe8cdAVKE5K4bYpXXLqgKYk/rl3SMi/VRad44Y PLasFd4btpaVzG4ClYEuQsvADWX5Boom4h8rKJd0sUJe7tPIOdGGLs6eXGqh2BmkZaKSTr 98xDeFoloPlNzZ9+H8DuEwDc9EZlLBE= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=KK5KFmUq; spf=pass (imf07.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718970877; a=rsa-sha256; cv=none; b=z/TX3iAsNRFIio5A2Vc67B8FfmytJNWZmxjRPzxppH5+CgZxwmb3Xw6r+flhZAubl64y4j T0XgWSJUAzy7vprJMiDRaNdCdSP8k1OMGtFNaHlgQCHQ/Gfch/EmRGFw8KhbxHQFwx6P5Y gT6yVLV3AWAEroOzK3S4joA7HvjJkv4= Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBQuHE001093; Fri, 21 Jun 2024 11:37: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 :content-transfer-encoding:mime-version; s=pp1; bh=pcK1rMwKAY+PK 8Ytyz/2vRX/RRHh9XTkiYTIv46ktrM=; b=KK5KFmUqFy+pAtK8dSlZyJeirzy+D vjgdsTAcMBMHfKZlEn+Q2I32LnTP1xKT+UjtKrTPGj/LxxIr8u4RqtsxNVD0CASx 5Ab2N4AqTZwsfnraG1oxqRJ8FfDHT10hFT2pVjEZT1vxBvXHy385Ok6RAa3r9uz1 sCmMt2FQAvxECLfUZwAiotv/hmcXX/gUjE27WfarwXeOsJjtOyFaia9zkTn3kWg3 5KVEwTWe83Is/+9SmczThu9FnFTj5FCQEk0RZx4d69rxGpbqVIIr7DW2VEtOvF8k C4FSh9yI7xIz3pOnWnnvkit4IG98OuefsYFmkYUSnH5/NMJKAIcZFpo2g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw5krgf2e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:28 +0000 (GMT) Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbRMl016963; Fri, 21 Jun 2024 11:37:27 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw5krgf2a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:27 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L9FnW9032319; Fri, 21 Jun 2024 11:37:27 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrsppv5q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:26 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbLhN37814576 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:23 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5D8762004F; Fri, 21 Jun 2024 11:37:21 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C90AE20067; Fri, 21 Jun 2024 11:37:20 +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:20 +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 20/38] lib/zlib: Unpoison DFLTCC output buffers Date: Fri, 21 Jun 2024 13:35:04 +0200 Message-ID: <20240621113706.315500-21-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> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: wJtOQ7TAKKf4TPkcI736NUE9Ic4mpwZq X-Proofpoint-ORIG-GUID: GqZyPigDgr7xcJiQq6qOfnvPbViWBKhq X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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 impostorscore=0 clxscore=1015 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 suspectscore=0 adultscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 1A47F40007 X-Stat-Signature: ihe6a3ffiyp6npfa1ufrofts5e6xmaer X-HE-Tag: 1718970881-791551 X-HE-Meta: U2FsdGVkX18dTPrajwYl10nGfAl4XHR1f5AH/6k5aXmPjYsgTXfaREn+bwRkSIeQFrCgxPSSGuf3KGS7M1FSfdtwcHKiXMXzwa/ebW9k6zrjVMdIY0h2Xi7lgKT7M0P3aEwHPzXbChkSmN2BWQC71rNiPYc1wzTreFL3qelBrAhE1veTO+xGPoJwDjD0YQ9b4oqy8+97kp1vrPmf28uWrZWwvu1bP9BGec9pbr63f1Vk9s1UZsNY2UbZeizDN7iFbun3wyTOhsRg5KBerP5/DDB6v4V7OMlv5FNUB6V4UenrkOIomjfJRqqHFw2sd9rhuqupbqn/8Ld+xqZxLrduOhCrhRAN1nYnW916KdwgBrFzQcAOAbDsmaxQyXaTBdaHun9h71tpNryEltRJiNoPTECXr085KVm357DsG7ZuL09vQjwFlpq0agSYd2ydlwQLufL5KVBBeHTeEDQDS8RJQaVdpoDGtmi++mUrb0o6eHDFygsssp5bgx3aZDPdeFWHKFJ0Cty/O1GJeWx2Fkvib9TPsCiFle3XuAK3s+mu6lIOQClO6sSgT422zhR5dDRMWupm0BsHVmFxsLVJNSOhLpqLjgpAOGfEVf+VdEgCyylIexsXp+KH8KhUgBFH1J88LzW/SMKB25DfqwxiE/TUxakuVSHthUUq7hxPXY7a+inpSJ0Prca3qSnVP744fCCSwz3yJD/UMTmwGwpjamQQrdNLNlBD1h6dgHar0YLe9qTWc64OtMSQ42J03tXUVH54hSATw5n3tC6XLQ8Vzgrg+CLT5Usalg0iTPv3YsMN0P7dVBXSV2z5jLV69YSLGzgRwd5x24oR4Ps44rRFp2yPjR1VbQhQqrcaYgbETGF/ATx6WnrfIV0/RDKkzFrHu/y8tYgMaz0r6CA5qFueaR+ZjUDU/Zgg7BBbqJ0YJ1AHYFN8cCI0DrY+NrcWH7EidnWpecvUN5qc7q9nS+vW/LJ Z8AD2mgz yAtOb0FuG44zTpOklfEETR21RcgmH+o4Haacg1yl3PgoX6kcIdOjyxd+36GW7gQ+2X/GaKj1TsKnNXdE0b1O3rpmJMOhV1l/YfLufd1ct7xwsc6bOZvP1mGjhN74uhoMaKV9Zoy9U5qU9UZ/MdtSSPzkD0ti6+yKbnGsmIamnrPbKe5jd/QCajNIGsCSQq2A2Ob890knUXx1b8WhGWbvApZaXtBUg7XXQEW0LDIgFmgsI5i+qMSPl8x7xdDddMC01w3xP+JyrQd7k7bSAfEdvLsNSoV5QJU5QZbw2JTmvzE8urBbpFFh0EF2W7Yqb5sjYmYTMfXqtVlbtNAqdHM3+I1tgRUDoZFDSYiBXqzVx0VKzWO6bvHHZ8BP2J6l1s3hd/Z3uOQGZkne7XrESgWB3ZSs8N8mKahYWPfF2TE2olJ8BIBqdx3TrUIl/LhSmL/KF1jU1L+bzi5YZJOCKPoZPZe5Z0Q== 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 constraints of the DFLTCC inline assembly are not precise: they do not communicate the size of the output buffers to the compiler, so it cannot automatically instrument it. Add the manual kmsan_unpoison_memory() calls for the output buffers. The logic is the same as in [1]. [1] https://github.com/zlib-ng/zlib-ng/commit/1f5ddcc009ac3511e99fc88736a9e1a6381168c5 Reported-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- lib/zlib_dfltcc/dfltcc.h | 1 + lib/zlib_dfltcc/dfltcc_util.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/lib/zlib_dfltcc/dfltcc.h b/lib/zlib_dfltcc/dfltcc.h index b96232bdd44d..0f2a16d7a48a 100644 --- a/lib/zlib_dfltcc/dfltcc.h +++ b/lib/zlib_dfltcc/dfltcc.h @@ -80,6 +80,7 @@ struct dfltcc_param_v0 { uint8_t csb[1152]; }; +static_assert(offsetof(struct dfltcc_param_v0, csb) == 384); static_assert(sizeof(struct dfltcc_param_v0) == 1536); #define CVT_CRC32 0 diff --git a/lib/zlib_dfltcc/dfltcc_util.h b/lib/zlib_dfltcc/dfltcc_util.h index 4a46b5009f0d..10509270d822 100644 --- a/lib/zlib_dfltcc/dfltcc_util.h +++ b/lib/zlib_dfltcc/dfltcc_util.h @@ -2,6 +2,8 @@ #ifndef DFLTCC_UTIL_H #define DFLTCC_UTIL_H +#include "dfltcc.h" +#include #include /* @@ -20,6 +22,7 @@ typedef enum { #define DFLTCC_CMPR 2 #define DFLTCC_XPND 4 #define HBT_CIRCULAR (1 << 7) +#define DFLTCC_FN_MASK ((1 << 7) - 1) #define HB_BITS 15 #define HB_SIZE (1 << HB_BITS) @@ -34,6 +37,7 @@ static inline dfltcc_cc dfltcc( ) { Byte *t2 = op1 ? *op1 : NULL; + unsigned char *orig_t2 = t2; size_t t3 = len1 ? *len1 : 0; const Byte *t4 = op2 ? *op2 : NULL; size_t t5 = len2 ? *len2 : 0; @@ -59,6 +63,30 @@ static inline dfltcc_cc dfltcc( : "cc", "memory"); t2 = r2; t3 = r3; t4 = r4; t5 = r5; + /* + * Unpoison the parameter block and the output buffer. + * This is a no-op in non-KMSAN builds. + */ + switch (fn & DFLTCC_FN_MASK) { + case DFLTCC_QAF: + kmsan_unpoison_memory(param, sizeof(struct dfltcc_qaf_param)); + break; + case DFLTCC_GDHT: + kmsan_unpoison_memory(param, offsetof(struct dfltcc_param_v0, csb)); + break; + case DFLTCC_CMPR: + kmsan_unpoison_memory(param, sizeof(struct dfltcc_param_v0)); + kmsan_unpoison_memory( + orig_t2, + t2 - orig_t2 + + (((struct dfltcc_param_v0 *)param)->sbb == 0 ? 0 : 1)); + break; + case DFLTCC_XPND: + kmsan_unpoison_memory(param, sizeof(struct dfltcc_param_v0)); + kmsan_unpoison_memory(orig_t2, t2 - orig_t2); + break; + } + if (op1) *op1 = t2; if (len1) From patchwork Fri Jun 21 11:35:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707336 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 ACEA4C2BA1A for ; Fri, 21 Jun 2024 11:38:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4D338D015C; Fri, 21 Jun 2024 07:37:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D39E38D015B; Fri, 21 Jun 2024 07:37:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE9E28D00DB; Fri, 21 Jun 2024 07:37:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 6693C6B018B for ; Fri, 21 Jun 2024 07:37:38 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 23FFA160D90 for ; Fri, 21 Jun 2024 11:37:38 +0000 (UTC) X-FDA: 82254695796.05.B2983C2 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf16.hostedemail.com (Postfix) with ESMTP id C7070180004 for ; Fri, 21 Jun 2024 11:37:35 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=h2ird5e7; spf=pass (imf16.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=1718969845; 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=eOJVqKOJuZasA86pPY8j/wtn7XC9Zj2RO1nXjWn3Mgo=; b=AFWrF8ZVRwZjBqvLKIqvXIGBDfR4WqNBUbHN46iLSkf55WTsof11kHTEZ2WeXOfbmUgQSn GVd18EmH6mjU4+0U9R6LPn2/MlqXO/+/G5JXZUsOS/UYjo14kPyorRF569/PIWyhhoQFjK kdZ/lN7gV/fW7nYWA/KdlRXHS7s733s= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969845; a=rsa-sha256; cv=none; b=4uy2RVV8WIXfPsvRZT6fa+2iaBDQoK0cttOMu7tO0yHsjxZ1mQfMexRmhQJ/QzCitIZgdz KAxjQL/dyI2Kqg7s6AyEDWTpIFIg800v0s3RrgUtAofbNYkjLzxPmn9MCq0DbyBqXs/G5X gGJ1760A/ABqUXb5Y4qf9Kl+0T3oEac= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=h2ird5e7; spf=pass (imf16.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 Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBQeuM012239; Fri, 21 Jun 2024 11:37:29 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=eOJVqKOJuZasA 86pPY8j/wtn7XC9Zj2RO1nXjWn3Mgo=; b=h2ird5e7i3JfLYpr9qwt1Hy5roSMh S1i6MVoeXZOyEHb43HFhpraS2JGEJL7PA7xR6Wz/veG3J/4vm9DD9t12ia8ZW4i1 a8X3NSf+uEXLnYATLQBMdoSdbX9hA8GqDKun5x13hRRuQaM94NKcEDa2LUyHif4K QSgPVCjb8qr9cAN8/gllJBa1O8WIwH85kF4FLXR2MQ9OnnXjLLvm6IPs1KJlFigy 1TIpjfaSFPtDdpoOBiI2xFuNIAt2gGvOULWN4W2IFhQMRMSKOELGn2XpryVttXAv QkgSbopYoSBfllsm1TWtE6z8ZdAr2z8S7KysuUUulY7rZFni6CJsEo/fA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw89g0290-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:29 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbSS1029851; Fri, 21 Jun 2024 11:37:28 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw89g028w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:28 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L9DLqD031890; Fri, 21 Jun 2024 11:37:27 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrsppv5u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:27 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbMLp56885692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:24 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F0FEF2004E; Fri, 21 Jun 2024 11:37:21 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6786E2005A; Fri, 21 Jun 2024 11:37:21 +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:21 +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 21/38] kmsan: Accept ranges starting with 0 on s390 Date: Fri, 21 Jun 2024 13:35:05 +0200 Message-ID: <20240621113706.315500-22-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: toFATofS8B9_Z_taxWBad7ov9MB1B9Uz X-Proofpoint-ORIG-GUID: 9wCxo3our9e3SLqooNZeo9rdl58xG5ZV 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 priorityscore=1501 mlxscore=0 bulkscore=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 clxscore=1015 impostorscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Stat-Signature: jned36zrf74icdj36ymiza1dxmw97b4s X-Rspamd-Queue-Id: C7070180004 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1718969855-389386 X-HE-Meta: U2FsdGVkX1+uJ6dVu5NvKFC2W0hxecSxyqaFtY8kbrh3qn/+Bjc+PYB8hC6Aoo3o+2NbHCFV/L7wz+IRCjUypxlJD2lcTx669N9QDOe2PAzfbX5F0HPyZttb+WGYeIrlMzcv84Qh5ZddsiIq87inPlkk2m6LT+7F5posjb8Aa6dJukXoZgD9Epe6kshqKLX7zyf95ddq5EMFfA57t6MUNT0O211Wxu5BXUoAuN8pn/h1pxT5Dk/jQajlMXAdatRLGVOFaYCuPFX+lp4r/KJOHb04OjH9FMLFhh5lIPoKdzbFI/6l4/FgkGGtm1NA35hg9G9U7bsuFncQ4iHvWF4CbWGpIomduWBS/XJy8+SOgh6TZHsxNUOhxqCq4tzIb/I+AU5B92XRJq9zVqoLFoq52xIQiIsh16/Bpz2o1sx9Mn3T43592ue7vTlA6bOSINuBm8Rzi2Fb4IgVv2XRdk6WWdJwWXEJCHfX7OvyQJU0+8ze+4BbdqM6Bgq8aDpg8PKZh/GVm8TzLvB1wIn9s8EOFdgV1FfA0xk3ZmFDS+R1emcJRqs1+Yh5FybFW37LkJ9aYmxujAVc3mI1lxCO/TKhusRturzAt0irNgi5BWoEP6CwC6KPgrWjd9iwbz10yBx1eU6/PavX0mkOeQKvPY5KyRwAyuBzMHzETtoob0U8T7jNxdd/mq5g851DFP0HuX1I7E0/tBbZepetseUen9LG5+btgLjaBprgo+2lw+lIntAzEBbuNs28FYZk5vHeaztKOSrV4TybqPUA4mSLl/yJnTgPU4yLeqXyJHGDS5JMy5uHKE5UJZcK0beQe34Zq4eewXGgjso+VUBq+n3rv/EyRw7Of9gq5fdyf2WCCwjDUWSxh+1IDSCg/khyvlAk4Q+NqveapUqhqEVTxMFkFVDRyO56yhTqOjRdX6rTo8BWtRKyx5IgeTjr7alzlWtjLBIF0PldXLSMff+RBTh9aZx gC8N+2iW Y3izRC8nHgcAE8qeycAv1pSEvUT4cITTdtBIJZC1uTFpuVV+Z8lw9Zd+SSYQPLEswAoNaSzRcPLN4IbwGLnNUDetmOwKMteQfU6FiVfzRt/XeEqYTS7tfDJwu9XAvH7k++vxz8zhV07f/QtHWpA8qQ94fpawW1gCHBRkwJsos2bwRsiAu+eG7qynoGQaCiXWrCW8M3LCW8WG8KjXNhHRW9FqVrWgnkCNbVEk6Xi/+0nqfyw3wM/iwaiEoRNQsUMxCuixxgpMoj5mkKnGxYF9o8PsdLGIuQtF0/KGZX3myKIyM4WYWOS+OWc/H85xiuwFAbKxlLPbV1piOVk5itHR3C1ZuHTcajAaFaHvzvGIqdgPXqQvqrBsVGI9HUVlPYyGbJAfvr/1TIITWYn0yqISJRgz0rPnWTNX3usZ+CCgm0jKIgh3WQkjzP8RM+VVxxcafanYz 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: On s390 the virtual address 0 is valid (current CPU's lowcore is mapped there), therefore KMSAN should not complain about it. Disable the respective check on s390. There doesn't seem to be a Kconfig option to describe this situation, so explicitly check for s390. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/kmsan/init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/kmsan/init.c b/mm/kmsan/init.c index 9de76ac7062c..3f8b1bbb9060 100644 --- a/mm/kmsan/init.c +++ b/mm/kmsan/init.c @@ -33,7 +33,10 @@ static void __init kmsan_record_future_shadow_range(void *start, void *end) bool merged = false; KMSAN_WARN_ON(future_index == NUM_FUTURE_RANGES); - KMSAN_WARN_ON((nstart >= nend) || !nstart || !nend); + KMSAN_WARN_ON((nstart >= nend) || + /* Virtual address 0 is valid on s390. */ + (!IS_ENABLED(CONFIG_S390) && !nstart) || + !nend); nstart = ALIGN_DOWN(nstart, PAGE_SIZE); nend = ALIGN(nend, PAGE_SIZE); From patchwork Fri Jun 21 11:35:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707337 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 D16C6C27C4F for ; Fri, 21 Jun 2024 11:38:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2FF4C8D00DB; Fri, 21 Jun 2024 07:37:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 286588D015B; Fri, 21 Jun 2024 07:37:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E46FF8D00DB; Fri, 21 Jun 2024 07:37:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 9F2CA6B018C for ; Fri, 21 Jun 2024 07:37:38 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 592171A0DD1 for ; Fri, 21 Jun 2024 11:37:38 +0000 (UTC) X-FDA: 82254695796.06.5748D36 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf08.hostedemail.com (Postfix) with ESMTP id 2391B160016 for ; Fri, 21 Jun 2024 11:37:35 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=BVvfizPq; spf=pass (imf08.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969850; 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=OrFUkNCKCdyNkojULrcA9z04Ys3K5qGxpLIcxQ1wcAk=; b=JPReSR9EGbUpIxzUXUx6lB4QK1Y0sGLA+5t8M8hjAxkUD5j+DW/IWwL5HgwrnwHdnzjArj 8pClXsV9FPhfVynwoSvl98ZEzW7Qvlid+MxVRdTqpviNbAWSgwW9wNU+qWqQlHkC0l7Osk EmDrnhWVXvLyUeBA3fGYyByZO01LczY= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=BVvfizPq; spf=pass (imf08.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969850; a=rsa-sha256; cv=none; b=wrKELKAU9g9I/t2jJrQW+oWJ4YncNk8jeeW3G1rlJ0+nQyR+30U6CoEWUKMTABnEiB0K8L lSyxpFijtt+ofaw/ciW7kJwNIWYYh4qx+ZveygC57aaHbSwyAXs9PBqnOHG2vsdQ5W8GRK 4L9Cmjd2aJYPeudAskFShFs4jVaFyhM= Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LAToPh001746; Fri, 21 Jun 2024 11:37:30 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=OrFUkNCKCdyNk ojULrcA9z04Ys3K5qGxpLIcxQ1wcAk=; b=BVvfizPqmi737elPzKjbOOXcSIA6E 1MykHdE0vH4HBMSiGRCizrC4yI88HOZ5B/xpF2b32CAIeeW4pJcR/+kzdctTD0Q/ sS/+wLZe3EZg11WZekEjlGZj/ODES2AVDioSTtyIpI+wuCZ6cHTgOv+1sctllGUc ejK8W7DUriOArqWRbFcD8yLa5MzhL0HV2VmQO5h7iiM8o4ZC+YeuLyubuWg8XS6R QFtMZx9deDQUI01jjGNg8euMxSdcH5zEYnYwEmaBu44CzCBYivtHbsh9muoaLlCG UScW139ievzgJcoKQARu8e7HI+bKAbrQprFZt0M7AGSgLRVoVKiLGxw/Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw7t80449-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:30 +0000 (GMT) Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBaIkc002408; Fri, 21 Jun 2024 11:37:29 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 3yw7t80446-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:29 +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 45L9Lx4D030885; Fri, 21 Jun 2024 11:37:28 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrssxvbk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:28 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbM4U53281240 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:24 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8F6B220040; Fri, 21 Jun 2024 11:37:22 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 06CBB20065; Fri, 21 Jun 2024 11:37:22 +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:21 +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 22/38] s390/boot: Turn off KMSAN Date: Fri, 21 Jun 2024 13:35:06 +0200 Message-ID: <20240621113706.315500-23-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: TSC_PCcgL4u2brPpF6RMrVNuprYHxa8t X-Proofpoint-ORIG-GUID: SuT93WsKPhYGRA62ysZuVSH9DSmbhz4u 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 clxscore=1015 suspectscore=0 bulkscore=0 mlxlogscore=752 spamscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 phishscore=0 adultscore=0 lowpriorityscore=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: 2391B160016 X-Stat-Signature: iyssj5zbskeuf5wy5zsb7wfek6736qqo X-Rspam-User: X-HE-Tag: 1718969855-255909 X-HE-Meta: U2FsdGVkX185wbGisl2so9p+V4vJdGD8JezZ2+SKqJs+z6+AQeRgGg2HeZ7j0WQFNoC0ZpeOrmWQoZR10XSFjYmIMkGI1i5c0jcy/FjbDhmInnbKjDaYvXTEq1NNMscWH3vwjzgoyo00x6W46po7GGUWMmRWZfLZDWKKm4Ak3G+tHKuy3/MP1foBSDV6rZK7kcmoFWsZbH2lUq4HC/KuiVdIiV/LgeyWt5joi+GiL35QUJr5SGLXM2QPEDa6m7lkLBTgz/NDRa/hVdThEJWdZYqoSraAvl57mQE68wmjmWn2GFoBBwpaBPqAOHYpbQlSGiix4yGVFPugd3lyCchx5zpJFcVFlTjsDNdlqv1ytVcbvX+Ey3MXzp1iO8yCHt00KptNMfwH4knPHq+rGZ4NMM1XIuumLTlDkCer2N0iJsah8/g/m6bWdLgrYo0EUSZW3ByGlcf37gIXGcm2n5D6pOJB0v5G3ESLcbSOGi4fm0NINS/Vs0v7qo6YSP6Hs0XqCRRz5FsO4EiHdR9P7Eq6+2Xjnxr9py6KIwEZBui6YZHcjULFe/FKA0mCVHAtx78KwuQrrymxZexpN9CXxJsnODxWjX/4rd+HJjAPoLo1bd3SLux/7VGRw9rDHmubD99KHN87BhpYfavwjncJuzLTYFTITSJVoS9D9kAgPSC9aW1L1syk044DRasD3veOXcuzX6jvDr9FHA/AapnYrjftxqRoULZGHH9QKzgHIHTzZ/1hb2C8LTKJ95s6WWj22TUSR/cC/kYckb0EjAHCb0LQoNf/tU4DyxhV0x304bclAvhER145RtOLOSae/2vZTVGIIkaoxtIsngF8Vrp0DsU0AqlPbRtx54aqEcC43+a93gxmPefjn14Hfml1vCmHhcFrcq9sqmfscOIV8oVhUk/v+TbNUDXRicr8ZWvtC6pBu5tQfdm40rLTSdngnrWBKMJoTU4hr93jOs4YkB9DTqK T0AddA0h 1WOt5VEoAO3+rfaOvxuo59FwvxpuU711nLyNJ8rnLbbwbPqMPFJ9J2wae5zD32Z2CGzKWdfdPH3B5I7YDxuiofzfQPRvzWJ7eR/w0/JDIcVnsU7HOfwGE6DxgOVD1bkQRV4xC1CRgQXLHKqpHO2i1dBuBf1nkvg/EqdRIJUu5Hlst283z9DPevXVnhMIO9zlLxh8FXIVveahNOXyjrakXsdZSYkn6eGqXjUrjpcx4N8h18FtFH+pff4BmTptvQsGlNluqM1yd6KvRlPyQ9Y931AoIy5+1I3H+cuRve8ZAlipreyImfS2hYlc01Qlq1dNZMWrSt6hnq7ZS9O8DZVL1baYM9UdvOvobBXRkxsBH1htav3g= X-Bogosity: Ham, tests=bogofilter, spamicity=0.003660, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: All other sanitizers are disabled for boot as well. While at it, add a comment explaining why we need this. Reviewed-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/boot/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile index 070c9b2e905f..526ed20b9d31 100644 --- a/arch/s390/boot/Makefile +++ b/arch/s390/boot/Makefile @@ -3,11 +3,13 @@ # Makefile for the linux s390-specific parts of the memory manager. # +# Tooling runtimes are unavailable and cannot be linked for early boot code KCOV_INSTRUMENT := n GCOV_PROFILE := n UBSAN_SANITIZE := n KASAN_SANITIZE := n KCSAN_SANITIZE := n +KMSAN_SANITIZE := n KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR) KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR) From patchwork Fri Jun 21 11:35:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707338 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 49E69C27C4F for ; Fri, 21 Jun 2024 11:38:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4D3FC8D015D; Fri, 21 Jun 2024 07:37:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 45A2B8D015B; Fri, 21 Jun 2024 07:37:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2AF978D015D; Fri, 21 Jun 2024 07:37:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 053408D015B for ; Fri, 21 Jun 2024 07:37:39 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C19FA160D93 for ; Fri, 21 Jun 2024 11:37:39 +0000 (UTC) X-FDA: 82254695838.22.9026F9D Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf28.hostedemail.com (Postfix) with ESMTP id 85F54C0005 for ; Fri, 21 Jun 2024 11:37:37 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=UkWan7cU; spf=pass (imf28.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=1718969847; 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=EM2Q29X1oynbiWdgAiIUaE04pJnjihVfcXc099lsq1w=; b=cEMqaywvtORaQ6RknV2VWxRB+KzeFhGbGuANc+GngUHUzXyZPcCb61HcF1Fc/tzR7Pt/fF R/3TetsaG51vKdA0WUuDY/tCOmjrOTEoygw7LzOxdpqZOqRQXmNv4pg5RCa/b4HkSVg1dG U+EdWXi06EwRJqNDShwPAW35AXllalA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969847; a=rsa-sha256; cv=none; b=JoDhmCp/FMVe47WnFiusAxMWu+pIMpUmOqqQhcv3/zYKGWcsS0PIoZjq6bCWIpAHH1Sz0p LTVIgFC1bPFAIGcwgAeMxAdoN9b1zqllaFcsH7o0AujbPfkJZEBlm6BhkOtjxarxEzO+Qp V/DTsDkaO1wjzWFRsZ4779unTn5YVPI= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=UkWan7cU; spf=pass (imf28.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 Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBCX9O024566; Fri, 21 Jun 2024 11:37:31 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=EM2Q29X1oynbi WdgAiIUaE04pJnjihVfcXc099lsq1w=; b=UkWan7cUcNRH8oR2BBetTb9Dvr7/H O0/Uo54O80JTg3Xx8tiuzYP3owLeKfk10eiNGRV7kUCmNqoZUEVhQpnVejQ+72cv aaktkQPOGnwT4U4rxPwalFcQtGI/GPo1T6omd7N+OzLAlwRI1nGD42bB4n4esgDM 1TLfXHekE22RLh/tLO2ZsrEF0nXGHx9kZ/Gb5Z+KI7kjDfWG2S9t9xiDgvQ4kM21 ZcZ8W44cRdC6mOiEkarhqIhgKlCPlp8QVWvNgu+qscLb7T+zFK1HAP4yXded+WCd SoW8dn5BXOgbDsKrXqUZ/BxBfP35iTMCQJzPCmQYB5Tsor50i14Y0+shw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw89g0294-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:30 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbTmw029867; Fri, 21 Jun 2024 11:37:30 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 3yw89g0291-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:29 +0000 (GMT) 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 45L9Jwlo007675; Fri, 21 Jun 2024 11:37:28 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrspeuq7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:28 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbNVf18285046 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:25 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2DF4920043; Fri, 21 Jun 2024 11:37:23 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 994292005A; Fri, 21 Jun 2024 11:37:22 +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:22 +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 23/38] s390: Use a larger stack for KMSAN Date: Fri, 21 Jun 2024 13:35:07 +0200 Message-ID: <20240621113706.315500-24-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: LpWocQY_2z3LBTS-d-yrj84PF4O_dgDf X-Proofpoint-ORIG-GUID: q9YeCvfYquJu68q92OV0j4NyHKdiD2Re 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 priorityscore=1501 mlxscore=0 bulkscore=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxlogscore=869 clxscore=1015 impostorscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Stat-Signature: 8u3zhjx1e6fc6yjho551ncmz1b1kzcjp X-Rspamd-Queue-Id: 85F54C0005 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1718969857-469788 X-HE-Meta: U2FsdGVkX1+Gt4P+EUbxB8YdojMZZcCcrv3iG3RfWm06ZFZdtlucyr+FgQeGZRALD/BtJGeS+aB07g9HdsuS2RUKU+ZGdiIqreEyEptHRI2d72Nz8Ft98AIatlbATSjI8nb38tMiMCT/QixcC+Ufz1NTzoJImryDDBFBw0rfjECF1gls9i7b5oaGb7bQ3tJpAfkP9vlGyvRcYiGnpeWYyL29ZJDG7wclydAMmfG6YVhb32+Ofp6/Jtu0pFGo4P+m5xI/gHComAXKJZ8ZgK6OeaGS+xec+EIVKCGo3z99HjUSbfPfKfzW7NADT2SaOWNSYeFDZS1OSJJ1VWy2MwonYc/txu6wnBx17CG48jjhhjI4Ld+uDhZFnlIAxYGeT67X36qEQq7ad0Cvi4WS27ZkuHRMRUfG1pIYbuKIjgkYzLw+5g+UwSg6ps50okJA2+NGyULWu+b87hYpb7m6nzd1AbvHrhE5fplsPdB5urTkOv8shLnTU5Y6AfIrLlPE/xfRwtU5xWyk3vxMqrCPoYNInN2UKPJP675GykNIs8Qksy0+XzGpAKKRAvyu0BtWGxub2l5i2OltaQXLSYqAxqiC8vlBA6cFvjUCXt4dxUoN903yGukEx7a6jwjE04TwfFXpduZipFKiczsjTRy3ZJlJ3sJe5ghqJgngX0TRb6hRtwvA2vT7lb86MsaCB/jtne4r5KoHci1ktxSH8z1YV6An/XqVl0H7Ig9Ak2MNbF/B+hqIO9M39TgBWqvdY8reEWrP7IrVBmpXe8u4XBTdneHz3O+qdNXBj8ruYZTLTwLyfAqQPF+737c1bnwC46cqxkD2V6fhqSAW/1VHOZYlz08QmEstaAI3s+BN8F8ky5xThx2BKx+DMoPz3WQZZhXZ14ukNQ31a5FHlc0JRkXmvMfIVblKlMiDJv7Y2za35wNseW4JF4irmhsa3vahiadYO9miw4DND7bL5YNPGMVi9nq 6WkIfgZI w87A498p3eEDE46vHoAfo/MaiLqhpoZ7ZYEVrK5sHLjIvCIETdaVYte5QaHDuPWOHIKcOqFrca5WR8PtF9D/5+grXZTF8VIV9o1U7yp4alvado+066Q8D8HhpXSLAdDyF4ID7nUViWb5QFIIhY4V84juNDmbHUtbRNYV5GkupIE7hdm82Rhh3vGSDA/UjAThnMM1wk2rGYn+5sPsQLyxlj1QU9dxzF3OWQlvCFQysG6y/xyXffONs7vf4kOCPTnmTk/136exuhb760fNqS7v8gOJQMiEA+ppw2k9d7VKlZxz4zeEqIEbHLJC8cayS5WClMZBZz64kKK2HtGBYccB7Pe0fYq3cdudi/3lnwe9/FpTP/1G9s9UWxQ4y8BEpcUpuvi+8RriB7mG7MgfDW+rpgWQkABZ6HOqT2li+yMZ9GZN9nLE5LpzQunFLFXZDMVDTsb8Fh/i/FmWjXpU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Adjust the stack size for the KMSAN-enabled kernel like it was done for the KASAN-enabled one in commit 7fef92ccadd7 ("s390/kasan: double the stack size"). Both tools have similar requirements. Reviewed-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/Makefile | 2 +- arch/s390/include/asm/thread_info.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/Makefile b/arch/s390/Makefile index f2b21c7a70ef..7fd57398221e 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -36,7 +36,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_CC_NO_ARRAY_BOUNDS),-Wno-array-bounds) UTS_MACHINE := s390x -STACK_SIZE := $(if $(CONFIG_KASAN),65536,16384) +STACK_SIZE := $(if $(CONFIG_KASAN),65536,$(if $(CONFIG_KMSAN),65536,16384)) CHECKFLAGS += -D__s390__ -D__s390x__ export LD_BFD diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h index a674c7d25da5..d02a709717b8 100644 --- a/arch/s390/include/asm/thread_info.h +++ b/arch/s390/include/asm/thread_info.h @@ -16,7 +16,7 @@ /* * General size of kernel stacks */ -#ifdef CONFIG_KASAN +#if defined(CONFIG_KASAN) || defined(CONFIG_KMSAN) #define THREAD_SIZE_ORDER 4 #else #define THREAD_SIZE_ORDER 2 From patchwork Fri Jun 21 11:35:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707478 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 13659C27C4F for ; Fri, 21 Jun 2024 12:25:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 62B316B0323; Fri, 21 Jun 2024 08:25:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D8E46B0325; Fri, 21 Jun 2024 08:25:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 451E26B0326; Fri, 21 Jun 2024 08:25:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 281D16B0323 for ; Fri, 21 Jun 2024 08:25:13 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id CEDE5A0E66 for ; Fri, 21 Jun 2024 12:25:12 +0000 (UTC) X-FDA: 82254815664.27.08490E9 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf06.hostedemail.com (Postfix) with ESMTP id 9AA1C180015 for ; Fri, 21 Jun 2024 12:25:09 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=DxC9YrH0; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf06.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718972698; 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=erZvlatfvJVe/hx7BkMgZ/7G1oP598/R1HnuL1JF6tI=; b=lQlcciGGGjBf37i6paFLDhWeBl26212lp42+TYumuRuDpCpFgC0dveXGIjjND7exwLDf3B m+wk2UzFQC5B1dXjCpY8tK2vfz98HWEDQOCsUX4FxY19U7w+tdctX92KqUYVwYlrYJsGw3 wBWpyUMcMG0bpVV/cpZgOLIsBGpUshM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718972698; a=rsa-sha256; cv=none; b=CQgiByQ6Qr966yVwuH4gD6AXxH9YDREMmlBHLW9TG9SctFyCbeyPquqVEAUuT/OFDZM+Wd lkhuCl4TRtfOJSpq4iQo27AdTQsQ8A7sm/ZapHFR6RqMZMXTUQKKfV2F62RxaISdem03H7 1mvd1BGsIGmtbSIeOklpowH0S4GOlXI= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=DxC9YrH0; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf06.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBR6cr001379; Fri, 21 Jun 2024 11:37:31 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=erZvlatfvJVe/ hx7BkMgZ/7G1oP598/R1HnuL1JF6tI=; b=DxC9YrH0fGKAyxTuo1OSltoEp0ikk /yNVAaQEJslqISR/aGO0K+I4OizC4wHbTu9deax938wGw5BB55huj8gJ4wscsmcB K0ZOzktZy6IxNgyGEJfy81GTJb+cxpow6ixZh3WrVMzCknXZ8tUEbf8TH65E9+8r /hh5DH5wA7h5bWbmmRAXVTpt7m+UBVj72m34UeIO263qw8xJEf3dh7/xcQIVVlxk B+tc7n6gdenKmCD8pR7qadwS8u2eV8+SYXgaTXjQQa/lnPP6Xo5sLUiAvMvv5+wU mc/iztUFBNCzB8mx+dc/S4oODUvX1xvnrVV3CDryT3s44WTe/PHNnu2Jg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw5krgf2m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:31 +0000 (GMT) Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBWqdJ011582; Fri, 21 Jun 2024 11:37:30 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw5krgf2g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:30 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L9CfeQ025708; Fri, 21 Jun 2024 11:37:29 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrqv6w06-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:29 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbNOn20251114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:25 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1A742004F; Fri, 21 Jun 2024 11:37:23 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 37C4E2004B; Fri, 21 Jun 2024 11:37:23 +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:23 +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 24/38] s390/boot: Add the KMSAN runtime stub Date: Fri, 21 Jun 2024 13:35:08 +0200 Message-ID: <20240621113706.315500-25-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: p0zIJbCSnkM2es8X-_i5LPorVdCAulWG X-Proofpoint-ORIG-GUID: N52-iqLFxUlqfOzwf01LwPyXye5pwRf4 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 impostorscore=0 clxscore=1015 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 suspectscore=0 adultscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 9AA1C180015 X-Stat-Signature: n958ze16fb8fkx1oo5pz7jeyquc4nfy6 X-Rspam-User: X-HE-Tag: 1718972709-825764 X-HE-Meta: U2FsdGVkX18s27Qzu331kA2m+DHK2nWkbOYhloDVLY61Ga2PV4HH6Lc7ceU4qtL3yV1G4EQ7U6ZCBAKpKbxZwSG6mc4hH513Y2KCrXnMgU8Q4x4RVsYB6lXtFAwhPblwIm6ZIaCVNGk5opVSXwjin5XPcv7CMV7tlRFyMN8r3f2HKBAzBJVKaQMJ/br5RA7qeA7PvEd1ht63Oei2iyMmgPBWeRKSCxpsx3BDEZgsts01pLHTiY8jjr/gYxaAqXcI8/4CKfUvJAoyISfdYks341KOfC7bUKH9ubBwRpIEdaYtBWDkujBCJjSOhzqIEZIggvfZBHzwn7asuMIgDOHcgel2BK1kaOaLH0REyaBpj1zCusjCnvN0c3T54wsAg7Tz5FgQWyE7CQcVyix/SFq+mdVM+2JUsRmLQjYdSCDKJJHnju9F05/6aAzf0QEhQOswU2oUNKKA54pj5vatYHSUGNDB1FEnI7dou9/36Fw9jshPSFBb+6ydKSb4lHWKccn0/Q75JxVJ6FCv445VnCotiWL34eM1VG4evwzL16iHjLhxHadsiOrDA/5IOSiFgU+WOq/MCJit6Q1nMcE06BYQ6sCaXJf0P+EcM5byF9TFCj5MgUvf9mUbmjjnjyNFDLF6XjvmzVb9NsAUOV74vUekwJVOkIkTdriIdqr6hiabqPTbFC+WibLzX3ABdHOH+yuY9VDqL7Sp41rvujBKrgxo9t6I3i930PewW5wYqyDAJs1rFKzpCkrg6+Y8D/xAHbutYf8566XkIxG4T1bWPC0pNeIAVn3lnP8VzyaKE8IyhedQYEJ1TeuvtveNHLWtoYpubqxSTlP7+fVTg5M1y2Ie2chwd/D7k/v5MSC9+gqIEQUuZiBhjkSA/qJBs7pNigId+ICjqwUxulVZ9m3HU0rl1zEcIsYpJ8qBthSRmg8DMoKpG2qiG3vZdECLqWMF54mN44p7pj4jWVUwhTvVZto azIIyZZ9 oaG0/04cD+RFBFiR/9PIwpPDlJZojaqaYwhyC3e7EsUoeJ4wgm0dysRKjHlPV0vI6p78bR8oak0+X1IJcEhcHRO3ikfTvbRTdt5RQSrnN7RtxE+uIW1pzwlcjCIRxda3FXfj6utxeWwTwYhU5lbcWMxHnzYf0GH55bbDgUmJDEOkQA3bT9tlBPt44qF03zPfAwaA6B84774b5oAz4yJDlxE4q61WyWTNWRk/VGxV4bsasMa6nlf67QNdLIF8FBuJ1z1hZAejO7HT6bNezkbYOv87oG4912aOlN7Tqsgn15gx57iRfRgShvu5FrmbtPMVU71HNh0vOUXYb6PtRKCairT4s7tAB7SjmdtEUAPEZoEEultLEd+Gt6oPTkQ5cp/UbDr3GRzmFyGZDHtB5inAUt32oPpi0olwRqaSKny5ROm7L2itd7BTvXttq34p58SQFPWtP X-Bogosity: Ham, tests=bogofilter, spamicity=0.000011, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: It should be possible to have inline functions in the s390 header files, which call kmsan_unpoison_memory(). The problem is that these header files might be included by the decompressor, which does not contain KMSAN runtime, causing linker errors. Not compiling these calls if __SANITIZE_MEMORY__ is not defined - either by changing kmsan-checks.h or at the call sites - may cause unintended side effects, since calling these functions from an uninstrumented code that is linked into the kernel is valid use case. One might want to explicitly distinguish between the kernel and the decompressor. Checking for a decompressor-specific #define is quite heavy-handed, and will have to be done at all call sites. A more generic approach is to provide a dummy kmsan_unpoison_memory() definition. This produces some runtime overhead, but only when building with CONFIG_KMSAN. The benefit is that it does not disturb the existing KMSAN build logic and call sites don't need to be changed. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/boot/Makefile | 1 + arch/s390/boot/kmsan.c | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 arch/s390/boot/kmsan.c diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile index 526ed20b9d31..e7658997452b 100644 --- a/arch/s390/boot/Makefile +++ b/arch/s390/boot/Makefile @@ -44,6 +44,7 @@ obj-$(findstring y, $(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) $(CONFIG_PGSTE)) += obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o obj-y += $(if $(CONFIG_KERNEL_UNCOMPRESSED),,decompressor.o) info.o obj-$(CONFIG_KERNEL_ZSTD) += clz_ctz.o +obj-$(CONFIG_KMSAN) += kmsan.o obj-all := $(obj-y) piggy.o syms.o targets := bzImage section_cmp.boot.data section_cmp.boot.preserved.data $(obj-y) diff --git a/arch/s390/boot/kmsan.c b/arch/s390/boot/kmsan.c new file mode 100644 index 000000000000..e7b3ac48143e --- /dev/null +++ b/arch/s390/boot/kmsan.c @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 +#include + +void kmsan_unpoison_memory(const void *address, size_t size) +{ +} From patchwork Fri Jun 21 11:35:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707339 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 5E904C27C4F for ; Fri, 21 Jun 2024 11:38:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 398F38D015E; Fri, 21 Jun 2024 07:37:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 323248D015B; Fri, 21 Jun 2024 07:37:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03EE18D015E; Fri, 21 Jun 2024 07:37:40 -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 CFE678D015B for ; Fri, 21 Jun 2024 07:37:40 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 91A8A1C1FD9 for ; Fri, 21 Jun 2024 11:37:40 +0000 (UTC) X-FDA: 82254695880.24.2FDDA10 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf25.hostedemail.com (Postfix) with ESMTP id 63A63A000E for ; Fri, 21 Jun 2024 11:37:38 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=chlTLdV8; spf=pass (imf25.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969850; 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=WE3ASvt90HWWKhjLUTLn3R+jUtOfzIMMtdYDGL1//DQ=; b=WE94NadN/145w09zemg6H4i4qbOX9JDXIS/pm6bSVx4UYWClJEvie/6KvgA9280WzTY7vK O6xB1tDs8DdUPjDVR1zIThi3IqckeyTJ6n5bAePH05GuLY40e+lygH9csRZ2zBMQPNwPcz VrLRJ59rWeSPCBUgQ6MATANym9udknE= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=chlTLdV8; spf=pass (imf25.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969850; a=rsa-sha256; cv=none; b=4KLkd+88RZlG/hJ1M7lFm2081PDkhATtsQr6eQfPU4sb6GurwDlMOdosqT/4IM1CF5/DMq j6vJsphDJ2Ay5MQgO+2S/6lMNd4ppunD8hcaRu0E3lz/CGpFam/8Pn9kwcO9sUyDiVZJui +QBNXlqK0GIVGx3xwZpsJP14mnzFniU= Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBSmdx031827; Fri, 21 Jun 2024 11:37:31 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=WE3ASvt90HWWK hjLUTLn3R+jUtOfzIMMtdYDGL1//DQ=; b=chlTLdV8G1iPoKwvZAkAoT2RxuLXS W0ib9MQgeyiTeu8qIDK/FwH6cZPN9iBilfFRWKcbUw3VJNmA4+vLnTRqHiAk2Skl KwxbbdftxY7zU3aDeR23ahAtjlvVs25OmeinjtIctNlOlvAnyilEUPAO8OWiILfY LFU+Ws97ay7Mk+fW2lmB1ohbA0yrr2cAJI+vLS5dLy1jeFul845TFSIfkVMBooB8 DzJDWlDW/f2j8dkAgzKoJTw9ZX6L7qQBFbYZM95MjOpCUaOmjSjqB0pa8Br/nmwg NZaegK0i2N9C59pS5JhbrgMlWHktODCA1D1LkLNJPUpgqSev0K94YGU3Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw8p2g0k1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:31 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbU7X014293; Fri, 21 Jun 2024 11:37:30 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw8p2g0ju-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:30 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L963JM025654; Fri, 21 Jun 2024 11:37:30 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrqv6w07-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:29 +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 45LBbOTv51970338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:26 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 613F92004B; Fri, 21 Jun 2024 11:37:24 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CBC1820063; Fri, 21 Jun 2024 11:37:23 +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:23 +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 25/38] s390/checksum: Add a KMSAN check Date: Fri, 21 Jun 2024 13:35:09 +0200 Message-ID: <20240621113706.315500-26-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: XJHRyrW6gEr7POyM_gQFseah-qSadybr X-Proofpoint-ORIG-GUID: S4CNayQqicfQAiPhKJFBb26TKMLrWZr3 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 mlxlogscore=927 spamscore=0 clxscore=1015 bulkscore=0 impostorscore=0 phishscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Stat-Signature: qrsofcwito9mbodsfqkn85g1wc7ykfan X-Rspam-User: X-Rspamd-Queue-Id: 63A63A000E X-Rspamd-Server: rspam02 X-HE-Tag: 1718969858-450293 X-HE-Meta: U2FsdGVkX188+lq2zr1V327Y6oYi977N+1KzwR9JR3qVWwgU7uQ5P610EjB0Vj7gI+ZgZA2sdEPaZKE4IwVSGaYz1Z7ttcL4z7DltNW+0ZKZPk66HLQJ4N5BIGZlAp1eHMkj/FasCHGTWuLg1wbF1EEJOi1vswYqVXVAM2B0SWDtGR52aaPPUabEw40uFMaUIfeqqqdLYpAVy34fHXXJ27V4G769lcLKwN35tLooosTutrB0oM62SgTb+6ChNJyjtnapJjGlKpm6f+YDn+Lt2oUeab9wECiThOJxMxQ80L5pNX4rL19/Pqu5bxHWlAxMfEO6TffxKeVpAqKLhvzDkmWhvigLwvkjjJe+MliV07/HjhYUVC5iJsPKCD6BulUJpLuTFVS4aJZCHCEPG9JU8VyoC6LT6kSe8PTfxfs9910V5dB6vo1NdJ2+mZA0EgtgmDhSUVeiwFuEQYAvYwmxOmMPv1YMb7kOeAeJ3ThQXuuLqDJT5284GhO5p0rSYnepnFFP2Qg05IxYxjoLld77L2jbifWzYNcF4cdkYegHPDEmtRHUyFHoH4VTHwWgr81FY7t3RB2L2Du5JnQNs9cYCITiJrJRE8mE8+UA5SsZbPpOzOLbvEQ+SY/22EerdBKDoL46v0vb2/oOhga4YKent8cNiF9LmY0PlqZIzEnfOB4rn6pLEVHgk6VdrsQWLgCtnqDN+HTMJoJ5I6yypRIdJc/r9o4m5xFHq9Cxe2YUjGdo8cNl94XRkXKl8qiU4TT5eaFchXhuhB4NsjDJy63d2xPsdPzy0QFzeESWlJkg+KePTYvdzT+ZRCmr7EqCLbfotTGtHRh9xh++gOHfTSTzFDYkH3TYjcdHk4hiVk3+0QlsqiPbbN2tOrA4JFblCQ/VvjP3ObELujLAjApnL5CxctWMc91Io8hZx6xm0+pJhHQIvSt1UjgFnydr6L+TzY7lwvft4c77HlFrgdWFVCT TAQEQz57 nEG94IsiWHSOIPE/6JXpRC/vAirSSQjxmZyO4alzmaactMyPOMVf5AfstHIFk14GF+dLb0AUGFDb/iHsGLZHPD+vxY06AXElNded1cdg1hri6NyMgMBVIctT60HP9GO+gpHk8OCZLKSBfDImnNlhe9uy99chX4pB+vrCZ4Z4LgmShnx6UCV/FaeFpNivCBdSn71SHvwjZ9AlTACsX9ge1HUb2Xy3Tf2Ykg8qwaIk4DrsZM0L5z3rYGyAStLlIiboX11CBV/SoTEGjRwHdKlVYX06It0M/HWhqcou6mp28DvERQ8NBma7h1YFR4lhK8PJv6MDMbFjdpcLpMneFmSBm6hLpkdgVDpq4mqVWKl+9KE4B/3CiVLtyyQH7IuEay3heaB/XS2KsmtkL5C9+0coFGuJ/4A== 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: Add a KMSAN check to the CKSM inline assembly, similar to how it was done for ASAN in commit e42ac7789df6 ("s390/checksum: always use cksm instruction"). Acked-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/include/asm/checksum.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/s390/include/asm/checksum.h b/arch/s390/include/asm/checksum.h index b89159591ca0..46f5c9660616 100644 --- a/arch/s390/include/asm/checksum.h +++ b/arch/s390/include/asm/checksum.h @@ -13,6 +13,7 @@ #define _S390_CHECKSUM_H #include +#include #include static inline __wsum cksm(const void *buff, int len, __wsum sum) @@ -23,6 +24,7 @@ static inline __wsum cksm(const void *buff, int len, __wsum sum) }; instrument_read(buff, len); + kmsan_check_memory(buff, len); asm volatile("\n" "0: cksm %[sum],%[rp]\n" " jo 0b\n" From patchwork Fri Jun 21 11:35:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707340 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 B1E58C27C4F for ; Fri, 21 Jun 2024 11:38:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A77EA8D015B; Fri, 21 Jun 2024 07:37:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A00738D015F; Fri, 21 Jun 2024 07:37:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7DE558D015B; Fri, 21 Jun 2024 07:37:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 51C2D8D015F for ; Fri, 21 Jun 2024 07:37:41 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D2CCDC0D8E for ; Fri, 21 Jun 2024 11:37:40 +0000 (UTC) X-FDA: 82254695880.23.BBB15A7 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf23.hostedemail.com (Postfix) with ESMTP id A004514000C for ; Fri, 21 Jun 2024 11:37:38 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=iYs1hdzC; spf=pass (imf23.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969851; 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=K/viBy/PeNICITSZpD3tBAO/npQA3ucnq3Zo5JONrlk=; b=oQ+FBWQi++9Z0TiuapeeZlfn8rfYl37vwBTd6OI/4G4r5h+ixb2z852pST9Wq8RWf0y15a RMT187B8y8pCDl5c9Bl5x90x3YAzPaCO2Sh43FkVx5lz6jPnPLPT4whCmJKnkcli7Z/QaV Z9MMQ3QbL0mNoj5rqrPcU4aHjKg/B0k= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=iYs1hdzC; spf=pass (imf23.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969851; a=rsa-sha256; cv=none; b=lmFdx/Nxs8yeH/6wB0PvAjh9aTEkAjckUqe3Wy66LuevG42jn7A1HafQnuDavMLOLkGHEC GPIhEEkR8AL2ZgvcMut+6BUnx7s+CiHa4keBCeZEf6k2RXPKgF/ymyIW00NOB6Ofs+GXC/ MWMPCxK4S44m16co6WMSuVCNNRmx0zw= Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBUfcr008189; Fri, 21 Jun 2024 11:37:32 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=K/viBy/PeNICI TSZpD3tBAO/npQA3ucnq3Zo5JONrlk=; b=iYs1hdzC5boJxwq7/S5rhcLPcqTTj tZGGqlLP19xQn1K58V0/wzSB0ye2Hrebi+x5BhZRFjnBfS2ES894o9mF6FepcnY1 WzkK0JL3EMZOgGwxFkqkZ/LqA9SvXU1aVXZkuJ/8ARJCiRnKKW/5EdsxD8EoaiZu 4AXFeMB4rHp46+9WA4XqIo1gi8c5zgZjsfzuQN4zmZmlL0u7PL3UD6H/bZuAA+Wv ceriske3cK2KnpfqkSf0CFPVZ2FkC2ukoJz1uG6bQiYBDn79R9wE8yNmTJ93R7Ag AM6lIdcXwxjAw/3pLid9Z+OR3PqkdxS5gkGfYGuawm7L3YGLM3ivxp7lA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw7t50467-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:32 +0000 (GMT) Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbVkE017536; Fri, 21 Jun 2024 11:37:31 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 3yw7t50463-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:31 +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 45L94RmU031319; Fri, 21 Jun 2024 11:37:30 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrrq6vg1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:30 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbPFO18153734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:27 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 020D82004D; Fri, 21 Jun 2024 11:37:25 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B5152004E; Fri, 21 Jun 2024 11:37:24 +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:24 +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 26/38] s390/cpacf: Unpoison the results of cpacf_trng() Date: Fri, 21 Jun 2024 13:35:10 +0200 Message-ID: <20240621113706.315500-27-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-ORIG-GUID: I7H6xZfZqOjODjPNPTm_ct-_p8FpZMwq X-Proofpoint-GUID: 3FJaVmD-eWbIAIcr6r1ict5AbgqpNVvY 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 lowpriorityscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 mlxlogscore=780 suspectscore=0 mlxscore=0 adultscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Stat-Signature: nrd5pbp67armomgonzjqph7me55drfxi X-Rspam-User: X-Rspamd-Queue-Id: A004514000C X-Rspamd-Server: rspam02 X-HE-Tag: 1718969858-231015 X-HE-Meta: U2FsdGVkX18GFRHD8HJCB8P+/QhTuXD2UjUOJQ4r6rHo9m2uiEZNPIAGI5Cpu8jvQP+Wo0Anv0pS5cAfkb/Xh6dwbRy/O5KBl/zvUGnLW9AaKqA/j0jPlVTMv0qNGSO9CFeEpzX154U8HmxOlPdwv8O+GbZjyKdfIiBMRfNwUB1LLQ2CkZWmk9R0tj1C2kaNK/zdSkQ6v/7W2KpOoBxFUhktscsDjRejhvduoYtsljdwtUzsIC/qst/A9sBbroxbgQkDGRHjVFtXRwW9mYFOQxyVw2+JWywfu45I5g24G5JuuHIaVk/hpKNuL7UY0db7sSJ12ps75QPpmp+xt1Oh0SA9GdaRl1BFbC656ND8ZnDX2uy/xZEowALG/AqfGhzj6HpCus5sNEn7DYtzScMtKq9uaxYiqStQrUu9z5oD7RkU2Bi3dIsVeXjTvGzPV/EQeWAFVnZ1M5HbZtmohMbD1ZW0X8WmaUoA3VD6Ux02j7VLtdM+zfcyzmvXqq8WFQch/cCQ9aPFGL35vbllbgYOlX5aCU+Sq5qidxCRdNTQAn/mSCCSvWOzKY2K8g9B+f2WSUnK6lLWdddtvUTJAFm30mSy4GLS5qq2VTOCsDzP49ZJ9qhSyjQeJfon1EtOa6wGVyjSAi53/DtuNH8ZJrST+x7BjUunejHh/N2J1wYCHmMGzOFbTiJY4+OkhzC2IhivIakHuBcmjEEs15TzkSkvCoYGr/9t272+uFNZRRb597dtmeggzAENcP5dOQkOacUXj2MY/X1LF4mPEFIqHAEbznPM9jhqp/PrrdWznEdZlSj0nOkWDv9lsFi7seSkN3OIu99sQqZ0kTteZ6JNIYriT0omjloQplnjehbd9dxWdm0zK/JlFHHnjnS6ZVdXLzPQIyK8WT39Ckcl1zSOjyh6ixuXajmMuOQoq+KWlPcBGyEQTpq16ZQN06QOy0mSG+Q5vqEBAcxo9LptBUuJlzU JWAUGsfo zk+w4EW8/7qUDNUc5zk6IGOtBsavycztev7I3Kz2GsITn8RsNF3eVoc7KwrvmpNrI+uFE/3kXYn+mbpL+L6Tq8yCwhcd31zoxH5QjAP2g0m1AaduSajbP3/6lm9BOsChyBGJD40V3STvdcWDlWYyl/Xf6+0aolFhFixCnh4zl0Q58i6lAmdqWcUNvyEgPVrb7nuc/fQouZDZhrEUc9BbkocSENbPZR7S/W3XCKG1/22dans5zZHFAAxpiQE4pYytKXEMbxk2aCa9RxXy8HOYw4xq+T6HY/c1r+6P1EjSnJsroYm/LeBN1dySMb2EYlxGC3R5h/rvcdr8EnVlVWIAH99zMu+JH+l8jcxuKwOlHoLKkdk3W9DT5WSDQoJSF70N7AiMemVhmhbMODJzDGQZL0grrNA== 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: Prevent KMSAN from complaining about buffers filled by cpacf_trng() being uninitialized. Tested-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Acked-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich --- arch/s390/include/asm/cpacf.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/s390/include/asm/cpacf.h b/arch/s390/include/asm/cpacf.h index c786538e397c..dae8843b164f 100644 --- a/arch/s390/include/asm/cpacf.h +++ b/arch/s390/include/asm/cpacf.h @@ -12,6 +12,7 @@ #define _ASM_S390_CPACF_H #include +#include /* * Instruction opcodes for the CPACF instructions @@ -542,6 +543,8 @@ static inline void cpacf_trng(u8 *ucbuf, unsigned long ucbuf_len, : [ucbuf] "+&d" (u.pair), [cbuf] "+&d" (c.pair) : [fc] "K" (CPACF_PRNO_TRNG), [opc] "i" (CPACF_PRNO) : "cc", "memory", "0"); + kmsan_unpoison_memory(ucbuf, ucbuf_len); + kmsan_unpoison_memory(cbuf, cbuf_len); } /** From patchwork Fri Jun 21 11:35:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707341 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 B4C20C27C4F for ; Fri, 21 Jun 2024 11:38:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 262918D015F; Fri, 21 Jun 2024 07:37:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C3288D0160; Fri, 21 Jun 2024 07:37:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBA088D015F; Fri, 21 Jun 2024 07:37:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B8F8E8D0160 for ; Fri, 21 Jun 2024 07:37:41 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7B238A0DF3 for ; Fri, 21 Jun 2024 11:37:41 +0000 (UTC) X-FDA: 82254695922.14.AFFEA2E Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf01.hostedemail.com (Postfix) with ESMTP id 35AB74001C for ; Fri, 21 Jun 2024 11:37:39 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=amWRvAmR; spf=pass (imf01.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969854; 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=tPY2/xfj0WoITwfgq4isE+nahUee+x7RgpdrRutXdLc=; b=7avJjwTuFym2wG7+MlqEChwiWsTpmWUbDN/PJOnw5AExfUuRx7JUFNgLDJWDUaobI4zy/f oNuEPHJXuFb3Wu/bc+TiVabbrCEZ23l2SDOXgN8LQ5M7hgBOWdHaLR0OBUYYD6Rc3s+aee g61QsxoXdxmmIZwb2BfIejkOCVZT2Xk= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=amWRvAmR; spf=pass (imf01.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969854; a=rsa-sha256; cv=none; b=MrNnUCf+iOrxlSTMUdDBBnXXbr3ye8JNj0Q5F1kQv0DkhZRoTsJQzBUaYHcIBVdI/PrkWO /jJwZVu4dp4XPfyVyUcbWmU2ORjKj5KK5W++2D0t5X+2wAJgDY/gSWcbT+y7/CIiGDbEqM M4o/36s2CeGZcDeA/1eausFkgkoQlTA= Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBSoRS031855; Fri, 21 Jun 2024 11:37:33 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=tPY2/xfj0WoIT wfgq4isE+nahUee+x7RgpdrRutXdLc=; b=amWRvAmRhVDzE6K1W1T2lzLvLYRA2 RaswMMsd1qritqfM/5YWqOW1G2Brn0SP/fI/GrcovouGrkDTQDZcKmFnR5fHNTqt EgkSu/TMSn31fOqgpp+XGuEelNNcB8RipF7hDVMQtuBHxk4Q6nCGkpKyXodhHpLV PKWDoQ0EKjRNejDT/nM3oA44IFVcMRN47zlAMzJb+Qkq1xqs3WerJOcjzVWYfZdh H14mPYHwcjV32tl8BmOwA6IFlIEFU5YCUptYIZCjXRdm5e+z/zeTX4CK8889g8jL 7cR6ohmXREXPIFxbpR6B07N+1tPVXNSiw6FrcRfq9ba5x8GMouz1CqoSw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw8p2g0kb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:32 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBaDh2011409; Fri, 21 Jun 2024 11:37:32 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 3yw8p2g0k4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:32 +0000 (GMT) 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 45L9ITHE019974; Fri, 21 Jun 2024 11:37:31 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrqupw0b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:31 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbPWL34603592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:27 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 95BB820040; Fri, 21 Jun 2024 11:37:25 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0C15F20063; Fri, 21 Jun 2024 11:37:25 +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:24 +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 27/38] s390/cpumf: Unpoison STCCTM output buffer Date: Fri, 21 Jun 2024 13:35:11 +0200 Message-ID: <20240621113706.315500-28-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: sJZxLZqi83f1gaq2C2xaVmzrDntGvdhy X-Proofpoint-ORIG-GUID: 47w3i0YnpjSgJH2Im2QQDMm0uJXN-cRp 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 mlxlogscore=958 spamscore=0 clxscore=1015 bulkscore=0 impostorscore=0 phishscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 35AB74001C X-Stat-Signature: uho3oag1x7e4trscnd6qk585iuzyp66z X-HE-Tag: 1718969859-489597 X-HE-Meta: U2FsdGVkX18z3S8Rg6dUQwiI7NLf0R6yj7/qX5puylyafqASvbLWACag7Rc2GZiySGBgfTZNPGY1T4OZP/qDQCAG/OXEHhK9lG+Y4yA/DWhPgo9zvyepseBqfvER3NNcA55nq6ljKRLf77U/5dSakhvZNnn2MlM2trWBTPfIKbu4VkOPHUcycpIqyxRN7+QlnNAw/mPkVfH1WemIRp2EorT/K0holDbICX425w/dpmM03DMkCh3Njdu25J8bK6ytoy/4SZQ07JvTjLW3gWQEV/EduLC5wcpgVFi7J7ZMl1Db6d7/GHN2WrQoXuCteYu5qjSpZJJ5qEJL8zI0IUKeT7bpzUviG+7MbpUpHCP7tW22CHSyOb0ppY9rumPN8QV7TrI/LOo9AwZocNyy1WEVzzaoed6Pwt/K/aL63nHPm3ZdKzMLSJPJIxoFhCMKUJQaWatREiSry3Z4BS3oo9zEr/B7YaUvnrMX29xsVh//nPQP/M++z/0/ueE4T4uEzXiEspmuuKYVo5T1O1xQ/To5rAmbdIb6lrnUEIMUGsfI6BMjGa+wPEJcBKyDgcsA+2JfhE2xE+hdSj8m2x20m2fRJXp5V4GgtvIBJbYst6jyrxQcQFnvGhJpn9vLj0q3+EhxLq/DmSN+fjNRU7aN2uERh0/9SGLPM67afkPI44kb94nEF+LNdiUHugJ21z32gkAcO8jW5/8aPDFT6UHIUa3mTOhPqZDzxNeUKGm4gp/B0llqz6S8SDlBINo6xrC5lWHfFIkT2fHuPs8Pc/5e5T5JCOGiL0DwwQXNHKNHeyi+YOMEsmhoOfrwGATv4+12cwM5bjqsNvjGLmkR4lkyECvoGuwkhb7pg+Ioedli6nNvyr8dc0gADTidHOSsO366tw9BiuZQRKxlOzgQ7Si1HSeS7sC/k3+XcvD9WDEyvp9t8IRj6+XOgzN7eRCm/bv4vNLMaGlmByEzAFIkp5IPe2z 4E6sIN7P UP2tKRMwbu6EUQChmRqul51T8Jh9/unRxtShsDLcxUWy4y7odMddkDa8cruib6XcWL4SFjDciBljGJVBo7XLtlUUKAbpW3iULszdgdX6+qmIUxqNJ2wnD+fkXz88Y5g+TB0YSDALZrtF54oRbU8UaZXDq3fo6EhZd138eWrNHG9uyfTgzZpFBKeXdBnuqOFdJgVkSOzBWXsLEfmImM7DrrTDOTzM3PT51t6nW1V+cqTPv2hUuKmgsV/rrCJtYT7bwUv5/4egCaIv0P989uQ/F+P3jqkVPnLGHWe/5L+wY9eaM0HZkq6TBVhS3J59zbhY2ANbjLcpTn7PgyTqs0anqU5hT0mVS4D+Ivhmh 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: stcctm() uses the "Q" constraint for dest, therefore KMSAN does not understand that it fills multiple doublewords pointed to by dest, not just one. This results in false positives. Unpoison the whole dest manually with kmsan_unpoison_memory(). Reported-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Acked-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich --- arch/s390/include/asm/cpu_mf.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/s390/include/asm/cpu_mf.h b/arch/s390/include/asm/cpu_mf.h index a0de5b9b02ea..9e4bbc3e53f8 100644 --- a/arch/s390/include/asm/cpu_mf.h +++ b/arch/s390/include/asm/cpu_mf.h @@ -10,6 +10,7 @@ #define _ASM_S390_CPU_MF_H #include +#include #include #include @@ -239,6 +240,11 @@ static __always_inline int stcctm(enum stcctm_ctr_set set, u64 range, u64 *dest) : "=d" (cc) : "Q" (*dest), "d" (range), "i" (set) : "cc", "memory"); + /* + * If cc == 2, less than RANGE counters are stored, but it's not easy + * to tell how many. Always unpoison the whole range for simplicity. + */ + kmsan_unpoison_memory(dest, range * sizeof(u64)); return cc; } From patchwork Fri Jun 21 11:35:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707342 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 4F517C27C4F for ; Fri, 21 Jun 2024 11:38:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4B378D0161; Fri, 21 Jun 2024 07:37:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D5BC58D0160; Fri, 21 Jun 2024 07:37:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B61AD8D0161; Fri, 21 Jun 2024 07:37:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8F67F8D0160 for ; Fri, 21 Jun 2024 07:37:42 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 4D61EA31B2 for ; Fri, 21 Jun 2024 11:37:42 +0000 (UTC) X-FDA: 82254695964.19.2E9CA32 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf17.hostedemail.com (Postfix) with ESMTP id 1741140014 for ; Fri, 21 Jun 2024 11:37:39 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=PnM2VyUr; spf=pass (imf17.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969852; 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=//0Kc+3BL5cKzp2INWy7uHqYWutu2bfhjte7hQD65vA=; b=c61jtsuYwmT7TkyfffJK8Hu4ci6s6Nm2qTgHzoy0KuENfvkaNhgflmPAzn42+1HZSziyeK 0PUbLB0RDPBxF+Eh6snWmxqqDRHnrOYIdo0q2HJA+UJz4fo49owiiDlqnay1jYa1bGBDSJ U+gz0c+IRiLWI6TAMumQEsoidoyGcAs= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=PnM2VyUr; spf=pass (imf17.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969852; a=rsa-sha256; cv=none; b=t8LZ0qfsJpZpZyWPCCeCopHnzNNMPJigiweAVCGnOr6RTcaFmVh7Y4+vtzq0+1DuM3x4YM st95FwwW/7oBmVKzrEk1+MBcItqdjtAKlPidvMG/xkGRbUTEd3fBjtLH3XdCK+g8KqcqWv vPLKTW6jAGgW40AZ8bQH3HKepWOGXOU= Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45L8D1FD021879; Fri, 21 Jun 2024 11:37:34 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=//0Kc+3BL5cKz p2INWy7uHqYWutu2bfhjte7hQD65vA=; b=PnM2VyUrLwLHYDwwa+7hKTD9pVEoo NebLaDJzAQhWuQfIwxDBXvxo164vHbEa/h/kAqIEquRdfWu310idRcLY2iEmGSfQ YJisT4nqZKD4ouqZVq4+BJxuzXkpSsGWVfohBtvqliHgoZlkjYDAlQ/RL9SMD1rq 9/8ngArEoxjkjPwnYMAjqsKJPBqdJYzGvGOzMoMMEO2gxQLXnWM+VQUXUq5u0Cmt V7Ehtm/pltH0mO+eGGUIX1wsin0++ELL/6Cu4gfm4OUTbfG9HyeHp3tUNj/DlxyH 9mGzJQJXeTScF8J4TpbDe/eBMitDX0X47HbpG4OJb5oNuaeQ4MuSNdV6A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw5ksrgv2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:34 +0000 (GMT) Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbXVK011203; Fri, 21 Jun 2024 11:37:33 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 3yw5ksrgux-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:33 +0000 (GMT) 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 45L9EaNq019935; Fri, 21 Jun 2024 11:37:32 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrqupw0c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:32 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbQvw39059716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:28 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 446842004F; Fri, 21 Jun 2024 11:37:26 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9FC8720043; Fri, 21 Jun 2024 11:37:25 +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:25 +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 28/38] s390/diag: Unpoison diag224() output buffer Date: Fri, 21 Jun 2024 13:35:12 +0200 Message-ID: <20240621113706.315500-29-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-ORIG-GUID: K1yfeVLY1XzD6dN6lzEspmtPxCXRFnpI X-Proofpoint-GUID: 0TwX7BudASTb7mZSUIMXE0d_8a29542w 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 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 clxscore=1015 mlxscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Stat-Signature: qsowx5yptgchm1tk77y78345gegixz5p X-Rspam-User: X-Rspamd-Queue-Id: 1741140014 X-Rspamd-Server: rspam02 X-HE-Tag: 1718969859-79400 X-HE-Meta: U2FsdGVkX19A4D97Cr0nnXJAzT0PZr6rbDu15DY8HrSI2LbV7IYpgvVkISYMVzBDn068rRFvz0uYfTZ1B19RlBeAg60MDh3kD2P5UODZrbTd6AtlkOZ9eJgIu9n09oAgSZPdZp3dOsDLwovvoc+k9meWOVQFDcLEgqt3y59L6oi66IpmEUazyV/I0HQdbMCyMkwuAbIQe2DDZ4AoCZxQ4ljEUxfa8Cf5LkLz2aTNeHKTwwZvQ3lx1z5tol5RuHMH48Gnj+bMsUUyde4yCfk/MDl0o+7c53NUDxVTn4IPVOYpPOOy45qBsAmbRVvpKVovWixMWeJ5zKdS16kcV0S59laYk5BmKhoQIJLdnWu6ZEYgAkaNwqbtmRPwBw5frK3Wn2B883I1lUjAZNF6ZvNGobwl7Yzizz5g1k8T2FyZe4iCpmaFuvWF1hpU3ywqqCa4//9ZaDgty1o0+eTWXPy9Wm+0VRvNm7Xc+gDmfUMuOQaPrx2tkelrvQKThbVDvooiyVGpiZHZ+dwO9jGMhPohEq+VoUlpNThI026OQp97fKNsA5SQAjQ8cJGb2IzOp9Xz+Dh5Hy8aQwX7mNIN+wwLrEPqwUbMgxtHQLuf8jE1FIKFDcsuZMblipYEcxtwNTmQuLjc+Bnr1EXxeXCn8U4vwcxTOPkomI8m5j8tMjoN77DFsB9JW575Exaa43CvAf3AI8U/odwUYVeuz/J7CRcFJnuyXLxLX2md//v6BuUOQsBEpaMRyVv3tzfFK0JNhBbari1kAgzDBCq0vZ/UT4tO+Vi9UV49lwxbznesaxz0/EKn59FTefG7LHIyeW5pnldr5MCHgh7gW6hDY3gg90Q3keGyCAbLamv5h8LDQ6ZmMdr8jGTkvW7IBZhc55fL5H2xonzwpOs6oinjK8FMfPgzYPgopTuV7fhJ6rTTPOZWp+tEy4zWgABUe0NRRmAX9Ov7NYMtDW6Z/Q9srdB/mfP 0tVnRJZ1 6IC4B09MvHxe8ZMP+DdnlAQkHhlu5k4ou3F5uaFqZ4MLeAht4eX5i9GVuYNS5yLl1SrmF5C215L818YC91aJS6zqRZqGKCr7LqO9bkvAJ2tTCqJLowSg5N/xypoEKW44op08WL7ubs0VpE0v0QOu689jIMuQmqkgr2Plit8C1Ykwkb0FDZh2hP3hW5lMyvQ2euFtbgHCaqpnTab5IAQEzJ4A2HicbnMhU6+V3Go5OmuL/sC4JEYPCD5UiAQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000022, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Diagnose 224 stores 4k bytes, which currently cannot be deduced from the inline assembly constraints. This leads to KMSAN false positives. Fix the constraints by using a 4k-sized struct instead of a raw pointer. While at it, prettify them too. Suggested-by: Heiko Carstens Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/kernel/diag.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c index 8dee9aa0ec95..8a7009618ba7 100644 --- a/arch/s390/kernel/diag.c +++ b/arch/s390/kernel/diag.c @@ -278,12 +278,14 @@ int diag224(void *ptr) int rc = -EOPNOTSUPP; diag_stat_inc(DIAG_STAT_X224); - asm volatile( - " diag %1,%2,0x224\n" - "0: lhi %0,0x0\n" + asm volatile("\n" + " diag %[type],%[addr],0x224\n" + "0: lhi %[rc],0\n" "1:\n" EX_TABLE(0b,1b) - : "+d" (rc) :"d" (0), "d" (addr) : "memory"); + : [rc] "+d" (rc) + , "=m" (*(struct { char buf[PAGE_SIZE]; } *)ptr) + : [type] "d" (0), [addr] "d" (addr)); return rc; } EXPORT_SYMBOL(diag224); From patchwork Fri Jun 21 11:35:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707343 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 1410DC2BA1A for ; Fri, 21 Jun 2024 11:38:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8F4EB8D0162; Fri, 21 Jun 2024 07:37:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 82CEB8D0160; Fri, 21 Jun 2024 07:37:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 608348D0162; Fri, 21 Jun 2024 07:37:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3312C8D0160 for ; Fri, 21 Jun 2024 07:37:44 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id DE2461C1C85 for ; Fri, 21 Jun 2024 11:37:43 +0000 (UTC) X-FDA: 82254696006.04.35AD9F3 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf22.hostedemail.com (Postfix) with ESMTP id 93958C0012 for ; Fri, 21 Jun 2024 11:37:41 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=cHS4AIQu; spf=pass (imf22.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969854; 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=X1oGap99TVdqBvzHLWhv+TXBuFqzUMdrRG4OBua4bwY=; b=5lNXBJxAJ2cXluHgsRHo2syHVBQjQVJzhPpF7+o2mb5T9kesLaA7XyA0W++tlyFedAabfZ 0koJ40VgXQXpRTP5QIITm/krdHl/JWTA3dHBKnqTEigzTNDrPXfe3va7ZztAkK4S/jDH7L 033U6xjhbp/4TKMIK+dtuBD6XK4lcXg= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=cHS4AIQu; spf=pass (imf22.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969854; a=rsa-sha256; cv=none; b=65i+Xi8vWFTpHPDQGrjDVRlxjGVZ6ReR0vaeqbO7Q1TiYSQbsvX9muN/T1siawpD8Xylgo HcvU/cvjlB4GYjEsX9JIJvW3S/oSAv6vEJ3Y6crnYazz0CJEjTT2iGBnrPdLBhei0+56aG wHpmybTzDorUCx87Q65t9zjlXZ469Ek= Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBSug8032437; Fri, 21 Jun 2024 11:37:35 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=X1oGap99TVdqB vzHLWhv+TXBuFqzUMdrRG4OBua4bwY=; b=cHS4AIQufHyIdJNvC/ckC7xvUQXq2 pmE/5t7z1eYxkVNhUNRsW3IQQLLwAVx+wMygpvoScm6hW/ZSvY18/EYjTpqhkSvB ++qp2VmG8ljf1linqVsRk/m7cZUs6kgChtkZidBDJPNLsLa5JeUXOrdg1VQ0gFEP cc6pqrhpJ3NY36cyqS58FR1viJ78PumnsWfk1CWhXMShNyZqNmWfErq8/pSHh5LF sBtF5Ptinmd3Pc6F0gyKH+Y0EvCEwouaeEa3k9t7lJcr66IK9NL1EyjtAh7CoULl nTN6Kv8L9kUC4XSeefoaZ6aDHCLYcnOqpbiq2jkwNln6urM2kZv2zm3Tw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw8p2g0kn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:35 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbYUM014376; Fri, 21 Jun 2024 11:37:34 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 3yw8p2g0kg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:34 +0000 (GMT) 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 45L9AHOT019941; Fri, 21 Jun 2024 11:37:34 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrqupw0g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:34 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbSnF54853978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:30 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1D9972004B; Fri, 21 Jun 2024 11:37:28 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 81C262004E; Fri, 21 Jun 2024 11:37:27 +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:27 +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 31/38] s390/mm: Define KMSAN metadata for vmalloc and modules Date: Fri, 21 Jun 2024 13:35:15 +0200 Message-ID: <20240621113706.315500-32-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: 72Oak4PnOY00Ouh9gmqCpCVl-f00e8x0 X-Proofpoint-ORIG-GUID: B6QLHfkbQ1aHYH9UguQEGWXygvTuApGV 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 mlxlogscore=663 spamscore=0 clxscore=1015 bulkscore=0 impostorscore=0 phishscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Stat-Signature: pt8zmqdq4qj7z3a7huujycukkdaf7t7f X-Rspam-User: X-Rspamd-Queue-Id: 93958C0012 X-Rspamd-Server: rspam02 X-HE-Tag: 1718969861-671931 X-HE-Meta: U2FsdGVkX19TznQd1C6mAnbWcbib2ZQSO4qJ7Ov8Wkr3RzPv/EbrGo0sHURsn2U2qEHBs2xH2GaBbdr3/gzb1kZpxGGGX8qUKiX81e2+IRPHcjM3P8J+dzWYWdxUq5gsMXdruBIhYHQrauJ4a/OSQpTxg/V3kDimtJPs+tVLMAeXApXsHx3wAhh+K++fqL+mQ6c0m1pM6TJmi3gcOGCMPhSDKL5fwH7OLX7mxIYzVI2peBVVq7nt6Z43uzBBWBAJsfgd8qRAU+466ez/n9qfWLFMXvFUD3tF4juSbPKPhMIddBt8OoxF66CD1tokeJSnKy/xmwZyivkew2iSHVRXVtBwZIE1x2ovmgerX6W9BZPlcRaTM92jfE16UTlrGOCYMO2ZHfQKr/KCdghW0dzCfrAju+BOigHo/fGVNo7cURmpDmtWyGa/jUzRzHqiogIWkisj+K5nABGRHmza82CULh6JXxPadA/mxFtL733/5qCG1UX/iTF/m5wtp4PX4fU6DwqSvWP/sUkF8NxTYOugtxqrG6f8T2galb1ySlBVOgqTJ6slw649/ifvVlKSW6knecDFraB91navuzz27pEdihYiiyz8jpi6XqK7/z/FVypeHVsbdVUViMvtLtH+jpvIvXUeSd/7i76aurXqRikx9Z2MPyEbGdRm6vjNbTeFdOzuGzldugQeioN+4RnXXbEbAb9+GagvZyVL3427paFngBvtsr9BsoWGFQhyMkYFU09MdJEnjZsOI1J5w+BcM3JjTNOKbGuzuiXZ85X9KPNNvCun51vPjqtv1kJa3m2SjHuTl0J8rhUu+d/a+07xWri4jix7vwD7EAVS6jHUXXlchSysmPsFIXGp69XJSPaGL+mh8Oya0yCHj0y4gBkzCRbYBHocnp0zktZSkmpgq2hNUJWkgqFAldxdXSnhU+imWuWl3nElv+XvOnoWtNjGpBDGOmDranwZEA1km20+WQn s43+8Zpn SPPDHUXoaGXcOEeMY8K0s+L3di174VAlbooDlkyYdCUImnxD3XCXnIMqUtWDw7UKx7589qEOqxOCpbDpaUGcD05AwgFczR96I3LEObzrbv48FQQtlJh6H6xgVk9odWBJtfIiiAMabH1b6ACyPQ9Bez2UNOYuIYPBKUvWXA3+IrnRdrOODTTCdzVRPpiH/9kIZjwbSRU6VTGaVsCgl/p1ubcUCueC0x6gWIbqxAY2L0R8K/zMHyzjvBe4qrLGyI7iNbdMv+oz4MlMWLhFygAIHz8OFEvH235SfWWUkOyFIgur8vqUzmIFa/MSWkIvDTqyms01cEF0A29QHzuG9aq5UNgjMOseXiJ/Tr2UJ 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 pages for the KMSAN metadata associated with most kernel mappings are taken from memblock by the common code. However, vmalloc and module metadata needs to be defined by the architectures. Be a little bit more careful than x86: allocate exactly MODULES_LEN for the module shadow and origins, and then take 2/3 of vmalloc for the vmalloc shadow and origins. This ensures that users passing small vmalloc= values on the command line do not cause module metadata collisions. Reviewed-by: Alexander Potapenko Acked-by: Alexander Gordeev Acked-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich --- arch/s390/boot/startup.c | 7 +++++++ arch/s390/include/asm/pgtable.h | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index 48ef5fe5c08a..d6b0d114939a 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -301,11 +301,18 @@ static unsigned long setup_kernel_memory_layout(unsigned long kernel_size) MODULES_END = round_down(kernel_start, _SEGMENT_SIZE); MODULES_VADDR = MODULES_END - MODULES_LEN; VMALLOC_END = MODULES_VADDR; + if (IS_ENABLED(CONFIG_KMSAN)) + VMALLOC_END -= MODULES_LEN * 2; /* allow vmalloc area to occupy up to about 1/2 of the rest virtual space left */ vsize = (VMALLOC_END - FIXMAP_SIZE) / 2; vsize = round_down(vsize, _SEGMENT_SIZE); vmalloc_size = min(vmalloc_size, vsize); + if (IS_ENABLED(CONFIG_KMSAN)) { + /* take 2/3 of vmalloc area for KMSAN shadow and origins */ + vmalloc_size = round_down(vmalloc_size / 3, _SEGMENT_SIZE); + VMALLOC_END -= vmalloc_size * 2; + } VMALLOC_START = VMALLOC_END - vmalloc_size; __memcpy_real_area = round_down(VMALLOC_START - MEMCPY_REAL_SIZE, PAGE_SIZE); diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 70b6ee557eb2..fb6870384b97 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -107,6 +107,18 @@ static inline int is_module_addr(void *addr) return 1; } +#ifdef CONFIG_KMSAN +#define KMSAN_VMALLOC_SIZE (VMALLOC_END - VMALLOC_START) +#define KMSAN_VMALLOC_SHADOW_START VMALLOC_END +#define KMSAN_VMALLOC_SHADOW_END (KMSAN_VMALLOC_SHADOW_START + KMSAN_VMALLOC_SIZE) +#define KMSAN_VMALLOC_ORIGIN_START KMSAN_VMALLOC_SHADOW_END +#define KMSAN_VMALLOC_ORIGIN_END (KMSAN_VMALLOC_ORIGIN_START + KMSAN_VMALLOC_SIZE) +#define KMSAN_MODULES_SHADOW_START KMSAN_VMALLOC_ORIGIN_END +#define KMSAN_MODULES_SHADOW_END (KMSAN_MODULES_SHADOW_START + MODULES_LEN) +#define KMSAN_MODULES_ORIGIN_START KMSAN_MODULES_SHADOW_END +#define KMSAN_MODULES_ORIGIN_END (KMSAN_MODULES_ORIGIN_START + MODULES_LEN) +#endif + #ifdef CONFIG_RANDOMIZE_BASE #define KASLR_LEN (1UL << 31) #else From patchwork Fri Jun 21 11:35:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707344 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 E8828C27C4F for ; Fri, 21 Jun 2024 11:38:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E97DE8D0160; Fri, 21 Jun 2024 07:37:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E21B28D0163; Fri, 21 Jun 2024 07:37:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C22EF8D0160; Fri, 21 Jun 2024 07:37:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9119D8D0163 for ; Fri, 21 Jun 2024 07:37:44 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5DA6A1A0DE6 for ; Fri, 21 Jun 2024 11:37:44 +0000 (UTC) X-FDA: 82254696048.23.77B249E Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf18.hostedemail.com (Postfix) with ESMTP id 20E701C000E for ; Fri, 21 Jun 2024 11:37:41 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=aYXtoMYb; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf18.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969854; a=rsa-sha256; cv=none; b=oNyHucFqlc53+hvj2nqEaZ7N2FpPVX2S9BWc/HJO2dhZbrhAJAKolKB48FoZ0dpX+TZBqs PWslypPj+WZcm3IO/Qp2ksuW0sD3tuMlmJVgGcPy53grTeqS6O76sZIdFUscM091ym83wN T6MzgGFbViF4eIWPbihDTjQvQbNpfe4= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=aYXtoMYb; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf18.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718969854; 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=twgTpfHCjImRnKDbwT1fFnn3UXy6li/j6Qe1IMbE5zU=; b=N4eruTEOLAVkIlkU/S6xQTMHDZMmtMhtRMBCfBh/gGtPq4QMN6BKc6zDj++VruzT+ZtCIp 6XifJwEjRkvsUuLiE4TDHBFCfKFgNo3UTLnYmoeQDi2EEc2lyPumMO8JwBYS3JGSNZuZoi bGRqRoeQ5qTlvOHIBt+ws/oCt+ApdFo= Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LAoUL6014184; Fri, 21 Jun 2024 11:37:36 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=twgTpfHCjImRn KDbwT1fFnn3UXy6li/j6Qe1IMbE5zU=; b=aYXtoMYbe4ekJIpkZtshNGmrQ6X8P UbBp/BljzbxZCdVdMQt9qhCP+Ypn/RoUcw1lQV8kFAiKPexaQgb9A/CZDJuoq+Hv 85BsDXb6gD2XLeAvY0tNddxCXnCIJtuyAKSSuGiSo3zY+TccZGsUgW09105F7d53 EFOqispB0NPA+I1RZmgElnZjXwLnfI6MJU799olTfwDPLf9DwB7a2nXfYpAjy7Lh 4SoFNnGqGT4TPK+ky9RHoxnxxxEA/3lDY7PoUjfUGs7gF5dkPFiqZYAlPP0UxNmI o6BgjwaiPDHk/SeMLEtZ3e+9LJEEBfNbMutGdGyAH86DEOf7kfEhc3C4w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw7t5046c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:36 +0000 (GMT) Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbZ56017560; Fri, 21 Jun 2024 11:37:35 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 3yw7t50469-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:35 +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 45L9Lx4G030885; Fri, 21 Jun 2024 11:37:34 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrssxvbw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:34 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbSjg49676548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:30 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B14842004E; Fri, 21 Jun 2024 11:37:28 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 27B452004D; Fri, 21 Jun 2024 11:37:28 +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:28 +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 32/38] s390/string: Add KMSAN support Date: Fri, 21 Jun 2024 13:35:16 +0200 Message-ID: <20240621113706.315500-33-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-ORIG-GUID: 3PFulpmb0GyW_EvRMDVFj7MrXJtxbV1X X-Proofpoint-GUID: XQwQMTK_IdbRjv4p0bY5Pn4_ph8BXBKO 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 lowpriorityscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 adultscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Queue-Id: 20E701C000E X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ohrui1tmednxhs4w5mcfd1t6rhgusku8 X-HE-Tag: 1718969861-468069 X-HE-Meta: U2FsdGVkX18BQutw81A3Cavce+J7yXO/bxfOvu0JgX76mjxMKDkk6EQXhaa61lD9qQWKyBVbNbDuKE4oW7N7FkHQeqjLwmAbd+M4vGL94tSeO64lm41DyG7oAueE8Y5nuW+4AvaV0cnA+w+ZWMizSe0CmW7DXc2BzycsP4JonyNITH2Mk3pCB4PSEBFgtVl7rFPsobmYGnK8b6unoa9zluDP2S/4FtrHHOcC6CnJDQAavKvuvSRKdJnGWymX1TXrOL77owpYmqaNvgmUDaXHKFMH2E6pBvuegPzasPKCcNqzd1l470RO4ag42MihbFChrxfKZSh3dUEnWz6/jjdDinIdI/DKYeb+RIj3AGo9QaId9Chjr5vc6ux5b5rINm6iB4YvhB5Gr79jYCch5D8J2ShiO8X3oxjMt7DvTo45jrV0afuiQSiH4WCpyruPtoss3JTKvt6AZLAvfKfhdCv5d6TVvp5M3B6SVVVXsaREiECULv9JmrRILwKU2Sm7QLu4tJy0QiErY6F/jKNsOfao636/cnPatPiGCyAmr2x/a5R+pqIBqfZPVdmBlwseNEHRx5iCvyGC2sgwoiQL243bCHNcBw6WH4DESWGCTv3X1r22JxhjsH+mII9CVKV4FhochDDYZhzuBWcZDr8kaiplaY/X7QPxuuo9lIVGlxQ+TPNfpR/CR02M1Za8P1O0zy7oCsiDu5o05ywYkMeCfsvnDJ3hj6MEA8vzTIfkYRMh5SaT3N5Pj0BU1GXIejV9lB5sFxO/mnMM9HCG5DVH0aXQvnl5KIfGWbGE0SiDb9JjWLS1+cjyyCgzh2yuUeuZ+WLea73N/kGrH3tpGx1+N+Lfv5UqTUWqpJFquDJrAjjacujrmtA2ywM7zmvGm/jSxGkph75hen1ettVbCzYdkLkkxklO+2X1S90IY6WeEYbK13r0oNHaNgwKuIpcvyCuAxVfS+n9r0GaV9D/HTtsXAc fNrf3z5R 61NUoUA6CQlC1AtEXjFFsOFTU3n537Qgv4lxAa4ajl7owXQCByf1AIlsH4rDyaGKsRvVEMS3mEvP0N7AvLOwOh68bwLXPGe0UVgCpW6ehSV5nOH1Bx2f3U0y2Lk4HseppMHW3/uN8dRWd4phkdCa17H0G6lhdtvMW8mpBBp5BDxlCdR2/9RNOMqH6wMYI1XQdUtpX5hn5V7SWLQn6r+/MnFEm2U7Yfu1CM3GGR3UuJzoC8LO5nBcwHbwKWEucprqee6Pn0H2uGQzLkeZ+spuXTHxEgDTc6B3eF/qUDeJ4uy74044crRvC+BAfTz9KuKdcC8URr+i3R+2ze3J1z7kO3IIZ4cbuK4+U8Fk2 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: Add KMSAN support for the s390 implementations of the string functions. Do this similar to how it's already done for KASAN, except that the optimized memset{16,32,64}() functions need to be disabled: it's important for KMSAN to know that they initialized something. The way boot code is built with regard to string functions is problematic, since most files think it's configured with sanitizers, but boot/string.c doesn't. This creates various problems with the memset64() definitions, depending on whether the code is built with sanitizers or fortify. This should probably be streamlined, but in the meantime resolve the issues by introducing the IN_BOOT_STRING_C macro, similar to the existing IN_ARCH_STRING_C macro. Reviewed-by: Alexander Potapenko Acked-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich --- arch/s390/boot/string.c | 16 ++++++++++++++++ arch/s390/include/asm/string.h | 20 +++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/arch/s390/boot/string.c b/arch/s390/boot/string.c index faccb33b462c..f6b9b1df48a8 100644 --- a/arch/s390/boot/string.c +++ b/arch/s390/boot/string.c @@ -1,11 +1,18 @@ // SPDX-License-Identifier: GPL-2.0 +#define IN_BOOT_STRING_C 1 #include #include #include #undef CONFIG_KASAN #undef CONFIG_KASAN_GENERIC +#undef CONFIG_KMSAN #include "../lib/string.c" +/* + * Duplicate some functions from the common lib/string.c + * instead of fully including it. + */ + int strncmp(const char *cs, const char *ct, size_t count) { unsigned char c1, c2; @@ -22,6 +29,15 @@ int strncmp(const char *cs, const char *ct, size_t count) return 0; } +void *memset64(uint64_t *s, uint64_t v, size_t count) +{ + uint64_t *xs = s; + + while (count--) + *xs++ = v; + return s; +} + char *skip_spaces(const char *str) { while (isspace(*str)) diff --git a/arch/s390/include/asm/string.h b/arch/s390/include/asm/string.h index 351685de53d2..2ab868cbae6c 100644 --- a/arch/s390/include/asm/string.h +++ b/arch/s390/include/asm/string.h @@ -15,15 +15,12 @@ #define __HAVE_ARCH_MEMCPY /* gcc builtin & arch function */ #define __HAVE_ARCH_MEMMOVE /* gcc builtin & arch function */ #define __HAVE_ARCH_MEMSET /* gcc builtin & arch function */ -#define __HAVE_ARCH_MEMSET16 /* arch function */ -#define __HAVE_ARCH_MEMSET32 /* arch function */ -#define __HAVE_ARCH_MEMSET64 /* arch function */ void *memcpy(void *dest, const void *src, size_t n); void *memset(void *s, int c, size_t n); void *memmove(void *dest, const void *src, size_t n); -#ifndef CONFIG_KASAN +#if !defined(CONFIG_KASAN) && !defined(CONFIG_KMSAN) #define __HAVE_ARCH_MEMCHR /* inline & arch function */ #define __HAVE_ARCH_MEMCMP /* arch function */ #define __HAVE_ARCH_MEMSCAN /* inline & arch function */ @@ -36,6 +33,9 @@ void *memmove(void *dest, const void *src, size_t n); #define __HAVE_ARCH_STRNCPY /* arch function */ #define __HAVE_ARCH_STRNLEN /* inline & arch function */ #define __HAVE_ARCH_STRSTR /* arch function */ +#define __HAVE_ARCH_MEMSET16 /* arch function */ +#define __HAVE_ARCH_MEMSET32 /* arch function */ +#define __HAVE_ARCH_MEMSET64 /* arch function */ /* Prototypes for non-inlined arch strings functions. */ int memcmp(const void *s1, const void *s2, size_t n); @@ -44,7 +44,7 @@ size_t strlcat(char *dest, const char *src, size_t n); char *strncat(char *dest, const char *src, size_t n); char *strncpy(char *dest, const char *src, size_t n); char *strstr(const char *s1, const char *s2); -#endif /* !CONFIG_KASAN */ +#endif /* !defined(CONFIG_KASAN) && !defined(CONFIG_KMSAN) */ #undef __HAVE_ARCH_STRCHR #undef __HAVE_ARCH_STRNCHR @@ -74,20 +74,30 @@ void *__memset16(uint16_t *s, uint16_t v, size_t count); void *__memset32(uint32_t *s, uint32_t v, size_t count); void *__memset64(uint64_t *s, uint64_t v, size_t count); +#ifdef __HAVE_ARCH_MEMSET16 static inline void *memset16(uint16_t *s, uint16_t v, size_t count) { return __memset16(s, v, count * sizeof(v)); } +#endif +#ifdef __HAVE_ARCH_MEMSET32 static inline void *memset32(uint32_t *s, uint32_t v, size_t count) { return __memset32(s, v, count * sizeof(v)); } +#endif +#ifdef __HAVE_ARCH_MEMSET64 +#ifdef IN_BOOT_STRING_C +void *memset64(uint64_t *s, uint64_t v, size_t count); +#else static inline void *memset64(uint64_t *s, uint64_t v, size_t count) { return __memset64(s, v, count * sizeof(v)); } +#endif +#endif #if !defined(IN_ARCH_STRING_C) && (!defined(CONFIG_FORTIFY_SOURCE) || defined(__NO_FORTIFY)) From patchwork Fri Jun 21 11:35:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707347 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 4827BC27C4F for ; Fri, 21 Jun 2024 11:38:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E4578D0166; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 769048D0163; 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 5216D8D0165; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 27AE38D0163 for ; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E3947A0DF2 for ; Fri, 21 Jun 2024 11:37:47 +0000 (UTC) X-FDA: 82254696174.30.7789182 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf21.hostedemail.com (Postfix) with ESMTP id 9B6411C000F for ; Fri, 21 Jun 2024 11:37:45 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b="acXEkLh/"; spf=pass (imf21.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=1718969855; 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=aLe/3XBqno9Ykh6K8Gazkn5dKq5eSwzJESHfR5NZsd4=; b=FGHkE5D38CFJ4dMOsvlZ3++Slotndm9vhyzQNZrXQiuAt8OIGh3avfrYh0XOkE0rkakwdx 5ntns9KMsMqfDta2l+w0FGfSWS4QH3HZorfBQ9bQBc73bYG01asq4RZzZ4em+JXCkByHFh PC0tQrBm5j67hAK91eBVcYaiSjWhfT8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969855; a=rsa-sha256; cv=none; b=TkzYNlgQwzMO0/kgIOUVG+4Km1reqf8/OZKJWM5pHPwlsmTnQQIFUUv5Ak29sccsUwzc3I lTQF2xoS6DEbxVkNmopbEzLtO/yHn+gTx9s/HPS8KOVIE8JYhXF0d3ZIb2VGaFuLv5Y/mA V62LT6ndlmTULSi98swiBh6b7wGvS44= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b="acXEkLh/"; spf=pass (imf21.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 Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LB1wEL032087; Fri, 21 Jun 2024 11:37:37 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=aLe/3XBqno9Yk h6K8Gazkn5dKq5eSwzJESHfR5NZsd4=; b=acXEkLh/8/3GnbI63Sa7o4fayEvTr TOayC2tgC16y+V2rc6oy3/4TfsHY7hV9EiLy0XG+PmhhJyOObYzDAjSIR0DGmlW7 cg8KQCOKrAiT1YPQczyvnLoVkGIQEaWIWxZTtmy361Uad9YyQoQuTKX0HT5vFE30 QSDQNNofiK+AOyqlu5LMHkEtb4pc+vQcwy5Y8slBmqGv13L33nIvWVECNFf1X9Cz nOXov6QSG/LDto8+Bb8IZVKWtkc9zpPcY7HawqWIAVQtVZIbf+1juAzqC8d37/nI meU/KQhXWBamC/zYJcMOrLlJD8x1Wn68dgaci0nbmMXrevx37PtDoOuWw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw49cgpwq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:37 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbaEL022055; Fri, 21 Jun 2024 11:37:36 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 3yw49cgpwj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:36 +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 45L9BsP1031330; Fri, 21 Jun 2024 11:37:35 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrrq6vga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:35 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbTXu51052840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:31 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5065020040; Fri, 21 Jun 2024 11:37:29 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BB2A720065; Fri, 21 Jun 2024 11:37:28 +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:28 +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 33/38] s390/traps: Unpoison the kernel_stack_overflow()'s pt_regs Date: Fri, 21 Jun 2024 13:35:17 +0200 Message-ID: <20240621113706.315500-34-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: 4W3rtCu_nH5X8A2P-hq6iliOp8gXzPKu X-Proofpoint-ORIG-GUID: AyWyEN58kjthDpoSHixMhSEVTnJKwLw- 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 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 phishscore=0 impostorscore=0 malwarescore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Stat-Signature: 665opdm818y47fc95hbywk6pcfziw1wo X-Rspamd-Queue-Id: 9B6411C000F X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1718969865-205351 X-HE-Meta: U2FsdGVkX19q+r57EEzdWgCotcLPOGc33iCowkTIRmXrQR5IC4xJg/CmY6Xxm0Za/Dzu00q3jqpgZ4B4fSUR+YTnvWy0kqCwDUEOR/kAh6MdiG3M7iX9/VZmMzwL2b5zTymBjVrhusGJRkYKJUllBQx0s6M8lEzUnp6blPpVpOGqQK+qA7CvEHFocHzv2Is3UGPrANHvo2DRRxiVs/LhHTWMGZstequAWHl6OCJvy72PwxE6asJ5aU+8tbD1/1AxOvead9N9Iu7hA1U6fzPz3or8NuXge57O3BRRtiaic5XwmWFKm6pZB2kqLnUuer7twbZabrX08EK6mBz1r9ut+hjqoMezxFc902qpYJrTuFKa9V1WwRcCaYgRmHFX+r199S6hiC3skvaFjojGSCtNTlFA0eM0L3XE6/1oba8QC3Tz44OUId3v8fUhJK4+S4jWnt6aGg8blkSfDhSNxuZTkFkFdX4MsIPe5nA+R9zclHrQRAbbfRj2TL2PVIIcRtw1n+TBDAjBj/eG/kZz+qov+pyeN0f8S0/5xztXGydCKpUJRIQR9DU2AOMM0NawqG41sMI49m7XAXZj+Qv/sTWqxz2lCVnIgV66irFyDPYGLrwTPUiF43k9lYGSfF+lAv9A+SXuGxsk1OUE+MZuXumEYdhyvkZ0xFbNQr1673V6YIUjSdYIWi8vow0384ZfN0YyxHtccT2f5l4Gl1uGV/WxVOJcvIyVB5rK30cBow0nAxZzfU4JSCcbrStT/lG5a0m9D5ClfZ8jawS8AKljzXhPgmLVBD8Sgi2B/N77hQgZ8AzS9nnZPOI338kWoe5vIWfSU9g1SOZUlQI8Fcnf1nh2Ohh86jtxnKXGoSVSMPE0f1hEvtbPZs7ip9VLvby5Wa1Y9/cYWZSKJxMjfmY9Vzpgzv9gPloZdXezXjbb20YcQYlJeq2qBP+mL2zvvS/e5synrTS0WDgDPEGt8kk8kiA bLzO97we r9Xzi95SDi+0IseX2vTvUc8RCRuOyGBklhQ2b/6mJvGdV4s/d7dqD5qGZ5Gt5Rl2VR4L8afEJAciZZjHLJyS6V2v02oGQQRAaBOedR/yzBnEfMacrSYnq6hG99Jo13JHyj3PT52FJv3iSTKOc0BNJzh/O9kkOIeoepVbVNhXtWzNt4pmtVkaq3yy5VkUNWLa9485kSrZ+fNwSRoUFT6JKtt53qb27Io8UAXCMeX9+uQuanrXoZxjRbNqre/y6JttatlrNVey4VULnPH7X/HS/VPwoXXY//oRONjAGPdB+T6vsDJ7j0y9uPE7RhDcgV6W7bllcKEpHbfoJbxnkn9ScM+gI4Yv/nSZF8gaHuB2wik1wYq0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000011, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This is normally done by the generic entry code, but the kernel_stack_overflow() flow bypasses it. Reviewed-by: Alexander Potapenko Acked-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich --- arch/s390/kernel/traps.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index 52578b5cecbd..dde69d2a64f0 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -262,6 +263,11 @@ static void monitor_event_exception(struct pt_regs *regs) void kernel_stack_overflow(struct pt_regs *regs) { + /* + * Normally regs are unpoisoned by the generic entry code, but + * kernel_stack_overflow() is a rare case that is called bypassing it. + */ + kmsan_unpoison_entry_regs(regs); bust_spinlocks(1); printk("Kernel stack overflow.\n"); show_regs(regs); From patchwork Fri Jun 21 11:35:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707345 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 1A5F1C27C4F for ; Fri, 21 Jun 2024 11:38:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 187346B0193; Fri, 21 Jun 2024 07:37:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F33596B0192; Fri, 21 Jun 2024 07:37:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE9648D0163; Fri, 21 Jun 2024 07:37:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 784446B00BD for ; Fri, 21 Jun 2024 07:37:45 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 02F3FA0DD6 for ; Fri, 21 Jun 2024 11:37:44 +0000 (UTC) X-FDA: 82254696090.02.BBE4C2A Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf03.hostedemail.com (Postfix) with ESMTP id B49E72000D for ; Fri, 21 Jun 2024 11:37:42 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=R6UM91jS; spf=pass (imf03.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969852; 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=2Lekuxa2dBCBcc5htHlKGfkEfSg9eOPP5CW8wCh3gqI=; b=qRyBXk2u3C/vPwMY1L1tT8AXptqjXuEihL1cgV0jcgwQgI5Zcep4IYeSMPCEaDCtOAq/jU bDT99YxTLQV2cFIVTqds92aIE3CmnABg8sfi8HwqpuSmX7vVuqg1Q81Dbw+M4GjB7mKRtV 2IOtrHmKLBbuW8cwlJpf6V6qFKqEgrY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969852; a=rsa-sha256; cv=none; b=tRH6iRPKVdCGandHlLpo8khPZ6sS0oZsMMlQZX32WQuuj7bzHqB4zpFbMq8iBdWPceOHAg AxrrQfOKUX/w+ku+UnDFLqSlR/qZiB3t36M3TDuCUu3HUiwh4AVwVSfFrs+J9t2pYBhiPJ frpQFS2aXVyn1VNnxdLH4IFMPdDuFHQ= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=R6UM91jS; spf=pass (imf03.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LAThJS018266; Fri, 21 Jun 2024 11:37:38 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=2Lekuxa2dBCBc c5htHlKGfkEfSg9eOPP5CW8wCh3gqI=; b=R6UM91jSAubeVh0/ZdD0sqVU+3Aao krCvmout86GKHRgD8VSABS0khGMSpkOIZeWpMC5kvuNmCCBGk3gur5xhRK0u3HCW esJB+vMXP+u4LXqYFaLnQeR3vSRV3AAVX7SfX4J84YaL6JIdivcdwAXKTJxHJN4e RYFVmTMJTpT0XUXGuhjANONZ8o+GuC4CNkiLHXcaGQZcjbRx2uXjEaR3bRTkSepo AWxFSfijn4IbqfNDyouT++6vY5ptfQtKwdOtGFsjh8jCuNJnSERCrldPTej/U/A9 maqCcfIvQQfWhU7cyu5QqxPnx+vH7i3OYPWc/bkweTzR1zRIRlaOR1p2Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw7t5046h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:37 +0000 (GMT) Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbbRH017573; Fri, 21 Jun 2024 11:37:37 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw7t5046d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:37 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L9F81Q032326; Fri, 21 Jun 2024 11:37:36 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrsppv6d-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 smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbUNs33817122 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:32 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8DE0C2006C; Fri, 21 Jun 2024 11:37:30 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 03C7F20065; 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:29 +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 35/38] s390/uaccess: Add the missing linux/instrumented.h #include Date: Fri, 21 Jun 2024 13:35:19 +0200 Message-ID: <20240621113706.315500-36-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-ORIG-GUID: mhn8jrenjGfEm4-xUpGHErN466P5A7lV X-Proofpoint-GUID: HzV0N2f4Iy-hsOvGb-JmJc_00Dwo5ipb 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 lowpriorityscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 adultscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Stat-Signature: hp1dsfdu6nmwcpoz9au1m4eqy35mwjgu X-Rspamd-Queue-Id: B49E72000D X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1718969862-822696 X-HE-Meta: U2FsdGVkX18qDTBQ9a7OtIAFP8ISZfa72qlvSCv4LPBLYvnJcohwWNEvo7Rxw5Xm0lTD1x13Vf9edrGjUcIMs5LCbb4zJe2CrYuSUHOKl7MgiSqu2li8LQVPy55XQ5g1sWPRqchUSo7DVMpX1CLRa+4bX2sOpYLTmr3v4gwGJoYrK3VfiqxQYSdKk7jZtybAypoJbUL1C/dzrgqC3FepbgZhZdTgKBYsyHzhiv7SIGRQfLsGmMbTixxXZXL8bDeVgtD6mTJr61IG5SAI1msv8lcxkPTNVLdEIy7prQPh0AHpyrbkrEsXYlEezEKyuLWROIJNOkpl4V3NRli4+EXyOmrpmW8UuCSdYfNTIoHLq2XeXQc9/Z3P1fxbGTnqBdRt1PjhE4DFTxZmyKW08jS4Q9Xv/sWcq0lVT6OFRwGfGirujmwucaNpE/HDp8VTNFyDgmFte+tOgUP0wfQAw1wM+2ZRvFGTE428TtqKhh8b8zvWE+MxNCQiRwFaLDyWeM74kjIfyyvdm1YKNQz1U9u2z6kI94wIFneqW2ga8DcTyCfF1/sZk7sNiDDGxD8jCGHoud6348PuXScV9T0g68hc/K5C8+OtIGVId6kqyYlYQVWUqjgBsjyFvBHAKObxWNw9aU4fqoAaA2MJUFVmOQfqwCZBLvula0myGW5kb+dc7Eb/iCVWuVdzpGHrNbMNMB6tRN5zLwzxDr3Oy5RF7ND981hkEuspBG9PNmVKmBPvCzRjziSlc6995S+1RLEyfyqki9NVdBYxun4G7b5TcrpgwDFU9l1HNrTGHNFvIWMXysi8r14eFjlDmWR5wEkpKpQgR7eQtT1/CkKMgLg8R2zptZftFjxDz+q0cGjpw/wtuzJzlfaVUlRpzpXGJzou8qOPVMHveFOpgYINlNuDiPq/sCnSIwswaHvm87vwMJ8aNIk3pNBvtsRl/DAXrCi6FoYPhlyGdYuvGp95TLunJ/4 oK9f8i2I PHC9qpxG9YDrlbaVV4Uz+pXb0LcZosxD68vbVHqWkCa+V2PTBTz9nO8Ki6kjBgCtN6J/XsIlLwem8kR7WkZ6VhjKSFJH7sii3Gx8Qurhty2Z1okG6X3JhsQMTnuUQRUvnslAq03lsIFYOZZMjRKIK0IQ/W/8XSx3xfv4JwiZbeJzzIXt1lqb8B/IRen81J2TfucW4PZP1pJ03wh/R0o04hMNwRNcY/IWXHzleCsO674VHPEuEgULHFtI50HLIW8iVLn0gz4ABmX1c0oz+BQmukx/aGbfCg/HaQQS9V9ZSWrTYaT8Kog6g7psxTyjMrXsE0g/FROdXiSLEJycGeGQ9msj0uXsIxyVr1FLxotWYEHyXan4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: uaccess.h uses instrument_get_user() and instrument_put_user(), which are defined in linux/instrumented.h. Currently we get this header from somewhere else by accident; prefer to be explicit about it and include it directly. Suggested-by: Alexander Potapenko Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/include/asm/uaccess.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h index 70f0edc00c2a..9213be0529ee 100644 --- a/arch/s390/include/asm/uaccess.h +++ b/arch/s390/include/asm/uaccess.h @@ -18,6 +18,7 @@ #include #include #include +#include void debug_user_asce(int exit); 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) { From patchwork Fri Jun 21 11:35:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707346 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 2A333C27C4F for ; Fri, 21 Jun 2024 11:38:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DC526B01F9; Fri, 21 Jun 2024 07:37:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 964E86B01FB; Fri, 21 Jun 2024 07:37:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F5C88D0163; Fri, 21 Jun 2024 07:37:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 44B8C6B01F5 for ; Fri, 21 Jun 2024 07:37:47 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 010951A0DE3 for ; Fri, 21 Jun 2024 11:37:46 +0000 (UTC) X-FDA: 82254696174.12.AC2BFB4 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf23.hostedemail.com (Postfix) with ESMTP id A51DA140016 for ; Fri, 21 Jun 2024 11:37:44 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=mvP63znE; spf=pass (imf23.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 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=1718969855; 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=dJTBCTVm+DYwwDfuPqhjkMdDHVgbTJOgQUj+bRO14r8=; b=RchUIgTF+ZpeyElj2GgOmlsIglqoUYuaJAWy7To07R5SGGKy8GYzETAUMB2NeeWVUWS/3O SoKevXJfW6rTdo+QODpWqyiWqxHHZSIFnquCk5Vx/zw3VyTzejPu6jOh+w93/D+p90sra0 YoxEmR7Kyy34J5Vdr7vaAPhdBubdlF4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969855; a=rsa-sha256; cv=none; b=dfw2/FVlhy9cgGJ08xubwhBABSmBkl0Lw76hN4dHNqMZAsVli4kJo9WERpPB7gEUUQRooK lgzcp5I8r0pbJP2ZE6qOUXBg/plj5jdpp1gWGP8CkrUXhK0gnOIapuvm5g1V8PCOuGg5vm YkG1yhlMxYCwDzqGE7N5ql86KAxW++c= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=mvP63znE; spf=pass (imf23.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LATgMN018262; 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=dJTBCTVm+DYww DfuPqhjkMdDHVgbTJOgQUj+bRO14r8=; b=mvP63znEJQedkrBiRJ53gaNoRZtDf 3Ebm2PJZRihPVWBP2VvYm0BF/nzOccwhGLxm1Hc3LaTG9DgavCBXcCl5tSEnG06A QzIA88A1RIQCz7a5ztFOk/x8RikEgfwG3pfs0Gz+26gi1xhkQCVQIbQcxDOIVHPd hWOgWzZt4PBsh189PXIMJt5QHARrxyWnDMaTsJugQsTcMqM7L0iYAZl/HhQQh5mX zjcjggCJuaINyFT8pv8A+S4MTODxcIsNWL749Su3sF1VrF7gqeQeJLRMeOwAwjPD pcbv4JlIZ/lArNJ3JmKPBd/Gc46mp9yuKc7e0gntrM1NWKQ+uKXuqYgOQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw7t5046n-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 m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBXEi6012851; Fri, 21 Jun 2024 11:37:38 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw7t5046j-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 (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L9EbHe025663; Fri, 21 Jun 2024 11:37:37 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrqv6w0u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:37 +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 45LBbVHE35389950 (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 C1E7920040; 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 3803320043; Fri, 21 Jun 2024 11:37:31 +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:31 +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 37/38] s390/kmsan: Implement the architecture-specific functions Date: Fri, 21 Jun 2024 13:35:21 +0200 Message-ID: <20240621113706.315500-38-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-ORIG-GUID: zaL6FENoUtTNqWUO1NRkU-7HlS4JHT7A X-Proofpoint-GUID: dbvEu-32DCOymeEi7JVqGwWM6oYY8HH_ 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 lowpriorityscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 mlxlogscore=916 suspectscore=0 mlxscore=0 adultscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Queue-Id: A51DA140016 X-Stat-Signature: yhrcn4wquss84ypesqzit3h9jj17ak5f X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1718969864-573135 X-HE-Meta: U2FsdGVkX18xZH20D4rQpRo/94r6jZAnROt6Px4mFLvnpzXlK8Y8n5QihMl+d/8sXjPfeX51GCzq0V5V2x8OJnp9OiywaN7LHzoQpr4U7M2NI2jhus5qNmCwmUI2zpkMn5mL/lwmJqnUw/BczsvCb/ZEmiHv0FBagDGwHA0qC3CK4D9eDCpNe/uhnfHRrSFON/OSL5j74ueCzR5uTAWFKU/DREpenfTYbgPE/VzqiBONy9IvXODHrxwyHWPSR73JykNDr20Jt1uPPf08QtCti+dL0M8YCiVaB+7pRkwKRRxWnnTDYVA8I8BMObqGG6KQVx2tKEJ+PoQvzP25Z9mZwVpxeQyUCaUl3udCnBq75bg7Kj3r2JUFj0UmbGfwpWSHy4rer1YxHhRqWfNIh37wP13m47pFiwS1Ic35wzRxAd/RjOSgv0vBbyXDAL7qbKoS7x6YS9vmXY0wcW871WGooD4IQnpTKK3JDnU9Fgjp6gFt5zZ13eSz4yYBVkwO1DyZ2t/BtDYgM5eKPpYGYVkirqhBsPkR4qmQfuCwNYKnMGtsg7bgnSVqMmZm5ZlrWPeOP39a9WpRvFj7QkwOObLzU+tCS+uYbNBvcaWhAqztYZEhnTP0TfeM6+OaeYmqExGp/QHuQX4EF6kXNLbjzRwkz3/Uihz7YvDuiO4CeVXQ6vKr9MZceNU58eO8uM3hEbN5mvVSlCbtG7OkUUzQ+2dYmCevzBZUIBZGuMbxLN5d0hTEEo5p2vVel6J768Q7JF7qMKZi5qO68aHVEIuOwxHMJ/M3TsgZlKobr/QucNL4FT78Sy6Ry9mlZxIalO5uufPO7IpZttU0AKhK2AUi7QpMKhwPEfY+RXeEBE8J15MJ+I+IrRi5Bsxml0RgS0CAEFt1avEn1JZvYl/8k7MSGTXrMppYQ2FvlBv9bUmKdm9pXb4flqilTTOvP/x9L7Zv9XFzCDt28JNdj5zehe0YulA Y66/ZvIA m8bEu3K2AXIWeJwcnGKg7Xyib6J7wJUN2DDaRjuc304+opn/TeuXeTgJj56zo+t/yx9cy2bFF0xLMcy5W2WpnMrtwJ5M+gDXAtZvd2bHyl30mfGTdJPnypGmhd6zGhSS60AowIPivoX5Vu3wl64tw95qvUsIpyLto2capjjcybkA+0/mpire77NcCFUyc8k+MxxG2EuSONzMeKYIFSDaNwOnxqo3yd0imDzG/SlQp5QYbIh7hXm7NMfhVnWyIU9Aw4XOpw2zsK/GKRrCCkoMMiiu706+CqM0DN5htFEGwWjHcryrem1qbiQLhA5gZUgftXfCclsd5MXTAwpoAcAwVC8AYJymzhh/qBixE/VbGePhDOuXST3gVdBM9/A== 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: arch_kmsan_get_meta_or_null() finds the lowcore shadow by querying the prefix and calling kmsan_get_metadata() again. kmsan_virt_addr_valid() delegates to virt_addr_valid(). Acked-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/include/asm/kmsan.h | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 arch/s390/include/asm/kmsan.h diff --git a/arch/s390/include/asm/kmsan.h b/arch/s390/include/asm/kmsan.h new file mode 100644 index 000000000000..27db65fbf3f6 --- /dev/null +++ b/arch/s390/include/asm/kmsan.h @@ -0,0 +1,59 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_S390_KMSAN_H +#define _ASM_S390_KMSAN_H + +#include +#include +#include +#include +#include + +#ifndef MODULE + +static inline bool is_lowcore_addr(void *addr) +{ + return addr >= (void *)&S390_lowcore && + addr < (void *)(&S390_lowcore + 1); +} + +static inline void *arch_kmsan_get_meta_or_null(void *addr, bool is_origin) +{ + if (is_lowcore_addr(addr)) { + /* + * Different lowcores accessed via S390_lowcore are described + * by the same struct page. Resolve the prefix manually in + * order to get a distinct struct page. + */ + addr += (void *)lowcore_ptr[raw_smp_processor_id()] - + (void *)&S390_lowcore; + if (KMSAN_WARN_ON(is_lowcore_addr(addr))) + return NULL; + return kmsan_get_metadata(addr, is_origin); + } + return NULL; +} + +static inline bool kmsan_virt_addr_valid(void *addr) +{ + bool ret; + + /* + * pfn_valid() relies on RCU, and may call into the scheduler on exiting + * the critical section. However, this would result in recursion with + * KMSAN. Therefore, disable preemption here, and re-enable preemption + * below while suppressing reschedules to avoid recursion. + * + * Note, this sacrifices occasionally breaking scheduling guarantees. + * Although, a kernel compiled with KMSAN has already given up on any + * performance guarantees due to being heavily instrumented. + */ + preempt_disable(); + ret = virt_addr_valid(addr); + preempt_enable_no_resched(); + + return ret; +} + +#endif /* !MODULE */ + +#endif /* _ASM_S390_KMSAN_H */ From patchwork Fri Jun 21 11:35:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707349 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 2F7B8C27C4F for ; Fri, 21 Jun 2024 11:38:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 065C18D0163; Fri, 21 Jun 2024 07:37:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E6ED38D0167; 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 BE0E78D0163; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 84B118D0167 for ; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 433541C2000 for ; Fri, 21 Jun 2024 11:37:48 +0000 (UTC) X-FDA: 82254696216.30.E670D8A Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf17.hostedemail.com (Postfix) with ESMTP id 110BD40018 for ; Fri, 21 Jun 2024 11:37:45 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=o+J+ZXvA; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf17.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969858; a=rsa-sha256; cv=none; b=VJ/JNrfN9pLt0ngHFzhHgf2sUWiC8urdR3gSqyNdQzV66gkDtZ0oLEwwJtW64w3bSJxK5F NQ9BtdnECzGR8DFK9xL1MnyJOaXvBGG3cDZlcWA7lftmBrn+CDPFYKgc+YIVKrLhu8r/wu qS/lQ0/pi6Iny5J8+xtToQQinWLIxDo= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=o+J+ZXvA; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf17.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718969858; 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=IRZnfl5kegw9DdaMeWWbTwWzCErv31wkZ0fJjvxbgdM=; b=CWRtrdkiKXl9i1oWaw1efay6gHMAPYuj/Nu6iWv7vEeMyU/PzNOoVDpQin6Bb1HYbMpLGt Acyna9KShFuONIF41a2bi/GC5P/6E1gIpoiEjM3E+0mYyducZBrRNAb/wukQYDCnF/xz9Z RC6Zw3oUDoXIgM9nK/lCAlwp4jDnicc= Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LBU15B002875; 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=IRZnfl5kegw9D daMeWWbTwWzCErv31wkZ0fJjvxbgdM=; b=o+J+ZXvAIVDd7GV89T07TJH6pEU9B LdGS1ISDj9LDglcNLkB+mPaxt/VGI1uuMmKZfOiRVKLCR8JJQxZexj7jPds6brRZ QeONte196+SvM/qpLVfy1y2PVhmYK9bkHjnwxgxessGQUnBlrTRkhHusJtsNHR2m YABDm7ZKNY93fZNURVRdHBwQmzMcBfjllDWTF9w9bqpO5xyJvdj1Q0LT9EJ053M3 YJSBPJLej24OgSfOBIBx0/2WfV0Ajdoq+GOEGF2QUTQAUXKWNNn66lS6eYk+dPku 4CgM8OYzkaQV5FyPOb8a2BP5lumwE1MI6bu+Mevy05UfAXAtDpXg7Bl0g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw8p2g0m2-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 m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbdav014439; Fri, 21 Jun 2024 11:37:39 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 3yw8p2g0kw-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 45L9Lx4I030885; Fri, 21 Jun 2024 11:37:38 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrssxvc8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:38 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbWGZ16908730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:34 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 61F722004E; Fri, 21 Jun 2024 11:37:32 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CBC0E2004F; Fri, 21 Jun 2024 11:37:31 +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:31 +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 38/38] kmsan: Enable on s390 Date: Fri, 21 Jun 2024 13:35:22 +0200 Message-ID: <20240621113706.315500-39-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: kJ0C__Db83mnTpY44STC6l__kqD4tnRR X-Proofpoint-ORIG-GUID: 8S2Itk7NRu5jxLYW6HoV5XhtvFWYkSW_ 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 mlxlogscore=764 spamscore=0 clxscore=1015 bulkscore=0 impostorscore=0 phishscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Rspamd-Queue-Id: 110BD40018 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: dbm9nw584mdg47roqpj95mr4ekbi19j7 X-HE-Tag: 1718969865-384070 X-HE-Meta: U2FsdGVkX1+yl6cS1YywLJYhz/ToSyU6l/DQFlx0HDH6g1GEGl4YOCClR2uA5rYfIgpmFitTmAF2gURCNR+CiZdiB9SKu9k4RxcoGHDW6r9wlh+5o+B/wEGTVH5jKKH+TCxvB0kWuu06qIrxC1M261dIjdudNEf1Akk+RJSROQ3Mh3Y/7KWBOgaGjV5BS5GCbnyacflv21X4bRQ24ZZnVaSxQ1/QryFyhmBaqCiKYR9ME8C2OktvSbrHDwP/lBGVp9NKY+GOykhwOfQ8NLMhFZ6AilTrDBrr0WZqmILzYMgUh2zXonbx9JfZ2iI/HYTcwQeUgoTzHxIRdZDWQICg/A4oM1BFU5Aar+1Ebsm+dXtZWH/YQS/AYl2fNDl3lYqG/rJjbyFBVyQ2xCEVeaUGelOPeojVXYG2JY47DLaMVHA5KTM8iEPx3aNB9lFnawpFcKWBBcE7vQiBxp3LBKovVT/M2qwXLm5Y8VKr8WBjueKzqfeyCxBfmIcvHPjI/fhAV0mY/T3oExxBjOQNqSSZ0HH24rR26glqBMIrajxY/ZzsP4edFOxDaJZdR7eqGxaWzO2yuYjLsVKdMq87OPHH3r1+tz+Dq34jognkIgeI/sYVl0LpH4VrHx2VOt+lJ9vPIoM1KKgI84F8D7O0cQCEn8As1QFdmyj/wWRwEd4lbfFN4d2qfNY/gcQEY+oUNErZrq6YKG558rJ87k/cFiOo1UtdQ7R5a4aaLNXPRMwYsoOsLHwmU5yNQ5+Rs70QrX2p/DClyY8F6wskdjlPVVnyyWUxYSBF8eGngV5UH/VPFKYxjA//IZdyTOcuQRQatLNC+BRTyHXn3LAHt/RGV0ABMz+0ms+N1ipsrnFNE7VtGAUd2mwiqFJRC+eCj5gziYyIZLntWwZ/h425eW+b9we01evj1U/Y/LepI52qoxGhDq6ZuuA03yX/cjT4T1udRjT4bhia8QBkBDRhjx9RU/l dnKQJdqH rRDie2jWNWQY+iSam8XpUTPAtG+JDk79Vlps67O6MtPYEtM+eo3WgqYTc66fHSsFu2RjdWGULnpmi84EY81EGJR+9ra/EiWt5GcIVq0keHuTsiU8BlScIzLhJ3spAxbyKSS2y85XBe4cBIpl1ZVgeQACfpeexJfMnxx5Ski75fhf6RjSHQjj48B9VDkvkub/C26hVhAs66hDnhhiM5oQYRh6220jYwynYAN6b04d4lYgPPhGGgQknWX03hTzDkQhmMGLXu6FX+BbPY0W/pnsz/Q7OlA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000097, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Now that everything else is in place, enable KMSAN in Kconfig. Acked-by: Heiko Carstens Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index c59d2b54df49..3cba4993d7c7 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -158,6 +158,7 @@ config S390 select HAVE_ARCH_KASAN select HAVE_ARCH_KASAN_VMALLOC select HAVE_ARCH_KCSAN + select HAVE_ARCH_KMSAN select HAVE_ARCH_KFENCE select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET select HAVE_ARCH_SECCOMP_FILTER