git: 06250515cff5 - main - imgact_elf: compute auxv buffer size instead of using magic value

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Jun 21 16:07:15 UTC 2021


The branch main has been updated by trasz:

URL: https://cgit.FreeBSD.org/src/commit/?id=06250515cff552217d14145e8932cb1a543a7e07

commit 06250515cff552217d14145e8932cb1a543a7e07
Author:     Edward Tomasz Napierala <trasz at FreeBSD.org>
AuthorDate: 2021-06-21 14:34:19 +0000
Commit:     Edward Tomasz Napierala <trasz at FreeBSD.org>
CommitDate: 2021-06-21 16:07:07 +0000

    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
---
 sys/kern/imgact_elf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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);


More information about the dev-commits-src-all mailing list