git: 29ef89ab1bd7 - stable/13 - rnd_elf: add comment explaining the interface

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sun, 19 Dec 2021 02:44:29 UTC
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=29ef89ab1bd79ea33811140cdbe3401905bafec2

commit 29ef89ab1bd79ea33811140cdbe3401905bafec2
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-12-09 15:22:54 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
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)