From nobody Sun Dec 12 14:30:34 2021 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 733E418E8CD6; Sun, 12 Dec 2021 14:30:36 +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 4JBn9l08Rmz4mZ6; Sun, 12 Dec 2021 14:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 331BE229D4; Sun, 12 Dec 2021 14:30:34 +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 1BCEUYHE066670; Sun, 12 Dec 2021 14:30:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BCEUYDE066669; Sun, 12 Dec 2021 14:30:34 GMT (envelope-from git) Date: Sun, 12 Dec 2021 14:30:34 GMT Message-Id: <202112121430.1BCEUYDE066669@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: a4007ae10c8f - main - rnd_elf: add comment explaining the interface 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4007ae10c8ffdd89155b4e0b6665b721d7b0a6c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639319435; 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=r97Kk8sGxVHcr1Y+25bXIZMuohf4YR/Tv5UNSBQoQL0=; b=DW/12B0ilHu1FTqhZKCiwcNNeb7ckjUmDIwaQA7FkyEsRnIfJlhj/jVfP10I4xpUtIrCV3 ++upr1FdojpniwIbcEyDrLbOI0k2GWvzOmvMMA+nMn47WH8HFh29tADfYexeepPGof5X8r JXSFALBz7LHx3gm2w5hmFjr/z2DgEIwCoQP6KmhNMvT/Oz6S6yuMsp1ctjdA+c/4bOcMsv vDAUX+r/Gnxv97nKo00SqcP6q4ElRFDxDmG1NOAGuZzWmNPkv2ZjmlEo+Kh+L8Oa4Zo29y DlXp1r7J+lxFaBomOc9ctVTk81Py2N67cJbdIECdAmdgDdJJ8VHb2UTU9B+14g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639319435; a=rsa-sha256; cv=none; b=BhhMF7f67i4wOaFNfwtkIyJoVVx1Ma6IwZEGcuyXLQ40R9iXWA2EC1SEOyjdNGoTpvyJip YujAzhRRXq6SflC7RUCwl7QMFF7eFkhxZ8QcS4itGReB6ljSyDP2wbk52UZVewb19zBCxJ WffAmtPk2J/4b3+STTCdHVq0iNMI3TXKSrPXl/tCLTAzfcmFC/kEUnwJx5TnkPthDswTIg pr76m2pkvBLc2n2xnl5Z0kJGwVeTm+9zri/VJDL7U1y/q2J4SH4nodBPUJin3YPh8yRha7 +Pl+2LYdWzxHmPwzdFxguGQs02aAFukegRMBxB+0+b+eiQ+FkNRJJOTuwzW2XA== 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=a4007ae10c8ffdd89155b4e0b6665b721d7b0a6c commit a4007ae10c8ffdd89155b4e0b6665b721d7b0a6c Author: Konstantin Belousov AuthorDate: 2021-12-09 15:22:54 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-12 14:28:38 +0000 rnd_elf: add comment explaining the interface Requested and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33359 --- sys/kern/imgact_elf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 6fcfef4050bb..7e7d4bdc1647 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -875,6 +875,16 @@ fail: return (error); } +/* + * Select randomized valid address in the map map, between minv and + * maxv, with specified alignment. The [minv, maxv) range must belong + * to the map. Note that function only allocates the address, it is + * up to caller to clamp maxv in a way that the final allocation + * length fit into the map. + * + * Result is returned in *resp, error code indicates that arguments + * did not pass sanity checks for overflow and range correctness. + */ static int __CONCAT(rnd_, __elfN(base))(vm_map_t map, u_long minv, u_long maxv, u_int align, u_long *resp)