Commit f51d42a
committed
media: uvcvideo: Remove dangling pointers
jira VULN-53462
jira VULN-53461
cve CVE-2024-58002
commit-author Ricardo Ribalda <ribalda@chromium.org>
commit 221cd51
upstream-diff used kernel-lt 5.15 commit 117f7a2
This is due to missing both:
- e8c0708 - Kbuild: move to -std=gnu11
- 54da6a0 - locking: Introduce __cleanup() based infrastructure
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: stable@vger.kernel.org
Fixes: e5225c8 ("media: uvcvideo: Send a control event when a Control Change interrupt arrives")
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20241203-uvc-fix-async-v6-3-26c867231118@chromium.org
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 117f7a2)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>1 parent 204f212 commit f51d42a
3 files changed
+71
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1532 | 1532 | | |
1533 | 1533 | | |
1534 | 1534 | | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
1535 | 1569 | | |
1536 | 1570 | | |
1537 | 1571 | | |
| |||
1542 | 1576 | | |
1543 | 1577 | | |
1544 | 1578 | | |
1545 | | - | |
| 1579 | + | |
| 1580 | + | |
1546 | 1581 | | |
1547 | 1582 | | |
1548 | 1583 | | |
| |||
1818 | 1853 | | |
1819 | 1854 | | |
1820 | 1855 | | |
1821 | | - | |
| 1856 | + | |
1822 | 1857 | | |
1823 | 1858 | | |
1824 | 1859 | | |
| |||
2749 | 2784 | | |
2750 | 2785 | | |
2751 | 2786 | | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
2752 | 2811 | | |
2753 | 2812 | | |
2754 | 2813 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| 661 | + | |
| 662 | + | |
661 | 663 | | |
662 | 664 | | |
663 | 665 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
333 | 337 | | |
334 | 338 | | |
335 | 339 | | |
| |||
604 | 608 | | |
605 | 609 | | |
606 | 610 | | |
| 611 | + | |
607 | 612 | | |
608 | 613 | | |
609 | 614 | | |
| |||
788 | 793 | | |
789 | 794 | | |
790 | 795 | | |
| 796 | + | |
| 797 | + | |
791 | 798 | | |
792 | 799 | | |
793 | 800 | | |
| |||
0 commit comments