From: Steven J. Magnani Date: Thu, 10 Feb 2011 18:12:13 +0000 (-0600) Subject: microblaze: Fix /dev/zero corruption from __clear_user() X-Git-Tag: v2.6.37.5~54 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=643023b097159a1d887278b0e84b30cd19de8ca0;p=pandora-kernel.git microblaze: Fix /dev/zero corruption from __clear_user() commit 6f3946b421395ff853bc0bcdab9c26b50ebbba8f upstream. A userland read of more than PAGE_SIZE bytes from /dev/zero results in (a) not all of the bytes returned being zero, and (b) memory corruption due to zeroing of bytes beyond the user buffer. This is caused by improper constraints on the assembly __clear_user function. The constrints don't indicate to the compiler that the pointer argument is modified. Since the function is inline, this results in double-incrementing of the pointer when __clear_user() is invoked through a multi-page read() of /dev/zero. Signed-off-by: Steven J. Magnani Acked-by: Michal Simek Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed