Re: passing __user function parameter from kernel_module result in EFAULT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 21, 2020 at 09:14:00PM +0300, Lev R. Oshvang . wrote:
> Hi all, I am trying to do a mount from kernel module in kernel 5.4 on x86_64.
> It fails with -14,  I tried to set_fs(USER_DS) before calling do_mount
> but it did not
>  help.
> 
> 
> do_mount() returns -EFAUTL when it checks filename validity just at
> the very first lines of do_mount ().
> 
> Are there other tricks to do in order to overcome and access_ok checks?

No "trick" is needed, just properly convert the data to a kernel pointer
and you should be fine.  Never touch the data pointed to by a userspace
pointer.

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux