Messages in this thread | | | Date | Sun, 24 Oct 2004 03:01:51 -0700 | From | Andrew Morton <> | Subject | Re: [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/
| |