mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
UPSTREAM: staging: android: vsoc: fix copy_from_user overrun
The `np->permission' structure is smaller than the `np' structure but sizeof(*np) worth of data is copied in there. Fix the size passed to copy_from_user() to avoid overrun. Fixes: 3d2ec9dcd553 ("staging: Android: Add 'vsoc' driver for cuttlefish.") Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 060ea4271a82270be6d44e8e9aefe8f155fb5626) Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Icc92c508c2d38477066a4eee5191ef742909d767 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
ee14c73b12
commit
d57bf9d962
@ -269,7 +269,8 @@ static int do_create_fd_scoped_permission(
|
||||
atomic_t *owner_ptr = NULL;
|
||||
struct vsoc_device_region *managed_region_p;
|
||||
|
||||
if (copy_from_user(&np->permission, &arg->perm, sizeof(*np)) ||
|
||||
if (copy_from_user(&np->permission,
|
||||
&arg->perm, sizeof(np->permission)) ||
|
||||
copy_from_user(&managed_fd,
|
||||
&arg->managed_region_fd, sizeof(managed_fd))) {
|
||||
return -EFAULT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user