From nobody Fri Sep 16 20:25:38 2022 X-Original-To: dev-commits-src-main@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 4MTlv64pXjz4d6ln; Fri, 16 Sep 2022 20:25:38 +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 4MTlv63YTtz3MZW; Fri, 16 Sep 2022 20:25:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663359938; 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=ADf4aVKiu0samqgJo5bzQj/4RbOv3ykfv4ZrNelKk4A=; b=N3cH7WXN2MLkSiKIn+eX5pzZnzKcAhC2UITypD1nP95/ZUaPF8uciG3SN6BEQkBG0hwJCv PXBC7WXINMqKx2O/FNbjMKSdx6E+eLN79zDJsbnVo8JlbNrdBsZJNRSNtkqzinz0fQ2oWF p2mxpXT94eIz3cKZ2sIRMrGFuvhIcSD1zqgAgiqWx+Xc22i5a87JMPMs7M8lfp7cDrzRYL Eq1CmBKR1D2YV/Rp1FWkffjuLSWqDFrErA5zdbUdl2fxKqootVCD8hAv3h4KkSzfEH9v/g RvefDjIuIgX9zBxWYwL78aEPMtG+LMUddRC4Bpr5ZDym1cubIbzGWsZA0VrIsw== 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 4MTlv62Rl2zT6B; Fri, 16 Sep 2022 20:25:38 +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 28GKPcvP026317; Fri, 16 Sep 2022 20:25:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28GKPc8C026316; Fri, 16 Sep 2022 20:25:38 GMT (envelope-from git) Date: Fri, 16 Sep 2022 20:25:38 GMT Message-Id: <202209162025.28GKPc8C026316@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8f2668b0605e - main - _elf_aux_info(3): add support for AT_USRSTACK{BASE,LIM} List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f2668b0605e26b04a103f63096cfcc856d950c1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663359938; 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=ADf4aVKiu0samqgJo5bzQj/4RbOv3ykfv4ZrNelKk4A=; b=jQFxKA7QNQ2zlOV4OIQh9CdeU1mFVOoz+ZKDhhsi3nH0QglNIa+WOoFV4Z1IlhPrfuMrdK iLAtkopLeUxk59fGGNcwYwbRDQAzuf/gx92nS3ZTBKCgSpFRxhgQDrcfghGoqXdEFi66Zl ZQIbdjVO3OPG5ZCX/0eznbNpzFWME30qXZwCN+arq1YlnXLeLZw5hPKt3ZksD+fnmdfffr P51yGVa1lB7khmiogEMpDsMzBCI711/h62csUHxoLHSTVkjC2wiUGzFbjfZYC+nPW2kmrE 3hNEOyKAotvkFxCKL98dQ2NrYdkzDYEh3cV0oQK6vHdrbi5MxBrJ454fFSXlLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663359938; a=rsa-sha256; cv=none; b=K5BDVPS+EwZSeH5mMUVuOlRxzxuRu4pA3eGjlMoCdhVhzuxJW8XwLhji7SM/IUqqfLSlyr BaAMYvUUyk4uWUlKhJO2jf6vvO48Knr0IqIrFMk+I+ksiv0vfMNabNC6TKma5cNZXuz+10 +3X27OAyz4vl2Z7XbDxIM/4UXiTUQ8FtM192aEzmrdQYR33WNRH7vNsLeadnVDqcMIwuH1 Fsj7+FstH4EwZ+NJhr122YE1iDEozKUMKKAoJkZ81iw1wiM1xcWOL0j7bhBm9SpyHnnigX IkxW+8mRgQKgGr6cWYc9twJn10EhjCUHgNdrFlIBbymQxzK+k85ARrlfoWi68g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8f2668b0605e26b04a103f63096cfcc856d950c1 commit 8f2668b0605e26b04a103f63096cfcc856d950c1 Author: Konstantin Belousov AuthorDate: 2022-09-12 19:36:24 +0000 Commit: Konstantin Belousov CommitDate: 2022-09-16 20:23:32 +0000 _elf_aux_info(3): add support for AT_USRSTACK{BASE,LIM} Reviewed by: brooks, imp (previous version) Discussed with: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36540 --- lib/libc/gen/auxv.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/libc/gen/auxv.c b/lib/libc/gen/auxv.c index ae21d088a8d1..af59a2dda90a 100644 --- a/lib/libc/gen/auxv.c +++ b/lib/libc/gen/auxv.c @@ -73,6 +73,7 @@ static char *canary, *pagesizes, *execpath; static void *ps_strings, *timekeep; static u_long hwcap, hwcap2; static void *fxrng_seed_version; +static u_long usrstackbase, usrstacklim; #ifdef __powerpc__ static int powerpc_new_auxv_format = 0; @@ -144,6 +145,14 @@ init_aux(void) case AT_FXRNG: fxrng_seed_version = aux->a_un.a_ptr; break; + + case AT_USRSTACKBASE: + usrstackbase = aux->a_un.a_val; + break; + + case AT_USRSTACKLIM: + usrstacklim = aux->a_un.a_val; + break; #ifdef __powerpc__ /* * Since AT_STACKPROT is always set, and the common @@ -370,6 +379,20 @@ _elf_aux_info(int aux, void *buf, int buflen) } else res = EINVAL; break; + case AT_USRSTACKBASE: + if (buflen == sizeof(u_long)) { + *(u_long *)buf = usrstackbase; + res = 0; + } else + res = EINVAL; + break; + case AT_USRSTACKLIM: + if (buflen == sizeof(u_long)) { + *(u_long *)buf = usrstacklim; + res = 0; + } else + res = EINVAL; + break; default: res = ENOENT; break;