From: Paul Fulghum Date: Tue, 14 Feb 2006 21:53:00 +0000 (-0800) Subject: [PATCH] tty reference count fix X-Git-Tag: v2.6.16-rc4~75 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da965822abd18a17d7cffe1d511f48951c82dfb6;p=pandora-kernel.git [PATCH] tty reference count fix Fix hole where tty structure can be released when reference count is non zero. Existing code can sleep without tty_sem protection between deciding to release the tty structure (setting local variables tty_closing and otty_closing) and setting TTY_CLOSING to prevent further opens. An open can occur during this interval causing release_dev() to free the tty structure while it is still referenced. This should fix bugzilla.kernel.org [Bug 6041] New: Unable to handle kernel paging request In Bug 6041, tty_open() oopes on accessing the tty structure it has successfully claimed. Bug was on SMP machine with the same tty being opened and closed by multiple processes, and DEBUG_PAGEALLOC enabled. Signed-off-by: Paul Fulghum Cc: Alan Cox Cc: Jesper Juhl Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed