mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Davide Libenzi <davidel@xmailserver.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Oleg Nesterov <oleg@tv-sign.ru>,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: undefined reference to `__clear_user' (was: Re: [patch 2/13] signal/timer/event fds v10 - signalfd core ...)
Date: Sun, 13 May 2007 03:44:42 -0700	[thread overview]
Message-ID: <20070513034442.52f81fff.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0705131222410.2271@anakin>

On Sun, 13 May 2007 12:28:23 +0200 (CEST) Geert Uytterhoeven <geert@linux-m68k.org> wrote:

> 	Hi Davide,
> 
> On Mon, 2 Apr 2007, Davide Libenzi wrote:
> > --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> > +++ linux-2.6.21-rc5.fds/fs/signalfd.c	2007-04-02 15:06:29.000000000 -0700
> 
> > +/*
> > + * Copied from copy_siginfo_to_user() in kernel/signal.c
> > + */
> > +static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo,
> > +			     siginfo_t const *kinfo)
> > +{
> > +	long err;
> > +
> > +	BUILD_BUG_ON(sizeof(struct signalfd_siginfo) != 128);
> > +
> > +	/*
> > +	 * Unused memebers should be zero ...
> > +	 */
> > +	err = __clear_user(uinfo, sizeof(*uinfo));
>               ^^^^^^^^^^^^
> 
> Shouldn't this be `clear_user()'? I don't see any access_ok() calls
> before this call (I do see them in copy_siginfo_to_user() in
> kernel/signal.c), but of course I may miss something...
> 
> I only noticed because m68k doesn't have __clear_user(), as this routine
> was never needed by generic code before your change.
> 

The vfs does the access_ok() checking on entry to read, write, readv,
writev, pread and pwrite.

I _think_ that covers everything, in which case all the code which
implements reading and writing can use the __ functions.  We have a lot of
code which doesn't avail itself of that optimisation though: 12 zillion
sysfs and proc handlers, for a start.

(I think.  I only recently noticed this and might have missed a path).

  reply	other threads:[~2007-05-13 10:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-02 22:58 [patch 2/13] signal/timer/event fds v10 - signalfd core Davide Libenzi
2007-05-13 10:28 ` undefined reference to `__clear_user' (was: Re: [patch 2/13] signal/timer/event fds v10 - signalfd core ...) Geert Uytterhoeven
2007-05-13 10:44   ` Andrew Morton [this message]
2007-05-13 16:44     ` Davide Libenzi
2007-05-14 20:24     ` Geert Uytterhoeven
2007-05-14 20:25     ` [PATCH] m68k: implement __clear_user() Geert Uytterhoeven
2007-05-13 16:49   ` undefined reference to `__clear_user' (was: Re: [patch 2/13] signal/timer/event fds v10 - signalfd core ...) Davide Libenzi

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=20070513034442.52f81fff.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=ebiederm@xmission.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®