From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C77FC433FE for ; Thu, 13 Jan 2022 17:27:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 98E946B0071; Thu, 13 Jan 2022 12:27:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 93DB56B0073; Thu, 13 Jan 2022 12:27:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 805C86B0074; Thu, 13 Jan 2022 12:27:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0144.hostedemail.com [216.40.44.144]) by kanga.kvack.org (Postfix) with ESMTP id 74DBA6B0071 for ; Thu, 13 Jan 2022 12:27:30 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2516995B13 for ; Thu, 13 Jan 2022 17:27:30 +0000 (UTC) X-FDA: 79025945460.22.7E0BCA2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf19.hostedemail.com (Postfix) with ESMTP id ACEF51A0006 for ; Thu, 13 Jan 2022 17:27:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642094849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6JAs1cBVKVd9apEjPFkt89/bQIVFWGiLVSiodneQbkU=; b=Ge+4gm9RkTT9++TXfTtUzABEa+Gnv4fv+K52vH2/zsy+kM4t0UuQ8lVNQ0pPVmYPHfwvZC DTkfe39GCN9/+SXbtd0dZ99D+sOarcLaoz22KagTP5mH8D7O3RtoycEqsFgEHJywS+zkJ5 8vjxv5I6phe4uIdwz6ruvxflu+ProYo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-187-3VuFLHQSP1u5wqMgynuaxw-1; Thu, 13 Jan 2022 12:27:23 -0500 X-MC-Unique: 3VuFLHQSP1u5wqMgynuaxw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 800AD1023F4E; Thu, 13 Jan 2022 17:27:21 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C6C5485F0C; Thu, 13 Jan 2022 17:27:17 +0000 (UTC) From: Florian Weimer To: "Andy Lutomirski" Cc: linux-arch@vger.kernel.org, "Linux API" , linux-x86_64@vger.kernel.org, kernel-hardening@lists.openwall.com, linux-mm@kvack.org, "the arch/x86 maintainers" , musl@lists.openwall.com, , , "Dave Hansen" , "Kees Cook" , Andrei Vagin Subject: Re: [PATCH v3 1/3] x86: Implement arch_prctl(ARCH_VSYSCALL_CONTROL) to disable vsyscall References: <3a1c8280967b491bf6917a18fbff6c9b52e8df24.1641398395.git.fweimer@redhat.com> Date: Thu, 13 Jan 2022 18:27:15 +0100 In-Reply-To: <3a1c8280967b491bf6917a18fbff6c9b52e8df24.1641398395.git.fweimer@redhat.com> (Florian Weimer's message of "Wed, 05 Jan 2022 17:02:48 +0100") Message-ID: <874k67zguk.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Stat-Signature: rr1ys75ttwebhg4oddscnhynh8aqtdcn Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ge+4gm9R; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf19.hostedemail.com: domain of fweimer@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=fweimer@redhat.com X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: ACEF51A0006 X-HE-Tag: 1642094849-742143 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: * Florian Weimer: > Distributions struggle with changing the default for vsyscall > emulation because it is a clear break of userspace ABI, something > that should not happen. > > The legacy vsyscall interface is supposed to be used by libcs only, > not by applications. This commit adds a new arch_prctl request, > ARCH_VSYSCALL_CONTROL, with one argument. If the argument is 0, > executing vsyscalls will cause the process to terminate. Argument 1 > turns vsyscall back on (this is mostly for a largely theoretical > CRIU use case). > > Newer libcs can use a zero ARCH_VSYSCALL_CONTROL at startup to disable > vsyscall for the process. Legacy libcs do not perform this call, so > vsyscall remains enabled for them. This approach should achieves > backwards compatibility (perfect compatibility if the assumption that > only libcs use vsyscall is accurate), and it provides full hardening > for new binaries. > > The chosen value of ARCH_VSYSCALL_CONTROL should avoid conflicts > with other x86-64 arch_prctl requests. The fact that with > vsyscall=emulate, reading the vsyscall region is still possible > even after a zero ARCH_VSYSCALL_CONTROL is considered limitation > in the current implementation and may change in a future kernel > version. > > Future arch_prctls requests commonly used at process startup can imply > ARCH_VSYSCALL_CONTROL with a zero argument, so that a separate system > call for disabling vsyscall is avoided. > > Signed-off-by: Florian Weimer > Acked-by: Andrei Vagin > --- > v3: Remove warning log message. Split out test. > v2: ARCH_VSYSCALL_CONTROL instead of ARCH_VSYSCALL_LOCKOUT. New tests > for the toggle behavior. Implement hiding [vsyscall] in > /proc/PID/maps and test it. Various other test fixes cleanups > (e.g., fixed missing second argument to gettimeofday). > > arch/x86/entry/vsyscall/vsyscall_64.c | 7 ++++++- > arch/x86/include/asm/mmu.h | 6 ++++++ > arch/x86/include/uapi/asm/prctl.h | 2 ++ > arch/x86/kernel/process_64.c | 7 +++++++ > 4 files changed, 21 insertions(+), 1 deletion(-) Hello, sorry to bother you again. What can I do to move this forward? Thanks, Florian