From nobody Tue Jan 18 19:58:04 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 DE7A119586D2; Tue, 18 Jan 2022 19:58:09 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jdfhc5vcwz50q3; Tue, 18 Jan 2022 19:58:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x736.google.com with SMTP id t66so284255qkb.4; Tue, 18 Jan 2022 11:58:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OQFaKy13HufzM7R7h/X2V8CefXoCIcH5z44KcUW6eiQ=; b=oqasaMejW4bRQ/BMaEWTYl694eIdtkgWppDsV1lknyA0SxtmDIRP5KkNJ0Tqag3zqR yTHei2tZFIsiqSzenWTARJjcDKVsq0EimUo36VnXXf8oLOEpgaUvRQDzC5B4e37dDprl cOOoshHqNGa3VTw0wojsz+dx4ClTHQM3rdLD28hAUNaA4crn+endqExIkFzJPvrcZnH6 3nkfk1bDIGBgHPYfHgSL843mOXF3SS7tPTLKSz9UM/U9mcntfBFacU9Z/KPk2cFC8CNv zivG5wfYwOvzAQVFCQzLtAi3xHGAPxenmVtGNDO9h0BYiS9Aa45j/DSLf4p076eyCTx9 bX9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=OQFaKy13HufzM7R7h/X2V8CefXoCIcH5z44KcUW6eiQ=; b=B28MBtE/UcFjXtoNHP2gjiE0HwVw3QqzURoWYC7VU1L8g+cZrJf300LohAkS+LOjDO ZoO7xWMngg8OCKR2cqGr7tW7E303AaMdCAfwCz76dgdG/QCyV4tgB3tSGDim+GWrIP8X RdbsMcDAPn+nvh6SPqTSArPA0KlMCU4BqEUsyzcAZpVOy/L5V1JgvSVLRa05qaEdztpW Q1RPUiUDjYgsGz+vkH/9ozV5g8DvTeGprYCTbMiYWwyfq7shuZl8l6P0MvTo4HANrmwW 8E504XiE1VqL2R8ICyFuVCJd6FWzL4JIB2v5uXrDSwr69CO/D58mgDgUwLnlCPRwpXOy XjWg== X-Gm-Message-State: AOAM530FrG/5/8R7XFXCaLCVTIc7ITsZ9WcqnTEgAwZP8+yxK/5BoFLS +P7l0sutot+honKBocA/E5ZwmFAmZJ8= X-Google-Smtp-Source: ABdhPJwM68JPU3aixngPhW99fOb0sF/gA6N65/cPIKsA0Lem5C7LTFINfO4LrIcV2xBG9WRYzrKRag== X-Received: by 2002:a05:620a:269a:: with SMTP id c26mr19361718qkp.497.1642535887957; Tue, 18 Jan 2022 11:58:07 -0800 (PST) Received: from nuc (198-84-189-58.cpe.teksavvy.com. [198.84.189.58]) by smtp.gmail.com with ESMTPSA id s19sm11556822qtk.40.2022.01.18.11.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 11:58:07 -0800 (PST) Sender: Mark Johnston Date: Tue, 18 Jan 2022 14:58:04 -0500 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 706f4a81a812 - main - exec: Introduce the PROC_PS_STRINGS() macro Message-ID: References: <202201172113.20HLD7v9006931@gitrepo.freebsd.org> <4e0db863-71fd-faa3-41f1-3cb05d539def@FreeBSD.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <4e0db863-71fd-faa3-41f1-3cb05d539def@FreeBSD.org> X-Rspamd-Queue-Id: 4Jdfhc5vcwz50q3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=oqasaMej; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::736 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-2.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::736:from]; MLMMJ_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-ThisMailContainsUnwantedMimeParts: N On Tue, Jan 18, 2022 at 07:31:47AM -0800, John Baldwin wrote: > On 1/17/22 1:13 PM, Mark Johnston wrote: > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=706f4a81a81250a326ea25914e7effe1768f1a37 > > > > commit 706f4a81a81250a326ea25914e7effe1768f1a37 > > Author: Mark Johnston > > AuthorDate: 2022-01-17 16:42:28 +0000 > > Commit: Mark Johnston > > CommitDate: 2022-01-17 21:11:54 +0000 > > > > exec: Introduce the PROC_PS_STRINGS() macro > > > > Rather than fetching the ps_strings address directly from a process' > > sysentvec, use this macro. With stack address randomization the > > ps_strings address is no longer fixed. > > > > Reviewed by: kib > > MFC after: 2 weeks > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D33704 > > FWIW, in CheriBSD we have a 'p_psstrings' member in struct proc that is a pointer > to the ps_strings structure in user space that is set by the ABI during exec. I did the exact same thing in an earlier version of the patch. It ended up being more useful to keep the stacktop address, and to derive the ps_strings address from that. I would like to MFC this as well, and that'll be easier without having modified the layout of struct proc. > CHERI removes the need for ASLR, but due to alignment requirements of capabilities > the stack is not a fixed location as its address can vary based on the size. Is it possible to use PROC_PS_STRINGS() there?