Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4538705pxj; Tue, 22 Jun 2021 02:32:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynkXyfgV/u0QotpnyQcOFZwOtOV/f2JEHjO0Lf4/8jtoF7Gkjp5DadDtyRV6XvwqES2C8g X-Received: by 2002:a05:6402:5:: with SMTP id d5mr3660846edu.312.1624354325470; Tue, 22 Jun 2021 02:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624354325; cv=none; d=google.com; s=arc-20160816; b=ciWJRmyq2uPw6DslHfCiWb53NFPuikHtSAwfj9EZn8CzPKjZRLQL190dZZmIeV8mH2 UDfIT+9EGJPKPkEf1UZmGb4a5JoP+A9n/ozE+p8kLRuPHf5+xq2h1o58ZuUmck83+vOc icAJRz+2DjYIOxQ85pFWHt0wQoCauRWI1tLh23DAl7wRPUxDRUIRLY88J7iu19RN8LvE aDCNB5FKYELrIdwRRCqDj/L8GYTcWQ9MKtjCD59ikJoV29YjRHyh2aT/fWaQTRDBoXhO nzreI2m+OBLB1Llj7W7wP8Z/ax79aydW3IqEF9kYWTGaNBD5N0L19/ubdCy43bY4I40H 0Rsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=58zdBT4iccY3hk8j5TcU5G4OItRSttrTmPDv2LwwaDM=; b=0+0/XwhNNUaLFo/Zqn9FEDEF1D1Pph6JFQrGeExsab6UyWeifUbE3qzLG0/tBB+mzB 939TjiAAkoxdOyPHe+yniTv+/ccticLs3kuhyEL7hTzupEAgv5XATj14GDf1LVRr3LBS XoD39Fyza9RNOPKQ3rozcDosOIQUuwCQxY8GjrRHrqoRbCtmeuBGccwNwF6bB+2UlsxF EUFgsDqj4VfnzI/SiaqFag6ZnvmAf3MxTKfs1pWwYJpMxTHUAjS1QL/YfRSxLbkEQHff SihgtlxsEP+PNrX3seYtpuRHleA3Fkjl3AVfxqmTxCDho+DqqB/Qw1D06JNpWq05zF8h 9fhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=I8nT0GIC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x44si8978246edy.607.2021.06.22.02.31.43; Tue, 22 Jun 2021 02:32:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=I8nT0GIC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229949AbhFVJcF (ORCPT + 99 others); Tue, 22 Jun 2021 05:32:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbhFVJcD (ORCPT ); Tue, 22 Jun 2021 05:32:03 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E0FFC061574 for ; Tue, 22 Jun 2021 02:29:48 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id x21so6385726qtq.9 for ; Tue, 22 Jun 2021 02:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=58zdBT4iccY3hk8j5TcU5G4OItRSttrTmPDv2LwwaDM=; b=I8nT0GICPLPZ1Jhb4B9W/QQIYPbvEQrVLYwutlY2c2qEMSCirWGRIwHKuF8WAivTLK /LpLwAJ4FKBILv7vHY+BKVUCTgnU9VDqokmEBuXWh61+figaMbqizpO7F0P+kLjpsq9M 24zUBztp9upMyC/n35LdB09iA/ZB+bpCEv8elrpP6Vb6Vt6P6+r+9QBwR3+5MsXGXIf/ 2WKf+aa4TfFuWtl3C/WNaxcRMjz8R1hlISaW2IbA4EzdUbpSeZZiTsTNzkStWqRZRMcJ Qzh0ozt8SJrDCqvmSYYrBo1NUf9TpLcMwXRCrSRBV0a2YSeRl3lALxiXCjQddkx+hDSj 9P9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=58zdBT4iccY3hk8j5TcU5G4OItRSttrTmPDv2LwwaDM=; b=ZGT7Nstdz40ExllIderbfS4tBvDASVkinBr1k/yh3GFwN+yQbupHYG0BtofON8M5PX o18ggeQ04xcgo7JBQ/rJW7gIaAx5JB4DQT42/LW8CZTNDrJZnxhkSyBVxzcG5Xh82dYl zaGN3vNwEPAklHq6wmjM8KqGWbOkZN3o7POTllyd3mRWVdY5ebCrNmajREBpc1RRQ/bw UXsHt6c3Y54bs5fI/dVgw2efcPWTXU/xMHhmiul/YvUbMMUyuo4dBionUB6Zpy/svtNL dDvfnixS3OesMreq9zPQ4KSkmNvEZ1de6tLObqYSQF1BY90KQBiZpl7XkYDfPVKtwy9V 1zEg== X-Gm-Message-State: AOAM533AGpw2XbmdxY/S2+pqKmJaFBC6K1ALyrWAh2DuY/cw/U0Op+x7 2N6MPfpgLD0g9n1gEKqmjLPsqH3TrfPP+E5crzXerA== X-Received: by 2002:ac8:5dcd:: with SMTP id e13mr2542822qtx.175.1624354187077; Tue, 22 Jun 2021 02:29:47 -0700 (PDT) MIME-Version: 1.0 References: <20210620114756.31304-1-Kuan-Ying.Lee@mediatek.com> <20210620114756.31304-4-Kuan-Ying.Lee@mediatek.com> In-Reply-To: <20210620114756.31304-4-Kuan-Ying.Lee@mediatek.com> From: Alexander Potapenko Date: Tue, 22 Jun 2021 11:29:11 +0200 Message-ID: Subject: Re: [PATCH v3 3/3] kasan: add memory corruption identification support for hardware tag-based mode To: Kuan-Ying Lee Cc: Andrey Ryabinin , Andrey Konovalov , Marco Elver , Dmitry Vyukov , Andrew Morton , Matthias Brugger , kasan-dev , LKML , Linux Memory Management List , Linux ARM , linux-mediatek@lists.infradead.org, wsd_upstream , chinwen.chang@mediatek.com, nicholas.tang@mediatek.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 20, 2021 at 1:48 PM Kuan-Ying Lee wrote: > > Add memory corruption identification support for hardware tag-based > mode. We store one old free pointer tag and free backtrace. > > Signed-off-by: Kuan-Ying Lee > Suggested-by: Marco Elver > Cc: Andrey Ryabinin > Cc: Alexander Potapenko > Cc: Andrey Konovalov > Cc: Dmitry Vyukov > Cc: Andrew Morton Reviewed-by: Alexander Potapenko > --- > lib/Kconfig.kasan | 2 +- > mm/kasan/kasan.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan > index 6f5d48832139..2cc25792bc2f 100644 > --- a/lib/Kconfig.kasan > +++ b/lib/Kconfig.kasan > @@ -157,7 +157,7 @@ config KASAN_STACK > > config KASAN_TAGS_IDENTIFY > bool "Enable memory corruption identification" > - depends on KASAN_SW_TAGS > + depends on KASAN_SW_TAGS || KASAN_HW_TAGS > help > This option enables best-effort identification of bug type > (use-after-free or out-of-bounds) at the cost of increased > diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h > index b0fc9a1eb7e3..d6f982b8a84e 100644 > --- a/mm/kasan/kasan.h > +++ b/mm/kasan/kasan.h > @@ -153,7 +153,7 @@ struct kasan_track { > depot_stack_handle_t stack; > }; > > -#ifdef CONFIG_KASAN_TAGS_IDENTIFY > +#if defined(CONFIG_KASAN_TAGS_IDENTIFY) && defined(CONFIG_KASAN_SW_TAGS) > #define KASAN_NR_FREE_STACKS 5 > #else > #define KASAN_NR_FREE_STACKS 1 > -- > 2.18.0 > > -- > You received this message because you are subscribed to the Google Groups= "kasan-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an= email to kasan-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgi= d/kasan-dev/20210620114756.31304-4-Kuan-Ying.Lee%40mediatek.com. --=20 Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg