forked fromtorvalds/linux
- Notifications
You must be signed in to change notification settings - Fork0
Commita4b98a7
usb: gadget: f_fs: Use local copy of descriptors for userspace copy
The function may be unbound causing the ffs_ep and its descriptorsto be freed while userspace is in the middle of an ioctl requestingthe same descriptors. Avoid dangling pointer reference by firstmaking a local copy of desctiptors before releasing the spinlock.Fixes:c559a35 ("usb: gadget: f_fs: add ioctl returning ep descriptor")Reviewed-by: Peter Chen <peter.chen@nxp.com>Signed-off-by: Vamsi Krishna Samavedam <vskrishn@codeaurora.org>Signed-off-by: Jack Pham <jackp@codeaurora.org>Cc: stable <stable@vger.kernel.org>Link:https://lore.kernel.org/r/20201130203453.28154-1-jackp@codeaurora.orgSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent45c5775 commita4b98a7
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1324 | 1324 | | |
1325 | 1325 | | |
1326 | 1326 | | |
1327 | | - | |
| 1327 | + | |
1328 | 1328 | | |
1329 | 1329 | | |
1330 | 1330 | | |
| |||
1336 | 1336 | | |
1337 | 1337 | | |
1338 | 1338 | | |
| 1339 | + | |
1339 | 1340 | | |
| 1341 | + | |
1340 | 1342 | | |
1341 | 1343 | | |
1342 | | - | |
| 1344 | + | |
1343 | 1345 | | |
1344 | 1346 | | |
1345 | 1347 | | |
| |||
0 commit comments
Comments
(0)