Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2608506yba; Mon, 6 May 2019 08:43:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLjcI+rR9jkCxWwBCfMuDfdkjPtw+BbCIrUwNMYUhE1fAREOWW3/GFMGqllnSftxfcwMQX X-Received: by 2002:a63:1e5b:: with SMTP id p27mr31919641pgm.213.1557157393827; Mon, 06 May 2019 08:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557157393; cv=none; d=google.com; s=arc-20160816; b=l0W2foFQo8YKlqNOBKk2l4tqoewAeRPKrs2GbSAjtncBaz6+rKCFPeUL0uDcucQs2A UbIVvw3dfKiGOveFu8Sq+4zC350eZFORhvN+osa9ggLguoJCwxnQvt9lM8XaOqbPM9Fi ZCWfLjlAya/4+OU4nW/o4wPcZehjDBuaoPBwff7D9hpBU6gWwTbA75jXdiW9C7Y6odP9 JolIQhQ16+fJeI8voMK0zomSFxdC4k3ea8rxoo7MmW1mRnHxCDWzGl+RZA6LPHXY7rmC 9VDIgZ7UOvzTKv4aIPexWm5j0r2fECw4yQO17u4WmZZ7U8+14FcJ8Hhd3zg2sPUzipqP cLsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=sWiwLp0claVgAzBg8Zvx67blklvtwm4mp2XbuvemYHg=; b=WpQsicJ/62PJo8qMiV24INKWo+HTrdkdB6unNFQlBOGIcVgrlEAm7DwqNvnQqQXrwf xidDgdL7HYeSaQl0aK/hcVqe98H1Neo7hAd+gi1/iU02sfEfzmVbADym9XTaQtygAF+C yDD1fcszSCEUCS00FfBmrWwV31+wYPYex9miiGGJ9KbcuQb26oX4TRjkWWOY+UPkLzjf 4DS4qebEhvsllNe34iwJbeUXxtYu6GmjXE60Kb3YhYS9bkT68oUUFXQ0bre4mT/kZgOr yAvOi2ZWlyN3Jx4mvJOmpakHO//m8nD1rhPkOhD5UAI2hJQ2okkg7Y6R5bqNGRv9akE0 DZPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Cx1qRw1H; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a85si15456967pfj.12.2019.05.06.08.42.58; Mon, 06 May 2019 08:43:13 -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=@kernel.org header.s=default header.b=Cx1qRw1H; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbfEFPmF (ORCPT + 99 others); Mon, 6 May 2019 11:42:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:55692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726413AbfEFPmE (ORCPT ); Mon, 6 May 2019 11:42:04 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ECAEB205C9; Mon, 6 May 2019 15:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557157323; bh=+YHeFNqCK/5U0tlr+IeuSEUFN3ecIaKPcoM27J6rAhw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Cx1qRw1HZDSbf4Ilvwj4EbMDs+rhawm/ZXJi75zdTrCCaCDN6AfuVvzjHn1Vce/En ep8clwz5pYSZfjSvJXEhqBXURT8BDeHmkiRkU9GluLLt1gabZ+237+jyjQCBq0H1iv 6aFdB3wivtAEk2wF1OPHBqJWHULfW6m2+QcN5228= Date: Mon, 6 May 2019 17:42:00 +0200 From: Greg Kroah-Hartman To: Andrey Ryabinin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Dmitry Vyukov , Alexander Potapenko , Andrey Konovalov , Andrew Morton , Linus Torvalds Subject: Re: [PATCH 4.9 09/62] kasan: turn on -fsanitize-address-use-after-scope Message-ID: <20190506154200.GA14919@kroah.com> References: <20190506143051.102535767@linuxfoundation.org> <20190506143051.888762392@linuxfoundation.org> <6636d7cf-03fe-e253-f981-e07d75858b33@virtuozzo.com> <20190506151026.GA12193@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 06, 2019 at 06:36:45PM +0300, Andrey Ryabinin wrote: > > > On 5/6/19 6:10 PM, Greg Kroah-Hartman wrote: > > On Mon, May 06, 2019 at 05:55:54PM +0300, Andrey Ryabinin wrote: > >> > >> > >> On 5/6/19 5:32 PM, Greg Kroah-Hartman wrote: > >>> From: Andrey Ryabinin > >>> > >>> commit c5caf21ab0cf884ef15b25af234f620e4a233139 upstream. > >>> > >>> In the upcoming gcc7 release, the -fsanitize=kernel-address option at > >>> first implied new -fsanitize-address-use-after-scope option. This would > >>> cause link errors on older kernels because they don't have two new > >>> functions required for use-after-scope support. Therefore, gcc7 changed > >>> default to -fno-sanitize-address-use-after-scope. > >>> > >>> Now the kernel has everything required for that feature since commit > >>> 828347f8f9a5 ("kasan: support use-after-scope detection"). So, to make it > >>> work, we just have to enable use-after-scope in CFLAGS. > >>> > >>> Link: http://lkml.kernel.org/r/1481207977-28654-1-git-send-email-aryabinin@virtuozzo.com > >>> Signed-off-by: Andrey Ryabinin > >>> Acked-by: Dmitry Vyukov > >>> Cc: Alexander Potapenko > >>> Cc: Andrey Konovalov > >>> Signed-off-by: Andrew Morton > >>> Signed-off-by: Linus Torvalds > >>> Signed-off-by: Andrey Konovalov > >>> Signed-off-by: Greg Kroah-Hartman > >>> > >>> --- > >>> scripts/Makefile.kasan | 2 ++ > >>> 1 file changed, 2 insertions(+) > >>> > >>> --- a/scripts/Makefile.kasan > >>> +++ b/scripts/Makefile.kasan > >>> @@ -29,6 +29,8 @@ else > >>> endif > >>> endif > >>> > >>> +CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope) > >>> + > >>> CFLAGS_KASAN_NOSANITIZE := -fno-builtin > >>> > >>> endif > >>> > >>> > >> > >> This shouldn't be in the -stable. > > > > Why not? Does no one use gcc7 with this kernel and kasan? > > > > You don't need this patch to use kasan on this kernel with gcc7. > This patch only enables detection of use-after-scope bugs. This feature appeared to be useless, > hence it disabled recently by commit 7771bdbbfd3d ("kasan: remove use after scope bugs detection.") Ah, didn't notice that, nice! Ok, I'll go drop this, thanks for letting me know. > The link errors mentioned in changelog was the problem only for some period of time in the development branch of GCC 7. > The released GCC7 version doesn't have this problem. Also good to know, thanks! greg k-h