Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 May 2021 12:35:39 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 67dc1da8f32a - stable/13 - imgact_elf: Ensure that the return value in parse_notes is initialized
Message-ID:  <202105031235.143CZdvH020959@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=67dc1da8f32a36e2017cabda4ad6e974a22207b4

commit 67dc1da8f32a36e2017cabda4ad6e974a22207b4
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-04-26 18:53:16 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-05-03 12:35:33 +0000

    imgact_elf: Ensure that the return value in parse_notes is initialized
    
    parse_notes relies on the caller-supplied callback to initialize "res".
    Two callbacks are used in practice, brandnote_cb and note_fctl_cb, and
    the latter fails to initialize res.  Fix it.
    
    In the worst case, the bug would cause the inner loop of check_note to
    examine more program headers than necessary, and the note header usually
    comes last anyway.
    
    Reviewed by:    kib
    Reported by:    KMSAN
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D29986
    
    (cherry picked from commit 409ab7e109c692014e3484a74af248dd7a4746e8)
---
 sys/kern/imgact_elf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 245894926ee1..c4aedbe6bbfa 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -2736,6 +2736,7 @@ note_fctl_cb(const Elf_Note *note, void *arg0, boolean_t *res)
 	desc = (const Elf32_Word *)p;
 	*arg->has_fctl0 = TRUE;
 	*arg->fctl0 = desc[0];
+	*res = TRUE;
 	return (TRUE);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105031235.143CZdvH020959>