Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751770AbXBVTB2 (ORCPT ); Thu, 22 Feb 2007 14:01:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751772AbXBVTB2 (ORCPT ); Thu, 22 Feb 2007 14:01:28 -0500 Received: from mx1.redhat.com ([66.187.233.31]:52627 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751770AbXBVTB1 (ORCPT ); Thu, 22 Feb 2007 14:01:27 -0500 Message-ID: <45DDE862.2000100@redhat.com> Date: Thu, 22 Feb 2007 14:00:50 -0500 From: Chuck Ebbert Organization: Red Hat User-Agent: Thunderbird 1.5.0.9 (X11/20070212) MIME-Version: 1.0 To: Aristeu Sergio Rozanski Filho CC: linux-kernel@vger.kernel.org Subject: Re: [PATCH] tty_io: fix race in master pty close/slave pty close path References: <20070222173744.GB6938@cathedrallabs.org> In-Reply-To: <20070222173744.GB6938@cathedrallabs.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2240 Lines: 61 Aristeu Sergio Rozanski Filho wrote: > This patch fixes a possible race that leads to double freeing an idr index. > > Without the patch, on some machines it's possible get easily idr warnings like > this one: > idr_remove called for id=15 which is not allocated. > [] idr_remove+0x139/0x170 > [] release_mem+0x182/0x230 > [] release_dev+0x4b7/0x700 > [] tty_ldisc_enable+0x27/0x30 > [] init_dev+0x254/0x580 > [] check_tty_count+0x14/0xb0 > [] tty_open+0x1c5/0x340 > [] tty_open+0x0/0x340 > [] chrdev_open+0xaf/0x180 > [] open_namei+0x8c/0x760 > [] chrdev_open+0x0/0x180 > [] __dentry_open+0xc9/0x210 > [] do_filp_open+0x5c/0x70 > [] get_unused_fd+0x61/0xd0 > [] do_sys_open+0x53/0x100 > [] sys_open+0x27/0x30 > [] syscall_call+0x7/0xb Would another possible trace look like this? idr_remove called for id=1 which is not allocated. [] dump_trace+0x69/0x1af [] show_trace_log_lvl+0x18/0x2c [] show_trace+0xf/0x11 [] dump_stack+0x15/0x17 [] idr_remove+0xe2/0x143 [] release_dev+0x63b/0x652 [] tty_release+0x7/0xa [] __fput+0xba/0x178 [] filp_close+0x52/0x59 [] put_files_struct+0x64/0xa6 [] do_exit+0x248/0x747 [] sys_exit_group+0x0/0xd [] 0xf5d480e4 DWARF2 unwinder stuck at 0xf5d480e4 Leftover inexact backtrace: [] get_signal_to_deliver+0x38a/0x3b2 [] do_notify_resume+0x75/0x62f [] __pagevec_lru_add_active+0x95/0xa0 [] autoremove_wake_function+0x0/0x35 [] _spin_unlock_irq+0x5/0x7 [] schedule+0x529/0x585 [] work_notifysig+0x13/0x19 We have some bug reports: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=211429 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=227203 - 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/