lkml.org 
[lkml]   [2004]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][resend] small binfmt_elf warning fix (copy_from_user return value checking) (fwd)
Jesper Juhl <juhl-lkml@dif.dk> wrote:
>
> diff -up linux-2.6.9-rc3-bk5-orig/fs/binfmt_elf.c linux-2.6.9-rc3-bk5/fs/binfmt_elf.c
> --- linux-2.6.9-rc3-bk5-orig/fs/binfmt_elf.c 2004-09-30 05:04:32.000000000 +0200
> +++ linux-2.6.9-rc3-bk5/fs/binfmt_elf.c 2004-10-06 23:21:22.000000000 +0200
> @@ -1223,7 +1223,7 @@ static void fill_psinfo(struct elf_prpsi
> len = mm->arg_end - mm->arg_start;
> if (len >= ELF_PRARGSZ)
> len = ELF_PRARGSZ-1;
> - copy_from_user(&psinfo->pr_psargs,
> + len -= copy_from_user(&psinfo->pr_psargs,
> (const char __user *)mm->arg_start, len);
> for(i = 0; i < len; i++)
> if (psinfo->pr_psargs[i] == 0)

It doesn't matter, really - we've already zeroed out the memory and will
correctly handle any uncopied data.

Maybe sticking a (void) in front of the copy_from_user() call will shut the
warning up. Although it could possibly break the build, depending on how
the architecture implements copy_from_user().
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.026 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site