Commit a261fcc
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 c892d0d commit a261fcc
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3132 | 3132 | | |
3133 | 3133 | | |
3134 | 3134 | | |
3135 | | - | |
3136 | 3135 | | |
3137 | 3136 | | |
3138 | 3137 | | |
3139 | | - | |
| 3138 | + | |
3140 | 3139 | | |
3141 | 3140 | | |
3142 | 3141 | | |
| |||
3152 | 3151 | | |
3153 | 3152 | | |
3154 | 3153 | | |
3155 | | - | |
| 3154 | + | |
3156 | 3155 | | |
| 3156 | + | |
| 3157 | + | |
3157 | 3158 | | |
3158 | 3159 | | |
3159 | 3160 | | |
| |||
3182 | 3183 | | |
3183 | 3184 | | |
3184 | 3185 | | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
3185 | 3189 | | |
3186 | 3190 | | |
3187 | 3191 | | |
3188 | 3192 | | |
3189 | 3193 | | |
3190 | 3194 | | |
3191 | | - | |
3192 | 3195 | | |
3193 | 3196 | | |
3194 | 3197 | | |
| |||
0 commit comments