From: Darrick J. Wong Date: Tue, 8 May 2007 07:25:47 +0000 (-0700) Subject: Fix race between proc_readdir and remove_proc_entry X-Git-Tag: v2.6.22-rc1~757 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59cd0cbc75367b82f704f63b104117462275060d;p=pandora-kernel.git Fix race between proc_readdir and remove_proc_entry Fix the following race: proc_readdir remove_proc_entry ============ ================= spin_lock(&proc_subdir_lock); [choose PDE to start filldir from] spin_unlock(&proc_subdir_lock); spin_lock(&proc_subdir_lock); [find PDE] [free PDE, refcount is 0] spin_unlock(&proc_subdir_lock); /* boom */ if (filldir(dirent, de->name, ... [de_put on error path --adobriyan] Signed-off-by: Darrick J. Wong Signed-off-by: Alexey Dobriyan Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed