can't find file to patch at input line 132 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |From patchwork Thu Dec 16 18:50:52 2021 |Content-Type: text/plain; charset="utf-8" |MIME-Version: 1.0 |Content-Transfer-Encoding: 7bit |X-Patchwork-Submitter: Florian Weimer |X-Patchwork-Id: 49018 |Return-Path: |X-Original-To: patchwork@sourceware.org |Delivered-To: patchwork@sourceware.org |Received: from server2.sourceware.org (localhost [IPv6:::1]) | by sourceware.org (Postfix) with ESMTP id 94BE3385843B | for ; Thu, 16 Dec 2021 18:51:27 +0000 (GMT) |DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94BE3385843B |DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; | s=default; t=1639680687; | bh=kQsFLXjdBR9elRvHqw7bzJsKFsK6a5+7VZvgNK6lAVE=; | h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: | List-Help:List-Subscribe:From:Reply-To:Cc:From; | b=xblwnyjPv/wA1wxmziU2xZFVe1QuObJ4/gmCDyq2AvI6HGm4kvXHfN0Zvdl9TEavp | 7arIu6B7nqOApbX/dtDVSP0dBFpMBrbt5bQc5z+3SckiH632TEJ0aMmEA54N4JWzxj | bGBjclMrNPJkUqkvvf7X9rGLSN8Zg05QgQ2g8r0o= |X-Original-To: libc-alpha@sourceware.org |Delivered-To: libc-alpha@sourceware.org |Received: from us-smtp-delivery-124.mimecast.com | (us-smtp-delivery-124.mimecast.com [170.10.133.124]) | by sourceware.org (Postfix) with ESMTPS id 86F8E3858D35 | for ; Thu, 16 Dec 2021 18:51:03 +0000 (GMT) |DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 86F8E3858D35 |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-608-dG_VWmWZPBijeQNWb1QoIA-1; Thu, 16 Dec 2021 13:51:00 -0500 |X-MC-Unique: dG_VWmWZPBijeQNWb1QoIA-1 |Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com | [10.5.11.16]) | (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) | (No client certificate requested) | by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5AE4B180FD62; | Thu, 16 Dec 2021 18:50:58 +0000 (UTC) |Received: from oldenburg.str.redhat.com (unknown [10.2.17.223]) | by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C1A84BC41; | Thu, 16 Dec 2021 18:50:54 +0000 (UTC) |To: "Andy Lutomirski" |Subject: [PATCH v2] x86: Implement arch_prctl(ARCH_VSYSCALL_CONTROL) to | disable vsyscall |Date: Thu, 16 Dec 2021 19:50:52 +0100 |Message-ID: <878rwkidtf.fsf@oldenburg.str.redhat.com> |User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |MIME-Version: 1.0 |X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 |X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, | DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, | RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, | SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 |X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on | server2.sourceware.org |X-BeenThere: libc-alpha@sourceware.org |X-Mailman-Version: 2.1.29 |Precedence: list |List-Id: Libc-alpha mailing list |List-Unsubscribe: , | |List-Archive: |List-Post: |List-Help: |List-Subscribe: , | |X-Patchwork-Original-From: Florian Weimer via Libc-alpha | |From: Florian Weimer |Reply-To: Florian Weimer |Cc: linux-arch@vger.kernel.org, libc-alpha@sourceware.org, | Kees Cook , kernel-hardening@lists.openwall.com, | Linux API , | the arch/x86 maintainers , musl@lists.openwall.com, | linux-kernel@vger.kernel.org, linux-mm@kvack.org, | linux-x86_64@vger.kernel.org, | Dave Hansen |Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org |Sender: "Libc-alpha" | | |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 |--- |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 | 10 +- | arch/x86/include/asm/mmu.h | 6 + | arch/x86/include/uapi/asm/prctl.h | 2 + | arch/x86/kernel/process_64.c | 7 + | tools/arch/x86/include/uapi/asm/prctl.h | 2 + | tools/testing/selftests/x86/Makefile | 13 +- | tools/testing/selftests/x86/vsyscall_control.c | 891 +++++++++++++++++++++++++ | 7 files changed, 927 insertions(+), 4 deletions(-) | |diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c |index fd2ee9408e91..8eb3bcf2cedf 100644 |--- a/arch/x86/entry/vsyscall/vsyscall_64.c |+++ b/arch/x86/entry/vsyscall/vsyscall_64.c -------------------------- File to patch: Skip this patch? [y] Skipping patch. 2 out of 2 hunks ignored can't find file to patch at input line 161 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h |index 5d7494631ea9..3934d6907910 100644 |--- a/arch/x86/include/asm/mmu.h |+++ b/arch/x86/include/asm/mmu.h -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 178 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/arch/x86/include/uapi/asm/prctl.h b/arch/x86/include/uapi/asm/prctl.h |index 754a07856817..aad0bcfbf49f 100644 |--- a/arch/x86/include/uapi/asm/prctl.h |+++ b/arch/x86/include/uapi/asm/prctl.h -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 189 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c |index 3402edec236c..834bad068211 100644 |--- a/arch/x86/kernel/process_64.c |+++ b/arch/x86/kernel/process_64.c -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 207 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/tools/arch/x86/include/uapi/asm/prctl.h b/tools/arch/x86/include/uapi/asm/prctl.h |index 754a07856817..aad0bcfbf49f 100644 |--- a/tools/arch/x86/include/uapi/asm/prctl.h |+++ b/tools/arch/x86/include/uapi/asm/prctl.h -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 218 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile |index 8a1f62ab3c8e..2a7c91ee68e0 100644 |--- a/tools/testing/selftests/x86/Makefile |+++ b/tools/testing/selftests/x86/Makefile -------------------------- File to patch: Skip this patch? [y] Skipping patch. 3 out of 3 hunks ignored patching file tools/testing/selftests/x86/vsyscall_control.c