Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2443475pxb; Mon, 11 Jan 2021 09:44:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFAQ5cbBhaK+w67cHc+tySO69wzAvtKTRKV2RPyT2xh2ZYvWkNAb6eA7M+ksYQ1iGn7RFu X-Received: by 2002:a05:6402:11c7:: with SMTP id j7mr376856edw.290.1610387056787; Mon, 11 Jan 2021 09:44:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610387056; cv=none; d=google.com; s=arc-20160816; b=Xs0CR6WvMF6P5i2JcX6eSu+dZRoWuQb0eTucVVQPDCWzSXP/rA/97mQIZ4kIay5x3S F0FeGWx9eYCSVyUDGozFo7L5AARub93Xh7vtKz97xhpieF5tw7NFXltnb3pOXBwJJUVc /gdynWEgFjHDPqt57LMIVkYt8kayXR7qnVAJgjEMiHs3SdBKet3rEucP2tYR/raph3FM WoxX/bWv5N+vAplqGQECkaELmJwvU+ZR01HjI6tDvtgsic+pDygcO4hdW7YAix3y0dUG RAKsFQ2yqul4JC6ZEO6QgPHL56dlkCvUk5Nw+tsG1wPM77I1pynu471Gr6HYq5MEfq7G NiWg== 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=qjQEnNzMbx9jfPqlYY0N0jYj1R3Q/O+LmSxzsF9dUuI=; b=Un4cZRHTsBpSQOS3hpUUpTybZ6MbQPjaaKN3zgp7cEK4gQ7FOnQJtlEUGF3FRx48qb lUITJgmKBDvLyjQz1AaYDJpJIvBQZiIguHTbsX2YWBynAzXAxNqKwxm9hzrUXtMK/VMg UXk9+8gHOvNdkt4DMoeZ4hpTGdPZ6SzbhtlC0AmHYekUG1ba2d2KQ6fze2/R5L0UMfBu F/A97InUJm3pkYEwnJVBPgpdpKCkQx5fvm3NJyV8khfApHBE9x1w1nWId4R5vzoiNnEO u4EeLxQUXWQBdF02qIOquWGxdvQahHgybLLiMS+6+5CbFccnt5fLxmgu2YENF33yivF8 bUxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vMdJQPxB; 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 qp17si42222ejb.516.2021.01.11.09.43.52; Mon, 11 Jan 2021 09:44:16 -0800 (PST) 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=vMdJQPxB; 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 S2389691AbhAKRk7 (ORCPT + 99 others); Mon, 11 Jan 2021 12:40:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389647AbhAKRk7 (ORCPT ); Mon, 11 Jan 2021 12:40:59 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C65DC061786 for ; Mon, 11 Jan 2021 09:40:19 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id p12so5099pju.5 for ; Mon, 11 Jan 2021 09:40:19 -0800 (PST) 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=qjQEnNzMbx9jfPqlYY0N0jYj1R3Q/O+LmSxzsF9dUuI=; b=vMdJQPxBpe62gqG1pM4PczjRnOrPEyBn6OX27rJgh3RoP9Bb8niJeXWnlLtYASKzs1 3tec2zfE91shpqvsoUtUzkG/s3YvNOUBIs6QRIpbj5A2uTZilfmqSgEHCupMdmtcskw3 z/0Ho9FHyV3j6J1WTeTJ6ki8j0WWTYpMEMl0kNXESAM7BHsOSEN5BvaVIJrRezTX9O++ 54WMwrTMCRPa2hxQD6G+aGtFz3ktlz5+uiSLFgT2YlOhNAAkdL03lR/0nNzjGTsVyTJY FPQNiuvc4oFV+C92Xx1rH933KYdXsTRE6t9fEHQ3WjlZaghphrDKguNdYDsJa+44c0Ob da3Q== 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=qjQEnNzMbx9jfPqlYY0N0jYj1R3Q/O+LmSxzsF9dUuI=; b=nwsVRDKI03A/wNiCzx65PoQkxL6tcCp9QfNNzEIMLdYVP6oorPYHQamoDIfEzpHpp5 R0tAExYHXYtn338NtU8KKP24nsrrGJqnecJ286aY+V/JCtDF/swGb2KBICbkiCjw7fIK NyR9H+5G7AtQNs5lyhE+AaSjk1PaRdSit8cxAwDdPL5gYEUVw+BzisO6w6oPIhQM22uV Ie2aLCp9MIa58fvs1HwjjwlwVJ00jE8guEqsBZQfUb8NFJQNtCe+JgoxZCPPgKc2J+L+ Y56S9VbGQJ+qrP4QtpXAMMFI2i6v+vGV35TVChFj8+0GrfhI9FkRCCFntqS0J8w17jLP 8M+Q== X-Gm-Message-State: AOAM532bY/S6Fx08Ku1fGXkobhXWVp6qsotIOxKXsLHwQQi/zYFqU5V1 zlNqNKIjd8TMsOxgbOrgYcX9ZMO78cbDvCWb0MqLuA== X-Received: by 2002:a17:90a:f683:: with SMTP id cl3mr383204pjb.136.1610386818720; Mon, 11 Jan 2021 09:40:18 -0800 (PST) MIME-Version: 1.0 References: <20210108040940.1138-1-walter-zh.wu@mediatek.com> In-Reply-To: From: Andrey Konovalov Date: Mon, 11 Jan 2021 18:40:07 +0100 Message-ID: Subject: Re: [PATCH v3] kasan: remove redundant config option To: Arnd Bergmann Cc: Walter Wu , Arnd Bergmann , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Andrew Morton , Nathan Chancellor , kasan-dev , Linux Memory Management List , LKML , Linux ARM , wsd_upstream , "moderated list:ARM/Mediatek SoC..." Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 8, 2021 at 9:31 PM Arnd Bergmann wrote: > > On Fri, Jan 8, 2021 at 7:56 PM Andrey Konovalov wrote: > > On Fri, Jan 8, 2021 at 5:09 AM Walter Wu wrote: > > > > @@ -2,6 +2,12 @@ > > > CFLAGS_KASAN_NOSANITIZE := -fno-builtin > > > KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET) > > > > > > +ifdef CONFIG_KASAN_STACK > > > + stack_enable := 1 > > > +else > > > + stack_enable := 0 > > > +endif > > > + > > > > AFAIR, Arnd wanted to avoid having KASAN_STACK to be enabled by > > default when compiling with Clang, since Clang instrumentation leads > > to very large kernel stacks, which, in turn, lead to compile-time > > warnings. What I don't remember is why there are two configs. > > > > Arnd, is that correct? What was the reason behind having two configs? > > I think I just considered it cleaner than defining the extra variable in the > Makefile at the time, as this was the only place that referenced > CONFIG_KASAN_STACK. > > The '#if CONFIG_KASAN_STACK' (rather than #ifdef) that got added > later do make my version more confusing though, so I agree that > Walter's second patch improves it. > > Acked-by: Arnd Bergmann Got it, thanks! > On a related note: do you have any hope that clang will ever fix > https://bugs.llvm.org/show_bug.cgi?id=38809 and KASAN_STACK > can be enabled by default on clang without risking stack > overflows? Not sure :( I've filed this on KASAN bugzilla to not forget: https://bugzilla.kernel.org/show_bug.cgi?id=211139