Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88861d4d authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: u_data_bridge: Check allowable size with gbridge_port_write()



Currently gbridge_port_write() is not checking size of user space
provided data and directly copies buffer into USB request buffer
which is having size as 2KB. If user space application writes data
bigger than 2KB, copy_from_user() tries to copy data beyond allocated
USB request buffer size which results into memory corruption. Fix
this issue by checking allowable size with gbridge_port_write() and
making sure that it doesn't copy data beyond allocated buffer size.

Change-Id: I7a34e37f5d1609792374f07b70542b80edbe6944
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent d96b4bb7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment