{"id":"CVE-2022-49842","summary":"ASoC: core: Fix use-after-free in snd_soc_exit()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nASoC: core: Fix use-after-free in snd_soc_exit()\n\nKASAN reports a use-after-free:\n\nBUG: KASAN: use-after-free in device_del+0xb5b/0xc60\nRead of size 8 at addr ffff888008655050 by task rmmod/387\nCPU: 2 PID: 387 Comm: rmmod\nHardware name: QEMU Standard PC (i440FX + PIIX, 1996)\nCall Trace:\n\u003cTASK\u003e\ndump_stack_lvl+0x79/0x9a\nprint_report+0x17f/0x47b\nkasan_report+0xbb/0xf0\ndevice_del+0xb5b/0xc60\nplatform_device_del.part.0+0x24/0x200\nplatform_device_unregister+0x2e/0x40\nsnd_soc_exit+0xa/0x22 [snd_soc_core]\n__do_sys_delete_module.constprop.0+0x34f/0x5b0\ndo_syscall_64+0x3a/0x90\nentry_SYSCALL_64_after_hwframe+0x63/0xcd\n...\n\u003c/TASK\u003e\n\nIt's bacause in snd_soc_init(), snd_soc_util_init() is possble to fail,\nbut its ret is ignored, which makes soc_dummy_dev unregistered twice.\n\nsnd_soc_init()\n    snd_soc_util_init()\n        platform_device_register_simple(soc_dummy_dev)\n        platform_driver_register() # fail\n    \tplatform_device_unregister(soc_dummy_dev)\n    platform_driver_register() # success\n...\nsnd_soc_exit()\n    snd_soc_util_exit()\n    # soc_dummy_dev will be unregistered for second time\n\nTo fix it, handle error and stop snd_soc_init() when util_init() fail.\nAlso clean debugfs when util_init() or driver_register() fail.","modified":"2026-04-03T13:14:26.237157Z","published":"2025-05-01T14:09:57.711Z","related":["SUSE-SU-2025:01918-1","SUSE-SU-2025:01966-1","SUSE-SU-2025:01982-1","SUSE-SU-2025:01983-1","SUSE-SU-2025:01995-1","SUSE-SU-2025:02173-1","SUSE-SU-2025:02262-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49842.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/2ec3f558db343b045a7c7419cdbaec266b8ac1a7"},{"type":"WEB","url":"https://git.kernel.org/stable/c/34eee4189bcebbd5f6a2ff25ef0cb893ad33d51e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/41fad4f712e081acdfde8b59847f9f66eaf407a0"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6ec27c53886c8963729885bcf2dd996eba2767a7"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8d21554ec7680e9585fb852d933203c3db60dad1"},{"type":"WEB","url":"https://git.kernel.org/stable/c/90bbdf30a51e42378cb23a312005a022794b8e1e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a3365e62239dc064019a244bde5686ac18527c22"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c5674bd073c0fd9f620ca550c5ff08d0d429bdd9"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49842.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49842"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"fb257897bf20c5f0e1df584bb5b874e811651263"},{"fixed":"41fad4f712e081acdfde8b59847f9f66eaf407a0"},{"fixed":"90bbdf30a51e42378cb23a312005a022794b8e1e"},{"fixed":"a3365e62239dc064019a244bde5686ac18527c22"},{"fixed":"2ec3f558db343b045a7c7419cdbaec266b8ac1a7"},{"fixed":"8d21554ec7680e9585fb852d933203c3db60dad1"},{"fixed":"34eee4189bcebbd5f6a2ff25ef0cb893ad33d51e"},{"fixed":"c5674bd073c0fd9f620ca550c5ff08d0d429bdd9"},{"fixed":"6ec27c53886c8963729885bcf2dd996eba2767a7"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49842.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}