From patchwork Mon Oct 23 07:57:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aiqun Yu (Maria)" X-Patchwork-Id: 13432500 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C8A9C001E0 for ; Mon, 23 Oct 2023 07:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=S+J8kGYytnf1h9XCiKpV8O3s3DOCLu1/nAqdVFX3ZYs=; b=gQb/JMk0yWjZqn bRkCvfx40vjSoy8l2jSnj+9bHR7brBFzkZFmKQ5GLpc8y/B9wx3i2ZDoaotDL63ynrkRERXFwYltc 4EQRWKaOPAJiZJinqamUqIa1J3LoJXAIvhJjxz3wxCHXHL22JIEjq6Iy+HFGHrt3dX4wOahsB18So SlhIGVTe/N5DdhwMWjWd3iMI0AcjNtWwTAeiiEW3get78g0TvWM2Fq3X6PfyqjJ1z5WNCoexq3EkF aRtLj/6dAvOnxCi2r+WbEEw9JLm5soP5vJyvg4xP+mhQz3hbU/aVjiCwD8OAp4owoHSYYhwzYRTai 371R98H/fJtbdxKBcMFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qupop-006hDH-0w; Mon, 23 Oct 2023 07:57:47 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qupon-006hCt-02 for linux-arm-kernel@lists.infradead.org; Mon, 23 Oct 2023 07:57:46 +0000 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39N7RVnO003055; Mon, 23 Oct 2023 07:57:36 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=c7KP3Zqe35K/UITXRHfu9WloJc95Zxfye7HE8lRDw1Q=; b=LO04fbQGS+K5kWBRwLwH/SFLsQWsCW3igdRmGALdXuURqWRcSqyt4BlB7BYMaC97ikzK uDSYPDrzPj7wMUpOwLdCxsFCqFkcWJruehMJg31XGB/2ncRDpOMa87kIqVfyZc/uugmK PK2GgbY7EXuN1OTTVxg40OetT1ZbSv6+o/WbC1NclUNw+G+PYSpR4hzF/Ijy7LrRSmhO oJaYBO0YF6HfUNZtzGBcAlQemjQaKHk5431stZMyYVLxu6odP5w9Jk85ts+56yDdP2xn W1auaDR0oTnlkqjv/o+1z1T1Er7WM6TeSst1Rp9nepACXMF8My+gnqx/mwfhcei4rwbp /g== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tv5ndue0r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Oct 2023 07:57:36 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39N7vZET002897 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Oct 2023 07:57:35 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 00:57:29 -0700 From: Maria Yu To: , , CC: Maria Yu , , , , Subject: [PATCH] arm64: module: PLT allowed even !RANDOM_BASE Date: Mon, 23 Oct 2023 15:57:14 +0800 Message-ID: <20231023075714.21672-1-quic_aiquny@quicinc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 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-GUID: mFIgwhexEX5_sUkfBMghA9gGEGxsMVFw X-Proofpoint-ORIG-GUID: mFIgwhexEX5_sUkfBMghA9gGEGxsMVFw 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-23_06,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=430 bulkscore=0 adultscore=0 impostorscore=0 mlxscore=0 phishscore=0 priorityscore=1501 clxscore=1011 suspectscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310230069 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231023_005745_190587_54F7B45F X-CRM114-Status: GOOD ( 14.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 | 3 --- 1 file changed, 3 deletions(-) base-commit: 05d3ef8bba77c1b5f98d941d8b2d4aeab8118ef1 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.