Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp157257ybi; Fri, 7 Jun 2019 05:59:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYAcWbbgeOkeJL/tZHSRGOpTH2/aUClj+galJ0QTnzPx6UQMdQU7GTpvnehhKRrWh1TgMH X-Received: by 2002:a17:902:ea:: with SMTP id a97mr14602789pla.182.1559912380198; Fri, 07 Jun 2019 05:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559912380; cv=none; d=google.com; s=arc-20160816; b=kUjNEML+0wPvInLLWdaasdQVP1rpU1Yq1riRjXzL/zKfBRjYg5g3fUtUcsO4dwMuj2 m9aa89Tm6ltgFK3idDDfaLMZhCNHCcY520R8JhIOASHDCDYaCOaUfF9MhqkosKrJoVzB dP09FrylbKqQZ0hXXyzwpzAsv2UUJz3WENzt460FeMGz359h6ZxRb4zeW9d2SYOLbUEX nPppjGMMt+GJz4DXaEEtEhNDN+cus211wLBWbrXohS0ZrfmfAg+5jIpvxfmk8ZN19TVL FNo+2HQED5TQdv43AK3jxx9Kn4aY20Kl0d4blx3zKcK8jP0Gp5TaYG1jpj+g8+5vz32s Z6dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=O5JfMQ0+cHk67J/O14yQP4biRgjJ7rp25dEgBvPcHIc=; b=VZVaFXOiNR2Li0DkIBOfBIYeeSUL4KJriA+NWsPvCdOaAIWaO8J5DYCuNwI7fEdio2 4AHYk4HWXodzOeyzOy84NpDkh7SnsqL+Zl+15qhRy3V6NUQvxtrGqyfFO4bbG1hAwlvY X+j5Jkn3Vk6ZWyiha/EMnstVZa1jFMXYS/kHiuQzsQOjz68EdKZqhmgM8LzUloWKkbsf nEzOJ9FGg9IgzL/P0zz0TnaXhm6XIyKbpu8SQPwkwlX2Z9LH7H8y+XAbwC4XAdbfduES ZofY4HH9k5DYfuJamU6EX63oCmRj0GgjCPAJs9JHY7iYtfudnqgfWOguZdhFOFanQVsQ /xVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@tq-group.com header.s=key1 header.b=ljwxq5Pu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si1676502pgi.432.2019.06.07.05.59.23; Fri, 07 Jun 2019 05:59:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@tq-group.com header.s=key1 header.b=ljwxq5Pu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728261AbfFGKtj (ORCPT + 99 others); Fri, 7 Jun 2019 06:49:39 -0400 Received: from mx1.tq-group.com ([62.157.118.193]:17387 "EHLO mx1.tq-group.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726584AbfFGKti (ORCPT ); Fri, 7 Jun 2019 06:49:38 -0400 X-IronPort-AV: E=Sophos;i="5.60,562,1549926000"; d="scan'208";a="7741348" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 07 Jun 2019 12:49:37 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Fri, 07 Jun 2019 12:49:37 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Fri, 07 Jun 2019 12:49:37 +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=1559904577; x=1591440577; h=from:to:cc:subject:date:message-id; bh=jg3ogeYyjZ13Io4RHa3NmQVEVmQp6Dm5x4LA/opROkA=; b=ljwxq5PuG5u/2sZxxyIqATOHpl4awhzoMvnGGlAyT61kYH/nTULUnqVf vII+tiA6avsw3eXg0ufD19C/NQPhMb+aPZ39o8DvfiqepkwlzTwC1kscT 3a/IygbrP0atz0RtWOuwYzZB00CqpS8wqTKOdjzF3ojW6+BVmg1+8JGxr e4dGFU2LRPpX4vkiMTbo9Bc9l61tZoleGdkvW+oZB94feWkZtr7h+S8aj tpYaUoAnVTYepFzJHGJHqg1L04dtGdsRfd8ixIjyWPkQmp/Km5aH/0FsS Saek5ARbYH3J8RSwQqpHsQhEgaiFNQ2tzaoSohz+TCDO+Q2HlWwouZxbp g==; X-IronPort-AV: E=Sophos;i="5.60,562,1549926000"; d="scan'208";a="7741347" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 07 Jun 2019 12:49:37 +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 3BE62280074; Fri, 7 Jun 2019 12:49:44 +0200 (CEST) From: Matthias Schiffer To: Russell King , Jessica Yu Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, Matthias Schiffer Subject: [PATCH modules v2 0/2] Fix handling of exit unwinding sections (on ARM) Date: Fri, 7 Jun 2019 12:49:10 +0200 Message-Id: <20190607104912.6252-1-matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. v2: Use __weak function as suggested by Jessica Matthias Schiffer (2): module: allow arch overrides for .exit section names ARM: module: recognize unwind exit sections arch/arm/kernel/module.c | 7 +++++++ include/linux/moduleloader.h | 5 +++++ kernel/module.c | 7 ++++++- 3 files changed, 18 insertions(+), 1 deletion(-) -- 2.17.1