Commit 6e608e3
unshare: fix nsproxy leak in ksys_unshare() on set_cred_ucounts() failure
[ Upstream commit a98621a ]
When set_cred_ucounts() fails in ksys_unshare() new_nsproxy is leaked.
Let's call put_nsproxy() if that happens.
Link: https://lkml.kernel.org/r/20260213193959.2556730-1-mge@meta.com
Fixes: 905ae01 ("Add a reference to ucounts for each cred")
Signed-off-by: Michal Grzedzicki <mge@meta.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexey Gladkov (Intel) <legion@kernel.org>
Cc: Ben Segall <bsegall@google.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Kees Cook <kees@kernel.org>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Cc: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 0ac17d4 commit 6e608e3
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3348 | 3348 | | |
3349 | 3349 | | |
3350 | 3350 | | |
3351 | | - | |
3352 | 3351 | | |
3353 | 3352 | | |
3354 | 3353 | | |
3355 | | - | |
| 3354 | + | |
3356 | 3355 | | |
3357 | 3356 | | |
3358 | 3357 | | |
| |||
3368 | 3367 | | |
3369 | 3368 | | |
3370 | 3369 | | |
3371 | | - | |
| 3370 | + | |
3372 | 3371 | | |
| 3372 | + | |
| 3373 | + | |
3373 | 3374 | | |
3374 | 3375 | | |
3375 | 3376 | | |
| |||
3398 | 3399 | | |
3399 | 3400 | | |
3400 | 3401 | | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
3401 | 3405 | | |
3402 | 3406 | | |
3403 | 3407 | | |
3404 | 3408 | | |
3405 | 3409 | | |
3406 | 3410 | | |
3407 | | - | |
3408 | 3411 | | |
3409 | 3412 | | |
3410 | 3413 | | |
| |||
0 commit comments