aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2021-06-21 14:34:19 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2021-06-21 16:07:07 +0000
commit06250515cff552217d14145e8932cb1a543a7e07 (patch)
tree3751f10ce73331d6fb29ff3b28769bce99790b56
parentab0c68ba4ae37cb83d15e64ce2a33375135ae750 (diff)
downloadsrc-06250515cff552217d14145e8932cb1a543a7e07.tar.gz
src-06250515cff552217d14145e8932cb1a543a7e07.zip
imgact_elf: compute auxv buffer size instead of using magic value
The new buffer is somewhat larger, but there should be no functional changes. Reviewed By: kib, imp Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D30821
-rw-r--r--sys/kern/imgact_elf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 57e9ac18e63b..d114070fc903 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -2456,7 +2456,8 @@ __elfN(note_procstat_auxv)(void *arg, struct sbuf *sb, size_t *sizep)
p = (struct proc *)arg;
if (sb == NULL) {
size = 0;
- sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN);
+ sb = sbuf_new(NULL, NULL, AT_COUNT * sizeof(Elf_Auxinfo),
+ SBUF_FIXEDLEN);
sbuf_set_drain(sb, sbuf_count_drain, &size);
sbuf_bcat(sb, &structsize, sizeof(structsize));
PHOLD(p);