From patchwork Tue Apr 2 16:27:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 10882093 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 F10C71708 for ; Tue, 2 Apr 2019 16:28:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7A7328718 for ; Tue, 2 Apr 2019 16:28:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB69A28769; Tue, 2 Apr 2019 16:28:17 +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 7BC7628718 for ; Tue, 2 Apr 2019 16:28:17 +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=zwcdAsW6YJdIeUrqWUk276LYCghfLk4fnB56AH52ass=; b=GsYtDFFPbJq+6P rDcjKQpd7Y+KlzFZ3iavtHTr3G8dkKpMUZAINjV3IpPO3jH82iAdA7fckPZnNW+Vq6zDll6FphSI5 fJNaiU6BeHxPK/GLa9gf7Ndh41pEY9GscwkS6N0x8LQNgt7pQOTgbAgS8D6ROtdkEzD913PmOlbBq cIMwcT7CinlzJPtuGTSdtMAtDByhRGtbjqZk6ZvyidLt5eYPZRngkDd9H3JJJXyVxnkWuPVS5IGLA 5Jxzlk2eugMtWjSj6KMneqQvz0eAZxf35WOLx4pINfirpFMB6eLhMy/k0Ld4e+/ozDcgoj3ppwRl9 HDecuUyiSQUZcStoNSeg==; 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 1hBMGl-00087w-VQ; Tue, 02 Apr 2019 16:28:15 +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 1hBMGh-00086E-EP for linux-arm-kernel@lists.infradead.org; Tue, 02 Apr 2019 16:28:14 +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 46B11374; Tue, 2 Apr 2019 09:28:10 -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 596553F721; Tue, 2 Apr 2019 09:28:09 -0700 (PDT) From: Vincenzo Frascino To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 0/4] arm64: compat: Add kuser helpers config option Date: Tue, 2 Apr 2019 17:27:53 +0100 Message-Id: <20190402162757.13491-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_092813_328135_A5A3DD87 X-CRM114-Status: GOOD ( 11.73 ) 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: -------- v3: - Fix aarch32_alloc_vdso_pages() 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 | 165 +++++++++++++++++++++++------ 9 files changed, 225 insertions(+), 102 deletions(-) create mode 100644 arch/arm64/kernel/sigreturn32.S