[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e9f96821-6dc2-4488-b470-199415fc2548@kernel.org>
Date: Fri, 20 Jun 2025 10:00:21 +0100
From: Quentin Monnet <qmo@...nel.org>
To: Yuan Chen <chenyuan_fl@....com>, ast@...nel.org,
alexei.starovoitov@...il.com
Cc: bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
Yuan Chen <chenyuan@...inos.cn>
Subject: Re: [PATCH v3] bpftool: Fix memory leak in dump_xx_nlmsg on realloc
failure
2025-06-20 09:21 UTC+0800 ~ Yuan Chen <chenyuan_fl@....com>
> From: Yuan Chen <chenyuan@...inos.cn>
>
> In function dump_xx_nlmsg(), when realloc() fails to allocate memory,
> the original pointer to the buffer is overwritten with NULL. This causes
> a memory leak because the previously allocated buffer becomes unreachable
> without being freed.
>
> Fixes: 7900efc19214 ("tools/bpf: bpftool: improve output format for bpftool net")
> Signed-off-by: Yuan Chen <chenyuan@...inos.cn>
Reviewed-by: Quentin Monnet <qmo@...nel.org>
Thanks!
Powered by blists - more mailing lists