From patchwork Mon Dec 10 07:00:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Currey X-Patchwork-Id: 10720669 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 B86B51731 for ; Mon, 10 Dec 2018 07:00:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A82AA29D3B for ; Mon, 10 Dec 2018 07:00:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A682C29D66; Mon, 10 Dec 2018 07:00:44 +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 mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 279CD29D13 for ; Mon, 10 Dec 2018 07:00:42 +0000 (UTC) Received: (qmail 19563 invoked by uid 550); 10 Dec 2018 07:00:40 -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 19518 invoked from network); 10 Dec 2018 07:00:39 -0000 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=fm1; bh=5ffOq37dciL64SqFc Q5frnHjPrCplznF8cLUyzPY30w=; b=O2WqoRtHKkHzTRn6VOSaVIM8N4/vijcvK DkyGfX7AFPETXocOhXN2530TQ+E+lFWvd3DpaTSWNu9fczEB/n0nHDmflSBnMPhY xHtgR4vmv1hsFA16xD2GW0b3R4G4GSK24ooY+LNbjqINu5+7F6ymbCyimvBFOuDv viWLzAuiAuW6pV8VWLLdG8mSabq28bJoHFaK/BcAbWocK964EulSvW+TWS4u6wAG DfONHuj/vjbprDwy+yITf9DiMp5ce1nizXG8/Zfo+kY8ULLCO7Q2j9/dG9fdv4zJ 7ekzUj8bJB6KVHyZH8K2hmcQxaGEXR7VHTMDKratPUtOhXNrbyZBQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudeggedguddtiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecu fedttdenucgfrhhlucfvnfffucdluddtmdenucfjughrpefhvffufffkofgggfestdekre dtredttdenucfhrhhomheptfhushhsvghllhcuvehurhhrvgihuceorhhushgtuhhrsehr uhhsshgvlhhlrdgttgeqnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpohiilhgrsg hsrdhorhhgnecukfhppeduvddvrdelledrkedvrddutdenucfrrghrrghmpehmrghilhhf rhhomheprhhushgtuhhrsehruhhsshgvlhhlrdgttgenucevlhhushhtvghrufhiiigvpe dt X-ME-Proxy: From: Russell Currey To: linuxppc-dev@lists.ozlabs.org Cc: mikey@neuling.org, mpe@ellerman.id.au, benh@kernel.crashing.org, npiggin@gmail.com, christophe.leroy@c-s.fr, kernel-hardening@lists.openwall.com, Russell Currey Subject: [PATCH v2 0/3] [PATCH v2 0/3] Kernel Userspace Protection for Radix MMU Date: Mon, 10 Dec 2018 18:00:41 +1100 Message-Id: <20181210070044.27503-1-ruscur@russell.cc> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP This series is based on Christophe's series: http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=78469 with some minor changes. I wanted to move my patches to apply at the tail of his series to make it easier for the two of us to work on independent parts, so I'm resending my part of the series with the intent that it applies at the end. There are two required changes to his series to make this work: In patch 04/11, the #ifdef around the paca_struct flag user_access_allowed needs to be dropped. With my patches removed, patch 11/11 needs to not reference asm/book3s/64/kup-radix.h in asm/book3s/64/kup.h (so below the kup.h chunk in that patch). Sorry for being a pain, I'd rather not send a gigantic series full of patches that aren't mine. This branch shows how I'd imagine it would be pulled together: https://github.com/ruscur/linux/commits/kuap2 Since the last version of this series: - fixed issues booting on hash, and the series now fully bisects - dropped some parts which are now part of Christophe's series - Fix __patch_instruction() in early boot - save three instructions in LOCK_USER_ACCESS() Russell Currey (3): powerpc/mm/radix: Use KUEP API for Radix MMU powerpc/lib: Refactor __patch_instruction() to use __put_user_asm() powerpc/64s: Implement KUAP for Radix MMU .../powerpc/include/asm/book3s/64/kup-radix.h | 36 +++++++++++++++++++ arch/powerpc/include/asm/exception-64s.h | 15 ++++++-- arch/powerpc/include/asm/kup.h | 3 ++ arch/powerpc/include/asm/mmu.h | 9 ++++- arch/powerpc/include/asm/reg.h | 1 + arch/powerpc/lib/code-patching.c | 4 +-- arch/powerpc/mm/pgtable-radix.c | 25 +++++++++++-- arch/powerpc/mm/pkeys.c | 7 ++-- arch/powerpc/platforms/Kconfig.cputype | 2 ++ 9 files changed, 92 insertions(+), 10 deletions(-) create mode 100644 arch/powerpc/include/asm/book3s/64/kup-radix.h