On Tue, Jan 3, 2017 at 10:59 PM, Pradeepa Kumar <cdpradeepa@xxxxxxxxx> wrote:
my app is crashing as it is trying iterate cmsghdrsit got after call to recvmsg();To give some contextbelow is the flow32 bit app <--> my kernel module <--> 64 bit appmy kernel module implements new protocol andprovides 'struct proto_ops'it never calls __sys_socket* calls.once 32 bit app calls recvmsg(),kernel module gets required data from another 64 bit appvia netlink msg.issue here is the struct msghdr and strcu cmsgdr sizesand members are of different lenghts.so kernel module needs to give data to 32 bit appin proper struct which are of correct sizes in 32 bit mode.so kernel module needs a way to figure outit is 32 bit app that made recvmsg() call and process accordingly.i dont see compat_recv in struct proto_ops
Don't top post.
I suggest sending mail to netdev kernel mailing list
with all the relevant information as I doubt if networking
layer in kernel doesn't handle 32/64 bit properly. On Wed, Jan 4, 2017 at 12:18 PM, Anish Kumar <anish198519851985@xxxxxxxxx> wrote:Please see inline belowOn Wed, Jan 4, 2017 at 11:07 AM, Anish Kumar <anish198519851985@xxxxxxxxx> wrote:Hi experts
in my 64 bit kernel, I have a custom kernel module providing new protocol and providing socket system calls.
it works fine when 64 bit app runs.
i am seeing issues when 32 bit app runs (for exp recvmsg() call does not work if msg has cmsghdrs as struct size of cmsghdr is different in 32 bit and 64 bit).
This is because my custom kernel module does not have 32 bit compatibility layer ( but linux kernel has this in compat.c etc).
is it simple to add compatibility layer to my custom kernel module
All you have to do is add compat_ioctl call to your driver.
my kernel module provides recvmsg() but i dont see any 'compat_recvmsg' in struct proto_ops.Try to wrap your text in 80 characters.Your application is crashing? Right?Have you figured where it is crashing exactly?I understood that your application is crashing asIt not able to function with 64 bit kernel.This happens because of the data being passedto kernel is not in the right format. You need tolook at what you are passing to the driver andif needed write the compat_ioctl callback in yourdriver fops.had there been 'compat_recvmsg' it would have been possible for me to define recvmsg() for 32 bit apps.please let me know if i am missing anything
how do i do this (any links ?)
You can see many drivers supports compat call.
Thanks
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxg
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbi es
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies