[openib-general] Data structure size mismatch

Pradeep Satyanarayana pradeep at us.ibm.com
Tue Nov 15 21:46:11 PST 2005







Roland Dreier <rolandd at cisco.com> wrote on 11/14/2005 11:47:13 AM:

>     Pradeep> I am trying to use copy_from_user()/copy_to_user of data
>     Pradeep> structures that contains pointers.
>
> If you are defining a new interface, then the simplest thing is not to
> do that: always put pointers in a 64-bit field.
>
> If it is an existing interface that can't be changed, then there
> should be an existing compat wrapper for the system call.
>
This is for address translation. Address translations use "write()"
to a character device. write() does not have a compat wrapper and so
there are two possible approaches:

1) convert the write() to ioctl() and use the compat wrapper
approach.
2) use the test_thread_flag(TIF_32BIT) or an alternative to ascertain
if it is a 32-bit app on a 64 bit kernel and do the compat_ptr(),
else use the regular copy_*_user().

I am leaning towards the first option, since that is the correct way to
approach this and will work across all platforms. Any other suggestions?

Pradeep
pradeep at us.ibm.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20051115/d17441d7/attachment.html>


More information about the general mailing list