Thread (2 messages) flat view 2 messages, 2 authors, 27d ago

Re: [PATCH net] net: fix a resource leak in copy_net_ns() error handling path

From: patchwork-bot+netdevbpf@kernel.org
Date: 2026-08-25 10:41:03
Also in: lkml

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni [off-list ref]:

On Sat, 22 Aug 2026 17:18:31 +0900 you wrote:
Currently, preinit_net() does two things:

  (1) call ns_common_init() which might fail
  (2) initialize resources which does not fail

However, preinit_net() is returning early when (1) fails, and copy_net_ns()
is jumping to the dec_ucounts: label. As a result, resources allocated by
net_alloc() are leaking. We need to call key_remove_domain() and
net_passive_dec() in order to release resources allocated by net_alloc().

[...]
Here is the summary with links:
  - [net] net: fix a resource leak in copy_net_ns() error handling path
    https://git.kernel.org/netdev/net/c/3220b62fbb8a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help