--- zzzz-none-000/linux-2.6.19.2/kernel/pid.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/kernel/pid.c 2007-01-19 14:42:56.000000000 +0000 @@ -27,6 +27,7 @@ #include #include #include +#include #define pid_hashfn(nr) hash_long((unsigned long)nr, pidhash_shift) static struct hlist_head *pid_hash; @@ -35,7 +36,7 @@ int pid_max = PID_MAX_DEFAULT; -#define RESERVED_PIDS 300 +#define RESERVED_PIDS 500 int pid_max_min = RESERVED_PIDS + 1; int pid_max_max = PID_MAX_LIMIT; @@ -94,7 +95,9 @@ int i, offset, max_scan, pid, last = pspace->last_pid; struct pidmap *map; - pid = last + 1; + pid = gr_random_pid(); + if (!pid) + pid = pspace->last_pid + 1; if (pid >= pid_max) pid = RESERVED_PIDS; offset = pid & BITS_PER_PAGE_MASK; @@ -299,7 +302,14 @@ */ struct task_struct *find_task_by_pid_type(int type, int nr) { - return pid_task(find_pid(nr), type); + struct task_struct *task; + + task = pid_task(find_pid(nr), type); + + if (gr_pid_is_chrooted(task)) + return NULL; + + return task; } EXPORT_SYMBOL(find_task_by_pid_type); @@ -318,6 +328,8 @@ struct task_struct *result; rcu_read_lock(); result = pid_task(pid, type); + if (gr_pid_is_chrooted(result)) + result = NULL; if (result) get_task_struct(result); rcu_read_unlock();