Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4186463ooa; Tue, 14 Aug 2018 02:20:29 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyoFhh+OzQ8VpunnsRATPk6VVD6cNAJCCCktkp8VPlNDKyrAYvWYvhdmJSomNy4YFpfZNtn X-Received: by 2002:a63:2c8e:: with SMTP id s136-v6mr19882783pgs.390.1534238429462; Tue, 14 Aug 2018 02:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534238429; cv=none; d=google.com; s=arc-20160816; b=I694lWPv+FNYLl7gP4v2tU0e0D/AwCjpo5BDT7rgG2LdOIJPoMKDvGbeu0pkMTRB3u Iv5R7dpHtP6OQES5t9CmxBgE2gKrp9PNgOO5DsY69A9OzgqxQwPuQRPNRUIlIGTP5hH5 Pes49aW8neXUNSYRRgVbZOonqLLgWHuX+E9P/xtUdcn85p+niqcJaQtRSvnL9QrERGUW VDXleWema74I2GUehgqXtLv++p1XUrRNAE8E3HAGyKWIoMyhwsPecEtPyV3ABOBquuXY dFOgRc+UTzqVaurHA1E3dd+Imrvjm5lulkeEbzQIf90Y/N1yGQo7aHJalszDkxb9pB7q FxQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=z5TIbTueCe7RhGzKCFbSLeYUkznaUJKDMTMVjsiszWw=; b=UBECnw+ajUJlXIV7LlHFc1LXvjUeJcnpm1GeboMS/rrZwiGLkWqVc0yJcUr0NANFDi awh1t0dmdVV5wgTZ03exOp+hDcD50NR90w61KjGucT6tFG4gsrfa2hw7ZL/QvhijJOP1 woABC/rv+Mhmc70yd8S8EPkk94yZ15mTaTSEiCM9993jyKT/+n11on1KxUzVZ8JCjMFk kKFrXW69dHWnd/jWwdmifsls0dEP1lwJ3DcwcAq/RnMNpBj++PIF89agIyF+GoAbe7sd bCE2tkkqcEHTBm2zK0EHdw0CGiXOofTEGuVmXqzJ+TBJSWDzCBiHn6KFt3ekZ8d7Q0UA R5gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=d5dMlNp6; 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=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 l26-v6si20240602pfj.188.2018.08.14.02.20.14; Tue, 14 Aug 2018 02:20:29 -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=@virtuozzo.com header.s=selector1 header.b=d5dMlNp6; 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=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731917AbeHNMEw (ORCPT + 99 others); Tue, 14 Aug 2018 08:04:52 -0400 Received: from mail-eopbgr50119.outbound.protection.outlook.com ([40.107.5.119]:32576 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728101AbeHNMEv (ORCPT ); Tue, 14 Aug 2018 08:04:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z5TIbTueCe7RhGzKCFbSLeYUkznaUJKDMTMVjsiszWw=; b=d5dMlNp6s2tldAKXgfeavFzJx/u80F6t7OLTQB7nDoK+JpH1LNvQ81Djz3wsVFYWprBe9RQl9hD7ZNVqVwqhszoNwvKjoH59JJHP5YF2z+rWhcCddyAMgrngvwU4jVjuJv/tOxWtbseFCmer0pLDkGuh5e++qF7q1iwtXhCwQ7s= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aryabinin@virtuozzo.com; Received: from [172.16.25.12] (185.231.240.5) by AM0PR08MB3249.eurprd08.prod.outlook.com (2603:10a6:208:5e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.20; Tue, 14 Aug 2018 09:18:26 +0000 Subject: Re: [PATCH] arm64: lib: use c string functions for KASAN support To: Kyeongdon Kim , catalin.marinas@arm.com, glider@google.com, dvyukov@google.com Cc: will.deacon@arm.com, Jason@zx2c4.com, gregkh@linuxfoundation.org, mingo@kernel.org, peterz@infradead.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <1534233322-106271-1-git-send-email-kyeongdon.kim@lge.com> From: Andrey Ryabinin Message-ID: Date: Tue, 14 Aug 2018 12:18:32 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1534233322-106271-1-git-send-email-kyeongdon.kim@lge.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1P18901CA0007.EURP189.PROD.OUTLOOK.COM (2603:10a6:801::17) To AM0PR08MB3249.eurprd08.prod.outlook.com (2603:10a6:208:5e::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6c2075d4-ec0d-418a-775f-08d601c6e51c X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:AM0PR08MB3249; X-Microsoft-Exchange-Diagnostics: 1;AM0PR08MB3249;3:BLSwe5EGGpnzvsVWzBcjgNtawRo0+V7GQDPeqz556fTqt45ELBOnODSkhmmmwxid6UamQy/zfK4IrguKWq+C+Bn2SC27G97gNJ62d7eUeiSR/6r/Kp2HlscH0BzmEBCobe8RNYN25+XSrmkliXQcprv38iwW5d9EZ+ns6oSxHsJ7hnxF+BsbrFknmfWxeljooOSXPgqi0KzGxv91vkcJ5v5/lrebw5LbdZNEpVuwOuRHTz9WUdb9P/KcsX/Wc0wW;25:IJ/o6A3azeV3gfmzMAnQENiJaZIKmsUQ03oF6w0UQWe0cvUNqW2RoHnVdtTxqsVZk/Ei23MOkgPBSuMTMGLGXRuo9kwYRmSHrPiFCvuv2pQn8Ipu+Ce2QEyN1I20Jzynl+lt6rOOjkHh6m+BFK8j1C7PG3uEM/sdz2YFXAH0E62Hknp7HpzPEQjwV38ujRnCO7U0c3UH3EYc00hJcF+xJSpfHF2SuQd8n/1tqrCrm839sHWLWQOygxqTuMStKsMrdTxvXuPVn8d4X5pk9+QgSknCy3AoFovJTkgdvdVF7UwgxT6j+/25LA9P3D+4lCaSxERlUMe19KAoQ9X1kZ5VJg==;31:Q6qbX9gDNV8HSXC0BvVNwXCS/C50m/Y8+FD6N0Th8nyXyJmwdbpMVv3ajt8SNb1SDEy6mQBTBDkR1rbCdQxMtji5M4V+XHReAUYcQT0UBLSSV5mxzGYbDNd2LYeWPiik5lN4iToKp2UeftFOIaEj72EGSfzPpDSZVkW+PszVe2xpM5Eg+c2lYh0LAVqNhB4b+pUANtMnwVkFvdWtYpRrhIuIK/DueTfpjs7C6EqVsjI= X-MS-TrafficTypeDiagnostic: AM0PR08MB3249: X-Microsoft-Exchange-Diagnostics: 1;AM0PR08MB3249;20:Gi2xID5TNVpc1KNUhmRYna8De6HXwNwSjy3dEU7gcZePUOLgAeFCrS6H6LsPABFs+h546mDl/iD84KLljsWyaPkLMBoNBvDa0JY8dhh3IKEQ8XTDFz6bnhpQ1/nldmUb/0Cs30qHFSlHBo4StNyD8nykw6TWpbGM3SskK03kZtcPlzUj3+68y5s4xA54ewJJfKnWy0a5KGE6Y0f2apjZFdx1XcTL8g0iPfSCxN4jf8qH7lq592GqHBM3zcqs1NVKa1PjAFpyS1q5fvonko9CzRLiXSKoPxIGKDI9lI4/Zb3rwiqYLSNaOzN2ItubLurmQM4o7D2HB8Q3KR3sal/pngX73Xerm5513aI8YncB0tZ6FIB/V+ujau1LLdc/lDwpboaOQfTf/hT4xL5IdrNEaofGl2ALoDx6onDCvNsZkmjKNdAUPy1zDxjn+Oiaglui2gVH6RI/lv08X88W0Nohdq0qj8H4o7EzZfzH0VEuSW7N6jP+PYaShBkzQknRgnBb;4:iI0VbzScdmUbteW6iPuTbiiKiGrrW3w22apfjGEsU5P9XsfWBftROJXCQUragewIPttjSFcwqRtmJBsc5QxyxMpXQVkGafMi2VKaNE02DGxDgUKUihz2e9G8ZC+XwTQsFb6Yd9dW3u97WXk02SjJa1OhaYEyy0omLmswck35o0kDvZVTgCqBnNh1Jg4DBGyGKZ6IrITsVYSWi9L01VH2Eu/nNDgwgCZ+RVK0GbDkb5atOMjP21UmMzwQvicw+oHY6nDCMbyWGb9/gltVE9hdew== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:AM0PR08MB3249;BCL:0;PCL:0;RULEID:;SRVR:AM0PR08MB3249; X-Forefront-PRVS: 0764C4A8CD X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(39850400004)(396003)(136003)(346002)(366004)(376002)(199004)(189003)(77096007)(476003)(2616005)(5660300001)(11346002)(6666003)(65826007)(26005)(16526019)(186003)(7416002)(53546011)(386003)(446003)(956004)(47776003)(229853002)(486006)(31686004)(65956001)(65806001)(66066001)(106356001)(81166006)(81156014)(305945005)(105586002)(6116002)(3846002)(6486002)(8676002)(8936002)(97736004)(230700001)(7736002)(36756003)(6246003)(52146003)(2486003)(76176011)(14444005)(68736007)(16576012)(316002)(31696002)(58126008)(52116002)(4326008)(23676004)(50466002)(25786009)(64126003)(86362001)(2906002)(478600001)(53936002);DIR:OUT;SFP:1102;SCL:1;SRVR:AM0PR08MB3249;H:[172.16.25.12];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTBQUjA4TUIzMjQ5OzIzOjkyZVg1U3VvMm83WHdhcXZPL2FXSVN5VGRi?= =?utf-8?B?SkJsck1QS21KMmM2MWJBam1qVDFsMm9jbFJVbGJZdUQ1TXVrdVlSZzB1bGU1?= =?utf-8?B?MDIwTUQ2ZXdZYWcwbDJHS3E4Vy9mSFFnaE5QQjFIOGFPd0V6QVFrWjYyTlJJ?= =?utf-8?B?RnN0bUtrVWRETGF3N20rSWpVU2JDekxJckRzeGRJc080MWttb3QwVU1JOFQv?= =?utf-8?B?ZW1rM0diWVE0aVF0RHNiL2VMLzgvVlhmZ24zZlZYdmoxNm5XVU9CNVRPS21S?= =?utf-8?B?V2RpSHdaRE1Sa2xKR3ZTbFg3bzVodEprWEt0YVF5bXhOZG52MWY1R0YwSGRK?= =?utf-8?B?NDgxSnViRUxSZXFGT1lZNHRQOEhFaWxLZ2ZJSXZqUWhWZGxnWFYrMXhyaFkw?= =?utf-8?B?MlFVMlN2WDZiNnNocUtSc2xIRDloemhGczZ4K3hKRGFnRUd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hEIxtVCnGf4yUvvUnS0tgAJScv87kZynLyAUF7Td56ecjxw0QcObEY6ty/6w/tubHwlx4vv/OGXC1RX02uovxorzmsgpNU7RNpWgRw+wvaGCgO90F4o9ah9hXoM8QDas0= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2018 09:18:26.6941 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c2075d4-ec0d-418a-775f-08d601c6e51c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3249 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/14/2018 10:55 AM, Kyeongdon Kim wrote: > Assembly optimized string functions cannot detect KASan bug. > This might have been the intention of the original author. > (not too much important to catch) > > But, I found the obvious uaf problem in strcmp() function. > - in this case, using 32bit KASan patchset helps > > Since I used c string function, I believe I could find this bug. > After using the patch, can see the report & backtrace the below: > .. > > Signed-off-by: Kyeongdon Kim > --- > arch/arm64/include/asm/string.h | 2 ++ > arch/arm64/kernel/arm64ksyms.c | 2 ++ > arch/arm64/lib/Makefile | 8 +++++--- > 3 files changed, 9 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/include/asm/string.h b/arch/arm64/include/asm/string.h > index dd95d33..5c5219a 100644 > --- a/arch/arm64/include/asm/string.h > +++ b/arch/arm64/include/asm/string.h > @@ -16,6 +16,7 @@ > #ifndef __ASM_STRING_H > #define __ASM_STRING_H > > +#if !defined(CONFIG_KASAN) > #define __HAVE_ARCH_STRRCHR > extern char *strrchr(const char *, int c); > > @@ -33,6 +34,7 @@ extern __kernel_size_t strlen(const char *); > > #define __HAVE_ARCH_STRNLEN > extern __kernel_size_t strnlen(const char *, __kernel_size_t); > +#endif > > #define __HAVE_ARCH_MEMCPY > extern void *memcpy(void *, const void *, __kernel_size_t); > diff --git a/arch/arm64/kernel/arm64ksyms.c b/arch/arm64/kernel/arm64ksyms.c > index d894a20..eb9bf20 100644 > --- a/arch/arm64/kernel/arm64ksyms.c > +++ b/arch/arm64/kernel/arm64ksyms.c > @@ -44,12 +44,14 @@ EXPORT_SYMBOL(__arch_copy_in_user); > EXPORT_SYMBOL(memstart_addr); > > /* string / mem functions */ > +#if !defined(CONFIG_KASAN) > EXPORT_SYMBOL(strchr); > EXPORT_SYMBOL(strrchr); > EXPORT_SYMBOL(strcmp); > EXPORT_SYMBOL(strncmp); > EXPORT_SYMBOL(strlen); > EXPORT_SYMBOL(strnlen); > +#endif > EXPORT_SYMBOL(memset); > EXPORT_SYMBOL(memcpy); > EXPORT_SYMBOL(memmove); > diff --git a/arch/arm64/lib/Makefile b/arch/arm64/lib/Makefile > index 68755fd..aa2d457 100644 > --- a/arch/arm64/lib/Makefile > +++ b/arch/arm64/lib/Makefile > @@ -2,9 +2,11 @@ > lib-y := clear_user.o delay.o copy_from_user.o \ > copy_to_user.o copy_in_user.o copy_page.o \ > clear_page.o memchr.o memcpy.o memmove.o memset.o \ > - memcmp.o strcmp.o strncmp.o strlen.o strnlen.o \ > - strchr.o strrchr.o tishift.o > - > + memcmp.o tishift.o > +ifndef CONFIG_KASAN > +lib-y := strcmp.o strncmp.o strlen.o strnlen.o \ > + strchr.o strrchr.o > +endif I think, this won't even compile. EFI needs some of these functions, and it can't use instrumented and not position independent variants. The easiest solution I see, is to not exclude these sting functions, but declare them as weak. In that case, EFI stub should pick up assembly variant and the kernel will use the C one.