Message ID | 20090108000931.DFF4449D1B8@mta03.sharp.co.jp |
---|---|
State | New, archived |
Headers | show |
--- drivers-mtd-mtdchar.c.orig 2009-01-07 17:35:18.000000000 +0900 +++ drivers-mtd-mtdchar.c 2009-01-07 17:42:36.000000000 +0900 @@ -579,17 +579,17 @@ ops.oobbuf = kmalloc(buf.length, GFP_KERNEL); if (!ops.oobbuf) return -ENOMEM; buf.start &= ~(mtd->oobsize - 1); ret = mtd->read_oob(mtd, buf.start, &ops); - if (put_user(ops.oobretlen, (uint32_t __user *)argp)) + if (put_user(ops.oobretlen, (uint32_t __user *)(argp + + offsetof(mtd_oob_buf, length)))) ret = -EFAULT; else if (ops.oobretlen && copy_to_user(buf.ptr, ops.oobbuf, ops.oobretlen)) ret = -EFAULT; kfree(ops.oobbuf); break; }