ucounts: Pair inc_rlimit_ucounts with dec_rlimit_ucoutns in commit_creds
[linux-2.6-microblaze.git] / kernel / cred.c
index f784e08..3d163bf 100644 (file)
@@ -501,7 +501,7 @@ int commit_creds(struct cred *new)
                inc_rlimit_ucounts(new->ucounts, UCOUNT_RLIMIT_NPROC, 1);
        rcu_assign_pointer(task->real_cred, new);
        rcu_assign_pointer(task->cred, new);
-       if (new->user != old->user)
+       if (new->user != old->user || new->user_ns != old->user_ns)
                dec_rlimit_ucounts(old->ucounts, UCOUNT_RLIMIT_NPROC, 1);
        alter_cred_subscribers(old, -2);