From: Arun Sharma <arun.sharma@intel.com>
To: Valdis.Kletnieks@vt.edu
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Kill a sparse warning in binfmt_elf.c
Date: Thu, 07 Oct 2004 11:49:24 -0700 [thread overview]
Message-ID: <41658FB4.5090402@intel.com> (raw)
In-Reply-To: <200410071811.i97IBQf0031262@turing-police.cc.vt.edu>
On 10/7/2004 11:11 AM, Valdis.Kletnieks@vt.edu wrote:
> On Wed, 06 Oct 2004 15:45:02 PDT, Arun Sharma said:
>
>> The attached patch kills a sparse warning in binfmt_elf.c:dump_write() by
>> adding a __user annotation.
>
>> static int dump_write(struct file *file, const void *addr, int nr)
>> {
>> - return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
>> + return file->f_op->write(file, (const char __user *) addr, nr, &file->f_pos) == nr;
>> }
>
> wouldn't it be more useful to put the annotation into the *prototype* for
> the dump_write() function, so that we get sparse typechecking for the
> caller(s) of this function? Your fix just kills the warning - when the *real*
> problem is that we're called with a 'void *' that we then cast to something
> without any real double check on what it is....
dump_write() is a static function without a prototype.
-Arun
next prev parent reply other threads:[~2004-10-07 18:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-06 22:45 Arun Sharma
2004-10-07 18:11 ` Valdis.Kletnieks
2004-10-07 18:49 ` Arun Sharma [this message]
2004-10-07 18:54 ` Valdis.Kletnieks
2004-10-07 19:01 ` Arun Sharma
2004-10-07 19:16 ` Valdis.Kletnieks
2004-10-07 22:07 ` Arun Sharma
2004-10-07 19:16 ` David S. Miller
2004-10-07 19:27 ` Valdis.Kletnieks
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=41658FB4.5090402@intel.com \
--to=arun.sharma@intel.com \
--cc=Valdis.Kletnieks@vt.edu \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome