aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/device.py
diff options
context:
space:
mode:
authorUdipto Goswami <[email protected]>2022-12-15 10:59:05 +0530
committerGreg Kroah-Hartman <[email protected]>2023-01-17 17:07:06 +0100
commit6a19da111057f69214b97c62fb0ac59023970850 (patch)
tree63c86f39f42f34d52cd349bb6f4dd601f7e79dd0 /scripts/gdb/linux/device.py
parentcde37881e2e14590675d0acdfbad408300d9ca95 (diff)
usb: gadget: f_fs: Prevent race during ffs_ep0_queue_wait
While performing fast composition switch, there is a possibility that the process of ffs_ep0_write/ffs_ep0_read get into a race condition due to ep0req being freed up from functionfs_unbind. Consider the scenario that the ffs_ep0_write calls the ffs_ep0_queue_wait by taking a lock &ffs->ev.waitq.lock. However, the functionfs_unbind isn't bounded so it can go ahead and mark the ep0req to NULL, and since there is no NULL check in ffs_ep0_queue_wait we will end up in use-after-free. Fix this by making a serialized execution between the two functions using a mutex_lock(ffs->mutex). Fixes: ddf8abd25994 ("USB: f_fs: the FunctionFS driver") Signed-off-by: Udipto Goswami <[email protected]> Tested-by: Krishna Kurapati <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/device.py')
0 files changed, 0 insertions, 0 deletions