All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Jesper Juhl <juhl-lkml@dif.dk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH][resend] small binfmt_elf warning fix (copy_from_user return value checking) (fwd)
Date: Sun, 24 Oct 2004 03:01:51 -0700	[thread overview]
Message-ID: <20041024030151.0c81df8f.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0410240244050.25721@dragon.hygekrogen.localhost>

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().

  reply	other threads:[~2004-10-24 10:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-24  0:49 [PATCH][resend] small binfmt_elf warning fix (copy_from_user return value checking) (fwd) Jesper Juhl
2004-10-24 10:01 ` Andrew Morton [this message]
2004-10-24 10:42   ` Jesper Juhl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041024030151.0c81df8f.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=juhl-lkml@dif.dk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.