Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp345321iog; Fri, 17 Jun 2022 04:47:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vPTJcTjkjOCJBKVsvWzlTfwcpgAO8zGy57JgzKQB9BwXV9dOO1Z1Fll8aGjk5n3I7xbwq6 X-Received: by 2002:a05:6a00:1744:b0:51b:d4d5:f34 with SMTP id j4-20020a056a00174400b0051bd4d50f34mr9755254pfc.0.1655466457331; Fri, 17 Jun 2022 04:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655466457; cv=none; d=google.com; s=arc-20160816; b=eJ43TyNeMXBiCHoLEJc0Nvg67mfp6DqjIZQaRV4lfAJjEQ6s8KW3R9DCHIyosFz/vJ YxJvL9PedqA6blabD+x1evZy88XW8GqZHNzu4bTlbBEN/kw5TO8BIAxYnf2MzieBe83n UeiYVOi0eY1jkV2CxSexwk0pEHVYtygQbSIyftCGmox/74cw76n9PVVIqFXCIeNiNB94 gqU05XKz8i58D8ERtLpNOJiK9USLPAOsA0jJWMF0V6n5o8TjG/qsfWjuTWOJM9tl7jgw 2uNKM8BGq1eBEWR7lJeoMM41jA6ChTObXtDteYlGSXy9rCRkPBjBhLjr/OWbw8ZOjEJe Kl4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=x5bwvKPWoiAdNfsl0rpPiOJbLUCKa6eFsFkR7Dl/GBw=; b=G36Vv6D0ja55P7Xs4sNUNDUMPmSD074O86b/vp8BSSfQ4/suLHkHblXN+9djKJUrhX 8Ai3wZSS62DLzKPSj6j2X8IHxuizLLCASJS6hJfqR2izawMtXmakeHk3AL+RtKx5cYvS rRY1KQkPtSHz7pAko3FupFrrMCM2EIFit/JIav79xjWfkK1b3ueyoNkyBRkVTZbeZamW iC/NQ/CeM4qrHetxEmcpYDyAew/fXL6a+CoONGwkUo0gJef7kv7C+i6Ik7vZGPWkc4mm OsmxT8YhIPGBLpci0uUPb3zWUR7mrJxINz3+ZfFEITuR6Q7d5u8h3TLramtIcJ4o2UzD sIUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=PENmBcxu; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 19-20020a170902e9d300b00163655cc8e9si5832709plk.203.2022.06.17.04.47.22; Fri, 17 Jun 2022 04:47:37 -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=@google.com header.s=20210112 header.b=PENmBcxu; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381770AbiFQLfe (ORCPT + 99 others); Fri, 17 Jun 2022 07:35:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380246AbiFQLfb (ORCPT ); Fri, 17 Jun 2022 07:35:31 -0400 Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com [IPv6:2607:f8b0:4864:20::1129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55BA3522CA for ; Fri, 17 Jun 2022 04:35:26 -0700 (PDT) Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-3177e60d980so17946687b3.12 for ; Fri, 17 Jun 2022 04:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x5bwvKPWoiAdNfsl0rpPiOJbLUCKa6eFsFkR7Dl/GBw=; b=PENmBcxuKfoFRDHda84GkCq+WJODrnGWd1BRRAYSLp6UWmG1E5r4fVQr3JlCQYWR2z Qergd8Q6YnMXN+pMYTsBxlrOigKyDtcdwAkd6Fu22A9ts3hO0XNAJA6xPzya4pYHDrUP 2j04UJ1lxfaS/nfX9aIIcWdVfQqb+t5HJ9a0tRlgtD7WGdewEjwEB/mxpuAP5Cz5Euh7 KwJ25dhBw8FvfWESdwfhtqZWRSvXLdaCek5fo8yrPOBi+uuAD+JUiTov9IONiWiwMl5j sBZgKiR/22QfjoIbF0VcBhHwo21dUvctTQ9K/3xAPyBfKfNXqf0FMg2lK4whTouF4FEB qBHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x5bwvKPWoiAdNfsl0rpPiOJbLUCKa6eFsFkR7Dl/GBw=; b=Tlg3U/iozPTXrlEHIuAyzRcVVmZ/oAkWMzFMhBrars5jH/PVKZn2p+PZj6XmURZmWx P0pFJEOaf6+8u08QR1o69glRHk35zNrsMxf8S+EB99N1RDLlUMf8mxLthhs5eg97G/98 hfyN0lZ5E+Ee0I61i9XX3D+hb7FVrPcY2FfEase9AJddHwDgHtW/DJ13yjKx2g+R4aXi EnnHbkDv76dgJWK1EvgBYaI5vBDN0Y77+ltjopmjmj1raKwJJrtIi0zGTPwN7kRlFY3r ubOE7X2E0abwc4y4t9LHiBkVD+/48IAm8eJNEmnpIDuMh2q79heCqVDudky3TD95MBUK O6vQ== X-Gm-Message-State: AJIora9ZUnRh+qjrpbgdaG+8LSRhOO2mKbjOlOJwNUhbmHR2TaAtgtsz xSmwHuVn6ufV+JWuVsb4kRd0Ajub1u34WwwI+pDRkA== X-Received: by 2002:a81:18c1:0:b0:317:648e:eec8 with SMTP id 184-20020a8118c1000000b00317648eeec8mr10552299ywy.327.1655465725193; Fri, 17 Jun 2022 04:35:25 -0700 (PDT) MIME-Version: 1.0 References: <11a7bfb5ed5de141b50db8c08e9c6ad37ef3febc.1655150842.git.andreyknvl@google.com> In-Reply-To: <11a7bfb5ed5de141b50db8c08e9c6ad37ef3febc.1655150842.git.andreyknvl@google.com> From: Marco Elver Date: Fri, 17 Jun 2022 13:34:49 +0200 Message-ID: Subject: Re: [PATCH 06/32] kasan: introduce kasan_print_aux_stacks To: andrey.konovalov@linux.dev Cc: Alexander Potapenko , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 On Mon, 13 Jun 2022 at 22:16, wrote: > > From: Andrey Konovalov > > Add a kasan_print_aux_stacks() helper that prints the auxiliary stack > traces for the Generic mode. > > This change hides references to alloc_meta from the common reporting code. > This is desired as only the Generic mode will be using per-object metadata > after this series. > > Signed-off-by: Andrey Konovalov > --- > mm/kasan/kasan.h | 6 ++++++ > mm/kasan/report.c | 15 +-------------- > mm/kasan/report_generic.c | 20 ++++++++++++++++++++ > 3 files changed, 27 insertions(+), 14 deletions(-) > > diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h > index aa6b43936f8d..bcea5ed15631 100644 > --- a/mm/kasan/kasan.h > +++ b/mm/kasan/kasan.h > @@ -265,6 +265,12 @@ void kasan_print_address_stack_frame(const void *addr); > static inline void kasan_print_address_stack_frame(const void *addr) { } > #endif > > +#ifdef CONFIG_KASAN_GENERIC > +void kasan_print_aux_stacks(struct kmem_cache *cache, const void *object); > +#else > +static inline void kasan_print_aux_stacks(struct kmem_cache *cache, const void *object) { } > +#endif Why not put this into one of the existing "#ifdef CONFIG_KASAN_GENERIC" blocks? There are several; probably the one 10 lines down might be ok?