af_unix: fix unix_sysctl_register() error path
Subsystems (3)
PATCH 1/1 af_unix: fix unix_sysctl_register() error path
We want to kfree(table) if @table has been kmalloced, ie for non initial network namespace.
--- net/unix/sysctl_net_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/sysctl_net_unix.c +1 -1
@@ -43,7 +43,7 @@ int __net_init unix_sysctl_register(struct net *net)return 0 ; err_reg: -if (net_eq (net, &init_net)) +if (!net_eq (net, &init_net))kfree (table); err_alloc:return -ENOMEM ;
Signature · 1 line
2.37.0.rc0.161.g10f37bed90-goog
Quoted 9 lines · Eric Dumazet
We want to kfree(table) if @table has been kmalloced, ie for non initial network namespace.
Fixes 849d5aa3a1d8 ("af_unix: Do not call kmemdup() for init_net's sysctl table.")Signed-off-by Eric Dumazet <[email protected]>Cc Kuniyuki Iwashima <[email protected]>Cc Eric W. Biederman <[email protected]>---
Wrong tag in [PATCH net], this patch is for net-next tree.
PATCH 1/1 af_unix: fix unix_sysctl_register() error path
In reply to Eric DumazetFrom: Eric Dumazet <[email protected]> Date: Fri, 8 Jul 2022 16:28:58 +0000
Quoted 5 lines
We want to kfree(table) if @table has been kmalloced, ie for non initial network namespace.
Fixes 849d5aa3a1d8 ("af_unix: Do not call kmemdup() for init_net's sysctl table.")Signed-off-by Eric Dumazet <[email protected]>
Sorry for my carelessness and thank you for the fix!
Best regards,
Kuniyuki
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 9 lines · On Fri, 8 Jul 2022 16:28:58 +0000 you wrote:
We want to kfree(table) if @table has been kmalloced, ie for non initial network namespace.
Fixes 849d5aa3a1d8 ("af_unix: Do not call kmemdup() for init_net's sysctl table.")Signed-off-by Eric Dumazet <[email protected]>Cc Kuniyuki Iwashima <[email protected]>Cc Eric W. Biederman <[email protected]>[...]
Here is the summary with links:
- [net] af_unix: fix unix_sysctl_register() error path
https://git.kernel.org/netdev/net-next/c/44ac441a51a7
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html