* passing __user function parameter from kernel_module result in EFAULT
@ 2020-04-21 18:14 Lev R. Oshvang .
2020-04-25 7:43 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Lev R. Oshvang . @ 2020-04-21 18:14 UTC (permalink / raw)
To: kernelnewbies
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?
Thanks,
Lev
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: passing __user function parameter from kernel_module result in EFAULT
2020-04-21 18:14 passing __user function parameter from kernel_module result in EFAULT Lev R. Oshvang .
@ 2020-04-25 7:43 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2020-04-25 7:43 UTC (permalink / raw)
To: Lev R. Oshvang .; +Cc: kernelnewbies
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@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-25 7:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 18:14 passing __user function parameter from kernel_module result in EFAULT Lev R. Oshvang .
2020-04-25 7:43 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.