Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp586521pxb; Fri, 8 Jan 2021 12:33:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0G+Gl1mZUoyFoz471g88hPiT8P3rZqo866Ud8pwr5MYceLqsqSTokKZMCfh3RGoOHXccG X-Received: by 2002:aa7:d354:: with SMTP id m20mr6336720edr.195.1610138033731; Fri, 08 Jan 2021 12:33:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610138033; cv=none; d=google.com; s=arc-20160816; b=SpxJmvCovb6PCmQ63om/aOqyuUcq5XVPlGgxbzJa/LorIbnteYu7o/dt9d0Cs7bCp/ +Y/HtSvOv/x7w4bjXhF3Tua5bbdp2YNjyKOoQhyaNNHIcn4vfE9czckoo0BRr2pPfYcv 7TxsSUVD53ZOSiOVX5XD72437X6rmCdGS6TyIonQhGVlVZemDT4dd0Ilcq1GnWGcVdc9 rY5wgwpYC8Rh961HU3pxixY+HUSx2Pi7XiEr6YX5489yVwhJXIM+XGyAO9HdsbYJCFZ7 XUBAb3n3sApGrSxscwvFlozJ6TpNYiAtQf9QNh6oExI02f3Zx0D6oe3to7yF/pPWvT6f UYWg== 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=fPcd5e17kvFT6rSYsfQi6Rm5JBuk365tGQ3m6T4XhzY=; b=SBUEXXocd326FNk410LVNzr3Dh3+ZtmLoT8a/ubKpqu03N9ZoqmsDWHtE5vWjuD3OI l2xPfbBXqI6yR47Xf8ZqCAFAn/oFy7UDrNq3YVzfOnI8lW8Vrt/gfe8oKgymrmOYNHMi q0CSJNa8k22hSbbxnQ76+kgAzWyW806q2yNYOGNdwUMab0s91pA1Oh7O7fDdlkSu5S4W TddPmCCECTyXmABMTWejNFCyDdVLG34gFYptBq3Vi8wld/WlSFnqS1Lxvt1lo0MV66jN 8pcptvmAZF8bA3GKNMrimxHZn78CmwGb7ILTRBnixlMLTQk0x/h0FyW2TubH8zOLh+gF d2NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CK8hMSmJ; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si3753751ejf.702.2021.01.08.12.33.30; Fri, 08 Jan 2021 12:33:53 -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=@kernel.org header.s=k20201202 header.b=CK8hMSmJ; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729190AbhAHUbv (ORCPT + 99 others); Fri, 8 Jan 2021 15:31:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:47524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727443AbhAHUbv (ORCPT ); Fri, 8 Jan 2021 15:31:51 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7117023AC2 for ; Fri, 8 Jan 2021 20:31:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610137870; bh=dN/vCuTfi01My7gqxrmbsoNneHB7mr8tZmJby3DM2Ts=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=CK8hMSmJlda2+nQd/elAbLb6PsPulkmBsfLI7uMcP/u5n2IrnaEt6BIOaRTYJxiwY LBj5ATT03OE7SXXkvjFHc+eADEWghwWQKrpuKdFN3I/CzOpVcQan+Atg0NaHa47OtK LmzxK/798PUNYHO/fGwACW0KH8Hi+652iL6SuDv9yndLXV2iiLwzJVi2Oz69n1Y4Sj N4pQqvohaveCDIzjwey5Z4V1PB75s0hXmo0GQO22OxC/+55xIxTHx9KeACIS2j/3r9 ye3R2dyzshr3vWK4ht96ESK7jnEbEUFyFgrCrJjEFGnE/hffyiVcsF/VVMJslTZ68Y 379cIu9sAq4Gw== Received: by mail-oi1-f182.google.com with SMTP id x13so12768468oic.5 for ; Fri, 08 Jan 2021 12:31:10 -0800 (PST) X-Gm-Message-State: AOAM5300g+PV0JmCDniIDvJgVaZOWUeFGJTXVahHEbiqL60fk8GQskVM XkJoLDbBmlncBC44zJ08jvRUxF795rt/8iX7GPk= X-Received: by 2002:aca:44d:: with SMTP id 74mr3515461oie.4.1610137869802; Fri, 08 Jan 2021 12:31:09 -0800 (PST) MIME-Version: 1.0 References: <20210108040940.1138-1-walter-zh.wu@mediatek.com> In-Reply-To: From: Arnd Bergmann Date: Fri, 8 Jan 2021 21:30:53 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] kasan: remove redundant config option To: Andrey Konovalov 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 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 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? Arnd