Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp698809rdf; Tue, 21 Nov 2023 14:04:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBeLV6ot5N8hP5jbWiwIBkTvIsRBHqTDn5B3BG4c0a/A0AsbuZku2tp7hJ9NUdTRYnr9jp X-Received: by 2002:a05:6a00:8e01:b0:6bd:7cbd:15a2 with SMTP id io1-20020a056a008e0100b006bd7cbd15a2mr576133pfb.26.1700604253298; Tue, 21 Nov 2023 14:04:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700604253; cv=none; d=google.com; s=arc-20160816; b=WUXZkfMlldy6Z4p/ZpX39rwBayQICOH0pRzHSrCb3trb7vtsfibkHsaAUqVo1x67gE 3OKtq3hHEgF8fygtIvM9rYIMaf4VM1MM09ZzvrUEsnOC+1g1GoBEEmnGdntN31Pc6T6D aKTTwKF0QrpELh7FDy5hxDlA7drbk8Ks6tcWUOamUVhAaTEERkQKG08hhyS5HWVMIe6w mT4OKGnJmSjQ7EuKibKs0r81QttsPeJpyX8F7D/XEt10bdzYW2++RBkN64BFG9zxleBI FQvyegTtGitcgp5HcCztMfFPtrzDIb4WwbmTVtVaLUTYprsYN3Qx/V//52laL/EWIuKC dhcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ll1jVWIn1WYeqe7oeR3JXJSFtnz9SYnx4hK39Q+YxwE=; fh=TQATEbdDZNcnk8L2eDP6eFL9HlexFaHIexhR1TH2IlY=; b=Eon18W+aVkrZXHfVen4MRJqGDCbnCKcw/6d6zZIG3Cqt1x3f/CdKACjUSV94fPCZ6r lLQVOB1Eb7Wyd22bJ9VsBp23Ye5iahnB737oxLHSxPKDJiq3K5RwOx6/3NFosPh3Mjjg BP7bDxpEHPGQII9Dthlr6j2KefHCdBdV1/C2vP8JFbHtYmp+SPB9mxwY58V53Ulaxa27 t1q+OTi7m2riO2VGx59a1luDWW+6PKrsdbaywE0TEeCWX/7HHtctj3K0xtRii1dDrvqw k9Q5FXjC91TZDTr4eDSWRyyMNnAEypIrlLwdntpp5QFRI73nVlIEyxqTmJcEztaroLT/ E9tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=E0uJNgWO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id y18-20020a056a00191200b0068beee4922csi11475125pfi.23.2023.11.21.14.04.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 14:04:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=E0uJNgWO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 330EB802AA03; Tue, 21 Nov 2023 14:04:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234579AbjKUWDa (ORCPT + 99 others); Tue, 21 Nov 2023 17:03:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbjKUWDP (ORCPT ); Tue, 21 Nov 2023 17:03:15 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4288B10FD; Tue, 21 Nov 2023 14:03:02 -0800 (PST) Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ALLlNiq020065; Tue, 21 Nov 2023 22:02: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=ll1jVWIn1WYeqe7oeR3JXJSFtnz9SYnx4hK39Q+YxwE=; b=E0uJNgWOSXQIqo86SlEdFe4HBO5qzUFPA0Wgq851WLA03vPxPYLpbPyQTwWe/7RrOKHG wLR+5iip0zovT+j+YxXN+3K3BmQ06jK5cGjSHsLdL/oBf0yMr5rtU/pd5MH0eb8EAImV PZADGYt7m5mEqqgIPTE4Hl/vrXWH4agqCkztnQ2mo9BjqGzuTkkVlWLqoK6a/StjHckd ZzlrzTKzNUaDU1COAHwxPdoSdQXEYpQ8b6rmg6S9DRoC/CdIOP0vCig/9BdLglsAv+B0 zNWhJePUOoFjFR605i/SAzEXvYfUuVsY59hfPXLaX8nx45bjYfX8OLW9D3hiuHzjnfeJ HA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uh4s68bs8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Nov 2023 22:02:39 +0000 Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3ALLo524026845; Tue, 21 Nov 2023 22:02:38 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 3uh4s68br7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Nov 2023 22:02:38 +0000 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 3ALLnYv6010672; Tue, 21 Nov 2023 22:02:36 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uf93kujr7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Nov 2023 22:02:36 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3ALM2Xf814877208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Nov 2023 22:02:33 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71D6720067; Tue, 21 Nov 2023 22:02:33 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A6F220063; Tue, 21 Nov 2023 22:02:32 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.179.23.98]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 21 Nov 2023 22:02: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 v2 16/33] mm: slub: Let KMSAN access metadata Date: Tue, 21 Nov 2023 23:01:10 +0100 Message-ID: <20231121220155.1217090-17-iii@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231121220155.1217090-1-iii@linux.ibm.com> References: <20231121220155.1217090-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Kr3chWIa4VLpaiM7it2xt72zkEIATI76 X-Proofpoint-GUID: o0Elbdg3uNB8jhs-NEltJ60ebAxZlMmP 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-21_12,2023-11-21_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 spamscore=0 impostorscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311210172 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 21 Nov 2023 14:04:06 -0800 (PST) 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. 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 169e5f645ea8..6e61c27951a4 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -700,10 +700,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(); } -- 2.41.0