Messages in this thread | | | Subject | Re: [PATCH] [MTD] mtdchar.c: Fix regression in MEMGETREGIONINFO ioctl() | From | David Woodhouse <> | Date | Mon, 01 Sep 2008 18:25:03 +0100 |
| |
On Mon, 2008-09-01 at 05:19 -0700, Zev Weiss wrote: > From: Zev Weiss <zevweiss@gmail.com> > Date: Mon, 1 Sep 2008 05:02:12 -0700 > Subject: [PATCH] [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 0ecbc81adfcb9f15f86b05ff576b342ce81bbef8. > > 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>
Thanks. Your patch was whitespace-damaged, but I managed to apply it anyway. Please check for future patches though -- try sending patches to yourself and then see if they get mangled. I believe gmail is known to be broken unless you submit mail with SMTP.
I also try to avoid the pointless types like 'u32' in MTD code -- the C language has perfectly good explicitly sized types; let's use them.
-- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation
| |