Commit 443b66f
committed
media: em28xx: initialize refcount before kref_get
jira VULN-8755
cve CVE-2022-3239
commit-author Dongliang Mu <mudongliangabcd@gmail.com>
commit c08eadc
The commit 47677e5("[media] em28xx: Only deallocate struct
em28xx after finishing all extensions") adds kref_get to many init
functions (e.g., em28xx_audio_init). However, kref_init is called too
late in em28xx_usb_probe, since em28xx_init_dev before will invoke
those init functions and call kref_get function. Then refcount bug
occurs in my local syzkaller instance.
Fix it by moving kref_init before em28xx_init_dev. This issue occurs
not only in dev but also dev->dev_next.
Fixes: 47677e5 ("[media] em28xx: Only deallocate struct em28xx after finishing all extensions")
Reported-by: syzkaller <syzkaller@googlegroups.com>
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
(cherry picked from commit c08eadc)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>1 parent 2697e4a commit 443b66f
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3838 | 3838 | | |
3839 | 3839 | | |
3840 | 3840 | | |
| 3841 | + | |
| 3842 | + | |
3841 | 3843 | | |
3842 | 3844 | | |
3843 | 3845 | | |
| |||
3938 | 3940 | | |
3939 | 3941 | | |
3940 | 3942 | | |
| 3943 | + | |
| 3944 | + | |
3941 | 3945 | | |
3942 | 3946 | | |
3943 | 3947 | | |
| |||
3992 | 3996 | | |
3993 | 3997 | | |
3994 | 3998 | | |
3995 | | - | |
3996 | | - | |
3997 | 3999 | | |
3998 | 4000 | | |
3999 | | - | |
4000 | | - | |
4001 | 4001 | | |
4002 | 4002 | | |
4003 | 4003 | | |
| |||
0 commit comments