unshare-fix-nsproxy-leak-in-ksys_unshare-on-set_cred_ucounts-failure.patch removed from -mm tree
The quilt patch titled
Subject: unshare: fix nsproxy leak in ksys_unshare() on set_cred_ucounts() failure
has been removed from the -mm tree. Its filename was
unshare-fix-nsproxy-leak-in-ksys_unshare-on-set_cred_ucounts-failure.patch
This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Michal Grzedzicki <[email protected]>
Subject: unshare: fix nsproxy leak in ksys_unshare() on set_cred_ucounts() failure
Date: Fri, 13 Feb 2026 11:39:59 -0800
When set_cred_ucounts() fails in ksys_unshare() new_nsproxy is leaked.
Let's call put_nsproxy() if that happens.
---
kernel/fork.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
kernel/fork.c renamed from kernel/fork.c~unshare-fix-nsproxy-leak-in-ksys_unshare-on-set_cred_ucounts-failure +7 -4
@@ -3174,11 +3174,10 @@ int ksys_unshare(unsigned long unshare_f new_cred, new_fs);if (err) goto bad_unshare_cleanup_cred; -if (new_cred) { err =set_cred_ucounts (new_cred);if (err) - goto bad_unshare_cleanup_cred; + goto bad_unshare_cleanup_nsproxy; }if (new_fs || new_fd || do_sysvsem || new_cred || new_nsproxy) {
@@ -3194,8 +3193,10 @@ int ksys_unshare(unsigned long unshare_fshm_init_task (current); } -if (new_nsproxy) +if (new_nsproxy) {switch_task_namespaces (current, new_nsproxy); + new_nsproxy =NULL ; + }task_lock (current);
@@ -3224,13 +3225,15 @@ int ksys_unshare(unsigned long unshare_fperf_event_namespaces (current); +bad_unshare_cleanup_nsproxy: +if (new_nsproxy) +put_nsproxy (new_nsproxy); bad_unshare_cleanup_cred:if (new_cred)put_cred (new_cred); bad_unshare_cleanup_fd:if (new_fd)put_files_struct (new_fd); - bad_unshare_cleanup_fs:if (new_fs)free_fs_struct (new_fs);
_
Patches currently in -mm which might be from [email protected] are