projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5fb4d25
)
Staging: rspiusb: Fix buffer overflow
author
Roel Kluin
<roel.kluin@gmail.com>
Fri, 7 Aug 2009 19:00:10 +0000
(21:00 +0200)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Fri, 7 Aug 2009 23:12:03 +0000
(16:12 -0700)
usb_buffer_map_sg() may return -1. This will result in a read from
pdx->PixelUrb[frameInfo][-1]
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rspiusb/rspiusb.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/staging/rspiusb/rspiusb.c
b/drivers/staging/rspiusb/rspiusb.c
index 2f8155c1968b31652f63f781c0e15071fd25afe6..04e2f92c0f6293292d55d5a56822a936d0a4ba52 100644
(file)
--- a/
drivers/staging/rspiusb/rspiusb.c
+++ b/
drivers/staging/rspiusb/rspiusb.c
@@
-716,6
+716,8
@@
static int MapUserBuffer(struct ioctl_struct *io, struct device_extension *pdx)
pdx->PixelUrb[frameInfo][i]->transfer_flags =
URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT;
}
+ if (i == 0)
+ return -EINVAL;
/* only interrupt when last URB completes */
pdx->PixelUrb[frameInfo][--i]->transfer_flags &= ~URB_NO_INTERRUPT;
pdx->pendedPixelUrbs[frameInfo] =