From owner-freebsd-bugs@FreeBSD.ORG Sun Jul 9 13:20:24 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A26316A4E0 for ; Sun, 9 Jul 2006 13:20:24 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83D8143D67 for ; Sun, 9 Jul 2006 13:20:21 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k69DKLYY068013 for ; Sun, 9 Jul 2006 13:20:21 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k69DKLN8068012; Sun, 9 Jul 2006 13:20:21 GMT (envelope-from gnats) Date: Sun, 9 Jul 2006 13:20:21 GMT Message-Id: <200607091320.k69DKLN8068012@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Atsuo Ohki Cc: Subject: Re: kern/99758: chown/chmod pty slave side in kernel X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Atsuo Ohki List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2006 13:20:24 -0000 The following reply was made to PR kern/99758; it has been noted by GNATS. From: Atsuo Ohki To: "Wojciech A. Koszek" Cc: Robert Watson , freebsd-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: kern/99758: chown/chmod pty slave side in kernel Date: Sun, 09 Jul 2006 22:19:42 +0900 "Wojciech A. Koszek" writes: > Sure. I'm willing to hear more about your changes and patches! To reproduce > problems I've seen, try to download Peter Wemm's stress suite, compile it, > and run PTY code. As I recall, after unpacking stress2.tgz you'll have > run.sh script and pty. You run it by typing: ./run > ./pty. Try to switch to other virtual terminal > and login. I got stress2.tgz and done `./run.sh pty.cfg' and got the message like Memory modified after free ... Most recently used by DEVFS1 The reason for this panic is devfs_close() in fs/devfs/devfs_vnops.c. As you see, devfs_close() eventually calls ptcclose()/ptsclose() which calls pty_maybecleanup() destroying devs for ptc&pts, but devfs_close() then calls dev_relthread() which may access just freeed dev. I'm afraid that devfs is not designed to handle destroing dev during close operation. I'm working on this problem with the idea: i) destory_dev() should not free dev, but just mark inactive. ii) devfs_populate() should actually free an inactive dev. iii) modify devfs_find() and other routines to take care of an inactive dev. But no success yet ;-<