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=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 ABF37C43457 for ; Mon, 19 Oct 2020 22:51:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F093E2242A for ; Mon, 19 Oct 2020 22:51:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="OC0a2zIS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F093E2242A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EF0466B005C; Mon, 19 Oct 2020 18:51:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E78F46B0062; Mon, 19 Oct 2020 18:51:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D3F866B0068; Mon, 19 Oct 2020 18:51:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by kanga.kvack.org (Postfix) with ESMTP id 9D9A66B005C for ; Mon, 19 Oct 2020 18:51:29 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 22AD982C27EA for ; Mon, 19 Oct 2020 22:51:29 +0000 (UTC) X-FDA: 77390173098.23.mask84_3e091e32723a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id F332737604 for ; Mon, 19 Oct 2020 22:51:28 +0000 (UTC) X-HE-Tag: mask84_3e091e32723a X-Filterd-Recvd-Size: 6534 Received: from mail-vs1-f65.google.com (mail-vs1-f65.google.com [209.85.217.65]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Mon, 19 Oct 2020 22:51:28 +0000 (UTC) Received: by mail-vs1-f65.google.com with SMTP id s15so901074vsm.0 for ; Mon, 19 Oct 2020 15:51:28 -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; bh=/5knxhq7CVjdPlgBy3BxP03HOY/V3PzThvC7xXq5gGQ=; b=OC0a2zISWY+9Gjsw14nwxC6O3itMVVWDC6aDVg4v2EmgcL/vXSJjZWkYXdUkTzxe8s cAD755MZ57dpMc2y810w9hN4HKdd1mPIEaK+Rhyf+6Icpc56uNmVjdhMx8V3t0ikNEmQ zD6SoncHRrTsQhuUBeiWz7RbQkYnuCzHoyppqlEH8CyBnjJtw9TvmlzrGNyksOi0PHt1 JJOXZ2rwGPjrKcgd6x8agmqX6Ta3X73gLTKwO5nf0H+oyki4Fdli1II52j8lP83hVfh7 s7+tdQlgbc3hhuzBHJL3dnlCc5OZ9mCCSUM9mgxhzSSB8r/CC/cb6lkT5AVZ16Fc4mBA Pfgg== 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=/5knxhq7CVjdPlgBy3BxP03HOY/V3PzThvC7xXq5gGQ=; b=t0qAVRFjcprtDQiLioY3dfreFOVX/lfTNPbXuCbtOjvt5RYXb4Ahd6VPFi11GmD8bP +RGZzmYNstpcHvT18zjF0jizZRQwMjfP2tjS7FWHml/uTghvbHfZ7i3ffKqYqbLcYm6/ k6z4ySFeFHB4cjbkMSH9KDXrHX25V3joEBnknnAVq+ucN1ZlQpQ3xzJPv06zIKJ5TjA6 v/qQ+Rt60GMSWrgyRreNtREvzD8nqBtiVp5W6tjinMgpYd4d0MZJMdczILlo9T9vqdoD kn5w1eALSW3r2yOcyxyTwQCLMsaeRzo5mlOqZ4+R7BhxVtt2ujIffTaAp/nhnw/pkDD/ /5Hw== X-Gm-Message-State: AOAM530NwaLUOWpWAJN1aVDwY/LzZpNdyL0H/Xeih5epVx5rcHtq1PGA xfPvcL+oXL98xELFhm7ajvrPG0DJbWQOQhpnEYafag== X-Google-Smtp-Source: ABdhPJy8KN/9grhnwkimwQACJ6SAuvwZovEjixiYVhsLIag8rk3K/bJAZV1lc/Yt7ptOv+azP1Utu40/QynZ3cYAZgw= X-Received: by 2002:a67:ff01:: with SMTP id v1mr26767vsp.10.1603147887388; Mon, 19 Oct 2020 15:51:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kostya Serebryany Date: Mon, 19 Oct 2020 15:51:15 -0700 Message-ID: Subject: Re: [PATCH RFC 0/8] kasan: hardware tag-based mode for production use on arm64 To: Andrey Konovalov Cc: Serban Constantinescu , Catalin Marinas , Will Deacon , Vincenzo Frascino , Dmitry Vyukov , Alexander Potapenko , Evgenii Stepanov , Andrey Ryabinin , Elena Petrova , Branislav Rankov , Kevin Brodsky , Andrew Morton , kasan-dev , Linux ARM , Linux Memory Management List , LKML , Marco Elver Content-Type: text/plain; charset="UTF-8" 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: Hi, I would like to hear opinions from others in CC on these choices: * Production use of In-kernel MTE should be based on stripped-down KASAN, or implemented independently? * Should we aim at a single boot-time flag (with several values) or for several independent flags (OFF/SYNC/ASYNC, Stack traces on/off) Andrey, please give us some idea of the CPU and RAM overheads other than those coming from MTE * stack trace collection and storage * adding redzones to every allocation - not strictly needed for MTE, but convenient to store the stack trace IDs. Andrey: with production MTE we should not be using quarantine, which means storing the stack trace IDs in the deallocated memory doesn't provide good report quality. We may need to consider another approach, e.g. the one used in HWASAN (separate ring buffer, per thread or per core) --kcc On Fri, Oct 16, 2020 at 8:52 AM Andrey Konovalov wrote: > > On Fri, Oct 16, 2020 at 3:31 PM Marco Elver wrote: > > > > On Fri, 16 Oct 2020 at 15:17, 'Andrey Konovalov' via kasan-dev > > wrote: > > [...] > > > > > The intention with this kind of a high level switch is to hide the > > > > > implementation details. Arguably, we could add multiple switches that allow > > > > > to separately control each KASAN or MTE feature, but I'm not sure there's > > > > > much value in that. > > > > > > > > > > Does this make sense? Any preference regarding the name of the parameter > > > > > and its values? > > > > > > > > KASAN itself used to be a debugging tool only. So introducing an "on" > > > > mode which no longer follows this convention may be confusing. > > > > > > Yeah, perhaps "on" is not the best name here. > > > > > > > Instead, maybe the following might be less confusing: > > > > > > > > "full" - current "debug", normal KASAN, all debugging help available. > > > > "opt" - current "on", optimized mode for production. > > > > > > How about "prod" here? > > > > SGTM. > > > > [...] > > > > > > > > Should we somehow control whether to panic the kernel on a tag fault? > > > > > Another boot time parameter perhaps? > > > > > > > > It already respects panic_on_warn, correct? > > > > > > Yes, but Android is unlikely to enable panic_on_warn as they have > > > warnings happening all over. AFAIR Pixel 3/4 kernels actually have a > > > custom patch that enables kernel panic for KASAN crashes specifically > > > (even though they don't obviously use KASAN in production), and I > > > think it's better to provide a similar facility upstream. Maybe call > > > it panic_on_kasan or something? > > > > Best would be if kasan= can take another option, e.g. > > "kasan=prod,panic". I think you can change the strcmp() to a > > str_has_prefix() for the checks for full/prod/on/off, and then check > > if what comes after it is ",panic". > > > > Thanks, > > -- Marco > > CC Kostya and Serban.