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 A7023C38142 for ; Mon, 23 Jan 2023 10:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231968AbjAWKTb (ORCPT ); Mon, 23 Jan 2023 05:19:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbjAWKTa (ORCPT ); Mon, 23 Jan 2023 05:19:30 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93112E390; Mon, 23 Jan 2023 02:19:29 -0800 (PST) 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 30A2860DFD; Mon, 23 Jan 2023 10:19:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F937C433A8; Mon, 23 Jan 2023 10:19:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674469168; bh=1MvSRUAOzKE+a90tCBvVLkylK82rha/QCQWLgVfCltk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=qyAVZIfrSxljckr6paKaAvkrfUHIHj7wUv64VH5np6cFl5xqxvlm74q4EtrYtLq5X tcPCCWE4G+tWCLKTPJr/swWLBnyg7XSw3wiTsFkC1aAYcGVzos1mWRcGIpql9bmxj6 VzxlEEWEhfTwVuYiV0QhRmHGNSrWKU3aljOEnv6uTiyVEqqfw0601zI01gOmiG1foe WPeVzTju4o47eweoEo4m5lIsmStAAIdWEu8YVyxUkReGKnN8rlmhdJDd3fvAtdzSM6 P0V1jbhOOwJs55X7/rXm0KUnhiz7B5XHNryhT4+pE4SrA7GtehC1liznfu6Gvnylh6 M0lMkEJwG4NFQ== Received: by mail-lj1-f179.google.com with SMTP id y9so8867485lji.2; Mon, 23 Jan 2023 02:19:28 -0800 (PST) X-Gm-Message-State: AFqh2kpTIF/vayA+9HpMAljA4vYyFZJDJcW+8CVAa3H3WDMU5yTW4R6N P/E+HinFHXTbPvHIMGezQclBSJEi45LoAsBrMrM= X-Google-Smtp-Source: AMrXdXuV+YvUcgUKs//ofpl9C6bOG97YA1tziN0Q7mYtszCfszfBMOgqRuExMzsmqv+/3z7ce4+CPdP6WyOI6u0UXVg= X-Received: by 2002:a2e:964e:0:b0:27f:b833:cf6d with SMTP id z14-20020a2e964e000000b0027fb833cf6dmr1969790ljh.291.1674469166406; Mon, 23 Jan 2023 02:19:26 -0800 (PST) MIME-Version: 1.0 References: <20230123100951.810807-1-alexghiti@rivosinc.com> <20230123100951.810807-5-alexghiti@rivosinc.com> In-Reply-To: <20230123100951.810807-5-alexghiti@rivosinc.com> From: Ard Biesheuvel Date: Mon, 23 Jan 2023 11:19:15 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 4/6] riscv: Fix EFI stub usage of KASAN instrumented strcmp function To: Alexandre Ghiti Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-efi@vger.kernel.org, Alexandre Ghiti Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 23 Jan 2023 at 11:14, Alexandre Ghiti wrote: > > From: Alexandre Ghiti > > 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 > --- > 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 7e2962ef73f9..15616155008c 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.37.2 >