diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2021-12-09 15:22:54 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2021-12-12 14:28:38 +0000 |
| commit | a4007ae10c8ffdd89155b4e0b6665b721d7b0a6c (patch) | |
| tree | de3cdc80a1940c624b2deacb259e09fb9cc5261e | |
| parent | 9cf78c1cf6e8909e4b5eaedeb86482904c0bbdc4 (diff) | |
| -rw-r--r-- | sys/kern/imgact_elf.c | 10 |
1 files changed, 10 insertions, 0 deletions
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) |
