Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1737352rda; Tue, 24 Oct 2023 01:25:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/WLxFTg7Jq5fLoBGVHXOl8tzQKyZODL7L2pcffqojhn5YGxMVFqvJ0zFiuyPLrL7POCYa X-Received: by 2002:a17:90a:a38d:b0:27d:3a34:2194 with SMTP id x13-20020a17090aa38d00b0027d3a342194mr11002545pjp.14.1698135940173; Tue, 24 Oct 2023 01:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698135940; cv=none; d=google.com; s=arc-20160816; b=YqJ4N3h3k9jANqT167wEsM7esk/Z73hCG5epVl25v2Wy3DFXGu/H8r/tChZ7YRlvb4 rQHSwQTJed51qCE8FW0JW2o6gd/tCoYyqNXgkIMqyTEzXwK144PSwALVT2yp/mzlwEVJ KYpATJmktg7aQUfPG7G2Y4eIbPDV3Dcs/j4Y8Bt9bgC2j2/Rcl10Wwvu3lsVAy5LcPX2 W4Kmvv8GeJEamb+WBzkseKs0NiroI/hMLlGof/3l/90fiwwIqgDLOykchWf7zeVYhaf9 MVzs2EAJzPvnyczWNZyODJPz8qJBS7imVq0CtNRAWksz5YJ0Cl6Ayw9p0SKV7rIdoYBu ivRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wc6vcdmIZmJIFHFqlaHaNEhj/5nMTEXFrERzAKrbhR8=; fh=Usb+YMM8WOJS9uyew8viA7OGW4G9UZYzvUJ7jF4c6g8=; b=Dx+qZtHyjgQDY+qYVSDsPnXGBeAMCNPPA8rJCRjQout8dyPqsHWPypycZlmSadQnHJ fHaA55cMq30rEAeY/AdM9sYJEUkdkn9rZ8utUnhJUZjjrSa/9a3gWi0p/SDGy0dL19hl xmQS8S1ZLj+QsuSFozZIO/xxK6RdTSVZaXU4QNw3RmYkBjNkv3eg/kdb3bFEr546Mv1v 0dQ5FRF7KqzkP6/odB/Ggwejlr7Q6q08/SQC3lq9/2d8PrnDQOWZ5aG4V3S9aGLbof9p k+3YiSwCHCb18JmDxdSVymc7CoB+KS08KM+4WG5MgwE+3Nnhpqx/PjHHyjoxoKVApbMr 5tew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lUHxY4dc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id b18-20020a170903229200b001bbb6f4cd6dsi8474853plh.334.2023.10.24.01.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 01:25:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lUHxY4dc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 9070B805CAAD; Tue, 24 Oct 2023 01:25:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233686AbjJXIZW (ORCPT + 99 others); Tue, 24 Oct 2023 04:25:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233122AbjJXIZU (ORCPT ); Tue, 24 Oct 2023 04:25:20 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B245D99; Tue, 24 Oct 2023 01:25:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 022F3C433CB; Tue, 24 Oct 2023 08:25:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698135918; bh=C59B0paKctZmmkp2VOX6y7BbpXKe0RQc3L0GlQ5MORA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=lUHxY4dcQwVjg5SUU5gs/je41M3qZ4LMPlg1s493IHaOO2/mZWmP1bMKoDO5pdTtH GqYrjvk53EzJ9EaquO/DZrQDKNWFoe4lDR0x4Qbd9ccZJgVdnheFdCrHQAzEu7cIrK QalJd+FW0IhUFrxsdgG5NYDQzoZMHiL2PfQ/1QO6CFX3dAoTpZkOdwlaKVF3Cs8gVC G5L/4tOyphbQQ3QSPDf5x7KowouqwsaFHMYJWJKUkgWEucYxBZV3NjgjX6qmfNG/NF CtRWVjDiy+HbirSgWYkbZo6EIdG6dGK7M7mhygh0jem6tfIWNXeFkJfkzY4LgHF0Im 0GRg+wfyy/bWw== Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2c3e23a818bso48303191fa.0; Tue, 24 Oct 2023 01:25:17 -0700 (PDT) X-Gm-Message-State: AOJu0YyrbbTVRXZ8lehm+X67KpSDdr8RANfLBAzBWEaLxrI17snl7bos ONwUB5QoPmqpFaO8htLrRcjJQwTcyX8SH0m7T2o= X-Received: by 2002:a05:651c:1308:b0:2c4:fdaf:1d62 with SMTP id u8-20020a05651c130800b002c4fdaf1d62mr4901833lja.11.1698135916116; Tue, 24 Oct 2023 01:25:16 -0700 (PDT) MIME-Version: 1.0 References: <20231024010954.6768-1-quic_aiquny@quicinc.com> In-Reply-To: <20231024010954.6768-1-quic_aiquny@quicinc.com> From: Ard Biesheuvel Date: Tue, 24 Oct 2023 10:25:04 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] arm64: module: PLT allowed even !RANDOM_BASE To: Maria Yu Cc: catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@quicinc.com, linux-arm-msm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 24 Oct 2023 01:25:37 -0700 (PDT) On Tue, 24 Oct 2023 at 03:10, 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 Acked-by: Ard Biesheuvel > --- > arch/arm64/kernel/module-plts.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/arch/arm64/kernel/module-plts.c b/arch/arm64/kernel/module-plts.c > index bd69a4e7cd60..79200f21e123 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. > @@ -269,9 +266,6 @@ static int partition_branch_plt_relas(Elf64_Sym *syms, Elf64_Rela *rela, > { > int i = 0, j = numrels - 1; > > - if (!IS_ENABLED(CONFIG_RANDOMIZE_BASE)) > - return 0; > - > while (i < j) { > if (branch_rela_needs_plt(syms, &rela[i], dstidx)) > i++; > > base-commit: 05d3ef8bba77c1b5f98d941d8b2d4aeab8118ef1 > -- > 2.17.1 >