Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2604292yba; Mon, 6 May 2019 08:38:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXSTH+sG192Tc6Nuy4EdmJqcSokockr1si5llBQ/QY5gA/JvJHN9SBAF2fbbvOe+MFjtL3 X-Received: by 2002:a62:2051:: with SMTP id g78mr26939119pfg.125.1557157135242; Mon, 06 May 2019 08:38:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557157135; cv=none; d=google.com; s=arc-20160816; b=e/Fo09T6QH0VjByHHwQ4ukY9Oai/7JAZKeUk0MHBEShT0wd4x+FjZVGDNgGLFkbUF3 IobChEizYqPan4iJ4GIR+MqJoV4KWIVOZ+9I1NJ8HAAsw18P1AnP1vGKV8eGg3J9vOSW LNYJRL8JLn6ZxloxVfAf+StDoKsiyoWhpSfdJmWAVt4PP/5p/6lXBZwFW4ILVNAYIj6C pGcEH9XB3cuKz7oww/b6ChiB7MYfJY13XHE2p+wLuhBcoqmSnBHn2yl97pHz3WVkNOvs ZG86QZsbQLDrGF+IJ2ojlno2B5azZvkbZJIt9ym5cCtyNHv4ZiylPfrtPI3TqEHJoDaQ HoGQ== 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=Boq4YwRsKaYS40nEqXavl+1g5CVRTqlw/4JvJObUiV0=; b=0Lmf2sj0I/yTDbH50Ye7qDOJq1JzxFeiOiEJYg7BNpax6JRRlrSZYtqQPKhjZfyjsR bE5s6ORAItblZs1DFIRIMo8Gv3yRvFt9j0yd1VEtxkRWCnpte3oamKid3nnzac/i2bnH uWuMA+5SMT50Y0mBXOdVdJrk3+mCgqFlblKMuRjK9nO6sNyRITKz0w70qkSnBOCP0eDD UGkzOtF17H5m7lF3lqRUi2tE3FK947UP0+TiLIgskOZdCnWCVX4I652YGela3AyBSPzP WQM8B/G2lyfr9y7JW0lKNc/VSq2rFUqWSqo8U6FggcnWWK2AYPxWxdu2V3xHvUUossuK yyXg== 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 cd16si16723437plb.336.2019.05.06.08.38.38; Mon, 06 May 2019 08:38:55 -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; 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 S1726521AbfEFPgZ (ORCPT + 99 others); Mon, 6 May 2019 11:36:25 -0400 Received: from relay.sw.ru ([185.231.240.75]:36242 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbfEFPgZ (ORCPT ); Mon, 6 May 2019 11:36:25 -0400 Received: from [172.16.25.12] by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1hNff9-0004Zp-Q9; Mon, 06 May 2019 18:36:19 +0300 Subject: Re: [PATCH 4.9 09/62] kasan: turn on -fsanitize-address-use-after-scope To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Dmitry Vyukov , Alexander Potapenko , Andrey Konovalov , Andrew Morton , Linus Torvalds References: <20190506143051.102535767@linuxfoundation.org> <20190506143051.888762392@linuxfoundation.org> <6636d7cf-03fe-e253-f981-e07d75858b33@virtuozzo.com> <20190506151026.GA12193@kroah.com> From: Andrey Ryabinin Message-ID: Date: Mon, 6 May 2019 18:36:45 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190506151026.GA12193@kroah.com> 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 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.") 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.