]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
objtool/klp: Fix XXH3 state memory leak
authorJosh Poimboeuf <jpoimboe@kernel.org>
Fri, 3 Apr 2026 00:35:53 +0000 (17:35 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 5 May 2026 04:16:01 +0000 (21:16 -0700)
The XXH3 state allocated in checksum_init() is never freed.  Free it in
checksum_finish().

Acked-by: Song Liu <song@kernel.org>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
tools/objtool/include/objtool/checksum.h

index 7fe21608722ac659f420e30a4156df86a08e3582..0bd16fe9168bf74b11d201f08160741dfa0829b7 100644 (file)
@@ -26,6 +26,7 @@ static inline void checksum_finish(struct symbol *func)
 {
        if (func && func->csum.state) {
                func->csum.checksum = XXH3_64bits_digest(func->csum.state);
+               XXH3_freeState(func->csum.state);
                func->csum.state = NULL;
        }
 }