From owner-freebsd-bugs Tue Feb 20 6:10: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B5E5137B4EC for ; Tue, 20 Feb 2001 06:10:05 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f1KEA5948150; Tue, 20 Feb 2001 06:10:05 -0800 (PST) (envelope-from gnats) Date: Tue, 20 Feb 2001 06:10:05 -0800 (PST) Message-Id: <200102201410.f1KEA5948150@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: David Malone Subject: Re: kern/25206: Kernel Panic Reply-To: David Malone Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/25206; it has been noted by GNATS. From: David Malone To: mm@omnix.net Cc: freebsd-gnats-submit@FreeBSD.org, peter@FreeBSD.org, iedowse@maths.tcd.ie Subject: Re: kern/25206: Kernel Panic Date: Tue, 20 Feb 2001 14:03:29 +0000 On Mon, Feb 19, 2001 at 11:34:40AM -0800, mm@omnix.net wrote: > luser@PAF$ tail -f /dev/ttyp1 > > now ruser is going to connect to my box: > ruser@NOWHERE$ telnet PAF > Connection closed by foreign host. This seems to be caused by kqueue trying to work on a revoked file discriptor. I think this bug is inaccessable in more recent versions of -stable after Peter's commit to vfs_vnops.c on 2001/02/09. The offending code looks like: static int filt_vnread(struct knote *kn, long hint) { struct vnode *vp = (struct vnode *)kn->kn_fp->f_data; struct inode *ip = VTOI(vp); kn->kn_data = ip->i_size - kn->kn_fp->f_offset; return (kn->kn_data != 0); } There is now a check to make sure that the file is in a UFS filesystem at the time the filter is attached. However, if the file is revoked it could change type, so checking something like: if (vp->v_tag != VT_UFS) return 1; might be a good idea. (Currently only device files can be revoked, but that's only 'cos it was disabeled on other file types 'cos it didn't work on fifos). David. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message