Thread (6 messages) 6 messages, 2 authors, 2017-01-04

adding 32 bit compatibility layer in custom kernel module

flat view

From: Pradeepa Kumar <hidden>
Date: 2017-01-04 06:03:02

Please see inline below

On Wed, Jan 4, 2017 at 11:07 AM, Anish Kumar [off-list ref]
wrote:

On Jan 3, 2017, at 8:04 PM, Pradeepa Kumar [off-list ref] wrote:

Hi experts

down votefavorite
<http://stackoverflow.com/questions/41455943/adding-32-bit-compatibility-layer-in-custom-kernel-module#>

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.
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 at kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170104/e6680e3c/attachment-0001.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help