Commit 9cf89ad
usb: gadget: f_fs: Assorted buffer overflow checks.
commit 83e526f2a2fa4b2e82b6bd3ddbb26b70acfa8947 upstream.
OS descriptor head, when flagged as provided, is accessed without
checking if it fits in provided buffer. Verify length before access.
Also, there are other places where buffer length it checked
after accessing offsets which are potentially past the end. Check
buffer length before as well to fail cleanly.
Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent e4c1e66 commit 9cf89ad
1 file changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2079 | 2079 | | |
2080 | 2080 | | |
2081 | 2081 | | |
| 2082 | + | |
| 2083 | + | |
2082 | 2084 | | |
2083 | 2085 | | |
2084 | 2086 | | |
| |||
2087 | 2089 | | |
2088 | 2090 | | |
2089 | 2091 | | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
2090 | 2097 | | |
2091 | 2098 | | |
2092 | 2099 | | |
| |||
2171 | 2178 | | |
2172 | 2179 | | |
2173 | 2180 | | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
2174 | 2184 | | |
2175 | 2185 | | |
2176 | 2186 | | |
| |||
2243 | 2253 | | |
2244 | 2254 | | |
2245 | 2255 | | |
2246 | | - | |
| 2256 | + | |
| 2257 | + | |
2247 | 2258 | | |
2248 | 2259 | | |
2249 | 2260 | | |
| |||
0 commit comments