* copy_to_user problem
@ 2001-08-24 5:41 PRASENJIT CHAKRABORTY
2001-08-24 16:38 ` Kanoj Sarcar
0 siblings, 1 reply; 3+ messages in thread
From: PRASENJIT CHAKRABORTY @ 2001-08-24 5:41 UTC (permalink / raw)
To: linux-mm; +Cc: arund
Hello All,
I posted this problem some days back but still have
not received any solution.
So sorry for the resend again.
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: copy_to_user problem
2001-08-24 5:41 copy_to_user problem PRASENJIT CHAKRABORTY
@ 2001-08-24 16:38 ` Kanoj Sarcar
2001-08-25 8:20 ` PRASENJIT CHAKRABORTY
0 siblings, 1 reply; 3+ messages in thread
From: Kanoj Sarcar @ 2001-08-24 16:38 UTC (permalink / raw)
To: PRASENJIT CHAKRABORTY, linux-mm; +Cc: arund
Can you try copy_to_user(), and not __copy_to_user().
Kanoj
--- PRASENJIT CHAKRABORTY <pras_chakra@yahoo.com>
wrote:
> Hello All,
>
> I posted this problem some days back but still
> have
> not received any solution.
>
> So sorry for the resend again.
>
> 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/
__________________________________________________
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: copy_to_user problem
2001-08-24 16:38 ` Kanoj Sarcar
@ 2001-08-25 8:20 ` PRASENJIT CHAKRABORTY
0 siblings, 0 replies; 3+ messages in thread
From: PRASENJIT CHAKRABORTY @ 2001-08-25 8:20 UTC (permalink / raw)
To: Kanoj Sarcar, PRASENJIT CHAKRABORTY, linux-mm; +Cc: arund
Yes I tried copy_to_user as well, but to no avail as
copy_to_user is basically a call to verify_area
followed by __copy_to_user.
--- Kanoj Sarcar <kanojsarcar@yahoo.com> wrote:
> Can you try copy_to_user(), and not
> __copy_to_user().
>
> Kanoj
>
> --- PRASENJIT CHAKRABORTY <pras_chakra@yahoo.com>
> wrote:
> > Hello All,
> >
> > I posted this problem some days back but still
> > have
> > not received any solution.
> >
> > So sorry for the resend again.
> >
> > 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/
>
>
> __________________________________________________
> 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/
__________________________________________________
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-08-25 8:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-24 5:41 copy_to_user problem PRASENJIT CHAKRABORTY
2001-08-24 16:38 ` Kanoj Sarcar
2001-08-25 8:20 ` PRASENJIT CHAKRABORTY
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox