Message ID | 20231115203401.2495875-17-iii@linux.ibm.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 3C9F4C072A2 for <linux-mm@archiver.kernel.org>; Wed, 15 Nov 2023 20:34:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84DBB80034; Wed, 15 Nov 2023 15:34:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D64980032; Wed, 15 Nov 2023 15:34:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6021880034; Wed, 15 Nov 2023 15:34:49 -0500 (EST) 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 4752E80032 for <linux-mm@kvack.org>; Wed, 15 Nov 2023 15:34:49 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 16EAB8055B for <linux-mm@kvack.org>; Wed, 15 Nov 2023 20:34:49 +0000 (UTC) X-FDA: 81461342298.29.23F0D66 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf20.hostedemail.com (Postfix) with ESMTP id DAE0A1C0005 for <linux-mm@kvack.org>; Wed, 15 Nov 2023 20:34:46 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=emT9maAc; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf20.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=1700080487; 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=CK3CSFhKHiUxb3M2GZk8QRFPFYlA6+i6yOOL0Bh28Bg=; b=GT0Lr2WknJLL852y/QEK1AlhhHpSIJtUxcZW5/3gxD4Xwt82FDZ290haIEosLRXGz9Yklf CBiWlt+u1CkQi5xDS/JeLHQafR3cfaWjvINy6gp+mnDBfSdpsc3Cun/Ar9XRykcsiPZgYr R3rHEnLArRoLodHGHQPqF2IFe3ekjoU= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=emT9maAc; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf20.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=1700080487; a=rsa-sha256; cv=none; b=pDdr++srOWM/5tKclKO3vWrY10fhyHHXVviEMfyGIkAP9eRpXQchsAd/DsQs8kYi6/n/bc Qnea0zAtAsyXUB7ExUlTXBpzV9PirGp0ffvwyk8LyVQom6zJpC4PhfW7jwXzAMt1CkOTy3 4TQn/gM//qKKtEuAI2MSTE1eQZ07kDE= Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AFKSANo032237; Wed, 15 Nov 2023 20:34:40 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=CK3CSFhKHiUxb3M2GZk8QRFPFYlA6+i6yOOL0Bh28Bg=; b=emT9maAcJzRM0G1DzNyB9iM8ZDVH2esBnEg/GihJ7LhUH2LLr25n4T16fwdyJps5Swbk wi4ydQ4vQY1dt3LHU3iEbPpDRQlK2WN3UgmbbuFpWQqA+NdbB1X1DTRjZDb79cxWxs14 l92PTve6gZdcBi+zTfFpznNCncAP5bY1O8MJRp6g0ZKo+7YKzVTEB37DAfMRevUc1q+d +eknBIA7PwtuOwMk5F3TMX2Uxm634QiwPtiNOYXcOzTFrM4zQMZuFhT8+4ha9MGLnPSb 339/RbJXkgFBm6wWvggkH1xF3nzhdx7IKq75wA+RnlnWIvdnE3fRnpaZkzLi2MevaFfd tw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ud4v38cv2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 20:34:40 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AFKG6nw003579; Wed, 15 Nov 2023 20:34:40 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 3ud4v38cur-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 20:34:39 +0000 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 3AFKJ1FS017525; Wed, 15 Nov 2023 20:34:39 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uamayj7ap-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 20:34:39 +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 3AFKYaAX24576754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Nov 2023 20:34:36 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 00EC32004E; Wed, 15 Nov 2023 20:34:36 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AB2F120040; Wed, 15 Nov 2023 20:34:34 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.179.9.51]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 Nov 2023 20:34:34 +0000 (GMT) From: Ilya Leoshkevich <iii@linux.ibm.com> To: Alexander Gordeev <agordeev@linux.ibm.com>, Alexander Potapenko <glider@google.com>, Andrew Morton <akpm@linux-foundation.org>, Christoph Lameter <cl@linux.com>, David Rientjes <rientjes@google.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, Marco Elver <elver@google.com>, Masami Hiramatsu <mhiramat@kernel.org>, Pekka Enberg <penberg@kernel.org>, Steven Rostedt <rostedt@goodmis.org>, Vasily Gorbik <gor@linux.ibm.com>, Vlastimil Babka <vbabka@suse.cz> Cc: Christian Borntraeger <borntraeger@linux.ibm.com>, Dmitry Vyukov <dvyukov@google.com>, 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 <mark.rutland@arm.com>, Roman Gushchin <roman.gushchin@linux.dev>, Sven Schnelle <svens@linux.ibm.com>, Ilya Leoshkevich <iii@linux.ibm.com> Subject: [PATCH 16/32] mm: kfence: Disable KMSAN when checking the canary Date: Wed, 15 Nov 2023 21:30:48 +0100 Message-ID: <20231115203401.2495875-17-iii@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231115203401.2495875-1-iii@linux.ibm.com> References: <20231115203401.2495875-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: A7EFZ5gScxsCuOEPrsIMx7XtWnrv7KuJ X-Proofpoint-ORIG-GUID: bCKwaI7qewBSCpfDoKVTIbT55i3gylk2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-15_20,2023-11-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxscore=0 suspectscore=0 impostorscore=0 malwarescore=0 adultscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311150163 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: DAE0A1C0005 X-Stat-Signature: u6bihcowgftyxtekakx9njwn8spijmxp X-HE-Tag: 1700080486-360409 X-HE-Meta: U2FsdGVkX1+OAaVPR/wW04pcR2xC10A2YfO/IiC6mO2pa3n5OYLwU2/Fr8lGIjg09io2xYiJy39s8BT6RWyySsvv+6GVRIR+vFJhwY/ATKF4hxQiVHrP2ILLSlxKgSnYTLRck9TcVHKeFi183nLdopRHftMEbVZaMPB7mtor43g2Bf6xlAJE/CY2R/aMh9ZyjydKNYrfV9m1Tc/mplhKfOJoM1i9RdzZ/x65Mfq+Oz1A/eG69wihLloPVCwDsPfd2pJLfo3tJucqTKe54xvGuKOjEpiMp8wkP2f5Aku55xEe4vA+csO8i0u62JzM0BgnvzHhdmKBB3B0KOTGt+qgjqoyc0D5sYmkQn5OHYGbMWzPRdY/n9H8whMQZ+/jfBl4aluA6+pp6Y+nLCUT/eAeTwFotBlmljWF6wOeb3tGrhPtoj7Jjjv8wIG9rJPBoQL3T7ppA1DO52CLXAKMVOD5su9QEZQvZYNl5ToAuBSDkGvswU7oVJnhTVSac8pzwloBixCo+QkTajA6khMKdAutmM+Hk7Ikz1lpJTsBTXoLKyYSAa7WI2SdRl86Jx7wm41hYZT1qg/SBKu+E6pOf+Dsrq4+vCtqnqyrFWJUxeAXv7zMR0+CHx1UtgIykg4RHmHZKFDtHMjOh7LgergixTFFU/ihqipQYZT52bRnU320T3lBQKlFSKcMLtJoD03nMxNvnAGAf4UH80X1cBiAiwqrngeEEcexvuYsOg/Xr5ianZ3ORXTpPiiKQrgZfHIBlZQWolQLpceqgi6jBpR0Jzn4Yu/81tv042hwHih2b/LEiJERqmCVGddAeQsRnt95PdfwYRtKbtC3uIjkicEi9iQTHoH+cSVseXUJbYTv6m2x7flHF1gAIag1I6WkqoFJbD9bSFlFzdQxXRo9uuTaMHpdvJv7iXoNoZmigRsBlZSVQLYqCYnBGBiK/wRziceWj7bEYBpx0ECxxasRTL2l2mD toBDVtwS J5dc7balooWDs8bzSAzusUXfeaE+zksDwOZu1N6dtOixYvI4GB2bnz6Ozls6KfcW1V+1RkI6MUXusikK1431NZWrBIuYakAuO4/RUIdALDAjXOO9GMqpq/ONf2hMzDRm21gjED3zLK+5DF6wOPWlsEjgsvFTWO0MK5uWzgvr/EhzrTEDvI3u9Bd/YtP9ySyzolmTGhWijmp4KE2MPDc+1NZic1Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
kmsan: Enable on s390
|
expand
|
diff --git a/mm/kfence/core.c b/mm/kfence/core.c index 3872528d0963..a2ea8e5a1ad9 100644 --- a/mm/kfence/core.c +++ b/mm/kfence/core.c @@ -306,7 +306,7 @@ metadata_update_state(struct kfence_metadata *meta, enum kfence_object_state nex } /* Check canary byte at @addr. */ -static inline bool check_canary_byte(u8 *addr) +__no_kmsan_checks static inline bool check_canary_byte(u8 *addr) { struct kfence_metadata *meta; unsigned long flags; @@ -341,7 +341,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) +__no_kmsan_checks static inline void +check_canary(const struct kfence_metadata *meta) { const unsigned long pageaddr = ALIGN_DOWN(meta->addr, PAGE_SIZE); unsigned long addr = pageaddr;
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. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> --- mm/kfence/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)