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 D3C85CDB474 for ; Mon, 23 Oct 2023 08:08:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229591AbjJWII5 (ORCPT ); Mon, 23 Oct 2023 04:08:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229513AbjJWII4 (ORCPT ); Mon, 23 Oct 2023 04:08:56 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44F4FA6; Mon, 23 Oct 2023 01:08:54 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B2FC45C0290; Mon, 23 Oct 2023 04:08:53 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 23 Oct 2023 04:08:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1698048533; x=1698134933; bh=CO pt03Eh0fEEnCE5W21Vph3o8D+rTTaPmsSG2cQhMKM=; b=BkUqBezm7JcPV3K9Lu Wy+OacQyNYe0wCPzOGauv/L0seeMFHf4+xskSnHZqCFvzclTRy+iSt285XafKqVn CUxKz6RCuOqlxcPCDcLi94dtwSRFOOFj2+yb1VyOwKqIF7rSafdQcQBHZJbHpLdf zdZBcrHKFlCSfcvZ7kTapsFd4t7+X6wkViw/Ysvef8FldaHailfA/zR30RJyWp8X gEPIDWwwB6k9J6y0dKXhEJfSFJazwuGLS9SXSlL6NAr2gGUamxe8OeAnj/C1k/e9 f4h3I8/tYwMloX1JEfyfEkWSp197+TFJdmYfpKzNqEtIm4H82LGPzZ0STw7JZy+7 1ZHg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1698048533; x=1698134933; bh=COpt03Eh0fEEn CE5W21Vph3o8D+rTTaPmsSG2cQhMKM=; b=O+m18wVj4mkJV37R6uPel8zayuhyN +mbwrgqyTiBzBngipKf583Gjf9LLGk0T0nmt2j/OjbfUp18wRd69f4NC5IH8+8gL omiv/+g/IebNPTDwsUnMAatcMp6E5/wjqJ0DAfudz5dkOs6jL8z6/P0+kjEHrCI2 vOOzZ8yNN9Zhzg9WRwXoP86+WbZK9NiPZzgX4j/R08IkuUn+1hMJftPIrJwo5DwU T4OOw01Hlh7gFddMfwNE+gGspjg5sY3AYMcpTDdfAGBsDnatDv57zHBcwRazBFG/ 0OcMzH78+VoYtjO7/jhKXn1hs/vlAAgTtH7JzynwKFZCbC0jau+/qPOIw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkeeiucetufdoteggodetrfdotffvucfrrh hofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehrnhguuceu vghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrthhtvghrnh epffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdekteffnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghrnhguse grrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 56F06B60089; Mon, 23 Oct 2023 04:08:53 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1048-g9229b632c5-fm-20231019.001-g9229b632 MIME-Version: 1.0 Message-Id: <56c2d30b-2f25-4613-aab1-00fccbd2fa05@app.fastmail.com> In-Reply-To: <20231023075714.21672-1-quic_aiquny@quicinc.com> References: <20231023075714.21672-1-quic_aiquny@quicinc.com> Date: Mon, 23 Oct 2023 10:08:33 +0200 From: "Arnd Bergmann" To: "Maria Yu" , "Catalin Marinas" , "Will Deacon" Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@quicinc.com, linux-arm-msm@vger.kernel.org, "Ard Biesheuvel" Subject: Re: [PATCH] arm64: module: PLT allowed even !RANDOM_BASE Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Mon, Oct 23, 2023, at 09:57, Maria Yu wrote: > Module PLT feature can be enabled even when RANDOM_BASE is disabled. > Break BLT entry counts of relocation types will make module plt entry > allocation fail and finally exec format error for even correct and plt > allocation available modules. > > Signed-off-by: Maria Yu Adding Ard Biesheuvel to Cc, as he added the check in commit a257e02579e42 ("arm64/kernel: don't ban ADRP to work around Cortex-A53 erratum #843419") > arch/arm64/kernel/module-plts.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/arch/arm64/kernel/module-plts.c > b/arch/arm64/kernel/module-plts.c > index bd69a4e7cd60..21a67d52d7a0 100644 > --- a/arch/arm64/kernel/module-plts.c > +++ b/arch/arm64/kernel/module-plts.c > @@ -167,9 +167,6 @@ static unsigned int count_plts(Elf64_Sym *syms, > Elf64_Rela *rela, int num, > switch (ELF64_R_TYPE(rela[i].r_info)) { > case R_AARCH64_JUMP26: > case R_AARCH64_CALL26: > - if (!IS_ENABLED(CONFIG_RANDOMIZE_BASE)) > - break; > - > /* > * We only have to consider branch targets that resolve > * to symbols that are defined in a different section. I see there are two such checks (in partition_branch_plt_relas() and in count_plts()), can you explain in more detail how you concluded that one of them is correct but the other one is not? Arnd