Input: synaptics-rmi4 - fix use after free in rmi_unregister_function()
stable inclusion from stable-v4.19.299 commit 2f236d8638f5b43e0c72919a6a27fe286c32053f category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9RDP6 CVE: CVE-2023-52840 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2f236d8638f5b43e0c72919a6a27fe286c32053f ---------------------------------------------------------------------- [ Upstream commit eb988e46da2e4eae89f5337e047ce372fe33d5b1 ] The put_device() calls rmi_release_function() which frees "fn" so the dereference on the next line "fn->num_of_irqs" is a use after free. Move the put_device() to the end to fix this. Fixes: 24d28e4f ("Input: synaptics-rmi4 - convert irq distribution to irq_domain") Signed-off-by:Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/706efd36-7561-42f3-adfa-dd1d0bd4f5a1@moroto.mountain Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Liu Chuang <liuchuang40@huawei.com>
Loading
Please sign in to comment