From nobody Mon Jan 24 14:21:05 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C6E1619680D8; Mon, 24 Jan 2022 14:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JjBwy1Nycz3GmN; Mon, 24 Jan 2022 14:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643034066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VsbqR4gB838wX4McbsTfZBSIn+/b9BW715D0WgbFfM4=; b=QVd5wyMSI9f+HnnCg2VnBgl0lHN6jJWBgsyJ9RLztvEOw/+FU/WqSTschw/FRHkk6CsP6P 0OIg/XgYv2gI0zjmEXr3qCnRXZMbBiz/GQ1sGqKs34/qplbiTfIwzaSiIvcOXq+zHOJRFG G/fYDhUqhwyt4kimcwsV1EZTcH6K4a3QudYWdb8jVWfqvUW6Re4LH0TwVvaAAayUQ9/jel WLLkSL9eT3Wi98giQywhp8dFzjAPZ1+xxO3GKkbKf1XY/V5xuOFz8L6wBn4MRcLzMGG0cN 1uoBWm4AZGGBIwXBvOngvA8dcMUOj/v9PZYxivFjYsLvEikDC3fqM8tdHvBkeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBACE17897; Mon, 24 Jan 2022 14:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20OEL5e2042314; Mon, 24 Jan 2022 14:21:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20OEL5Ku042313; Mon, 24 Jan 2022 14:21:05 GMT (envelope-from git) Date: Mon, 24 Jan 2022 14:21:05 GMT Message-Id: <202201241421.20OEL5Ku042313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c595625abe8e - stable/13 - Revert "kern_exec: Add kern.stacktop sysctl." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c595625abe8e21e49c4c37986af7dde8d00c5d3b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643034066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VsbqR4gB838wX4McbsTfZBSIn+/b9BW715D0WgbFfM4=; b=XMz4y1rlw7HNY4tKWULlmmtDO6kbo/bXyBCwJf4uaZgE2XYvvUnPtcmCYY6o/UpgcLEeiD Oz5ZIQk2FJ0697Zb0tfL+77KzFIIEuHY5sV0qtBYqQvLXBZSwHXpd4rs+5OXF1miDeakTb 7aLLIay5fho6272HmgcEIQrFmBgquszKDDAKltLT4BBKiYZfO04fNg3ULzDD1ARkgiwLvQ 686V8K8KUAwVPOKWcsApp/2dunkHhv6uHF5MdRZJZNQE06PywvRmeiQrzGheSB3BxsMQxp 0Ck8hAxBAwoJeH7VnpJulx4p+uleszMDh8OQcre6UmKjKBTRxBBXGphfFZanQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643034066; a=rsa-sha256; cv=none; b=L16v10i2/fMufj0z6rUcoEdYwVeM+D16IADAIIb8bvUmG3+tfmDsNyrqf8gVOfmdrKDa/V MFShFXBrPIRnD4PRHCJctvfCAWSDUxaHVtwOJMWG1FrM2a/D2jNmb4I/8nnNym7+hYABWl ZMJrliytGWqYK3rvsTd+HbKSsPx47uQ1S3GxZ/yg0WArEa1q6jrRHAfSMuPvN2aBiLki/4 vj1JgnznAN9pZB9CgjT2D/7ulze565Dv/jaHgOP8ahKtc6WRF4DeicKbBKm05axUekOsFL KX8mgRYzgvEfmPsL0kkHSJ8PRVrnnjQzD4keaFE92ym/TfMQ/miAdU+aChR53w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c595625abe8e21e49c4c37986af7dde8d00c5d3b commit c595625abe8e21e49c4c37986af7dde8d00c5d3b Author: Mark Johnston AuthorDate: 2022-01-17 16:41:58 +0000 Commit: Mark Johnston CommitDate: 2022-01-24 14:20:21 +0000 Revert "kern_exec: Add kern.stacktop sysctl." The current ASLR stack gap feature will be removed, and with that the need for the kern.stacktop sysctl is gone. All consumers have been removed. This reverts commit a97d697122da2bfb0baae5f0939d118d119dae33. Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 1544f5add8c72c28e939a1557e3e319c6cfe5008) --- sys/kern/kern_exec.c | 31 +------------------------------ sys/sys/sysctl.h | 1 - 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 2031f8b46ef9..97857c82f7a7 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -119,7 +119,6 @@ SYSCTL_INT(_kern, OID_AUTO, coredump_pack_vmmapinfo, CTLFLAG_RWTUN, static int sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS); static int sysctl_kern_usrstack(SYSCTL_HANDLER_ARGS); -static int sysctl_kern_stacktop(SYSCTL_HANDLER_ARGS); static int sysctl_kern_stackprot(SYSCTL_HANDLER_ARGS); static int do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, struct vmspace *oldvmspace); @@ -134,10 +133,6 @@ SYSCTL_PROC(_kern, KERN_USRSTACK, usrstack, CTLTYPE_ULONG|CTLFLAG_RD| CTLFLAG_CAPRD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_usrstack, "LU", "Top of process stack"); -SYSCTL_PROC(_kern, KERN_STACKTOP, stacktop, CTLTYPE_ULONG | CTLFLAG_RD | - CTLFLAG_CAPRD | CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_stacktop, "LU", - "Top of process stack with stack gap."); - SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_stackprot, "I", "Stack memory permissions"); @@ -196,31 +191,7 @@ sysctl_kern_usrstack(SYSCTL_HANDLER_ARGS) #endif error = SYSCTL_OUT(req, &p->p_sysent->sv_usrstack, sizeof(p->p_sysent->sv_usrstack)); - return (error); -} - -static int -sysctl_kern_stacktop(SYSCTL_HANDLER_ARGS) -{ - vm_offset_t stacktop; - struct proc *p; - int error; - - p = curproc; -#ifdef SCTL_MASK32 - if (req->flags & SCTL_MASK32) { - unsigned int val; - - val = (unsigned int)(p->p_sysent->sv_usrstack - - p->p_vmspace->vm_stkgap); - error = SYSCTL_OUT(req, &val, sizeof(val)); - } else -#endif - { - stacktop = p->p_sysent->sv_usrstack - p->p_vmspace->vm_stkgap; - error = SYSCTL_OUT(req, &stacktop, sizeof(stacktop)); - } - return (error); + return error; } static int diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index c8c9dddc146d..9e9bd723f4bd 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -982,7 +982,6 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define KERN_HOSTUUID 36 /* string: host UUID identifier */ #define KERN_ARND 37 /* int: from arc4rand() */ #define KERN_MAXPHYS 38 /* int: MAXPHYS value */ -#define KERN_STACKTOP 39 /* int: USRSTACK - stack gap */ /* * KERN_PROC subtypes */