From patchwork Tue Apr 2 11:13:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 10881429 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 3638313B5 for ; Tue, 2 Apr 2019 11:13:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BA1422F3E for ; Tue, 2 Apr 2019 11:13:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F039285BE; Tue, 2 Apr 2019 11:13:36 +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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ABF6F22F3E for ; Tue, 2 Apr 2019 11:13:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1eVYpfUAy3TtcZCp1Y8SOCrUP7XnYfEcwbxp399NlhI=; b=YU4GxuH5Tp4blO rxVrCI7Uo3E/2iXga5UtIMKmUtE7iYi0l/nSR74p9NzRY5Uuz9hj45lIHEUZkC7uDBn10CZN20eu5 ou6n7CgcvIf2uNCHUytjL9NcyyCWiPVlKVs4btTX2qqWZALPznjoz+obMDawTW0ZDbKDncHMREMn8 S81n3kgs1GyjsOmSdeBAyLREkZrp9cHBqUUigwclK0KOLkPstYeg7VoCarUeFuYbsbZWJT/XPAXPZ NQEibeuwptTf40FNtBl9+TKPivdob6BPMsjmE1yjJQQgdHYq6kCiGNaZOIf+yRVS13mtfdjTVWGV2 WAifQIoe21n24iElgt8A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBHMA-0000TT-IF; Tue, 02 Apr 2019 11:13:30 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBHM7-0000SV-BN for linux-arm-kernel@lists.infradead.org; Tue, 02 Apr 2019 11:13:28 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BAA831688; Tue, 2 Apr 2019 04:13:26 -0700 (PDT) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CCAEA3F59C; Tue, 2 Apr 2019 04:13:25 -0700 (PDT) From: Vincenzo Frascino To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 0/4] arm64: compat: Add kuser helpers config option Date: Tue, 2 Apr 2019 12:13:00 +0100 Message-Id: <20190402111304.20825-1-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190402_041327_400870_75010C13 X-CRM114-Status: GOOD ( 11.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Catalin Marinas , Will Deacon Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Currently on arm64 compat kuser helper are enabled by default. To be on pair with arm32, this patchset makes it possible to disable the kuser helpers by adding a CONFIG_KUSER_HELPERS option which is enabled by default to avoid compatibility issues. When the config option is disabled: - The kuser helpers-related code is not compiled with the kernel. - The kuser helpers mapping, for any compat process, at 0xffff0000 is not done. - Any attempt to use a kuser helper from a compat process will result in a segfault. Changes: -------- v2: - Rebased on 5.1-rc3. - Addressed review comments. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Signed-off-by: Vincenzo Frascino Vincenzo Frascino (4): arm64: compat: Alloc separate pages for vectors and sigpage arm64: compat: Split kuser32 arm64: compat: Refactor aarch32_alloc_vdso_pages() arm64: compat: Add KUSER_HELPERS config option arch/arm64/Kconfig | 28 +++++ arch/arm64/include/asm/elf.h | 6 +- arch/arm64/include/asm/processor.h | 4 +- arch/arm64/include/asm/signal32.h | 2 - arch/arm64/kernel/Makefile | 5 +- arch/arm64/kernel/kuser32.S | 66 ++---------- arch/arm64/kernel/signal32.c | 5 +- arch/arm64/kernel/sigreturn32.S | 46 +++++++++ arch/arm64/kernel/vdso.c | 157 +++++++++++++++++++++++------ 9 files changed, 217 insertions(+), 102 deletions(-) create mode 100644 arch/arm64/kernel/sigreturn32.S