From patchwork Wed Aug 29 06:47:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 963253 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 420bpZ73YQz9ryn for ; Wed, 29 Aug 2018 16:49:58 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bFJMHFlM"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 420bpZ5Vg4zF318 for ; Wed, 29 Aug 2018 16:49:58 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bFJMHFlM"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 420bmN1TKgzDrJ7 for ; Wed, 29 Aug 2018 16:48:04 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bFJMHFlM"; dkim-atps=neutral Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by bilbo.ozlabs.org (Postfix) with ESMTP id 420bmN0jHVz8vCd for ; Wed, 29 Aug 2018 16:48:04 +1000 (AEST) Received: by ozlabs.org (Postfix) id 420bmN0XZsz9s4c; Wed, 29 Aug 2018 16:48:04 +1000 (AEST) Delivered-To: linuxppc-dev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linaro.org (client-ip=2a00:1450:4864:20::543; helo=mail-ed1-x543.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bFJMHFlM"; dkim-atps=neutral Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 420bmM2bh1z9s3Z for ; Wed, 29 Aug 2018 16:48:02 +1000 (AEST) Received: by mail-ed1-x543.google.com with SMTP id h4-v6so3105705edi.6 for ; Tue, 28 Aug 2018 23:48:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=3uQDAacTbAtwviVNGniY9/23Bso6idUJzw2KBLmeYMI=; b=bFJMHFlMc6xKxK0NgnrbiLrzad6jl+W3+fahQXnAsX2E9MdPSJHvmlvlJuspsJuelA hM4dYr2zGbklTQ07dY/LNPLQnthP/WqqGJryP9LWis1biv+IIryjNCLelRu7heSvizXo YecoocKrGCNk4d/Ic7KGV6yoh2L+6bOkzL1qQ= 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=3uQDAacTbAtwviVNGniY9/23Bso6idUJzw2KBLmeYMI=; b=mU6x0ufoqDx2bdHgOuL20FprxM7s/xIWotc+dMtk6v6w7XAg3XM4LKQZv1Qf2c1ZJk ZeQ1S/3YtDh4HS594/RckyEafCF63M4BjGSJZ77FWgNUMPyFKbJRdgjjjhN41kvKgK1G BzUvqb+oOKZzN9kcASQEvb2Ry2YsG+3zweXsfVA1wqfLJc7OSzJ/ZD4cAHJL+fM2/DwP 6M4DauUw1PLYn8cpq3gp0R7IIhp3Z6FvPekOKCbpuXBqM7SYcDruu7bXC/urOsODgHXS 6OStp7s/B2DhG3MGi50GhQtsRyNzmUMdvx7jSK6asJdUGp4N81aC7imea2stpfd6XGML +woQ== X-Gm-Message-State: APzg51Dt/YZL4b/p/YyU1NNeDgBprm0FGdMox0L4DRk3WFKGR6Csj3pp uNENQYhoOyrGG4Vi07nTNqsL89qzJZAQGwaz X-Google-Smtp-Source: ANB0Vda+23Je/vT5z5wj9zDRkwgVrjqn0bUFmzQ96LlcnCATv8BIOO5CA6N0qznQXS6GpmfBnTpwuw== X-Received: by 2002:a50:cd58:: with SMTP id d24-v6mr2022470edj.1.1535525279886; Tue, 28 Aug 2018 23:47:59 -0700 (PDT) Received: from localhost.localdomain ([2a02:a212:9283:9800:5106:4d27:cd08:ce27]) by smtp.gmail.com with ESMTPSA id 25-v6sm1639550edz.45.2018.08.28.23.47.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Aug 2018 23:47:59 -0700 (PDT) From: Ard Biesheuvel To: linuxppc-dev@ozlabs.org Subject: [PATCH] powerpc: disable support for relative ksymtab references Date: Wed, 29 Aug 2018 08:47:53 +0200 Message-Id: <20180829064753.7133-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Ard Biesheuvel , will.deacon@arm.com, nicholas.piggin@gmail.com, schwab@linux-m68k.org, jeyu@kernel.org, akpm@linux-foundation.org, mingo@kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The newly added code that emits ksymtab entries as pairs of 32-bit relative references interacts poorly with the way powerpc lays out its address space: when a module exports a per-CPU variable, the primary module region covering the ksymtab entry -and thus the 32-bit relative reference- is too far away from the actual per-CPU variable's base address (to which the per-CPU offsets are applied to obtain the respective address of each CPU's copy), resulting in corruption when the module loader attempts to resolve symbol references of modules that are loaded on top and link to the exported per-CPU symbol. So let's disable this feature on powerpc. Even though it implements CONFIG_RELOCATABLE, it does not implement CONFIG_RANDOMIZE_BASE and so KASLR kernels (which are the main target of the feature) do not exist on powerpc anyway. Reported-by: Andreas Schwab Suggested-by: Nicholas Piggin Signed-off-by: Ard Biesheuvel --- arch/powerpc/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index db0b6eebbfa5..a80669209155 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -177,7 +177,6 @@ config PPC select HAVE_ARCH_KGDB select HAVE_ARCH_MMAP_RND_BITS select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT - select HAVE_ARCH_PREL32_RELOCATIONS select HAVE_ARCH_SECCOMP_FILTER select HAVE_ARCH_TRACEHOOK select HAVE_CBPF_JIT if !PPC64