Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3734903imu; Mon, 14 Jan 2019 08:10:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN6f5lVgciHvkdeUT+DbYDxRHFTfc+zY+7Zd87kkK2iTqMW7y7g5sqc8CkEDpO64Y23GRgyW X-Received: by 2002:a63:4d0e:: with SMTP id a14mr23694993pgb.408.1547482207188; Mon, 14 Jan 2019 08:10:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547482207; cv=none; d=google.com; s=arc-20160816; b=AxUN+9bB2iD2YfXXTZs0E677Pu06QXkRITrX+Q2lA3qGsuTyRUJUbXFJsqlUniiYwg Uz/E9F892f9cil19hgRZMr0tPzM7RWfrOybfpG+XHZp6eNtgUMqPKblWEcKFYn5jjegH wp357Da+QlFhGFwvPIgh6RPdsE/K6rl9Mkd45eianD4wgusqPReHNiCwGnamaXab5vdT REs4U43T8t9GwH0NZEVa4h5z7ymE2yiY655AN19s6A+0wyd75/B10ZvL0nNHXGuZy4NZ GEEJiz4ukbOMocG65RZzsvFQ19afofUDjTuGYxZMh/pT67ZhFoQaon03VckVfSjR5HFs RB+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=I+Y+VSiapP5/VBA0HThD3r64w9CagWPLjo9ljICNNk4=; b=SZvY3hfqqfSvvCPIRh6+w2fPF8ThsdNgLD0UFAXBa821gY99qlLnY0p30h+pdBhVKv b+23fLwV7FDK5W2WBGRoJui1wRlQP6xiUaS9PTqs5Ykp8O/MW+8NtGq42lrKNH0SmmWy TAmMpq8VHrhVz8mqtL/HGfJE3QovsxzBSwNXOVHVd6HJzdLd9w282f26a1FIXZqAL39y jjahUTNuPZJwlcrBrSAyH1JGraQqXbDbo9RyS7vCYY7ozzoPHZNFfYNW4L5FlGyprBi2 zBcr78WDRoesggKQ0i0psdCFMliAB8PkNypSTBlvyqFF0CaVQn5WX4J8sTRfQ++mrd0W cd+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6si627974pgq.207.2019.01.14.08.09.50; Mon, 14 Jan 2019 08:10:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726803AbfANQII (ORCPT + 99 others); Mon, 14 Jan 2019 11:08:08 -0500 Received: from relay.sw.ru ([185.231.240.75]:57070 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbfANQII (ORCPT ); Mon, 14 Jan 2019 11:08:08 -0500 Received: from [172.16.25.12] by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gj4mK-0004Ut-5L; Mon, 14 Jan 2019 19:07:56 +0300 Subject: Re: [PATCH] kasan: Remove use after scope bugs detection. To: Dmitry Vyukov Cc: Andrew Morton , LKML , kasan-dev , Linux-MM , Linux ARM , Qian Cai , Alexander Potapenko , Catalin Marinas , Will Deacon References: <20190111185842.13978-1-aryabinin@virtuozzo.com> From: Andrey Ryabinin Message-ID: <296f2311-0a11-f4bd-b665-70c3ffad2124@virtuozzo.com> Date: Mon, 14 Jan 2019 19:08:19 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/14/19 4:24 PM, Dmitry Vyukov wrote: > On Fri, Jan 11, 2019 at 7:58 PM Andrey Ryabinin wrote: >> >> Use after scope bugs detector seems to be almost entirely useless >> for the linux kernel. It exists over two years, but I've seen only >> one valid bug so far [1]. And the bug was fixed before it has been >> reported. There were some other use-after-scope reports, but they >> were false-positives due to different reasons like incompatibility >> with structleak plugin. >> >> This feature significantly increases stack usage, especially with >> GCC < 9 version, and causes a 32K stack overflow. It probably >> adds performance penalty too. >> >> Given all that, let's remove use-after-scope detector entirely. >> >> While preparing this patch I've noticed that we mistakenly enable >> use-after-scope detection for clang compiler regardless of >> CONFIG_KASAN_EXTRA setting. This is also fixed now. > > Hi Andrey, > > I am on a fence. On one hand removing bug detection sucks and each > case of a missed memory corruption leads to a splash of assorted bug > reports by syzbot. On the other hand everything you said is true. > Maybe support for CONFIG_VMAP_STACK will enable stacks larger then > PAGE_ALLOC_COSTLY_ORDER? > Yes, with vmap stacks higher order won't be a problem, since vmalloc() does only 0-order allocations. But even with vmap stacks use-after-scope won't become useful, thus I don't see the point of re-enabling it with vmap stacks. If feature doesn't detect bugs, but waste resources, than it's bad for detecting bugs. We wasting our limited resources for useless checks, instead of using these resources for doing more useful checks, running tests faster hence detecting more bugs per-time.