From patchwork Wed Oct 14 10:59:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ahmad Fatoum X-Patchwork-Id: 11837501 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6D9514B3 for ; Wed, 14 Oct 2020 11:01:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D465208B3 for ; Wed, 14 Oct 2020 11:01:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PyU/gLco" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D465208B3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RZD3FdfmHGxzhFXFFw3ZcrP8fo/Ri1+v3nua1Y68IX4=; b=PyU/gLcom8qR4BP3/k7k3DwoI 1TDCx74ssOVKf57wk13N4fly0giyOQIeYF7Aofa6kFTr87BIvVpkQ3k8L0AyeeX1xuPdXo89Gvvgw qaUlPdJryJ7j5q9GSRtV+6fM1JXTSct41UkemD5miwM9/ORqurtVGOVwLh0daJLOkjWUU5i33lsFV qKThRXD94uFoVJ7t3rzeV8OXlwpq4K++v57bIa3SMS183I5Dq99kNLElo6eFM361oLSjXGwxk6if6 YTKfWQbUM8Af+Hdl9YZUUcpeRvMg/uj9hJ3TpU1cSWLHBaDmT/Lkzw86LD0dlQr7pL1M+p7c6uSfb gOdWl8J0A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSeWT-0004Eb-2D; Wed, 14 Oct 2020 11:00:45 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSeWQ-0004Df-Tr for linux-arm-kernel@lists.infradead.org; Wed, 14 Oct 2020 11:00:43 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kSeWI-0005e1-4v; Wed, 14 Oct 2020 13:00:34 +0200 Received: from afa by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1kSeWD-0000ZY-RO; Wed, 14 Oct 2020 13:00:29 +0200 From: Ahmad Fatoum To: linus.walleij@linaro.org Subject: [PATCH] fixup! ARM: Replace string mem* functions for KASan Date: Wed, 14 Oct 2020 12:59:59 +0200 Message-Id: <20201014105958.21027-1-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012215701.123389-3-linus.walleij@linaro.org> References: <20201012215701.123389-3-linus.walleij@linaro.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: afa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201014_070043_000634_F633EC18 X-CRM114-Status: GOOD ( 12.17 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: f.fainelli@gmail.com, Ahmad Fatoum , arnd@arndb.de, liuwenliang@huawei.com, linux@armlinux.org.uk, kasan-dev@googlegroups.com, rppt@linux.ibm.com, glider@google.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, aryabinin@virtuozzo.com, ardb@kernel.org, dvyukov@google.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org CONFIG_FORTIFY_SOURCE doesn't play nicely for files that are compiled with CONFIG_KASAN=y, but have sanitization disabled. This happens despite 47227d27e2fc ("string.h: fix incompatibility between FORTIFY_SOURCE and KASAN"). For now, do what ARM64 is already doing and disable FORTIFY_SOURCE for such files. Signed-off-by: Ahmad Fatoum --- CONFIG_FORTIFY_SOURCE kernel on i.MX6Q hangs indefinitely in a memcpy inside the very first printk without this patch. With this patch squashed: Tested-by: Ahmad Fatoum --- arch/arm/include/asm/string.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/include/asm/string.h b/arch/arm/include/asm/string.h index 947f93037d87..6c607c68f3ad 100644 --- a/arch/arm/include/asm/string.h +++ b/arch/arm/include/asm/string.h @@ -58,6 +58,11 @@ static inline void *memset64(uint64_t *p, uint64_t v, __kernel_size_t n) #define memcpy(dst, src, len) __memcpy(dst, src, len) #define memmove(dst, src, len) __memmove(dst, src, len) #define memset(s, c, n) __memset(s, c, n) + +#ifndef __NO_FORTIFY +#define __NO_FORTIFY /* FORTIFY_SOURCE uses __builtin_memcpy, etc. */ +#endif + #endif #endif