Hello,
I have created two sockets with socketpair() and one of them is put into kernel module through ioctl.
I need to work with passed socket in separate kernel thread.
In my module ioctl handler I am able to retrieve file descriptor from user mode descriptor (int user_sock) :
file_fd = fd_getfile2(lewepe->l_proc, user_sock);
and consequently pointer to socket structure:
struct socket* so = file_fd->f_undata.fd_so;

My question is:
Can I use such retrieved file_fd or struct socket* so in separate kernel thread ?

(Is not needed to call some kernel equivalent of dup() to duplicate retrieved file_fd or retrieved so to be able work in separate kernel thread ? Or to use copyin() on struct socket* to retrieve kernel copy of struct socket* ?
Or something other ?)

Peter

Reply via email to