Commit 7979d32
Desnes Nunes
media: uvcvideo: Fix crash during unbind if gpio unit is in use
JIRA: https://issues.redhat.com/browse/RHEL-78828
CVE: CVE-2024-58079
commit a9ea1a3
Author: Ricardo Ribalda <ribalda@chromium.org>
Date: Wed, 6 Nov 2024 20:36:07 +0000
We used the wrong device for the device managed functions. We used the
usb device, when we should be using the interface device.
If we unbind the driver from the usb interface, the cleanup functions
are never called. In our case, the IRQ is never disabled.
If an IRQ is triggered, it will try to access memory sections that are
already free, causing an OOPS.
We cannot use the function devm_request_threaded_irq here. The devm_*
clean functions may be called after the main structure is released by
uvc_delete.
Luckily this bug has small impact, as it is only affected by devices
with gpio units and the user has to unbind the device, a disconnect will
not trigger this error.
Cc: stable@vger.kernel.org
Fixes: 2886477 ("media: uvcvideo: Implement UVC_EXT_GPIO_UNIT")
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20241106-uvc-crashrmmod-v6-1-fbf9781c6e83@chromium.org
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Desnes Nunes <desnesn@redhat.com>1 parent d4c30a8 commit 7979d32
2 files changed
+22
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1295 | 1295 | | |
1296 | 1296 | | |
1297 | 1297 | | |
1298 | | - | |
| 1298 | + | |
1299 | 1299 | | |
1300 | 1300 | | |
1301 | 1301 | | |
1302 | 1302 | | |
1303 | 1303 | | |
1304 | 1304 | | |
1305 | | - | |
| 1305 | + | |
1306 | 1306 | | |
1307 | 1307 | | |
1308 | 1308 | | |
| |||
1329 | 1329 | | |
1330 | 1330 | | |
1331 | 1331 | | |
| 1332 | + | |
1332 | 1333 | | |
1333 | 1334 | | |
1334 | 1335 | | |
1335 | 1336 | | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
1339 | | - | |
1340 | | - | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
1341 | 1353 | | |
1342 | 1354 | | |
1343 | 1355 | | |
| |||
1934 | 1946 | | |
1935 | 1947 | | |
1936 | 1948 | | |
| 1949 | + | |
| 1950 | + | |
1937 | 1951 | | |
1938 | 1952 | | |
1939 | 1953 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
| |||
0 commit comments