Commit 052793b
committed
media: uvcvideo: Remove dangling pointers
jira VULN-53464
cve CVE-2024-58002
commit-author Ricardo Ribalda <[email protected]>
commit 221cd51
upstream-diff `guard(mutex)' construct replaced with older locking
scheme because `ciqlts9_2' lacks
54da6a0. This commit is actually a
direct cherry pick of the 5.15 stable backport
117f7a2.
When an async control is written, we copy a pointer to the file handle
that started the operation. That pointer will be used when the device is
done. Which could be anytime in the future.
If the user closes that file descriptor, its structure will be freed,
and there will be one dangling pointer per pending async control, that
the driver will try to use.
Clean all the dangling pointers during release().
To avoid adding a performance penalty in the most common case (no async
operation), a counter has been introduced with some logic to make sure
that it is properly handled.
Cc: [email protected]
Fixes: e5225c8 ("media: uvcvideo: Send a control event when a Control Change interrupt arrives")
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Ricardo Ribalda <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Laurent Pinchart <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
(cherry picked from commit 221cd51)
Signed-off-by: Marcin Wcisło <[email protected]>1 parent 068e994 commit 052793b
3 files changed
+71
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1378 | 1378 | | |
1379 | 1379 | | |
1380 | 1380 | | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
1381 | 1415 | | |
1382 | 1416 | | |
1383 | 1417 | | |
| |||
1388 | 1422 | | |
1389 | 1423 | | |
1390 | 1424 | | |
1391 | | - | |
| 1425 | + | |
| 1426 | + | |
1392 | 1427 | | |
1393 | 1428 | | |
1394 | 1429 | | |
| |||
1660 | 1695 | | |
1661 | 1696 | | |
1662 | 1697 | | |
1663 | | - | |
| 1698 | + | |
1664 | 1699 | | |
1665 | 1700 | | |
1666 | 1701 | | |
| |||
2573 | 2608 | | |
2574 | 2609 | | |
2575 | 2610 | | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
2576 | 2635 | | |
2577 | 2636 | | |
2578 | 2637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
| 609 | + | |
| 610 | + | |
609 | 611 | | |
610 | 612 | | |
611 | 613 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
479 | 483 | | |
480 | 484 | | |
481 | 485 | | |
| |||
728 | 732 | | |
729 | 733 | | |
730 | 734 | | |
| 735 | + | |
731 | 736 | | |
732 | 737 | | |
733 | 738 | | |
| |||
910 | 915 | | |
911 | 916 | | |
912 | 917 | | |
| 918 | + | |
| 919 | + | |
913 | 920 | | |
914 | 921 | | |
915 | 922 | | |
| |||
0 commit comments