Bug 7613 - Input: synaptics-rmi4 - fix use after free in rmi_unregister_function()
Summary: Input: synaptics-rmi4 - fix use after free in rmi_unregister_function()
Status: NEW
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: drivers (show other bugs) drivers
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: GuixinLiu
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-22 17:54 UTC by zhujun
Modified: 2023-11-22 17:59 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhujun cmss_group 2023-11-22 17:54:13 UTC
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.

Additional info:

社区有patch已经解决
Input: synaptics-rmi4 - fix use after free in rmi_unregister_function()

commit 6c71e065befb2fae8f1461559b940c04e1071bd5

Reference:https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=6c71e065befb2fae8f1461559b940c04e1071bd5

git cherry-pick -s 6c71e065b(with stable-v5.10.201 repo added)
Comment 1 小龙 admin 2023-11-22 17:59:00 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2451