Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754129AbdLDQLm (ORCPT ); Mon, 4 Dec 2017 11:11:42 -0500 Received: from mail-ve1eur01on0091.outbound.protection.outlook.com ([104.47.1.91]:61856 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751033AbdLDQLe (ORCPT ); Mon, 4 Dec 2017 11:11:34 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aryabinin@virtuozzo.com; Subject: Re: [PATCH v3 2/5] kasan/Makefile: Support LLVM style asan parameters. To: Paul Lawrence , Alexander Potapenko , Dmitry Vyukov , Masahiro Yamada Cc: linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kbuild@vger.kernel.org, Matthias Kaehlcke , Michael Davidson , Greg Hackmann References: <20171201213643.2506-1-paullawrence@google.com> <20171201213643.2506-3-paullawrence@google.com> From: Andrey Ryabinin Message-ID: <33f13b1a-494c-67d5-a470-294867c06f9a@virtuozzo.com> Date: Mon, 4 Dec 2017 19:14:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171201213643.2506-3-paullawrence@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: VI1PR08CA0213.eurprd08.prod.outlook.com (2603:10a6:802:15::22) To DB6PR08MB2821.eurprd08.prod.outlook.com (2603:10a6:6:1d::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a2a20935-d941-4940-af99-08d53b31aa5a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603286);SRVR:DB6PR08MB2821; X-Microsoft-Exchange-Diagnostics: 1;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/XK7Z82GQ6iZM8CSkppWkymhnfiGik+Xvq17JDODUr4vDkRNHcFpOHhoYvvm0OTTVfaQL8HkkIssasl3rpsWC4QsT+GdvZPVizM9umObjPUOf5O0lHfO8yVJVdz5AZMduDyRRac/7X/lguD7EMRqXXfcieqRIlrItI+1M0t2EdKiNBweZvKDGQnYZlj9p3jEKVGL8XunsacNgiQ9d3ziiAijotItQNv6JAEXpSrU0hp/oNzDvfPS6zyikA9ohX47OU7eU7AfCACzaGuaqXnhw01H630=;4:XNxGsQkbKbQfX8tOB5lb5cTBy2nKFxFOEpS8psLi6s66RF1wp+418xfVYMhTGundkmuzbRF5sBTRFzbWmxcj7C2CYKkFPj5DCsGYBozKQjWxWR2BQGUb9jqGkGCXGaxo3UajodfOPt8T7dcZ2tzHnlXbnTXiluCkIuvd1T0pCzfGDlNCBGiegvCTr1fG1tyESdNr1Ida9a3Qy9BQk+oBAm0COaII/C9gEyGujNAXUaqlgtynzOX9P9xt2YRyE6co8qnsZENFMvN/ErkTrAKIGw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231022)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(6072148)(201708071742011);SRVR:DB6PR08MB2821;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DB6PR08MB2821; X-Forefront-PRVS: 051158ECBB X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(6049001)(376002)(346002)(366004)(189002)(199003)(24454002)(478600001)(83506002)(53936002)(16576012)(4326008)(229853002)(101416001)(53546010)(25786009)(31696002)(8936002)(106356001)(65826007)(5660300001)(33646002)(86362001)(6246003)(64126003)(7416002)(36756003)(8676002)(2486003)(50466002)(97736004)(52116002)(230700001)(54356011)(16526018)(6666003)(76176011)(2950100002)(189998001)(23676004)(305945005)(7736002)(52146003)(55236003)(68736007)(3846002)(81156014)(81166006)(66066001)(316002)(6486002)(31686004)(110136005)(77096006)(2906002)(58126008)(47776003)(54906003)(65806001)(65956001)(105586002)(6116002);DIR:OUT;SFP:1102;SCL:1;SRVR:DB6PR08MB2821;H:[172.16.25.12];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjZQUjA4TUIyODIxOzIzOi8yYW9VUm5jQS9tem5nSDY1YW9tLy9NMXhI?= =?utf-8?B?VXhzUDVkVDcrRXpydFViSVRvTExaaitodWhhVlVXd2YwUFkrbXRxN1hndzZ3?= =?utf-8?B?WmZ0aENGMzNjYXQweWFraC9IOGJ3M2NJN0JMRlJuQTFkM0pxQ1lwRnVlMTNB?= =?utf-8?B?dFhWWlBGcjU4dFlkRXJTdHRNTDhSRm9EbFVvR2N4WDh0RmQ2T01zSFlaclFm?= =?utf-8?B?Q0hOQlhaVkxtME04Y2RPVk1qWVRSVVNPdTI1QUs0Ryt1TldnMFZkMVM1TkJj?= =?utf-8?B?Wjd0eCsrbjhwcXdVa29BSFRXR01FQkZIQmtwRy9taDVsSGNOUGh2NmRWWlVk?= =?utf-8?B?TGpnYWhpc3ZJWVhzV1hRV2lmd2VNenFXOWhHZHlXL1FoR0kxb2E3OEJlNkdn?= =?utf-8?B?TWVQZGE2V21TcXQ0ZGNhZ2xVV1E5UVoyaXJjTzNOYVNHU0tLM3pnVDl6bkVp?= =?utf-8?B?VjFXS0grMEw3b3hxSWdLdFEzVTMwY2d0a0pZMFlLUFFlSVg0QVRFS21DM2R2?= =?utf-8?B?OHpqQzFoMll5K3pzV2tMRG5MRVpvWTltc284TDFBQUNKeXhJWU00T0lMcnFB?= =?utf-8?B?VlIrM1p1ZFFrNldnc253bnoyVHNIV2ZiVWIrRk9ZUnZuRURMWlkxWThtaldT?= =?utf-8?B?Z3FXaDJBL0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C67dH0Tc2mYc+PvMrFCieAttTnoAQaZWEAE1I5IMi6p6YmNI5HPH10e4e7CVyCX5hfZJyGIZKb3IIa8NSZ1cErBfxC5dZFMNExFo=;7:CrbXf7mKNueMu0xa57YUq8rdUCr/t5W0TxMNP7KbBJOxzBqAiCyNoWKdoDrD2XWTD5nXYliQMrQYV2GPb9Cb7Wy31/fh4DOi/Sn5crPwE6XTznkns/5TZuTG/p2pqajU+Uji/gryiSjLwnKPD5ISnPzsai/l4FTu0Qfo6WAC9ubDey2yz3tgEF6R3SxBTTNcJf1BVPkYqCfDGUqiuMJ74lgZoFBD6bT1E628GmFxwGJ3wV3kyrPzlBXlKnKkYpsi SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DB6PR08MB2821;20:AM3TSx2H+bH/17tzWHY/hi92w40qkKIO7Yton+h/d9xKmyIcMMxFveZcA67b2POJXLqLanbBI8tMR/Zxukp8PioYPkzy/7F/n7pfGsd0r6dPnpgRs5msnr0Yjnw8iZ71yc1BRuy3WWrVqy5YXV5Jb+JkR6HI0ZoQzTd3ls0It6w= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2017 16:11:22.7643 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a2a20935-d941-4940-af99-08d53b31aa5a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2821 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1569 Lines: 46 On 12/02/2017 12:36 AM, Paul Lawrence wrote: > Missing: From: Andrey Ryabinin Please, don't change authorship of the patches. > LLVM doesn't understand GCC-style paramters ("--param asan-foo=bar"), > thus we currently we don't use inline/globals/stack instrumentation > when building the kernel with clang. > > Add support for LLVM-style parameters ("-mllvm -asan-foo=bar") to > enable all KASAN features. > > Signed-off-by: Andrey Ryabinin > --- > scripts/Makefile.kasan | 29 ++++++++++++++++++----------- > 1 file changed, 18 insertions(+), 11 deletions(-) > > diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan > index 1ce7115aa499..7c00be9216f4 100644 > --- a/scripts/Makefile.kasan > +++ b/scripts/Makefile.kasan > @@ -10,10 +10,7 @@ KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET) > > + # -fasan-shadow-offset fails without -fsanitize > + CFLAGS_KASAN_SHADOW := $(call cc-option, -fsanitize=kernel-address \ > + -fasan-shadow-offset=$(KASAN_SHADOW_OFFSET), \ > + $(call cc-option, -fsanitize=kernel-address \ > + -mllvm -asan-mapping-offset=$(KASAN_SHADOW_OFFSET))) > + > + ifeq ("$(CFLAGS_KASAN_SHADOW)"," ") This not how it was in my original patch. Why you changed this? Condition is always false now, so it breaks kasan with 4.9.x gcc. > + CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL) > + else > + # Now add all the compiler specific options that are valid standalone > + CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \ > + $(call cc-param,asan-globals=1) \