Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp388293rdb; Thu, 30 Nov 2023 07:26:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IElhaXqYHREOzE24kxiiNtetywxcP/59hgXFenIv9gvwe65AGObJNXji+tc7K0zBZeJQunf X-Received: by 2002:a17:902:c40d:b0:1cf:59ad:9637 with SMTP id k13-20020a170902c40d00b001cf59ad9637mr38736613plk.22.1701357994893; Thu, 30 Nov 2023 07:26:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701357994; cv=none; d=google.com; s=arc-20160816; b=u/5Eie0mD5DIVBFupzfq0OHup8xLjDeCxEX8cEIcCWb57m7IKsA4FiKI98sX7+Ehoh j3vN4vwOFeZTp+A1zmfaSnPT/k1k/CAfUbAxbS6f1M4ZFsGA/5x9Gaddx3NfM1lRHc7o C7O3GsDG1Zm8riDdTUG7GBMazGKgsxoPrG2GKrYGOq129uaMQyJ3MY0jri1yRG6Q2jqn kJlhy9+z2CQpJoBwizo63+yRZIirrK93pyAojx10K0audpCvJASfsOeExsJVNDL7rBUx z5jN7xwuy+i4fopcTpZy5g0aAwpgp+WINewW0S87F9i5kNXw2xtx6ljCRlZRq3khU0Vg YwAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=mxIiLrFJ3h2AITHNfurmssPmbrlUNKlJzFiV3X9eiys=; fh=gtwm6qN9lskLrXqGcgQSmKN+lN7yfNQhDGa14RKei7M=; b=BZu0fWBuPjGMzpOlcNg6mLJEQ7kPrFGLshUWbmO/1ManODsidTSli68Am1/3D4HMeJ l63eaYjkqVBTasmPDyGIzkFnkLU0WYowgih0YMgQfGsRLB5V9jqsiKH4BFWrBtCpxU/u yut6NjRzPxWCyDMpDhLBjhwUAYfFvYEsbKviqDQqybQXwL1vOrOEPgVbKUmQxh9FKsja hhx9jd8A4soK7FL63XsgUIgrCqoXt4YZYVmEQPF7+xCG7FxdxyQMgJNrK4Zp2j8RYTr1 swIdUmQG/9jA5BHkBwNVfztzuGuz0s27xrSmfvihsRvnq7HLVgiYRSU9hxvs3Dd9RxWe 3uxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id v5-20020a170902b7c500b001cc47d6f4absi1389325plz.107.2023.11.30.07.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 07:26:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5AE5B827D0EA; Thu, 30 Nov 2023 07:26:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232062AbjK3P0S (ORCPT + 99 others); Thu, 30 Nov 2023 10:26:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbjK3P0R (ORCPT ); Thu, 30 Nov 2023 10:26:17 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBBD810E5; Thu, 30 Nov 2023 07:26:18 -0800 (PST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2F54721B21; Thu, 30 Nov 2023 15:26:15 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id F24E713AB1; Thu, 30 Nov 2023 15:26:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id cXTBOpapaGXbYQAAD6G6ig (envelope-from ); Thu, 30 Nov 2023 15:26:14 +0000 Message-ID: <414847ea-b7e7-aa05-5e2d-de50788d9b4d@suse.cz> Date: Thu, 30 Nov 2023 16:26:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v2 16/33] mm: slub: Let KMSAN access metadata Content-Language: en-US To: Ilya Leoshkevich , Alexander Gordeev , Alexander Potapenko , Andrew Morton , Christoph Lameter , David Rientjes , Heiko Carstens , Joonsoo Kim , Marco Elver , Masami Hiramatsu , Pekka Enberg , Steven Rostedt , Vasily Gorbik 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 References: <20231121220155.1217090-1-iii@linux.ibm.com> <20231121220155.1217090-17-iii@linux.ibm.com> From: Vlastimil Babka In-Reply-To: <20231121220155.1217090-17-iii@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spamd-Bar: ++++++++++++ X-Spam-Score: 12.69 X-Rspamd-Server: rspamd1 Authentication-Results: smtp-out1.suse.de; dkim=none; spf=softfail (smtp-out1.suse.de: 2a07:de40:b281:104:10:150:64:97 is neither permitted nor denied by domain of vbabka@suse.cz) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspamd-Queue-Id: 2F54721B21 X-Spamd-Result: default: False [12.69 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; R_SPF_SOFTFAIL(4.60)[~all]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(2.20)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; BAYES_HAM(-0.00)[20.85%]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(1.20)[suse.cz]; NEURAL_SPAM_LONG(3.50)[1.000]; RCPT_COUNT_TWELVE(0.00)[24]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FREEMAIL_CC(0.00)[linux.ibm.com,google.com,gmail.com,googlegroups.com,vger.kernel.org,kvack.org,arm.com,linux.dev]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Status: No, score=-2.9 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 30 Nov 2023 07:26:32 -0800 (PST) On 11/21/23 23:01, Ilya Leoshkevich wrote: > 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 Acked-by: Vlastimil Babka > --- > 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(); > } >