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

Commit 6b4ed96e authored by Arumuga Durai A's avatar Arumuga Durai A
Browse files

USB: gadget: f_fs: Fix adb issues due to retrying adb_read



Commit b0d8bfa8 ("USB: gadget: ffs: Fix USBCV compliance
failure due to adbd") retries read if disconnect/reset happened
without any data transfers between set_alt and disable. This
allows userspace to not unnecessarily perform unbind-bind. As
part of that driver leaves data as not NULL (from previous read)
and clears only read->error flag. This leads to two issues.

If disconnect-connect happened with adb server not running on host
then write->error flag is not cleared, hence subsequent adb_write
fails. This results in adb going offline. Memory corruption due to
double free of memory as data ptr is not NULL (post retry) when
adbd receives signal.
Fix these by clearing all epfile->error flags and set data pointer
to NULL on adb_read retry

CRs-Fixed: 1114810
Change-Id: Ic3a5336b8d974d24355539c247434d98ab79b03f
Signed-off-by: default avatarArumuga Durai A <cadurai@codeaurora.org>
parent bf10764e
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