Moving fasync_struct into struct file?
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Rusty Russell
Hi guys,
Stephen Rothwell pointed out that if you set up SIGIO from an
fd, fork, and exit, and PIDs wrap, the new process may be clobbered by the SIGIO. IMVHO the best way to clean this up is to check thefasync_listinsys_close, and if pid ==filp->f_owner.pidand fd ==fasync_list->fa_fd, unregister the SIGIO.
The pid/owner checking at setup time is very broken anyways. Consider a threaded application that wants to set up SIGIO from one thread but receive from another. It has to be root currently to do that.
Best would be to never check anything in F_SETOWN, but just save the uid/pid/gid and always check at signal sending time.
[in addition sk->proc should go and use the fasync list, but that is a different thing for now]
-Andi