Proper locking while using find_task_by_pid_type

Sunday, July 6, 2014

I'm using "find_task_by_pid_type()" in order to get the task struct of some process. afterwards i want to use the task struct i got to retrieve the process name. i read a little bit about it and it seems that i have to use rcu_read_lock/unlock when using this function.

My question is - do i need to use another lock (for example, task_lock) when i retrieve the process name from the task struct, or the use of rcu_read_lock is sufficient?