All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: Valdis.Kletnieks@vt.edu
Cc: arun.sharma@intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Kill a sparse warning in binfmt_elf.c
Date: Thu, 7 Oct 2004 12:16:23 -0700	[thread overview]
Message-ID: <20041007121623.674796d1.davem@davemloft.net> (raw)
In-Reply-To: <200410071854.i97IsvU5031703@turing-police.cc.vt.edu>

On Thu, 07 Oct 2004 14:54:57 -0400
Valdis.Kletnieks@vt.edu wrote:

> > dump_write() is a static function without a prototype.
> 
> static int dump_write(struct file *file, const char __user *addr, int nr)
> {
> 	return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
> }
> 
> And then go find the callers and make sure what they're passing is a
> 'const char __user *' rather than a 'const void *'....

The caller's aren't, that is the point.  They run dump_write()
with set_fs(KERNEL_DS), which allows kernel pointers to be treated
as user ones in system call handling paths, which is why the cast
is needed somewhere.


  parent reply	other threads:[~2004-10-07 19:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-06 22:45 [PATCH] Kill a sparse warning in binfmt_elf.c Arun Sharma
2004-10-07 18:11 ` Valdis.Kletnieks
2004-10-07 18:49   ` Arun Sharma
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 [this message]
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=20041007121623.674796d1.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=arun.sharma@intel.com \
    --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.