Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3475394pxp; Tue, 8 Mar 2022 15:25:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkmkSQNjIl8/wvHbozbt21u9Y8AUzAfOCfhqm7E4OJi7i79yvdtp21wyPBJMGRaSBhFb2U X-Received: by 2002:aa7:805a:0:b0:4f6:f223:a459 with SMTP id y26-20020aa7805a000000b004f6f223a459mr15065527pfm.4.1646781913190; Tue, 08 Mar 2022 15:25:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646781913; cv=none; d=google.com; s=arc-20160816; b=JUMFhWl9FQebQWZ6Z+FiDSeagpDeap5Dp6q/zoi7GZVbN9H8Z3ibuuNx8aPOH71h76 eaa0p+NhONUUkl9XtTz/JNG3hnNmGamMoE2AuOOBXQ/AwZFDBQaaeZaj+6YQOTFlvD40 GfYzx7QtRbFv6p6in4q+7m9eBMbj0GlEqWU2suZMhoYKFL8VoRX8mruaQH03+qi9C2Zp I3X4IxyCHlhBoQmBA1fcW3oeTFWwSphxM41WP+goLWpDWa1+P4SebEK2zpyR87AOJNVF gLSrNu4+nAevUkb2TkOBAkW5uV36QPPEK7KLFmT3zCdQypaVz51foW6q+5etljwL0kRS z0jQ== 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=EbG/qqfr/wurjd2//LUTHT4MZ/YTGKmKEm4o3JLwT/s=; b=WuLtpShFwI9Ko8fem5duEFB09LX1T5wXKf/qWT0GaGqrdWlMQwetUBkwZn4IAufsdQ STTMhAURVKrQOuKR6Uy8/8akr2gRrBp/ma1xMz1XjajdF/7c0UyZuExnfbujT3ZPW5ck PkCIcchessMsgN/KQj/RdbnYnGfTuEFP8bAcT+AeA0ZfouPWrAtof90HiJRgvTO1uBsp l5EcM9Tt5/zOPsWxOMIETRCV0PL1NXRAxu+2zHpg1PbL/FN3uyTTH24MZJmN3KxwrEEG Z64obbWn0fdtrYtTPkvcFkhbkEnbOgEn4JkRgACnauvwFSmm97W9rnH2cLteCES3Q/u2 RZlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HvQ65t8f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e8-20020a056a001a8800b004e1d864ca0bsi181395pfv.346.2022.03.08.15.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 15:25:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HvQ65t8f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 617A07B57B; Tue, 8 Mar 2022 15:16:25 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347344AbiCHOKx (ORCPT + 99 others); Tue, 8 Mar 2022 09:10:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347341AbiCHOKu (ORCPT ); Tue, 8 Mar 2022 09:10:50 -0500 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D4A54AE01 for ; Tue, 8 Mar 2022 06:09:54 -0800 (PST) Received: by mail-io1-xd33.google.com with SMTP id c23so21086895ioi.4 for ; Tue, 08 Mar 2022 06:09:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EbG/qqfr/wurjd2//LUTHT4MZ/YTGKmKEm4o3JLwT/s=; b=HvQ65t8feIo0gRSK95UMXEATxi4c4DoYSB6JJZCO8NKipsnwvobh9/vyJW6KnA4Ta1 d7ZwUmtiJ9X9jqfy4IyCBp4LwwKTbw252gdFl5IvhQiRdHGR+yCENQLl6YhN+Eluw8tQ kcsLzGPN/hCZpD3pYKze6xFjB0UPWoHCBjA50sP7SsW7R5wpEeuxbiE3yJhYMEBqJ9bL DL4o8ZvmQtB1yX8NmUi3iRxe7s+oVJCKQx4wO7WQnzy96JG53slddSp/RQXUmkWTUPAr nRzkkgeolSvSx262NMoqgxSeyHHln9AkpMp2esCK/ML/vQmG2XrTEL8q9aTEd6O62roq FPXA== 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=EbG/qqfr/wurjd2//LUTHT4MZ/YTGKmKEm4o3JLwT/s=; b=VLqGrKqGDD2vMd6FQxn+wO2V/WfJYSPm/SB7pKnHzX5Fqh9ePN8SlSxz+ApFSIJ9al gaYJJ5HlPlWIH9yHl166VRNu+R2qimxgI3YsKsSqdb2caLQ03BS9YmOHzvhLKXfKQz/n Gynq7eIr7KtYszJ2sWPoUcx/xhtsSz2j9oJrLbppuKSUnf5B2Yv9uwN7bxEebNd/spn8 XEvjunbUssu5SC/RZ4ptoKcnLJm8/+ACuhjKPeWRMFrJppNkZZq+d42SfBq+tFYMsw+E Bm493HD4Jt8OGtLI11P5OTV6UtzAnv1pSkTrCbyDfCP+/rQW9QrOPmUWSTZbeqUYboTg HtCQ== X-Gm-Message-State: AOAM532lQCdbfQBa2UqpM07QqzHrm0Bu3Rm+itr6LpYMR+6o91BPF8pL jGEex0n/EqQbxsLdnv9AXMrCM3ftJJ5StOt6jIUz7qTa X-Received: by 2002:a05:6638:d85:b0:317:d2f5:8f1d with SMTP id l5-20020a0566380d8500b00317d2f58f1dmr4997851jaj.117.1646748593868; Tue, 08 Mar 2022 06:09:53 -0800 (PST) MIME-Version: 1.0 References: <029aaa87ceadde0702f3312a34697c9139c9fb53.1646237226.git.andreyknvl@google.com> In-Reply-To: From: Andrey Konovalov Date: Tue, 8 Mar 2022 15:09:43 +0100 Message-ID: Subject: Re: [PATCH mm 05/22] kasan: print basic stack frame info for SW_TAGS To: Alexander Potapenko Cc: andrey.konovalov@linux.dev, Marco Elver , Dmitry Vyukov , Andrey Ryabinin , kasan-dev , Andrew Morton , Linux Memory Management List , LKML , Andrey Konovalov Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, Mar 2, 2022 at 6:34 PM Alexander Potapenko wrote: > >> diff --git a/mm/kasan/report_sw_tags.c b/mm/kasan/report_sw_tags.c >> index d2298c357834..44577b8d47a7 100644 >> --- a/mm/kasan/report_sw_tags.c >> +++ b/mm/kasan/report_sw_tags.c >> @@ -51,3 +51,14 @@ void kasan_print_tags(u8 addr_tag, const void *addr) >> >> pr_err("Pointer tag: [%02x], memory tag: [%02x]\n", addr_tag, *shadow); >> } >> + >> +#ifdef CONFIG_KASAN_STACK >> +void kasan_print_address_stack_frame(const void *addr) >> +{ >> + if (WARN_ON(!object_is_on_stack(addr))) >> + return; >> + >> + pr_err("The buggy address belongs to stack of task %s/%d\n", >> + current->comm, task_pid_nr(current)); > > This comm/pid pattern starts to appear often, maybe we could replace it with an inline function performing pr_cont()? Sounds good, will do if/when posting a v2. Thanks!