From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2ED33C04AAB for ; Mon, 6 May 2019 15:42:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE5D12087F for ; Mon, 6 May 2019 15:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557157326; bh=+YHeFNqCK/5U0tlr+IeuSEUFN3ecIaKPcoM27J6rAhw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=fkwMkno/4EVtsw6ZEIs6+CIF/0Q3RpO5eVUMusq/5SFl9Vsah1pZlVRdZRM0VsGmZ 40BhpoSBONbCw3IARlrO583t/Hn33hRJA/Uz9rWU9KTjMjGh2HO/jf5BMlGFuUR+zu lVlm2wqwnb1D0aSh4OaW7MjXnHonjF3PRnkXxBBs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726871AbfEFPmF (ORCPT ); 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