Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7298048ybi; Mon, 22 Jul 2019 10:31:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqybDcRxZR8zJVk6Nn6Mjw2jWjIVjSEIV6c2w8R/qJQxRGPRp6ekpNJ2l0+NQA+pSujsCN8r X-Received: by 2002:a17:90a:2190:: with SMTP id q16mr75705682pjc.23.1563816706338; Mon, 22 Jul 2019 10:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563816706; cv=none; d=google.com; s=arc-20160816; b=InAEO1K0IES3/mETq+KeKneAgAQzkQZKaT4jptbqV9MFnzcxyAYicppf2c4oPh1z4+ memdsgzL+vB3XjWfwUP8ZeajVwIhlFojAoUXQ+wdo3zg5sNj20+6hz6YCdnVOd3RKKfX ThD7cqw7gXzIyFkZkG0lSAYKXVoTw+Am99xztrVDn8QOWyoisR1OpjKMGMPOpooHXS9m 23WEp6OkqVQwPTCsB14QGU6HcTbRJFmQd9n5HW8zChls6bRq8u7XyJwePIB2JvFdrz1X 5yvXjhPO3lpSlVNvnY8xcyRdPfZw8w+eMlVbcX4/bUMHoiuxenITmBD0jL2evKUwFyPq U4tQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=uNIXtMoWHaULzjujraJ7oGg3HCXmRUXf1Hrg+5gPseg=; b=f/oJboO28JnHtqDd9lILHQ8JEw5hNkFoJcknnJzpIcrHT3U+kF9qcTxVOniVhTGIFE 9UAkJ6ZH6xYYJQTP74Jh8U0QkCVIp9kBbmkwHANY2G58TwV/mj0GjMN1VnxoRHUY54n8 KP6+lH2uacktZNMt2TTLkdQOZZiWs/OUk4u2OIzSTFfjLiHML4uTEYKwHzEWLRTW6Eep mQjiDGn5xZdrLlGXEkVFkqn75Uk7W2vC1YhdSn/p3e9drdJdW6Qqk4nNyDFxO9dd4hr/ VNZpJAO6lUUWjuqHOSrcAFsQ95LaOYyUTZrgxsZQzKlJH+KCBm1DIwjDUfwbcvbMvYzM kFQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Yy0am124; 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 j66si8460161plb.375.2019.07.22.10.31.30; Mon, 22 Jul 2019 10:31:46 -0700 (PDT) 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=Yy0am124; 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 S1728798AbfGVPXo (ORCPT + 99 others); Mon, 22 Jul 2019 11:23:44 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:33333 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728115AbfGVPXn (ORCPT ); Mon, 22 Jul 2019 11:23:43 -0400 Received: by mail-wr1-f66.google.com with SMTP id n9so39939336wru.0 for ; Mon, 22 Jul 2019 08:23:41 -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:content-transfer-encoding; bh=uNIXtMoWHaULzjujraJ7oGg3HCXmRUXf1Hrg+5gPseg=; b=Yy0am124r9rOBj+kg/aTljeUfCtQ4wcSIbHJjqJalwkmicDObwQ/YjVsDhv3CjNRsw XzngO8FH+3mjssmlknvKnaNiq6lUk8XBHDkyw4vjcCZ650BdJn5b0b1lnXQMh/lmJCpA YtFG4I+MH6TlE9DPz70y5vKVrNXLN4sKzFb+C/aRPAwAm8OQWUB3EeaFPLDWITfKYL/H uEIDU01tHxYtFak5OWPbRv2gqP0RlWUaS200C489PN4bSRYeObWs4uPIdBQD+1l9u0CP bu4Bkz3oHYWLaEalTpJmMBvzPkpCihkXPLFu0UAXggsxQDcbxhy5c54bKxMLp/s0Ye9X LhoQ== 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:content-transfer-encoding; bh=uNIXtMoWHaULzjujraJ7oGg3HCXmRUXf1Hrg+5gPseg=; b=CVUWqWbx2JvAjJXtcWbiPwUodAg/VOFk0gfcFDE4RwtTTrdd+AxARkH2WiO6zarVMN hicqxXHxwQNZcALoMTnuabJ8pArgVrA2Il5KdfKc1OHdGCL5jDlyewD4Aa0ytDh0g2xg Askwv/b8cIEstweJVMpY0cD1d2dggOWGtmJMNkPJcIA3y5A8Dv9iE3xv9+LzAo+TllsJ ZKrDTXQLunbTXSK6O+WLAUFldO/stpg4qAmC6stibMnSazTwJ5tFnPnDx6/UXh1QqG4/ dK0OJjGJ1MEwWU6tmKHr0fINjTU9nQVmD/Phvt8a9E8IbbRTYWxNIwG2DYtiv5ge/N6J nVnA== X-Gm-Message-State: APjAAAUChSS7RAbYiXu2n8eT3/5Bp63kEjekwCfzvamEplGvEW3AIt78 fkp2EqKltruA59kt1QCa7ZgIwQGt/eBhT1zs7OOe3g== X-Received: by 2002:a5d:5388:: with SMTP id d8mr75033157wrv.299.1563809020856; Mon, 22 Jul 2019 08:23:40 -0700 (PDT) MIME-Version: 1.0 References: <20190722114134.3123901-1-arnd@arndb.de> In-Reply-To: From: Alexander Potapenko Date: Mon, 22 Jul 2019 17:23:28 +0200 Message-ID: Subject: Re: [PATCH] [RESEND v2] structleak: disable STRUCTLEAK_BYREF in combination with KASAN_STACK To: Arnd Bergmann Cc: Dmitriy Vyukov , Marco Elver , Andrew Morton , James Morris , "Serge E. Hallyn" , Kees Cook , Ard Biesheuvel , Masahiro Yamada , linux-security-module , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 22, 2019 at 4:26 PM Arnd Bergmann wrote: > > On Mon, Jul 22, 2019 at 3:43 PM Alexander Potapenko w= rote: > > On Mon, Jul 22, 2019 at 1:41 PM Arnd Bergmann wrote: > > > > > > KASAN_STACK is currently implied by KASAN on gcc, but could be made a > > > user selectable option if we want to allow combining (non-stack) KASA= N > > > with GCC_PLUGIN_STRUCTLEAK_BYREF. > > > > > > Note that it would be possible to specifically address the files that > > > print the warning, but presumably the overall stack usage is still > > > significantly higher than in other configurations, so this would not > > > address the full problem. > > > > > > I could not test this with CONFIG_INIT_STACK_ALL, which may or may no= t > > > suffer from a similar problem. > > We would love to be able to run KASAN together with > > CONFIG_INIT_STACK_ALL on syzbot, as this will potentially reduce the > > number of flaky errors. > > Doesn't that just limit the usefulness of KASAN, as you no longer catch > actual accesses to unintialized variables that KASAN is designed to find? KASAN (unlike KMSAN) doesn't detect accesses to uninitialized variables. It can of course detect bugs induced by e.g. treating an uninitialized variable as a pointer or an array index. Depending on the pattern used to initialize those variables, this can indeed mask some bugs, but OTOH others will become more reproducible. I'm not really sure KASAN+CONFIG_INIT_STACK_ALL is a problem right now, will need to take a look. > > Given that we already increase the stack size in KASAN builds, how big > > of a problem are these warnings? > > Perhaps it's better to disable them in this configuration, or push the = limit up? > > I'm really hoping to lower the per-function limit for 'allmodconfig' buil= ds, > since both a high limit and lots of bogus warnings prevent us from > noticing any newly introduced functions that use a lot of kernel stack > without KASAN. > > An allmodconfig build (and ideally also any randconfig build) should alwa= ys > complete without warnings to be useful for compile testing. > > Arnd --=20 Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg