linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: PRASENJIT CHAKRABORTY <pras_chakra@yahoo.com>
To: linux-mm@kvack.org
Subject: Need help in using __copy_to_user()
Date: Tue, 21 Aug 2001 05:13:09 -0700 (PDT)	[thread overview]
Message-ID: <20010821121309.29694.qmail@web14202.mail.yahoo.com> (raw)

Hello All,

   I am a new addition to this list.

I am developing a driver. Though the driver is
functioning well but I am stuck up at the point of
transferring something from kernel to user space.

I am using __copy_to_user() and before calling this I
am checking the validity of user address with
verify_area().

Now the problem is that __copy_to_user() sometimes
return value > 0 which indicates a failure. This
happens everytime the user address is not currently
present in the Physical Page i.e the when
__copy_to_user tries to copy to a page which is not
currently paged in then it fails.

Moreover if I access the user buffer from my user
program before passing it to the kernel for transfer
then __copy_to_user performs it happily or if I lock
that page through mlock() system call. I read the
documentation but nowhere I found that I need to do
something before __copy_to_user().

The problem for the time being has been workarounded
by putting __verify_write() before __copy_to_user.

So I would like to know what is wrong with my approach
or is it due to some other issue which is unknown to
me (e.g corruption etc).

I shall be grateful to you all if you kindly help me
out of this.

Thanks n Regards,

Prasenjit


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

                 reply	other threads:[~2001-08-21 12:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20010821121309.29694.qmail@web14202.mail.yahoo.com \
    --to=pras_chakra@yahoo.com \
    --cc=linux-mm@kvack.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