Commit 665dc1e
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 bba68ec commit 665dc1e
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3176 | 3176 | | |
3177 | 3177 | | |
3178 | 3178 | | |
3179 | | - | |
3180 | 3179 | | |
3181 | 3180 | | |
3182 | 3181 | | |
3183 | | - | |
| 3182 | + | |
3184 | 3183 | | |
3185 | 3184 | | |
3186 | 3185 | | |
| |||
3196 | 3195 | | |
3197 | 3196 | | |
3198 | 3197 | | |
3199 | | - | |
| 3198 | + | |
3200 | 3199 | | |
| 3200 | + | |
| 3201 | + | |
3201 | 3202 | | |
3202 | 3203 | | |
3203 | 3204 | | |
| |||
3226 | 3227 | | |
3227 | 3228 | | |
3228 | 3229 | | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
3229 | 3233 | | |
3230 | 3234 | | |
3231 | 3235 | | |
3232 | 3236 | | |
3233 | 3237 | | |
3234 | 3238 | | |
3235 | | - | |
3236 | 3239 | | |
3237 | 3240 | | |
3238 | 3241 | | |
| |||
0 commit comments