Commit 3e0d902
committed
media: uvcvideo: Remove dangling pointers
jira LE-3615
cve CVE-2024-58002
Rebuild_History Non-Buildable kernel-5.14.0-570.28.1.el9_6
commit-author Ricardo Ribalda <[email protected]>
commit 221cd51
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: Jonathan Maple <[email protected]>1 parent 2f592d7 commit 3e0d902
3 files changed
+67
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1579 | 1579 | | |
1580 | 1580 | | |
1581 | 1581 | | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
1582 | 1616 | | |
1583 | 1617 | | |
1584 | 1618 | | |
| |||
1589 | 1623 | | |
1590 | 1624 | | |
1591 | 1625 | | |
1592 | | - | |
| 1626 | + | |
| 1627 | + | |
1593 | 1628 | | |
1594 | 1629 | | |
1595 | 1630 | | |
| |||
1863 | 1898 | | |
1864 | 1899 | | |
1865 | 1900 | | |
1866 | | - | |
| 1901 | + | |
1867 | 1902 | | |
1868 | 1903 | | |
1869 | 1904 | | |
| |||
2772 | 2807 | | |
2773 | 2808 | | |
2774 | 2809 | | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
2775 | 2830 | | |
2776 | 2831 | | |
2777 | 2832 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
659 | 659 | | |
660 | 660 | | |
661 | 661 | | |
| 662 | + | |
| 663 | + | |
662 | 664 | | |
663 | 665 | | |
664 | 666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
341 | 345 | | |
342 | 346 | | |
343 | 347 | | |
| |||
612 | 616 | | |
613 | 617 | | |
614 | 618 | | |
| 619 | + | |
615 | 620 | | |
616 | 621 | | |
617 | 622 | | |
| |||
795 | 800 | | |
796 | 801 | | |
797 | 802 | | |
| 803 | + | |
| 804 | + | |
798 | 805 | | |
799 | 806 | | |
800 | 807 | | |
| |||
0 commit comments