]> git.baikalelectronics.ru Git - kernel.git/commit
fbmem: don't call copy_from/to_user() with mutex held
authorAndrea Righi <righi.andrea@gmail.com>
Wed, 4 Feb 2009 23:12:03 +0000 (15:12 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 5 Feb 2009 20:56:46 +0000 (12:56 -0800)
commit294ef0c9e82d599a76344a55f4cf19499c2c9b4f
tree713d0ace63c95da9b989aafce8ec84ebb1d1cbc3
parenta1061a5772f73bf9f9239936bac903697ed5a1fd
fbmem: don't call copy_from/to_user() with mutex held

Avoid calling copy_from/to_user() with fb_info->lock mutex held in fbmem
ioctl().

fb_mmap() is called under mm->mmap_sem (A) held, that also acquires
fb_info->lock (B); fb_ioctl() takes fb_info->lock (B) and does
copy_from/to_user() that might acquire mm->mmap_sem (A), causing a
deadlock.

NOTE: it doesn't push down the fb_info->lock in each own driver's
fb_ioctl(), so there are still potential deadlocks elsewhere.

Signed-off-by: Andrea Righi <righi.andrea@gmail.com>
Cc: Dave Jones <davej@redhat.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Johannes Weiner <hannes@saeurebad.de>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/fbcmap.c
drivers/video/fbmem.c
include/linux/fb.h