From patchwork Tue Jan 17 19:26:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 91713 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp654798qgi; Tue, 17 Jan 2017 11:26:33 -0800 (PST) X-Received: by 10.98.21.131 with SMTP id 125mr45374123pfv.110.1484681193691; Tue, 17 Jan 2017 11:26:33 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k17si25785877pgj.56.2017.01.17.11.26.33; Tue, 17 Jan 2017 11:26:33 -0800 (PST) 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=pass header.i=@linaro.org; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751242AbdAQT0b (ORCPT + 25 others); Tue, 17 Jan 2017 14:26:31 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:35427 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751057AbdAQT00 (ORCPT ); Tue, 17 Jan 2017 14:26:26 -0500 Received: by mail-wm0-f42.google.com with SMTP id r126so215155078wmr.0 for ; Tue, 17 Jan 2017 11:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=d2gJrgbAbY/Jp4V66GCFOvlbeMy3USATWJwF1a8HP2o=; b=jzXgbJRLqrHYC5WKOpTwWJDg4w4URJj2bN4NebVO6QNA6axd9LyGAvF1QU2OXDC4r6 ijpuNKmOi94lzLSNZyLheck7EB1P0dIylXt+QIeCf6Wjn8VUzfi+4lbdhynPAG0p2V3b pWVaiZ3ni3e+8gG5y75LsHasbVmt4l7+DC3NU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=d2gJrgbAbY/Jp4V66GCFOvlbeMy3USATWJwF1a8HP2o=; b=pSOewb6BRrcEu8ftEQvU4gbtQg2pwoL2SEOzYLY0/BZpJFNeBHADNTXFTRufGXI2nh Hk7wRR4nYXe70UYGszTME8ml6YEaWAZzx/ks/hrEFjnP264MTFgLESbRGZU0EvSdIXyk 3je3CkrP20Ze8JLoxG0FYVBWx6Ff1HLCVcO04uhffksyfLZxWkt1qFCz6J5rWLhThO9P uqs6ABR6uPMvE15LQ2qLA2vaThqFr0wio8Rn2cXDQrgkcSu+Vm1aMqeiEJQ4mSR3Xsny KMqN0xJj/iyuKV1II1FS7e/t96dnS4pDRLkM+UGkWtzFc21Ks1fXQysEFksh9DF91XvQ pNHw== X-Gm-Message-State: AIkVDXK32pwctandOj/0DIV656TW8bi67Ld/i3wAaDffXlN96xKs9uW7I1c3qLJ+sf9DXh1Q X-Received: by 10.28.109.218 with SMTP id b87mr16570982wmi.52.1484681180593; Tue, 17 Jan 2017 11:26:20 -0800 (PST) Received: from localhost.localdomain ([160.167.203.25]) by smtp.gmail.com with ESMTPSA id 197sm39171953wmy.16.2017.01.17.11.26.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 11:26:19 -0800 (PST) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org, mpe@ellerman.id.au, jeyu@redhat.com Cc: rusty@rustcorp.com.au, suzuki.poulose@arm.com, will.deacon@arm.com, akpm@linux-foundation.org, benh@kernel.crashing.org, paulus@samba.org, arnd@arndb.de, torvalds@linux-foundation.org, viro@zeniv.linux.org.uk, linuxppc-dev@lists.ozlabs.org, Ard Biesheuvel Subject: [PATCH v4 0/3] modversions: Fix CRC mangling under CONFIG_RELOCATABLE=y Date: Tue, 17 Jan 2017 19:26:10 +0000 Message-Id: <1484681173-11644-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series is a followup to the single patch 'modversions: treat symbol CRCs as 32 bit quantities on 64 bit archs', of which three versions have been sent out so far [0][1][2] Given the recent issues regarding modversions, I have added some more people to cc this time. As pointed out by Michael, GNU ld behaves a bit differently between arm64 and PowerPC64, and where the former gets rid of all runtime relocations related to CRCs, the latter is not as easily convinced. Patch #1 fixes the issue where CRCs are corrupted by the runtime relocation routines for 32-bit PowerPC, for which the original fix was effectively reverted by commit 0e0ed6406e61 ("powerpc/modules: Module CRC relocation fix causes perf issues") Patch #2 adds handling of R_PPC64_ADDR32 relocations against the NULL .dynsym symbol entry to the PPC64 runtime relocation routines, so it is prepared to deal with CRCs being emitted as 32-bit quantities. Patch #3 is the original patch from the v1 and v2 submissions. Changes since v3: - rebased onto v4.10-rc - add Suzuki's ack to patch #1 - update patch #2 to work around the binutils-powerpc behavior to only account for R_PPC64_RELATIVE relocations in the RELACOUNT entry in .dynamic Changes since v2: - added #1 and #2 - updated #3 to deal with CRC entries being emitted from assembler - added Rusty's ack (#3) Branch can be found here: https://git.kernel.org/cgit/linux/kernel/git/ardb/linux.git/log/?h=kcrctab-reloc [0] http://marc.info/?l=linux-kernel&m=147652300207369&w=2 [1] http://marc.info/?l=linux-kernel&m=147695629614409&w=2 [2] http://marc.info/?l=linux-kernel&m=147758564705776&w=2 Ard Biesheuvel (3): powerpc/reloc32: fix corrupted modversion CRCs powerpc/reloc64: add support for 32-bit CRC pseudo-symbols modversions: treat symbol CRCs as 32 bit quantities on 64 bit archs arch/powerpc/include/asm/module.h | 4 -- arch/powerpc/kernel/module_64.c | 8 --- arch/powerpc/kernel/reloc_32.S | 36 ++++++++++-- arch/powerpc/kernel/reloc_64.S | 60 ++++++++++++-------- arch/powerpc/kernel/vmlinux.lds.S | 1 + arch/powerpc/relocs_check.sh | 5 +- include/asm-generic/export.h | 7 +-- include/linux/export.h | 8 +++ include/linux/module.h | 14 ++--- kernel/module.c | 47 ++++++--------- 10 files changed, 105 insertions(+), 85 deletions(-) -- 2.7.4