From patchwork Mon Sep 5 21:05:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 12966548 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 3A771ECAAD5 for ; Mon, 5 Sep 2022 21:07:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A253E80210; Mon, 5 Sep 2022 17:07:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D4B58020F; Mon, 5 Sep 2022 17:07:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 874FA80210; Mon, 5 Sep 2022 17:07:01 -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 6D8DA8020F for ; Mon, 5 Sep 2022 17:07:01 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 382761606AF for ; Mon, 5 Sep 2022 21:07:01 +0000 (UTC) X-FDA: 79879266642.29.8CE6E1A Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf20.hostedemail.com (Postfix) with ESMTP id B960B1C007D for ; Mon, 5 Sep 2022 21:07:00 +0000 (UTC) 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 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662412020; 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=OY6e59NvKBhkMf/4HyAqWSEo1eLRPIhpqy/QZPuprxE=; b=R1SWtA/KOfKYC5FI/1V0qqmRN6VuJL/fFjSXo9TEFc7ZJ0WWHRBEISjE7Kq1IlH9SK9e5b LBS9LKam9MGjiNYpeUmgrv3fRfW7oB8bveTqP0paA1fr4MQJFkVLZxdQS36WpKuhq9pEiL Q7OeYFAgtqGpPkb/AjCcBlOs64w31Tc= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="TDgm7/mj"; spf=pass (imf20.hostedemail.com: domain of andrey.konovalov@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662412020; a=rsa-sha256; cv=none; b=OrpqLrN7Jw/97i2v675xYgudixh0qZxYQ9ClI8dk5R1h9IPJnbByGsDK+gynfsaJL7bYgS 1HnhLBLQrHjN0Xka8tV0ld6O6WT/PO1PoH+VFvnUq7n1YAZdaw/6X/r80SAXDKciuSA2ce lqqxToXcK9rRQeWhwvuc2VS+hhSpuF4= X-Stat-Signature: m3ftzek4fi8awm59xzesk5c4f84gopy3 X-Rspamd-Queue-Id: B960B1C007D Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="TDgm7/mj"; spf=pass (imf20.hostedemail.com: domain of andrey.konovalov@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1662412020-163783 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: 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; }