Commit 280a8ab
media: dvb-core: Fix use-after-free due to race condition at dvb_ca_en50221
If the device node of dvb_ca_en50221 is open() and the
device is disconnected, a UAF may occur when calling
close() on the device node.
The root cause is that wake_up() and wait_event() for
dvbdev->wait_queue are not implemented.
So implement wait_event() function in dvb_ca_en50221_release()
and add 'remove_mutex' which prevents race condition
for 'ca->exit'.
[mchehab: fix a checkpatch warning]
Link: https://lore.kernel.org/linux-media/20221121063308.GA33821@ubuntu
Signed-off-by: Hyunwoo Kim <v4bel@theori.io>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>1 parent b8c75e4 commit 280a8ab
1 file changed
+36
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
154 | 160 | | |
155 | 161 | | |
156 | 162 | | |
| |||
1711 | 1717 | | |
1712 | 1718 | | |
1713 | 1719 | | |
1714 | | - | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
1715 | 1729 | | |
| 1730 | + | |
1716 | 1731 | | |
1717 | 1732 | | |
1718 | 1733 | | |
1719 | 1734 | | |
| 1735 | + | |
1720 | 1736 | | |
1721 | 1737 | | |
1722 | 1738 | | |
| |||
1741 | 1757 | | |
1742 | 1758 | | |
1743 | 1759 | | |
| 1760 | + | |
1744 | 1761 | | |
1745 | 1762 | | |
1746 | 1763 | | |
| |||
1760 | 1777 | | |
1761 | 1778 | | |
1762 | 1779 | | |
| 1780 | + | |
| 1781 | + | |
1763 | 1782 | | |
1764 | 1783 | | |
1765 | 1784 | | |
| |||
1770 | 1789 | | |
1771 | 1790 | | |
1772 | 1791 | | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
1773 | 1799 | | |
1774 | 1800 | | |
1775 | 1801 | | |
| |||
1893 | 1919 | | |
1894 | 1920 | | |
1895 | 1921 | | |
| 1922 | + | |
1896 | 1923 | | |
1897 | 1924 | | |
1898 | 1925 | | |
| |||
1935 | 1962 | | |
1936 | 1963 | | |
1937 | 1964 | | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
1938 | 1973 | | |
1939 | 1974 | | |
1940 | 1975 | | |
| |||
0 commit comments