diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-01-30 15:00:39 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-01-30 15:00:39 +0100 |
| commit | 7ab004dbcbee38b8a70798835d3ffcd97a985a5e (patch) | |
| tree | 0caa6cb97801736046823ca785a5ba36bf684ac6 /kernel/ucount.c | |
| parent | 710f8af199ee9d72dd87083edd55c5ee250ee6f4 (diff) | |
| parent | 26291c54e111ff6ba87a164d85d4a4e134b7315c (diff) | |
| download | lwn-7ab004dbcbee38b8a70798835d3ffcd97a985a5e.tar.gz lwn-7ab004dbcbee38b8a70798835d3ffcd97a985a5e.zip | |
Merge tag 'v5.17-rc2' into char-misc-next
We need the char/misc fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/ucount.c')
| -rw-r--r-- | kernel/ucount.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/ucount.c b/kernel/ucount.c index 7b32c356ebc5..65b597431c86 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -190,6 +190,7 @@ struct ucounts *alloc_ucounts(struct user_namespace *ns, kuid_t uid) kfree(new); } else { hlist_add_head(&new->node, hashent); + get_user_ns(new->ns); spin_unlock_irq(&ucounts_lock); return new; } @@ -210,6 +211,7 @@ void put_ucounts(struct ucounts *ucounts) if (atomic_dec_and_lock_irqsave(&ucounts->count, &ucounts_lock, flags)) { hlist_del_init(&ucounts->node); spin_unlock_irqrestore(&ucounts_lock, flags); + put_user_ns(ucounts->ns); kfree(ucounts); } } |
