[PATCH OLK-5.10] HID: logitech-hidpp: Prevent use-after-free on force feedback initialisation failure
From: Lee Jones <lee@kernel.org> mainline inclusion from mainline-v7.0-rc5 commit f7a4c78bfeb320299c1b641500fe7761eadbd101 category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/14581 CVE: CVE-2026-43049 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... ---------------------------------------------------------------------- Presently, if the force feedback initialisation fails when probing the Logitech G920 Driving Force Racing Wheel for Xbox One, an error number will be returned and propagated before the userspace infrastructure (sysfs and /dev/input) has been torn down. If userspace ignores the errors and continues to use its references to these dangling entities, a UAF will promptly follow. We have 2 options; continue to return the error, but ensure that all of the infrastructure is torn down accordingly or continue to treat this condition as a warning by emitting the message but returning success. It is thought that the original author's intention was to emit the warning but keep the device functional, less the force feedback feature, so let's go with that. Signed-off-by: Lee Jones <lee@kernel.org> Reviewed-by: Günther Noack <gnoack@google.com> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org> Conflicts: drivers/hid/hid-logitech-hidpp.c [context conflicts] Signed-off-by: Chen Jinghuang <chenjinghuang2@huawei.com> --- drivers/hid/hid-logitech-hidpp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 8bdcd4027416..12ff00b3685a 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -3933,10 +3933,12 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id) if (hidpp->quirks & HIDPP_QUIRK_CLASS_G920) { ret = hidpp_ff_init(hidpp, &data); - if (ret) + if (ret) { hid_warn(hidpp->hid_dev, "Unable to initialize force feedback support, errno %d\n", ret); + ret = 0; + } } /* -- 2.34.1
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://atomgit.com/openeuler/kernel/merge_requests/22337 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/W6H... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://atomgit.com/openeuler/kernel/merge_requests/22337 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/W6H...
participants (2)
-
Chen Jinghuang -
patchwork bot