lkml.org 
[lkml]   [2010]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] binfmt_elf_fdpic: Fix clear_user() error handling
On Tue, Jun 01, 2010 at 02:10:47PM +0100, David Howells wrote:
> From: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
>
> clear_user() returns the number of bytes that could not be copied rather than
> an error code. So we should return -EFAULT rather than directly returning the
> results.
>
> Without this patch, positive values may be returned to elf_fdpic_map_file()
> and the following error handlings do not function as expected.
>
> 1.
> ret = elf_fdpic_map_file_constdisp_on_uclinux(params, file, mm);
> if (ret < 0)
> return ret;
> 2.
> ret = elf_fdpic_map_file_by_direct_mmap(params, file, mm);
> if (ret < 0)
> return ret;
>
> Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
> Signed-off-by: David Howells <dhowells@redhat.com>
> Acked-by: Mike Frysinger <vapier@gentoo.org>
> CC: Alexander Viro <viro@zeniv.linux.org.uk>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: Daisuke HATAYAMA <d.hatayama@jp.fujitsu.com>
> CC: Paul Mundt <lethal@linux-sh.org>

Acked-by: Paul Mundt <lethal@linux-sh.org>


\
 
 \ /
  Last update: 2010-06-02 10:23    [W:0.322 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site