From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1559BC47083 for ; Wed, 2 Jun 2021 12:24:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AE6D26124B for ; Wed, 2 Jun 2021 12:24:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE6D26124B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3CB706B006C; Wed, 2 Jun 2021 08:24:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A2066B006E; Wed, 2 Jun 2021 08:24:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26AB06B0070; Wed, 2 Jun 2021 08:24:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id E9A186B006C for ; Wed, 2 Jun 2021 08:24:46 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 89C6C8249980 for ; Wed, 2 Jun 2021 12:24:46 +0000 (UTC) X-FDA: 78208702572.03.CDF2F6C Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by imf04.hostedemail.com (Postfix) with ESMTP id 2B58A3C3 for ; Wed, 2 Jun 2021 12:24:39 +0000 (UTC) Received: by mail-ej1-f48.google.com with SMTP id e18so3563322eje.5 for ; Wed, 02 Jun 2021 05:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AwfKJOjaR7R6vzUo1s6BF5wo5oy1/Uxlj9t1SzL/r6g=; b=qTe44U4p6PT0wikwIdv6f+Q5KJDNZZuqRkp1TfXfFttdjmgLHZenydDf/bXghIRPb5 NIXcq90EdZKu/DJYjR0L5KUXfaacanzLR4et6WuXoSaVfN+kRewPFQZ+XivUm7Oo/Tnn 56E+sZl/FyqhlyFNzSwtF38MdwEgZnAjlx1TXZ2CS+0cPRQE6elf3byOwTAKN/x6XxlC U7HdA5KVta0YMTYFNY3xhMIg7QaTGGhl37bPIISJ2rUrutue0KJxsDpdELjxfrlte6cn JlA9JE9BhjlL7AGMhyzIC6MdnNVh7Ls53K6T2cS3UckLXEmZ4tSeMlbWFnb8x5gT/jwY uPUA== 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; bh=AwfKJOjaR7R6vzUo1s6BF5wo5oy1/Uxlj9t1SzL/r6g=; b=MOJWgY21kg1m6Og6QmaW7URqswcS8nAcjt9XJmYc1z3y4F3OOprdtiVt8jNXWR6CKp n/Fxt7ivMRGMj1Xcq50sDveGNy6cuC232BbgfEKm4DdFF37On54R6Ue3r9FgN0vXaMHD O+1sT+r+okzh1Alv3L6p4r5Q4I3CRRbE7Dl8EuXnxRROXxHMJ8Y/dOyAQfZPXSHM1AuZ 4lUbfTDFHHM+XWIpDcgqitQVzFzIBfPIxrbInLsC5Nq4N4flfT+G7dUG8XQGLrKCkNuA juIrOFqfhYKOPExjGMQ1fitg8kA/yQf5gwY35TWiMqUETGH436bHsF208HbdLYjS4zZc NOjg== X-Gm-Message-State: AOAM533oBoVdPiUhWTIOV4TTzMec2l+SdFIgSPB1zCE2B1GkABs2bQDu xY7ur2oQmrJpSmXmeanNiFMutLwMItsan7ZHilM= X-Google-Smtp-Source: ABdhPJzsiXc2u5mECupMkkVWYnf84fFmvHy4h/CZTKleRGIQUTPrIA1mw8k9Xx4/IR8U7JKxpPZb4/J3+lfdiS+mNEo= X-Received: by 2002:a17:906:a945:: with SMTP id hh5mr33928412ejb.227.1622636685254; Wed, 02 Jun 2021 05:24:45 -0700 (PDT) MIME-Version: 1.0 References: <20210530044708.7155-1-kylee0686026@gmail.com> <20210530044708.7155-2-kylee0686026@gmail.com> In-Reply-To: From: Andrey Konovalov Date: Wed, 2 Jun 2021 15:24:34 +0300 Message-ID: Subject: Re: [PATCH 1/1] kasan: add memory corruption identification for hardware tag-based mode To: Marco Elver Cc: Kuan-Ying Lee , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Andrew Morton , kasan-dev , LKML , Linux Memory Management List , Walter Wu Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=qTe44U4p; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of andreyknvl@gmail.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=andreyknvl@gmail.com X-Stat-Signature: 3qyff9b1uf4n7m3urduhsdgm8y6d744h X-Rspamd-Queue-Id: 2B58A3C3 X-Rspamd-Server: rspam02 X-HE-Tag: 1622636679-995061 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, May 31, 2021 at 11:50 AM Marco Elver wrote: > > On Sun, May 30, 2021 at 12:47PM +0800, Kuan-Ying Lee wrote: > > Add memory corruption identification at bug report for hardware tag-based > > mode. The report shows whether it is "use-after-free" or "out-of-bound" > > error instead of "invalid-access" error. This will make it easier for > > programmers to see the memory corruption problem. > > > > We extend the slab to store five old free pointer tag and free backtrace, > > we can check if the tagged address is in the slab record and make a good > > guess if the object is more like "use-after-free" or "out-of-bound". > > therefore every slab memory corruption can be identified whether it's > > "use-after-free" or "out-of-bound". > > > > Signed-off-by: Kuan-Ying Lee > > On a whole this makes sense because SW_TAGS mode supports this, too. > > My main complaints are the copy-paste of the SW_TAGS code. > > Does it make sense to refactor per my suggestions below? > > This is also a question to KASAN maintainers (Andrey, any preference?). All of your comments are valid. Thank you, Marco.