The patch titled proc: put check_mem_permission before __get_free_page in mem_read has been removed from the -mm tree. Its filename was proc-put-check_mem_permission-before-__get_free_page-in-mem_read.patch This patch was dropped because it was nacked The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: proc: put check_mem_permission before __get_free_page in mem_read From: Jovi Zhang <bookjovi@xxxxxxxxx> It would be better to put check_mem_permission() before __get_free_page() in mem_read(), to be same as mem_write(). Signed-off-by: Jovi Zhang <bookjovi@xxxxxxxxx> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> Reviewed-by: Stephen Wilson <wilsons@xxxxxxxx> Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/proc/base.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff -puN fs/proc/base.c~proc-put-check_mem_permission-before-__get_free_page-in-mem_read fs/proc/base.c --- a/fs/proc/base.c~proc-put-check_mem_permission-before-__get_free_page-in-mem_read +++ a/fs/proc/base.c @@ -831,23 +831,21 @@ static ssize_t mem_read(struct file * fi if (!task) goto out_no_task; - ret = -ENOMEM; - page = (char *)__get_free_page(GFP_TEMPORARY); - if (!page) - goto out; - mm = check_mem_permission(task); ret = PTR_ERR(mm); if (IS_ERR(mm)) - goto out_free; + goto out_task; ret = -EIO; - if (file->private_data != (void*)((long)current->self_exec_id)) - goto out_put; + goto out_mm; + + ret = -ENOMEM; + page = (char *)__get_free_page(GFP_TEMPORARY); + if (!page) + goto out_mm; ret = 0; - while (count > 0) { int this_len, retval; @@ -870,12 +868,10 @@ static ssize_t mem_read(struct file * fi count -= retval; } *ppos = src; - -out_put: - mmput(mm); -out_free: free_page((unsigned long) page); -out: +out_mm: + mmput(mm); +out_task: put_task_struct(task); out_no_task: return ret; _ Patches currently in -mm which might be from bookjovi@xxxxxxxxx are linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html