Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp845503iog; Mon, 13 Jun 2022 14:20:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tt4+26BhPmab/gONTs1EWawWM8FIfSHixGEezmm6jhcyOhkTLR/FItXoY1+YQaSd/RCD3d X-Received: by 2002:a05:6402:ca2:b0:433:4a31:d0ee with SMTP id cn2-20020a0564020ca200b004334a31d0eemr2020378edb.288.1655155204679; Mon, 13 Jun 2022 14:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655155204; cv=none; d=google.com; s=arc-20160816; b=rhGJ5f9on1dHhgcnyTMj7KdAcb+cDfVc8+NlUSgzpaYXV5SC3rQYmMfGnKrryGCMZ9 NHEAx2RkW723iBdMGpC2NAekr9edFYZlqQSE0LxsWuuoMp0JzTLi052L14/C2tqtRevi cRnH/0NBAF9lo1UKfb5EDaPmWZ8iJw9W3QFevWIdBA7iGgf0ivQ9WJYOPBm36SvK2seT VUgQOMffnZaecz1u/Rt12nAWxV2HQSSFc4thyFk/XURnoBQnUfCWlT+wcrr8ZKM1dF0y 7Y8Ndr4GSU/T7jYhWp4WmPemWsx1JulCMNNtKDeqsObH5yXXeDcbo9UzDLRBpC3t+/Rn MaAQ== 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=vo/QgRsJex180B/MZOFV4gS3W10znq++oNOGcslvwl0=; b=Ep/GX6Ry9NJvtrNu7Y5leBEgam6giRG4ofO6MsAL5CmoFPoyCmdfAG6mfkvJ0JWH6u wjAvSPxI4CdRSCRgaBZ5j2875VdtKGk8+cMx5rEOgAd+87TTkyFbZU/jZbdvGGAP/Qcu E0yVQPTIH1+hDZIgD6Vc0kBtjdhGQ+Kwyg/7qRJBWKeSJmw70Hot/14/lQKmiBacCVXu /nm0GL8d3V0IwYJ14IW6UrasacLBCyXvsEB0pqrXoCz2fVDdikZcQn63qeguRMJyb3At GDMKACR3gieupttGftKSyA8ea3LoA2EemSWH7a8ZtooZeILynj3FEi287Gq3l5W6TMg4 YUZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Dl9JaXiP; 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 gb20-20020a170907961400b006fef8601459si8792184ejc.823.2022.06.13.14.19.39; Mon, 13 Jun 2022 14:20:04 -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=Dl9JaXiP; 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 S1350517AbiFMU4A (ORCPT + 99 others); Mon, 13 Jun 2022 16:56:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351519AbiFMUxj (ORCPT ); Mon, 13 Jun 2022 16:53:39 -0400 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 694BD186E0 for ; Mon, 13 Jun 2022 13:17:40 -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=1655151457; 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=vo/QgRsJex180B/MZOFV4gS3W10znq++oNOGcslvwl0=; b=Dl9JaXiPgE3KB2W9PytyX2Ydb8CErjoRbyqdS1Z4vTV2EHG4vJto9UgmTzKVC+tzN4k6r4 KDwziMj6rUu7nd8whB1jFF7vvWI6sRETVADmv38Uoj7/ZNOexQsxpkRPRqeeSDyuwqGEvH BwEOie7GxwDdyuGfRMy3sQ8YZis7ANg= 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 17/32] kasan: only define metadata structs for Generic mode Date: Mon, 13 Jun 2022 22:14:08 +0200 Message-Id: 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 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 ab2cd3ff10f3..30ec9ebf52c3 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -192,14 +192,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 { @@ -218,12 +216,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