Doubt with Kernel module
by webquinty from LinuxQuestions.org on (#58VK6)
Hello everybody,
This doubt is relative to how to create a Kernel module.
Years ago, I started with Kernel modules in my job using kernel 2.6.24.7.
It was hard to develop it, but finally I did it.
Later I use de same driver ( source code ) with kernel version 3.19 and it was necessary to modify some variables a functions, but nothing else.
Now, I am trying to port the same driver and its source code with kernel 5.4.61 without sucess. After read several webpages and PDFs, I just realized that tere are some changes in the new kernel.
One of them is the following:
-> The user-space buffer in user virtual address space.
-> The kernel-space buffer in kernel virtual address space.
So, in the new kernel ( I don't know from which version this feature has been implemented ) it is not allowed to use data created in user space inside the kernel and it is mandatory to use the copy_(from|to)_user functions to copy data from user space to kernel space and vice versa.
Is that so and there is no way to change it?
What is the meaning of this change? For security?
I hope I have explained myself clearly
Thank you in advance


This doubt is relative to how to create a Kernel module.
Years ago, I started with Kernel modules in my job using kernel 2.6.24.7.
It was hard to develop it, but finally I did it.
Later I use de same driver ( source code ) with kernel version 3.19 and it was necessary to modify some variables a functions, but nothing else.
Now, I am trying to port the same driver and its source code with kernel 5.4.61 without sucess. After read several webpages and PDFs, I just realized that tere are some changes in the new kernel.
One of them is the following:
-> The user-space buffer in user virtual address space.
-> The kernel-space buffer in kernel virtual address space.
So, in the new kernel ( I don't know from which version this feature has been implemented ) it is not allowed to use data created in user space inside the kernel and it is mandatory to use the copy_(from|to)_user functions to copy data from user space to kernel space and vice versa.
Is that so and there is no way to change it?
What is the meaning of this change? For security?
I hope I have explained myself clearly
Thank you in advance