Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1070939rda; Mon, 23 Oct 2023 01:09:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG59ph8ss4NuOmkYwrZh7iG8/SbzxLKYPK9dXiR5BwibBHLXy5tYfkTzUwPifEW4ingMxIY X-Received: by 2002:a05:6808:17a3:b0:3b2:e3b5:b94 with SMTP id bg35-20020a05680817a300b003b2e3b50b94mr10980805oib.16.1698048552737; Mon, 23 Oct 2023 01:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698048552; cv=none; d=google.com; s=arc-20160816; b=yneLCrq1M3PW30b28le+uOdACi1ADYtIgvLfTUL2c4dyTe2v+bbJmfMwYo0TCijJc3 iiOPU+cP0s6XhbZTO88FWCY2TYUJUhKeUiiJGUqDO1QCN3gdVqwh9YRS3Puz5S4MExSz 7WD3K5w/9joXcI1OrfCN/XhsW1WB7IX3GoM7te1VzFZy24zlZ/E+Z64FApj/SmtG5WxZ cvGRNjMZ/jwj+jbD2wlvovovrVG7NdoWyaVpCbsuHSFjQcf8pfl4HBTkrGzUR7uVmHQz mmQ5o5kQQqPfyvK1w5KcCXIzrbyQCg7wPi8fpd2VD3uUkLqn6dgSP/CdyRrT1tw4ajQ9 hmDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=COpt03Eh0fEEnCE5W21Vph3o8D+rTTaPmsSG2cQhMKM=; fh=PUySu2OKOsK54XgFKGpRLx7/JBXXdM/AmYsV8HlIcp4=; b=ubfe0UiQZLvH4yubkVHMA6hY9psC9LO3Mh4dma/qh8zn/ji+8+s1+y3CIgWQLDbMnm JVKV+5YY53o5ErZ9KR4iSqaZmE/2KpAI2MpE0bhfZVcmQkA+qqrjzxbyCx9Y7Nn7F1+i 5SKxpXHdtUDib7R+fZQBOKd74jHonXGbQ4dV10Hb6SzE/VvafMuKXJHtTn4R4GXo57PE VwRXPBmhB3hy2qilyZtiSDex+goF8knmwVpNrKzFpdO6BDeFhvtFhihx9yDZV4ivGHjE dTnSKXDs5RxjLxpdNCDwpyvnKoGGfylbcIeWYjoR7tQ4IzIdyfyMrvWDspmUYEwouDhH HEng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=BkUqBezm; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=O+m18wVj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id u18-20020a056a00125200b006933caa6f03si6115196pfi.165.2023.10.23.01.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 01:09:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=BkUqBezm; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=O+m18wVj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 9416680473FF; Mon, 23 Oct 2023 01:09:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229463AbjJWII5 (ORCPT + 99 others); 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 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 23 Oct 2023 01:09:10 -0700 (PDT) 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