Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1582848rda; Mon, 23 Oct 2023 18:10:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVMXEUNh0xHtmrUO7beVEEv9PEifWVpHvfb5tOY3GhC8QgMDyMjbj0zBXJrEa4iZbAVcw+ X-Received: by 2002:a05:6a00:1405:b0:6b4:d17b:25ab with SMTP id l5-20020a056a00140500b006b4d17b25abmr12483812pfu.25.1698109845201; Mon, 23 Oct 2023 18:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698109845; cv=none; d=google.com; s=arc-20160816; b=AUhLAX6ROdNr4BSGyuTlFeY/lh2Hu16WY40j6WVsJtoSbkAiBA6ulP+REfDL2ugLEv oD6aNtWS+D1CRXLoUoL8HbI68DlAmrDGf3Wp3B2RyjWngHVIh1X3env5AAHwM6FtiH6r WHSG6m2f+aqeb9I2xCfNJIMeWOz4FPADB8kM1xHzYXlyaRZY+1Kl21VaD6E8NjVacOuv /aeBhua8zQPFlZgOwRRl7IREIG4AE0wDfFC+PATYTsBzoBut7IxhBef1oZU5DKyQs0tU rsfV7KLPqjUTELADduWwaflKQVpRoELOQkkStwOojWU4cNYIgyUwPwJ0CmlK4IfYzeyi IQEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=Rm3I2nHRtdWaizFG/T8bQDHEIxz6rfk7S5/hRGdCpa8=; fh=RnjkIeD+8tG30WqQNLB52YBix0FvY9gWtnhcqAd75Sg=; b=H7J+Ltoti2DILTh12nPZ90zUT4oJDOrspu5vyoEOf9+PnpfB4etR2Wl6VIpJNeUui4 1t1U0DHCyV275NrGiiQ+qcRk2vheXjOu7h/zSSHSrhd0SFXlEmXZ5ooN83EdhY3I5lHo CwYV+dJDu2N/0Wr+ZwRkCPEKdhknksqEtvE3xsLY36qMgq58rRSMmQ9C4moOxs4vW25x /OeQmaHnbnq6L5WVn/vr9doQDjJShGFE34AIZodE4RdPP2cUE8tTpKeA+5RsX06//0iZ m32OyIdR2QHhUGiacALIAhfzACjhnQ0HIjsC46JsAFAwbDpX/YU4izp1Qk5FLgMTW6it yKsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BGSx0Epl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id c22-20020a637256000000b005b8a641b442si4278344pgn.461.2023.10.23.18.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 18:10:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BGSx0Epl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D58D280A776C; Mon, 23 Oct 2023 18:10:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230284AbjJXBKf (ORCPT + 99 others); Mon, 23 Oct 2023 21:10:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229679AbjJXBKe (ORCPT ); Mon, 23 Oct 2023 21:10:34 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B597EDE; Mon, 23 Oct 2023 18:10:32 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39O0rJMl025073; Tue, 24 Oct 2023 01:10:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=Rm3I2nHRtdWaizFG/T8bQDHEIxz6rfk7S5/hRGdCpa8=; b=BGSx0EplG4nGFN/8TTT7xOOapLnkMeo6ilAc80uvvU1aUFnp5C6UYaAEQfyG4ve6SRBq rpa/GRg+PfcGoFZIIfbC/NdHtzXI4dcKul6oMeFMVTQFtyYwNeuI9Ro+5b2De8ukUfR8 jiXQyTYv0XRvo0FAF7E9fEal8Fcc3xP1kMzsUZmFP49RjMWbtcwfh4wLPlEaownxm8XU jAlppa8pCOPJ46FLSq04xAMbEEo0OjKWlL401Xn5VhhIs6agS/p0zNFKCjGjPTkODl+R 5NV/9UplEJjldmQg4glkp9x5N/Wu4BoQmmFWm+rhfnM54NmfbdwpfBc+fbWFt2U3+aAY iQ== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tv5ky64n7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Oct 2023 01:10:14 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39O1ADaQ021290 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Oct 2023 01:10:13 GMT Received: from aiquny2-gv.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Mon, 23 Oct 2023 18:10:08 -0700 From: Maria Yu To: , , CC: Maria Yu , , , , , Subject: [PATCH v2] arm64: module: PLT allowed even !RANDOM_BASE Date: Tue, 24 Oct 2023 09:09:54 +0800 Message-ID: <20231024010954.6768-1-quic_aiquny@quicinc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: BQdT7oyjF0HUPTWRE5XC7ujirxcb2trZ X-Proofpoint-GUID: BQdT7oyjF0HUPTWRE5XC7ujirxcb2trZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-24_01,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 clxscore=1015 phishscore=0 mlxscore=0 mlxlogscore=382 lowpriorityscore=0 suspectscore=0 adultscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310240009 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 18:10:43 -0700 (PDT) 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 --- 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