From owner-cvs-src@FreeBSD.ORG Fri May 30 22:20:45 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A9C8D37B401; Fri, 30 May 2003 22:20:45 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D28843F75; Fri, 30 May 2003 22:20:45 -0700 (PDT) (envelope-from ru@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h4V5Kj0U008749; Fri, 30 May 2003 22:20:45 -0700 (PDT) (envelope-from ru@repoman.freebsd.org) Received: (from ru@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h4V5Kjfr008748; Fri, 30 May 2003 22:20:45 -0700 (PDT) Message-Id: <200305310520.h4V5Kjfr008748@repoman.freebsd.org> From: Ruslan Ermilov Date: Fri, 30 May 2003 22:20:44 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/lib/libc_r/uthread uthread_close.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2003 05:20:46 -0000 ru 2003/05/30 22:20:44 PDT FreeBSD src repository Modified files: lib/libc_r/uthread uthread_close.c Log: If an application closes one of its stdio descriptors (0..2), an excessive close() on one of these descriptors would cause a memory for this descriptor to be allocated in the internal descriptor table. When this descriptor gets used again, e.g. through the call to open() or socket(), the descriptor would be erroneously left in the blocking mode, and the whole application would get stuck on a blocking operation, e.g., in accept(2). Prevent this bug from happening by disallowing close() against non-active descriptors (return -1 and set errno to EBADF in this case). Reviewed by: deischen Approved by: re (scottl) Revision Changes Path 1.14 +4 -2 src/lib/libc_r/uthread/uthread_close.c