Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3932625imw; Mon, 18 Jul 2022 17:47:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uvK/Qhuqegz49Bs7Fwo9RE88ScZ294svA7KKF7EEwj/WJkNYYUMYTVAeM15KJLpRiUGoyK X-Received: by 2002:a17:907:761c:b0:6d6:e553:7bd1 with SMTP id jx28-20020a170907761c00b006d6e5537bd1mr28631704ejc.5.1658191655333; Mon, 18 Jul 2022 17:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658191655; cv=none; d=google.com; s=arc-20160816; b=GqnHyBmWEjhc8ie6uSLkF1jFfoIkgWq+mKmeIKPrxiBr6MVUsLuT3EQLWN2vfMJZ8N Q45iGeNWO+EUh+DJa9H/6SvCclEsfIZgTzaFyCSI2vKF41UExXq9vK2p4nOZAmltK/z3 dJHvSDYpjj8aKnS4wkmL2vH1y62b9cobdQ+Iu2XDUeRSojd7nkVO9QOXnm8+twUurG8+ /14Q4LYdmkXBLIUuWoQ7IywLvfz3TCdOm5zN02ggrMCOL5vgXUoY+WgdfHhP5QxfObZw XVSD5iUiAUFrSQSYtShZ18QxE1YCxe8v4tOVRVX04oaytGsnzfO2a8fYD69ze4HFv2aJ nKSw== 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=4Ug+nRhk4S0scNxkqaQhWMyfD8pnsHKB57f6laJzIdM=; b=Qkye+QvI5CKspJu+Yzi+Bu/kaWVGVdapOWhheOkaNxj+RwvpNUrod+N0sjaS90HVKL VXLzr4/2zBwbyQcZYDmayrCh6KPCJX1mxQpZSnfLneGCDFGFmVCku5KP2wBoy9xgCOLM yf9oO/yGXzYqsxB6yL1Ht/XbaNwyEIeKQxknYZvmcMxm6JOh+DFTvVFycZxe5uFBq/ed pF/J+3mEmNF7iTwKA64Z3t2ZRT+TtVueV/u/mkGB1flf72hkmAf2hOb8Zcdt3LeabwMy xnAtqZD0SbwFJhCVZ10V26h3KAQbG47mxkCgJNrnqxsZ0ajxVpK9PRag/oMTxwanoBKJ QnNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=LQyieyg1; 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 go33-20020a1709070da100b0072eece129bdsi19895458ejc.59.2022.07.18.17.47.11; Mon, 18 Jul 2022 17:47:35 -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=LQyieyg1; 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 S236593AbiGSAMq (ORCPT + 99 others); Mon, 18 Jul 2022 20:12:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236544AbiGSAMf (ORCPT ); Mon, 18 Jul 2022 20:12:35 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D914F33E16 for ; Mon, 18 Jul 2022 17:12:34 -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=1658189553; 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=4Ug+nRhk4S0scNxkqaQhWMyfD8pnsHKB57f6laJzIdM=; b=LQyieyg1ICB2hXD7nyoI+Yg4EYt5bi3rUmzt2PuEluJOu99p4MYMwPczZhfwWen5F70+l+ VLshZJN+OWEMvyYiENeKha1OPzIPTx7mC4urQUrlxY2aDPgoV5BlqiQOItNkoI9TaL7NkO R90LaEavqGGJ00VEHl5fWxChGEvumwo= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Peter Collingbourne , Evgenii Stepanov , Florian Mayer , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH mm v2 17/33] kasan: only define metadata structs for Generic mode Date: Tue, 19 Jul 2022 02:09:57 +0200 Message-Id: <93569dbf8c3615ae49e62e7be1607b6fea406ae9.1658189199.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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS 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 Hide the definitions of kasan_alloc_meta and kasan_free_meta under an ifdef CONFIG_KASAN_GENERIC check, as these structures are now only used when the Generic mode is enabled. Signed-off-by: Andrey Konovalov --- mm/kasan/kasan.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index 6da35370ba37..cae60e4d8842 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -193,14 +193,12 @@ struct kasan_track { depot_stack_handle_t stack; }; +#ifdef CONFIG_KASAN_GENERIC + struct kasan_alloc_meta { struct kasan_track alloc_track; - /* Generic mode stores free track in kasan_free_meta. */ -#ifdef CONFIG_KASAN_GENERIC + /* Free track is stored in kasan_free_meta. */ depot_stack_handle_t aux_stack[2]; -#else - struct kasan_track free_track; -#endif }; struct qlist_node { @@ -219,12 +217,12 @@ struct qlist_node { * After that, slab allocator stores the freelist pointer in the object. */ struct kasan_free_meta { -#ifdef CONFIG_KASAN_GENERIC struct qlist_node quarantine_link; struct kasan_track free_track; -#endif }; +#endif /* CONFIG_KASAN_GENERIC */ + #if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) /* Used in KUnit-compatible KASAN tests. */ struct kunit_kasan_status { -- 2.25.1