From: Linus Torvalds Date: Sat, 16 Dec 2006 17:44:32 +0000 (-0800) Subject: Fix incorrect user space access locking in mincore() X-Git-Tag: v2.6.20-rc2~125 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f77d107050abc14bc393b34bdb7b91cf670c250;p=pandora-kernel.git Fix incorrect user space access locking in mincore() Doug Chapman noticed that mincore() will doa "copy_to_user()" of the result while holding the mmap semaphore for reading, which is a big no-no. While a recursive read-lock on a semaphore in the case of a page fault happens to work, we don't actually allow them due to deadlock schenarios with writers due to fairness issues. Doug and Marcel sent in a patch to fix it, but I decided to just rewrite the mess instead - not just fixing the locking problem, but making the code smaller and (imho) much easier to understand. Cc: Doug Chapman Cc: Marcel Holtmann Cc: Hugh Dickins Cc: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed