lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6ac21f07-45ef-4e80-bedf-c0470df47bc7@bootlin.com>
Date: Wed, 17 Sep 2025 17:32:55 +0200
From: Bastien Curutchet <bastien.curutchet@...tlin.com>
To: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
Cc: Björn Töpel <bjorn@...nel.org>,
 Magnus Karlsson <magnus.karlsson@...el.com>,
 Jonathan Lemon <jonathan.lemon@...il.com>,
 Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
 Andrii Nakryiko <andrii@...nel.org>, Martin KaFai Lau
 <martin.lau@...ux.dev>, Eduard Zingerman <eddyz87@...il.com>,
 Song Liu <song@...nel.org>, Yonghong Song <yonghong.song@...ux.dev>,
 John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>,
 Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>,
 Jiri Olsa <jolsa@...nel.org>, Mykola Lysenko <mykolal@...com>,
 Shuah Khan <shuah@...nel.org>, "David S. Miller" <davem@...emloft.net>,
 Jakub Kicinski <kuba@...nel.org>, Jesper Dangaard Brouer <hawk@...nel.org>,
 Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
 Alexis Lothore <alexis.lothore@...tlin.com>, netdev@...r.kernel.org,
 bpf@...r.kernel.org, linux-kselftest@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v3 03/14] selftests/bpf: test_xsk: Fix memory
 leaks

Hi Maciej

On 9/16/25 7:58 PM, Maciej Fijalkowski wrote:
> On Thu, Sep 04, 2025 at 12:10:18PM +0200, Bastien Curutchet (eBPF Foundation) wrote:
>> Some tests introduce memory leaks by not freeing all the pkt_stream
>> objects they're creating.
>>
>> Fix these memory leaks.
> 
> I would appreciate being more explicit here as I've been scratching my
> head here.
> 

Indeed it lacks details sorry. IIRC I spotted these with valgrind, maybe 
I can add valgrind's output to the commit log in next iteration.

>  From what I see the problem is with testapp_stats_rx_dropped() as it's the
> one case that uses replace and receive half of pkt streams, both of which
> overwrite the default pkt stream. So we lose a pointer to one of pkt
> streams and leak it eventually.
> 

Exactly, we lose pointers in some cases when xsk->pkt_stream gets 
replaced by a new stream. testapp_stats_rx_dropped() is the most 
convoluted of these cases.

Best regards,
-- 
Bastien Curutchet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ