]> git.baikalelectronics.ru Git - kernel.git/commit
[MTD] mtdchar.c: Fix regression in MEMGETREGIONINFO ioctl()
authorZev Weiss <zevweiss@gmail.com>
Mon, 1 Sep 2008 12:02:12 +0000 (05:02 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 2 Sep 2008 08:29:05 +0000 (09:29 +0100)
commit21ff3a91c93e81a4d6c84e1d276b630d413b9047
treefc2ebe12c5b34439b9034742f957177111409cc7
parent6b9e06502a9f721ff6a6f0f2572983dc049e4502
[MTD] mtdchar.c: Fix regression in MEMGETREGIONINFO ioctl()

The MEMGETREGIONINFO ioctl() in mtdchar.c was clobbering user memory by
overwriting more than intended, due the size of struct mtd_erase_region_info
changing in commit e211f1cecdc531808ec0069ea1be5ee059970402 ('Support
for auto locking flash on power up').

Fix avoids this by copying struct members one by one with put_user(), as there
is no longer a convenient struct to use the size of as the length argument to
copy_to_user().

Signed-off-by: Zev Weiss <zevweiss@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/mtdchar.c