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 72BB3C001B0 for ; Wed, 26 Jul 2023 16:34:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbjGZQeA (ORCPT ); Wed, 26 Jul 2023 12:34:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjGZQd6 (ORCPT ); Wed, 26 Jul 2023 12:33:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 194BC2707 for ; Wed, 26 Jul 2023 09:33:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A9C2961BBD for ; Wed, 26 Jul 2023 16:33:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57627C433C7; Wed, 26 Jul 2023 16:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690389235; bh=qu98mFypzryfpNaKpoZ+to2I3RSD5K9vRrssyVUA0yo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D54mej26YFHACyW3/VOA+ZMi36bsP/fou7ZveiThS03CWvwwpJN/kdUnKqSNHiFJP FKS9xAVPUOTubYpjQIKpjkfmAuQtTpL5Aqakr9L257D1bsF/6THKz4UC9x0P16oMRB 9oPeimDouzi9q/Wo3+554QvmYQNKafyxGrnYBjCq0UICUO4Hh8BkYSHnM93w0hJyt0 WRmeAWylRa/zCCPNi3AzeeM6zGzeTYuR2aA9KQMN9cTtJj+9bZrcjmVG+udwROFsIs 4S6p/YUV5CCDWmweF5n1kRHjgdPpCZd/+j0cpig9S0pQCdhtdds1c800KpH6GH1k4u hh/OCaAABboWg== Date: Wed, 26 Jul 2023 17:33:49 +0100 From: Conor Dooley To: Petr Tesarik Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Li Huafei , Liao Chang , Masahiro Yamada , Kees Cook , Andrew Morton , Heiko Stuebner , Ricardo Ribalda , Alyssa Ross , Li Zhengyu , "open list:RISC-V ARCHITECTURE" , kexec@lists.infradead.org, open list , Torsten Duwe , Roberto Sassu , petr@tesarici.cz Subject: Re: [PATCH v2 2/3] riscv/purgatory: do not link with string.o and its dependencies Message-ID: <20230726-excavate-swoosh-424ede98f63d@spud> References: <2832b3e5ac781a0c0ade9d77b15a80e7f2fb4ab2.1690365011.git.petr.tesarik.ext@huawei.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1Yc8XiDptGjnzByY" Content-Disposition: inline In-Reply-To: <2832b3e5ac781a0c0ade9d77b15a80e7f2fb4ab2.1690365011.git.petr.tesarik.ext@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --1Yc8XiDptGjnzByY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 26, 2023 at 11:54:00AM +0200, Petr Tesarik wrote: > From: Petr Tesarik >=20 > Linking with this object file makes kexec_file_load(2) fail because of > multiple unknown relocation types: >=20 > - R_RISCV_ADD16, R_RISCV_SUB16: used by alternatives in strcmp() > - R_RISCV_GOT_HI20: used to resolve _ctype in strcasecmp() >=20 > All this hassle is needed for one single call to memcmp() from > verify_sha256_digest() to compare 32 bytes of SHA256 checksum. >=20 > Simply replace this memcmp() call with an explicit loop over those 32 byt= es > and remove the need to link with string.o and all the other object files > that provide undefined symbols from that object file. >=20 > Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file") > Signed-off-by: Petr Tesarik This version keeps the automation happy, Acked-by: Conor Dooley Thanks, Conor. --1Yc8XiDptGjnzByY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHQEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZMFK7AAKCRB4tDGHoIJi 0nywAP45WUTUj6aGAMM66t2i6LtknIHriZ5AtX22HuqEfK8W3gD45i6hU1k0jKxD iBzfCHatNLhnBRoYTPRflCChJJDBAA== =pFZE -----END PGP SIGNATURE----- --1Yc8XiDptGjnzByY--