public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] rtnetlink: Fix small memory leaks
@ 2025-02-12  8:23 Bastien Curutchet (eBPF Foundation)
  2025-02-12  8:23 ` [PATCH net 1/2] rtnetlink: Fix rtnl_net_cmp_locks() when DEBUG is off Bastien Curutchet (eBPF Foundation)
  2025-02-12  8:23 ` [PATCH net 2/2] rtnetlink: Release nets when leaving rtnl_setlink() Bastien Curutchet (eBPF Foundation)
  0 siblings, 2 replies; 7+ messages in thread
From: Bastien Curutchet (eBPF Foundation) @ 2025-02-12  8:23 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Nikolay Aleksandrov, Kuniyuki Iwashima
  Cc: Alexis Lothore, Thomas Petazzoni, netdev, linux-kernel,
	Bastien Curutchet (eBPF Foundation), stable

Hi all,

I ran into a small memory leak while working on the BPF selftests suite
on the bpf-next tree. It leads to an oom-kill after thousands of iterations
in the qemu environment provided by tools/testing/selftests/bpf/vmtest.sh.

To reproduce the issue from the net-next tree:
$ git remote add bpf-next https://github.com/kernel-patches/bpf
$ git fetch bpf-next
$ git cherry-pick 723f1b9ce332^..edb996fae276
$ tools/testing/selftests/bpf/vmtest.sh -i -s "bash -c 'for i in {1..8192}; do ./test_progs -t xdp_veth_redirect; done'"
[... coffee break ...]
[ XXXX.YYYYYY] sh invoked oom-killer: gfp_mask=0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_COMP|__GFP_ZERO), order=0, oom_score_adj=0
[...]
[ XXXX.YYYYYY] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/,task=bash,pid=116,uid=0
[ XXXX.YYYYYY] Out of memory: Killed process 116 (bash) total-vm:6816kB, anon-rss:2816kB, file-rss:240kB, shmem-rss:0kB, UID:0 pgtables:48kB oom_score_adj:0

Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
---
Bastien Curutchet (eBPF Foundation) (2):
      rtnetlink: Fix rtnl_net_cmp_locks() when DEBUG is off
      rtnetlink: Release nets when leaving rtnl_setlink()

 net/core/rtnetlink.c | 4 ++++
 1 file changed, 4 insertions(+)
---
base-commit: 5d332c1ad3226c0a31653dbf2391bd332e157625
change-id: 20250211-rtnetlink_leak-8b12ca5c83f3

Best regards,
-- 
Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-02-12  9:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12  8:23 [PATCH net 0/2] rtnetlink: Fix small memory leaks Bastien Curutchet (eBPF Foundation)
2025-02-12  8:23 ` [PATCH net 1/2] rtnetlink: Fix rtnl_net_cmp_locks() when DEBUG is off Bastien Curutchet (eBPF Foundation)
2025-02-12  8:45   ` Kuniyuki Iwashima
2025-02-12  9:07     ` Bastien Curutchet
2025-02-12  8:23 ` [PATCH net 2/2] rtnetlink: Release nets when leaving rtnl_setlink() Bastien Curutchet (eBPF Foundation)
2025-02-12  8:31   ` Kuniyuki Iwashima
2025-02-12  9:05     ` Bastien Curutchet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox