From patchwork Wed Nov 22 22:18:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 168580 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:6f03:b0:164:83eb:24d7 with SMTP id r3csp1537113rwn; Wed, 22 Nov 2023 14:18:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3IK185RNMdbkZYeJTYQGlHH3ipTiuVPtccnurZUkznN1QIyW2pJSPjDKLF4YCvYQa04SV X-Received: by 2002:a05:6a00:1c8c:b0:6be:5a1a:3b93 with SMTP id y12-20020a056a001c8c00b006be5a1a3b93mr3602956pfw.4.1700691521969; Wed, 22 Nov 2023 14:18:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700691521; cv=none; d=google.com; s=arc-20160816; b=bnE1dGRe+GCF5ibCR/fPQffB7zaEgyXOzKnTAPmdcvag/SM/v2pAp7fdVyyTYMlDCv CDo/43JyTVg9GxYHLf2ZqrWZLlugRgnTwdlPEZ49etd5o1iELy7sQ4An8qHA//c/b/h3 Ul9oq/oR3yG1OaFEIQR7vxVsqcdTGO6svr/PEP0U4ReA3fyraxxtYAx8p/wU4qmwx3ge AyYiMlVDkWWJ9lqMvaCg3n9YvMNsnriYMM+gyq2xP2i7QZxru8S9k+y0BKiuEcwk0+cA qJST0fEWKH/ZrIFWeOoAehIYJpSAZvBTDB9J8ClJe26b2eoZ43vfMQQfqkxHHyDvJXLt hxRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=//rM/jtPk29ZexVoO3S4krAhI8Q91c//MPYQhR89e/E=; fh=p1Qf4H5TYe6x87oeu/ZwD97uWE3f/aSmdhLxEgeh+tk=; b=hAMssxuCWxkxUIe+QkW2ptSrHXqydIxbP1dL+k3g56opWSAuBpsA+SY4SGj2Cuosvn wqpux9hj2tt7UqZEjGAnu/WF03qdl25i0EawaihR5AbMPUcHeCgbNWfIr+vG75I6qxXM pGJgTPdxPetVJFS1Cvkzh9kGmi0dhRArrCnMd40bk8oBl3YeYCPIX/uTFbdOk9eCwRUl PU/NK91pQSrVxBbGKEfNkZHnvPa3oE+QpwsgjbXctDh2erPbFyyf3Oo3JfJuLLFDPrw8 NFSgWkyQxtJsaKi6mRbj9DpSPxxXsTcOEAH2CsqvxnTiXo/BUGiRxHYOIp8k4YzSZeJq eA9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DDxAjeN0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id l2-20020a056a00140200b0068a65b26fc6si426415pfu.43.2023.11.22.14.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 14:18:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DDxAjeN0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id A75BE825A6C0; Wed, 22 Nov 2023 14:18:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344685AbjKVWSb (ORCPT + 99 others); Wed, 22 Nov 2023 17:18:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344661AbjKVWS0 (ORCPT ); Wed, 22 Nov 2023 17:18:26 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D83F0D42 for ; Wed, 22 Nov 2023 14:18:22 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AC02C433CC; Wed, 22 Nov 2023 22:18:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700691502; bh=naPsrd6dgZmrcqFRnBTJLF85zK+mznbfmwCxwvHg1bc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DDxAjeN0PF56HLuHq+owxFyRf1SXkUc0Z3SIxrGBECInqJ9bI5WTebiKUjB+kdXgc 4GAAJFWkwGKOeLi4wqgSc5qKmWrSDg2dC/VcMaTpnvQB/ctWee/LrWjppfZMvUUEZT +Xt4fRitwdPMjB5F1t2+G/fVNeDMtj/EVVXtakgp2AUggs4s5bljxWU2MTDNSB4ElI e5d9Yb4xkQhock5YbwJnwZ+TbIKMpPf7s/cT+0vH51VrCbGGPqjMw2BFSh1//YguKf ZXpMGYJ71+KG4ilzh78AGFUUbGJIONjGDFGHncsmOLm0RinIWC8kHlcjJce+uJ0aNU YM+gqd4jArNIg== From: deller@kernel.org To: linux-kernel@vger.kernel.org, Masahiro Yamada , Arnd Bergmann , linux-modules@vger.kernel.org, linux-arch@vger.kernel.org, Luis Chamberlain Subject: [PATCH 2/4] modules: Ensure 64-bit alignment on __ksymtab_* sections Date: Wed, 22 Nov 2023 23:18:12 +0100 Message-ID: <20231122221814.139916-3-deller@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231122221814.139916-1-deller@kernel.org> References: <20231122221814.139916-1-deller@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 22 Nov 2023 14:18:38 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783304313326062221 X-GMAIL-MSGID: 1783304313326062221 From: Helge Deller On 64-bit architectures without CONFIG_HAVE_ARCH_PREL32_RELOCATIONS (e.g. ppc64, ppc64le, parisc, s390x,...) the __KSYM_REF() macro stores 64-bit pointers into the __ksymtab* sections. Make sure that those sections will be correctly aligned at module link time, otherwise unaligned memory accesses may happen at runtime. The __kcrctab* sections store 32-bit entities, so use ALIGN(4) for those. Signed-off-by: Helge Deller Cc: # v6.0+ Signed-off-by: Luis Chamberlain --- scripts/module.lds.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/module.lds.S b/scripts/module.lds.S index bf5bcf2836d8..b00415a9ff27 100644 --- a/scripts/module.lds.S +++ b/scripts/module.lds.S @@ -15,10 +15,10 @@ SECTIONS { *(.discard.*) } - __ksymtab 0 : { *(SORT(___ksymtab+*)) } - __ksymtab_gpl 0 : { *(SORT(___ksymtab_gpl+*)) } - __kcrctab 0 : { *(SORT(___kcrctab+*)) } - __kcrctab_gpl 0 : { *(SORT(___kcrctab_gpl+*)) } + __ksymtab 0 : ALIGN(8) { *(SORT(___ksymtab+*)) } + __ksymtab_gpl 0 : ALIGN(8) { *(SORT(___ksymtab_gpl+*)) } + __kcrctab 0 : ALIGN(4) { *(SORT(___kcrctab+*)) } + __kcrctab_gpl 0 : ALIGN(4) { *(SORT(___kcrctab_gpl+*)) } .ctors 0 : ALIGN(8) { *(SORT(.ctors.*)) *(.ctors) } .init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) }