Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3569801rwb; Mon, 5 Sep 2022 14:21:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR7jhboJ9bphqZIjYxpF0xKNnIsowivc0w7bWBOULYgml4wgMGn2vqj+sUDBgzzd2jeSKD03 X-Received: by 2002:a17:902:d546:b0:176:985a:8087 with SMTP id z6-20020a170902d54600b00176985a8087mr10609411plf.79.1662412863320; Mon, 05 Sep 2022 14:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662412863; cv=none; d=google.com; s=arc-20160816; b=EF04WF90/zYuSLEJUnubP7PHULFWZMzyDuYlR6wQQHd6tOvxx2PZB/Z7s9Sqs2Q2xU i6EAOqUUn5j9qPUD3uLpq+QKbCPX9yYk6cqNZtngfYr+xOf00C4poDCMYdq5sdTvc2aY +mAaYXv7QhT9FhEUiYRQpcCdmyMMb4GKpK2pkRcuirJzTUyAXIeXpe1KJ9QvSgO+aHRs TjgM9VRNnngnt4+SR7FeGwOVzYWIVweUtPJ+uZokzb+u4BWG48s1s6Jr0wvkObt+BjWM AKmM7dBQxg4rtIBIkPU7SKOU/6Rd3MndYm5f2jjw2k4+oWF8YJG8TdFn8AJlvCHTwNes GxNw== 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=OY6e59NvKBhkMf/4HyAqWSEo1eLRPIhpqy/QZPuprxE=; b=V4MuzlEmxl4PD9mxWeYJ1pMmYB2sUmbcWtEnMvIOwW8GcbenQNmfKOCEEBW1kD45OY yMKRYjXFiwWryEm0p20e8Vp4tE4VIEwEa3maWLzEbTMi1QLtPdBEns0s9zJbj1XIK2Db 0ve5lcvZKr11hOLIfE+Prxio6QV7Od3xfrezPl6mgT7AKlRmJ98urpexOa0XwramsL+7 /rNSYD8S0XvIoO9Bbq/w5BWkOUctR2MPMfRH0B1LHwKQnaGMAf96589XgRkuAZaOqqqO xrwPuMWarYEDe3Ro6tzSdaQY4nvuL/ycof5qKpCIqgSQKnTehQnCNbDPnD6eCenLyey5 8EZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="TDgm7/mj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jc12-20020a17090325cc00b00176a84b760dsi4175970plb.258.2022.09.05.14.20.50; Mon, 05 Sep 2022 14:21:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="TDgm7/mj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232918AbiIEVHh (ORCPT + 99 others); Mon, 5 Sep 2022 17:07:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232772AbiIEVHC (ORCPT ); Mon, 5 Sep 2022 17:07:02 -0400 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 297EE65816 for ; Mon, 5 Sep 2022 14:07:01 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1662412019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OY6e59NvKBhkMf/4HyAqWSEo1eLRPIhpqy/QZPuprxE=; b=TDgm7/mj9ob4txlaIwLMVe3fKPhb66SDCk4DLReAJENl/TjCbUVtg/eaG3D5YJ7/zh6CNz ihjozcKLMPExKMlkzUGrgce2PjWoLPL2ij3JyR4Yez6oYXBIuxIXwL/9AeyInlxBY5h0KK pY9xNi6B7Ph6B3nJYpru4vMdsJkOmrA= From: andrey.konovalov@linux.dev To: Andrew Morton Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Peter Collingbourne , Evgenii Stepanov , Florian Mayer , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH mm v3 09/34] kasan: clear metadata functions for tag-based modes Date: Mon, 5 Sep 2022 23:05:24 +0200 Message-Id: <470fbe5d15e8015092e76e395de354be18ccceab.1662411799.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Konovalov Remove implementations of the metadata-related functions for the tag-based modes. The following patches in the series will provide alternative implementations. As of this patch, the tag-based modes no longer collect alloc and free stack traces. This functionality will be restored later in the series. Reviewed-by: Marco Elver Signed-off-by: Andrey Konovalov --- mm/kasan/tags.c | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/mm/kasan/tags.c b/mm/kasan/tags.c index 2e200969a4b8..f11c89505c77 100644 --- a/mm/kasan/tags.c +++ b/mm/kasan/tags.c @@ -19,54 +19,25 @@ void kasan_init_object_meta(struct kmem_cache *cache, const void *object) { - struct kasan_alloc_meta *alloc_meta; - - alloc_meta = kasan_get_alloc_meta(cache, object); - if (alloc_meta) - __memset(alloc_meta, 0, sizeof(*alloc_meta)); } void kasan_save_alloc_info(struct kmem_cache *cache, void *object, gfp_t flags) { - struct kasan_alloc_meta *alloc_meta; - - alloc_meta = kasan_get_alloc_meta(cache, object); - if (alloc_meta) - kasan_set_track(&alloc_meta->alloc_track, flags); } void kasan_save_free_info(struct kmem_cache *cache, void *object, u8 tag) { - struct kasan_alloc_meta *alloc_meta; - - alloc_meta = kasan_get_alloc_meta(cache, object); - if (!alloc_meta) - return; - - kasan_set_track(&alloc_meta->free_track, GFP_NOWAIT); } struct kasan_track *kasan_get_alloc_track(struct kmem_cache *cache, void *object) { - struct kasan_alloc_meta *alloc_meta; - - alloc_meta = kasan_get_alloc_meta(cache, object); - if (!alloc_meta) - return NULL; - - return &alloc_meta->alloc_track; + return NULL; } struct kasan_track *kasan_get_free_track(struct kmem_cache *cache, void *object, u8 tag) { - struct kasan_alloc_meta *alloc_meta; - - alloc_meta = kasan_get_alloc_meta(cache, object); - if (!alloc_meta) - return NULL; - - return &alloc_meta->free_track; + return NULL; } -- 2.25.1