[PATCH] user namespace: fix copy_user_ns return value
From: Serge E. Hallyn
Date: Thu Jul 19 2007 - 16:58:14 EST
As found by sukadev@xxxxxxxxxx, current -git, when compiled with
CONFIG_USER_NS=n, can be crashed by doing
#include <sched.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
unshare(CLONE_NEWNS);
setuid(1000);
}
as root.
The dummy version of copy_user_ns was returning NULL instead of
a valid namespace. The following patch fixes the problem.
Please apply.
thanks,
-serge