Oct. 12, 2012
4:48 a.m.
How to get task_struct of a socket owner process? i.e. how to get task_struct* from sock* I have tried following (on 2.6.38) but didn't work. struct sock* sk = xxx; (i) sk->sk_socket->file->f_cred->uid (ii) tsk = get_pid_task(sk->sk_socket->file->f_owner->pid, sk->sk_socket->file->f_owner->pid_type) The goal is know which process opened the socket. (I know netstat -p option, and /proc/<pid>/fd methods, but I want to do it in kernel module only). Thank you Lal
5054
Age (days ago)
5054
Last active (days ago)
1 comments
2 participants
participants (2)
-
Lal -
richard -rw- weinberger