lkml.org 
[lkml]   [1997]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: verifying a task_struct
From
Date
tyson  <tyson@rwii.com> writes:

|> How can I verify that a struct task_stuct pointer is still valid before
|> using it? The pointer is copied from current as part of an ioctl() but
|> I have found that if the process forks after the ioctl, the parent
|> exits and then the child continues to use the open file descriptor that
|> problems can result. Specifically, the driver ends up sending a signal
|> to a process that no longer exists and the system becomes unstable.

I think you should save the pid, not the task_struct pointer, and then use
the pid to send the signal.

--
Andreas Schwab "And now for something
schwab@issan.informatik.uni-dortmund.de completely different"
schwab@gnu.org

\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.047 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site