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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 143DAC7EE22 for ; Tue, 9 May 2023 03:56:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234602AbjEID4I (ORCPT ); Mon, 8 May 2023 23:56:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234531AbjEIDzv (ORCPT ); Mon, 8 May 2023 23:55:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EE2DD2D6; Mon, 8 May 2023 20:55:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 870BD62401; Tue, 9 May 2023 03:55:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9292C43443; Tue, 9 May 2023 03:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683604519; bh=FeEPuL62SD/ceTdy1AZqZeZrGvNE+W6iSSHqrcpuhdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OhJSQT2MVsMODcgKmZm3eXaO3m06LFE72mdzX/Zb9R28CHWG7mHNsLan02Z03oFND p4i+PAwh3q0Re1S+KQGPNottImrfarMe3RdGQxtH3yQXm1CUJsU3oqAHRpgm+aTCBB hCJ8SufK0gtviNc/Pcf85a+gMOueoRzhUuUlO+FZEURK5CL/R2VSxx1w6gJTZLYGY6 nep3geF4Gaz1Y1USNBhXweO26vYZKW6H0zH3U1wdpyVDMHrMBc/UldlR9iHtzhe6t8 8ikJhD7wqOHw0OX/vdi2p6fhCxc+4BkCwvU+Ngb0socWp1hSlNRhi0UViYsQhZvmhf PUhkvD+Y6CQQA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexandre Ghiti , Ard Biesheuvel , Atish Patra , Palmer Dabbelt , Sasha Levin , paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org Subject: [PATCH AUTOSEL 6.2 3/6] riscv: Fix EFI stub usage of KASAN instrumented strcmp function Date: Mon, 8 May 2023 23:55:09 -0400 Message-Id: <20230509035515.59855-3-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230509035515.59855-1-sashal@kernel.org> References: <20230509035515.59855-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Alexandre Ghiti [ Upstream commit 617955ca6e275c4dd0dcf5316fca7fc04a8f2fe6 ] The EFI stub must not use any KASAN instrumented code as the kernel proper did not initialize the thread pointer and the mapping for the KASAN shadow region. Avoid using the generic strcmp function, instead use the one in drivers/firmware/efi/libstub/string.c. Signed-off-by: Alexandre Ghiti Acked-by: Ard Biesheuvel Reviewed-by: Atish Patra Link: https://lore.kernel.org/r/20230203075232.274282-5-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt Signed-off-by: Sasha Levin --- arch/riscv/kernel/image-vars.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/riscv/kernel/image-vars.h b/arch/riscv/kernel/image-vars.h index 7e2962ef73f92..15616155008cc 100644 --- a/arch/riscv/kernel/image-vars.h +++ b/arch/riscv/kernel/image-vars.h @@ -23,8 +23,6 @@ * linked at. The routines below are all implemented in assembler in a * position independent manner */ -__efistub_strcmp = strcmp; - __efistub__start = _start; __efistub__start_kernel = _start_kernel; __efistub__end = _end; -- 2.39.2