Subject: [PATCH] Fix pid_to_user to perform the pid_visibility check From: Eric W. Biederman Date: 1129805274 -0600 I thought I had made this change earlier, but apparently not. --- include/linux/pspace.h | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) 5eba5caff68220da8542e3d263b0e85ea47ee985 diff --git a/include/linux/pspace.h b/include/linux/pspace.h index ab0ed58..770fdf3 100644 --- a/include/linux/pspace.h +++ b/include/linux/pspace.h @@ -41,13 +41,16 @@ static inline int pid_from_user(int pid) static inline int pid_to_user(int pid) { - return pid - current->pspace->offset; + pid = pid - current->pspace->offset; + if ((pid <= 0) || (pid >= current->pspace->max)) + pid = 0; + return pid; } static inline int pid_visible(int pid) { pid = pid_to_user(pid); - return (pid > 0) && (pid < current->pspace->max); + return pid > 0; } static inline void get_pspace(struct pspace *pspace) -- 1.0.GIT