Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp946815imp; Wed, 20 Feb 2019 12:03:26 -0800 (PST) X-Google-Smtp-Source: AHgI3IbwTj3hOtir+y/xqKX5rUYrWpFIqxn7MrASIYhhK9DZbkP0uBb7H5YokT+GbnJyvdkzYTap X-Received: by 2002:a17:902:74cb:: with SMTP id f11mr36391845plt.180.1550693006368; Wed, 20 Feb 2019 12:03:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550693006; cv=none; d=google.com; s=arc-20160816; b=Ww2eyQ4XJqg8cEqEG6SgRqxeemXR8Jhi5Gld3O/7q5MhX/hN6uO4zYDV9UvLyAzjMR gnBow3NtVLrIVZjl0+unSZ3cHJA12Ic1L8Dlsqc3bCK+rBiTL2StKVuDSxihePTrWcgk gLq6DW2m+ju/zKx26xENx7oaBtIhCpGRDDs9VTFONts9jp6xGk4GpTog+ipZ+YkpTtuM RS3Jg8maZNf8u/c+Zm3/3kaGFbEkwVwhOlgvwPTHQh9d5eTuNr8b+/I91IF1MWJCIHoj 7+wpqH23CCyQwTA2JJOXTZxr+nOfJKdI62p6MBSxc+SD5oJwHfFdDsTMKTd82PIf9ZrN 5iNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=112zj6PRaNXWgIVj94nd+tIs7m+rINcfBIyQEFXR0Pg=; b=Rsd1p1FPhke53qBqDI+7T4mNrAtG+KGHCd84ZrL8aGaNBIJGwwZYVeM5q4RzlR6FCW 50T4lrGCmHCF8UW7DSM9ANr1jPQTN2e0zw8X9wqS3xr5yOCfM67RWhM3Vwd6UDIUBxGR QSqkwEAeIW+nVkpEQ6NhFCUiSNSwhgTtf11/G9PiTPt8PUERYoU9J53tZIzXoiJB291O hM3bD9bZtuTmUQRx1ZACQiHefiBqcEcFZoXb6RYZnqN7OK5kqTHXRCE+M6L7F48L+0C8 38QesyIC8g55348OTCtwOGhIA73vAC3svRQ/qsaGGpZ0JhZSuDvG+5rgik1NlVOwQI+Z 0z0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Jp/kr+dn"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d64si19632086pgc.413.2019.02.20.12.03.10; Wed, 20 Feb 2019 12:03:26 -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; dkim=pass header.i=@google.com header.s=20161025 header.b="Jp/kr+dn"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726423AbfBTUCn (ORCPT + 99 others); Wed, 20 Feb 2019 15:02:43 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:38088 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725834AbfBTUCm (ORCPT ); Wed, 20 Feb 2019 15:02:42 -0500 Received: by mail-pg1-f196.google.com with SMTP id m2so10162889pgl.5 for ; Wed, 20 Feb 2019 12:02:42 -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=112zj6PRaNXWgIVj94nd+tIs7m+rINcfBIyQEFXR0Pg=; b=Jp/kr+dnK71oGHB9Tx0lEr3BSYMspX+z9Nh9j/nldJotDy7CDUx9stfQh4XrKNEArF uAQjHt9fcb7qSNAyP1+MaQWx+EoCX0r7l/9pwGKk+B0mjlGMJpB2L0zqfrtYCY5Ryc0h /nRHbHEG5UF5WoOjXwp7bI1mdFY8OZc4J+o5q7q6gLo9dhWxGBGqXEvaCfZtcCWVNftv E3v2m8DuUE6sCfb7zU4FVjnQqlMsU/7kPmEpy+Za6wxcckNc7KjnprrT/77OTloX/MsV 4AGXOvVi7l/viGkRi3LitvXeAaWtQCR24usoAWYJxqHHAx4Z8ITZFUVS+1YhelkY0plt o5ag== 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=112zj6PRaNXWgIVj94nd+tIs7m+rINcfBIyQEFXR0Pg=; b=WKnF3IPuc5517EEnpR0fR0jvL2A58MO0KLVi+s4pimDAp6EGcsN4g+ewjrMkC/kwgF 9vZ1fkSifcyaHEZJNQHJtAQaDSgSdIYhsYLhezJMmVsfpnVkqCXntp0fU8uk+FFmqdHt ds7mzl0oGWhTMg5io5foYwJeDl1xvruBrzNT5VbJFVhdXkNjt16cFb/jSO23Xw52u/vr SJ31SoF7MkI6p1H8hBWLJt1A+HAx1fskBErmavetxCPI5c3yCCpOx/NTp2U/ltsfK6Wm kGg8heuVspznzw/GJ4VjIJJFkryWVnZnLRLC6mnT0jjPIKQQb7zYPaR3scCtgBmSs94F ORKQ== X-Gm-Message-State: AHQUAua4CuAo+/Q32ENRzM3o2ftxrmHgWX0uF40PUSh/2pdcPL+Gn46g A+LR/O8yOo8gaOjh9HXLqzmZeQhXmXwSI6AX3ZQb9w== X-Received: by 2002:a63:fe58:: with SMTP id x24mr30887173pgj.255.1550692961511; Wed, 20 Feb 2019 12:02:41 -0800 (PST) MIME-Version: 1.0 References: <20190219214940.391081-1-arnd@arndb.de> <20190220184408.GG9878@sirena.org.uk> In-Reply-To: <20190220184408.GG9878@sirena.org.uk> From: Nick Desaulniers Date: Wed, 20 Feb 2019 12:02:30 -0800 Message-ID: Subject: Re: [PATCH] kasan: turn off asan-stack for clang-8 and earlier To: Mark Brown , Kostya Serebryany , Evgenii Stepanov Cc: Arnd Bergmann , Andrey Ryabinin , Andrey Konovalov , Masahiro Yamada , Michal Marek , Andrew Morton , Dmitry Vyukov , Qian Cai , Alexander Potapenko , Martin Schwidefsky , Christoph Lameter , LKML , Linux Kbuild mailing list , kasan-dev Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 20, 2019 at 10:44 AM Mark Brown wrote: > > On Wed, Feb 20, 2019 at 10:07:36AM -0800, Nick Desaulniers wrote: > > > I like Evgenii's idea: > > https://bugs.llvm.org/show_bug.cgi?id=38809#c10 > > That's a suggestion to tune the inlining heuristics. Yes; but it will also improve KASAN (if feasible). > > While I myself share Arnd's goal of driving compiler warnings to zero, > > in general I'd prefer not to disable warning-producing-features or > > disable warnings outright for cases where we have some ideas of > > changes we can make to the compiler. There's probably a list now of > > false warnings produced by old versions of Clang from bugs in Clang > > that we fixed. I'm not interested in additionally trying to work > > around those somehow in kernel sources. > > We do have infrastructure in the kernel for managing warnings based on > compiler version (Arnd was looking at some improvements to that IIRC), > if we've got a kernel that builds with a given compiler it's worth > looking at tuning what we do with that compiler. If newer versions of > the compiler work better or have new options we can turn things on for > them. so maybe something like (pseudocode): if kasan && clang && clang_version < 9: disable -Wframe-larger-than= If you overrun the stack with KASAN, a warning would be nice, but you'll hopefully find out the hard way at runtime. And that doesn't require up to 114 Makefile changes, which would be kind of obnoxious for this papercut. > > > Qian previously pointed out that most drivers don't produce this > > warning under KASAN+Clang. While 114 is a lot, what are the chances > > that someone NEEDS a KASAN+Clang build to compile warning free and > > happen to include one of these problematic drivers? And if there is a > > chance they do observe the warning, are we doing a disservice by > > disabling the feature (-asan-stack=1) outright for the whole kernel, > > or disabling the warning (`-Wstack-frame-larger-than=`) which can flag > > issues unrelated to KASAN? > > People doing treewide work and subsystem maintainers are a reasonably > important target for this sort of thing - for example people looking at > the kernelci output. It's a lot easier to pay attention to problems if > you don't have to wade through large numbers of false positives. Good point. Current reports are a flood of -Wframe-larger-than= because of KASAN (we've fixed just about everything else), and I have to pick out what's new from that sea of false positives. I would hate for these warnings from KASAN to be the last thing before people start taking clang builds seriously due to false positive warnings. -- Thanks, ~Nick Desaulniers