Re: [PATCH v2] modpost: prevent leak when early return no suffix .o in read_symbols()

Nathan Chancellor <[email protected]> Mon, 29 Jun 2026 19:33:40 -0700
Newsgroups dev.linux.lists.linux-kernel-mentees,org.kernel.vger.linux-kbuild,org.kernel.vger.linux-kernel
Message-ID <178278682007.3414597.2722879998608613962.b4-review@b4>
On Wed, 24 Jun 2026 11:47:42 +0700, Robertus Diawan Chris <[email protected]> wrote:
> The allocation for elf info symsearch and hdr from parse_elf() haven't
> been released when return because of modname didn't have suffix ".o".
> And it seems like the suffix ".o" check did not depends on parse_elf()
> to succeed first. So, move the suffix ".o" check before checking
> parse_elf() result to prevent resource leak when the modname didn't have
> suffix ".o" and return early.
> 
> [...]

Reviewed-by: Nathan Chancellor <[email protected]>

-- 
Cheers,
Nathan