From patchwork Mon Jun 3 10:57:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 10972751 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4428F76 for ; Mon, 3 Jun 2019 10:58:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30C8B288B8 for ; Mon, 3 Jun 2019 10:58:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24900288C4; Mon, 3 Jun 2019 10:58:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 50E0B288B8 for ; Mon, 3 Jun 2019 10:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject: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=xdgvSsY4aiASOx66LIAtplEz8ZhLMAR5FBpfxmdFdAU=; b=odP m8+Gv9SIPS+VYLxxvXZRqa/XqjdLgSKvd5bGkv92cAOV40yR4zpdgJCU3KzvOsE2QscV8+SuyOfAQ HQTGuzys8P0IX8+ODmLMV1apPZ3TKZwiONpQbmos7itoS0zvGyZrNYWxWbDmv9n0VnmX2P8X9fzgY C3zefoUHnBqFKUCjrUoCRZN3mQI0D6fkeLixi6ZhnfbB7uO8SYMtpiMlcXMCN0eNs5lgsgOFx4oYK /muRKV0G5WEDvBL8fgw3glu4f8P8/MmccPgbl1/y+Iaw9CmHg1l57feJ+YyqNiWOx96DV6p6sYmJJ PTAf68qcC751l5RsQModE2qAgT5jnbA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hXkfg-00046H-1V; Mon, 03 Jun 2019 10:58:32 +0000 Received: from mx1.tq-group.com ([62.157.118.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hXkfd-00045k-5N for linux-arm-kernel@lists.infradead.org; Mon, 03 Jun 2019 10:58:31 +0000 X-IronPort-AV: E=Sophos;i="5.60,546,1549926000"; d="scan'208";a="7665930" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 03 Jun 2019 12:58:11 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Mon, 03 Jun 2019 12:58:12 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Mon, 03 Jun 2019 12:58:12 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1559559491; x=1591095491; h=from:to:cc:subject:date:message-id; bh=W9GQMQ3nEmL01MlgBQ683CPdonwLrFB8qrhTZhg3YNw=; b=jXTnxI2NcbxsldYXEqjnpH16mc0K29vGBYKrtdwRiTYt1qVA6byxqnqb QT/5J2fK0vhpWv8bUzKzn+4nubKl1fDaZPM1VUTsztEbgcb0It5P8//L2 Mtc4VxfIWBhCPcqr34rTtcn61qXZxoS5GImvPGlOek1tD5JtfnjfTgg/N vN4CMfWQ0tHNTYmMzYqdUwLyKbNTBuomp7lyjj/XPDzRllUL+wr4F1X66 EHcsK6cUDrjkHA8Y6nhGZEdI6lC9KLqizs9YidCamoiOLmAOtk7mK2Pfg O6CW4funJEgBcGVe6wgjYKZSyNV1dfsnn4L8vu+OsU0i73+l/SGR7qJUH A==; X-IronPort-AV: E=Sophos;i="5.60,546,1549926000"; d="scan'208";a="7665929" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 03 Jun 2019 12:58:11 +0200 Received: from schifferm-ubuntu4.tq-net.de (schifferm-ubuntu4.tq-net.de [10.117.49.26]) by vtuxmail01.tq-net.de (Postfix) with ESMTPA id 5EBEA280074; Mon, 3 Jun 2019 12:58:15 +0200 (CEST) From: Matthias Schiffer To: Russell King , Jessica Yu Subject: [PATCH modules 0/2] Fix handling of exit unwinding sections (on ARM) Date: Mon, 3 Jun 2019 12:57:24 +0200 Message-Id: <20190603105726.22436-1-matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190603_035829_663281_235EA4E7 X-CRM114-Status: GOOD ( 10.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthias Schiffer , linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP For some time (050d18d1c651 "ARM: 8650/1: module: handle negative R_ARM_PREL31 addends correctly", v4.11+), building a kernel without CONFIG_MODULE_UNLOAD would lead to module loads failing on ARM systems with certain memory layouts, with messages like: imx_sdma: section 16 reloc 0 sym '': relocation 42 out of range (0x7f015260 -> 0xc0f5a5e8) (0x7f015260 is in the module load area, 0xc0f5a5e8 a regular vmalloc address; relocation 42 is R_ARM_PREL31) This is caused by relocatiosn in the .ARM.extab.exit.text and .ARM.exidx.exit.text sections referencing the .exit.text section. As the module loader will omit loading .exit.text without CONFIG_MODULE_UNLOAD, there will be relocations from loaded to unloaded sections; the resulting huge offsets trigger the sanity checks added in 050d18d1c651. IA64 might be affected by a similar issue - sections with names like .IA_64.unwind.exit.text and .IA_64.unwind_info.exit.text appear in the ld script - but I don't know much about that arch. Also, I'm not sure if this is stable-worthy - just enabling CONFIG_MODULE_UNLOAD should be a viable workaround on affected kernels. Kind regards, Matthias Matthias Schiffer (2): module: allow arch overrides for .exit section names ARM: module: recognize unwind exit sections arch/arm/include/asm/module.h | 11 +++++++++++ include/linux/moduleloader.h | 8 ++++++++ kernel/module.c | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-)