Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 19 Feb 2002 04:27:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 19 Feb 2002 04:27:11 -0500 Received: from ns.suse.de ([213.95.15.193]:52488 "HELO Cantor.suse.de") by vger.kernel.org with SMTP id ; Tue, 19 Feb 2002 04:27:07 -0500 To: Rusty Russell Cc: linux-kernel@vger.kernel.org Subject: Re: Moving fasync_struct into struct file? In-Reply-To: From: Andi Kleen Date: 19 Feb 2002 10:27:01 +0100 In-Reply-To: Rusty Russell's message of "19 Feb 2002 08:21:27 +0100" Message-ID: Lines: 21 X-Mailer: Gnus v5.7/Emacs 20.6 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Rusty Russell writes: > 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 the > fasync_list in sys_close, and if pid == filp->f_owner.pid and 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/