]> git.karo-electronics.de Git - karo-tx-linux.git/commit
microblaze: Fix /dev/zero corruption from __clear_user()
authorSteven J. Magnani <steve@digidescorp.com>
Thu, 10 Feb 2011 18:12:13 +0000 (12:12 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Mar 2011 20:03:39 +0000 (13:03 -0700)
commit1bb392f30a34dfb18d72750fd9898f71b9ed7923
tree9174840e7f7b6d5119d78964514ac895d73fccee
parentb030eac99b99ba92dd6d3bcf641c3fa219b2a73e
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 <steve@digidescorp.com>
Acked-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/microblaze/include/asm/uaccess.h