From patchwork Wed Feb 26 06:35:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Currey X-Patchwork-Id: 11405361 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5552138D for ; Wed, 26 Feb 2020 06:36:27 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 2C37B21556 for ; Wed, 26 Feb 2020 06:36:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=russell.cc header.i=@russell.cc header.b="QB3lHwMo"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="O4/p3ZJv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C37B21556 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=russell.cc Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-17944-patchwork-kernel-hardening=patchwork.kernel.org@lists.openwall.com Received: (qmail 13517 invoked by uid 550); 26 Feb 2020 06:36:25 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 13482 invoked from network); 26 Feb 2020 06:36:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=russell.cc; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=xzPxK0T3LkI6AKlfQxuJpPd2C1 +xMqQduZDssjupEwU=; b=QB3lHwMoFrMTwCghDNWOiSxy2EErGseqg/TawWgLL/ CmgWAj7Dq0dNddaHBCPXjD69LEOLV7nMa97QhYBdjBA8zGXO0ozC2izszq2jj42m mBBrHd0OROYbjFKjAIlIzc6xiawriOTP0HBFugkgSFrlQuxFsIuLAirOVrGyBwgZ vWO5L7+T2LRmJMIuE58XBv9bKBHSZ4wwFBRJU1TJaGpy6/4IG7c5GAjGO5DdxjJJ XMCS7iTCTY2zvROxQSV/PtIiCcOlad5r13j3EVJ2xPuaolJ/XShJjBJHoQ+T+dCj iUNw0kDVMC435P01rfRCuRyGGBGQPvwpUfMzZ+Gh9a7g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=xzPxK0T3LkI6AKlfQ xuJpPd2C1+xMqQduZDssjupEwU=; b=O4/p3ZJvPHU2wN2WkpCFFxVgXlb5y7zN1 S4fob/M5jVJbSM63v82LuesIkd809mq/nhk1qddMxU5s1ue/PuMvZV+iT1uusdwb eDj16F0M9uM+GRHnqa6CAF7BV0EM7ZCMadBbKUx3nBe+WQxOzPuEU21+V+OfBjYu MMkXMxODChCsUXnxPlVqN5OZWQOcSm/UzMV1sTZA+3huyj3b6Uk0BygbS+dbemyv T3czXUb7XtOv6mHRtgtKxs/ymizI49FCP/A8S9n2djbcmUdf2jrp47hL78xtpTBf +uXAXJEQFJZ2EQ2+gQEL47ssz5b+tUB7werucUfi7bKO6j5o/E0Cw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrleefgdelkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdduhedmnecujfgurhephffvuf ffkffoggfgsedtkeertdertddtnecuhfhrohhmpeftuhhsshgvlhhlucevuhhrrhgvhicu oehruhhstghurhesrhhushhsvghllhdrtggtqeenucffohhmrghinhepohiilhgrsghsrd horhhgnecukfhppeduvddvrdelledrkedvrddutdenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehruhhstghurhesrhhushhsvghllhdrtggt X-ME-Proxy: From: Russell Currey To: linuxppc-dev@lists.ozlabs.org Cc: jniethe5@gmail.com, Russell Currey , christophe.leroy@c-s.fr, joel@jms.id.au, mpe@ellerman.id.au, ajd@linux.ibm.com, dja@axtens.net, npiggin@gmail.com, kernel-hardening@lists.openwall.com Subject: [PATCH v5 0/8] set_memory() routines and STRICT_MODULE_RWX Date: Wed, 26 Feb 2020 17:35:43 +1100 Message-Id: <20200226063551.65363-1-ruscur@russell.cc> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Repost from v4 because I somehow missed half of the final patch. Picking up from Christophe's last series, including the following changes: - [6/8] Cast "data" to unsigned long instead of int to fix build - [8/8] New, to fix an issue reported by Jordan Niethe Christophe's last series is here: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=156428 Christophe Leroy (4): powerpc/mm: Implement set_memory() routines powerpc/kprobes: Mark newly allocated probes as RO powerpc/mm: implement set_memory_attr() powerpc/32: use set_memory_attr() Russell Currey (4): powerpc/mm/ptdump: debugfs handler for W+X checks at runtime powerpc: Set ARCH_HAS_STRICT_MODULE_RWX powerpc/configs: Enable STRICT_MODULE_RWX in skiroot_defconfig powerpc/mm: Disable set_memory() routines when strict RWX isn't enabled arch/powerpc/Kconfig | 2 + arch/powerpc/Kconfig.debug | 6 +- arch/powerpc/configs/skiroot_defconfig | 1 + arch/powerpc/include/asm/set_memory.h | 34 +++++++ arch/powerpc/kernel/kprobes.c | 17 +++- arch/powerpc/mm/Makefile | 2 +- arch/powerpc/mm/pageattr.c | 117 +++++++++++++++++++++++++ arch/powerpc/mm/pgtable_32.c | 95 +++----------------- arch/powerpc/mm/ptdump/ptdump.c | 21 ++++- 9 files changed, 202 insertions(+), 93 deletions(-) create mode 100644 arch/powerpc/include/asm/set_memory.h create mode 100644 arch/powerpc/mm/pageattr.c