From nobody Sun Dec 19 02:44:29 2021 X-Original-To: dev-commits-src-branches@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 299DC18E48CA; Sun, 19 Dec 2021 02:44:30 +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 4JGn9n4HkZz4qZl; Sun, 19 Dec 2021 02:44:29 +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 3ED4C1A6F7; Sun, 19 Dec 2021 02:44:29 +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 1BJ2iTW0012614; Sun, 19 Dec 2021 02:44:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BJ2iTFD012613; Sun, 19 Dec 2021 02:44:29 GMT (envelope-from git) Date: Sun, 19 Dec 2021 02:44:29 GMT Message-Id: <202112190244.1BJ2iTFD012613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 29ef89ab1bd7 - stable/13 - rnd_elf: add comment explaining the interface List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 29ef89ab1bd79ea33811140cdbe3401905bafec2 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639881869; 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=5QTFzXYNfMTSKFsJeGg3pqsheUVN5qjsHa0HI+Bmn7Y=; b=yy/aUFtFr3wL132HwdeGu1JB/XP255gsekcm2Tyb1LCo8Jh7RpJjWUzyxMEfj028xVQsKN y8UWQS7VUMmXW/EGLrJKVF8do6mXFQ2qxMbd9EjqhZRTzqTFq4TZ8jCi+fcZtIn63djdWB UDEsNBvyonImFJ7ytMhO5FdbzqolBXyO3xtFK67TOHwotBN7a5bbFKr3DjLmkp/aKwrNii afdMWOk7AGqZ3m5n6EC/gfyGw83H5rAKOVGyAtGc6NgsKnTrlhJNlD7rvs5RaH+50F9qWP zqKDtMM5IH8Ev2EOs2HiV4oGFDVD/932FUFNKEyiHmnvKljQcYEG5qkqfndmIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639881869; a=rsa-sha256; cv=none; b=nK7xemmYoV46YtkAzmvvwDeqnguvcMC6awPv6/cZSPdiwnfE3HucuhCwBrEbr8otDKGLjz NJHCaEji99bL54S3MB1Itr4JvZbxTNx81CqvevNBATx8Eyg3Lh+HfEAaFSoyNxhmoog/aO Go3KvHmmnZFRfc5Xqv1hsDuWv9AMYm1JyNY8fCGwBUZovBKHXn4zkqJW+MqjVsNrxJCYQo 3Xq1GJiNYIlfsRWPV0cLKtBiyZ/5Ls9r66cOQUdSXZvUW1QA0t0XdY2kikgIll80XYPiGk wT/O5WwVNaTRfDqe58KTpAQpt13qgQUhEnq3G+nphmm8qSAldw0K45rNz5waIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=29ef89ab1bd79ea33811140cdbe3401905bafec2 commit 29ef89ab1bd79ea33811140cdbe3401905bafec2 Author: Konstantin Belousov AuthorDate: 2021-12-09 15:22:54 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-19 02:42:51 +0000 rnd_elf: add comment explaining the interface (cherry picked from commit a4007ae10c8ffdd89155b4e0b6665b721d7b0a6c) --- 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 915d21b1ad0c..77ecd1538084 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -855,6 +855,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)