android_kernel_xiaomi_sm8350/arch/i386/lib
Thomas Gleixner b6a8b316c6 [PATCH] i386: fix file_read_actor() and pipe_read() for original i386 systems
The __copy_to_user_inatomic() calls in file_read_actor() and pipe_read()
are broken on original i386 machines, where WP-works-ok == false, as
__copy_to_user_inatomic() on such systems calls functions which might
sleep and/or contain cond_resched() calls inside of a kmap_atomic()
region.

The original check for WP-works-ok was in access_ok(), but got moved
during the 2.5 series to fix a race vs. swap.

Return the number of bytes to copy in the case where we are in an atomic
region, so the non atomic code pathes in file_read_actor() and
pipe_read() are taken.

This could be optimized to avoid the kmap_atomicby moving the check for
WP-works-ok into fault_in_pages_writeable(), but this is more intrusive
and can be done later.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-04-02 10:07:25 -07:00
..
bitops.c
checksum.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
delay.c [PATCH] Some config.h removals 2006-10-01 00:39:34 -07:00
getuser.S
Makefile {rd,wr}msr_on_cpu SMP=n optimization 2007-02-20 14:29:37 -05:00
memcpy.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mmx.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
msr-on-cpu.c {rd,wr}msr_on_cpu SMP=n optimization 2007-02-20 14:29:37 -05:00
putuser.S
semaphore.S [PATCH] i386: fix rwsem build bug on CONFIG_M386=y 2006-10-05 18:47:22 +02:00
strstr.c
usercopy.c [PATCH] i386: fix file_read_actor() and pipe_read() for original i386 systems 2007-04-02 10:07:25 -07:00