[PATCH OLK-6.6 0/4] CVE
CVE Keenan Dong (1): Bluetooth: MGMT: validate LTK enc_size on load Lee Jones (2): HID: multitouch: Check to ensure report responses match the request HID: core: Mitigate potential OOB by removing bogus memset() Vicki Pfau (1): HID: core: Add printk_ratelimited variants to hid_warn() etc drivers/hid/hid-core.c | 7 ++++--- drivers/hid/hid-multitouch.c | 7 +++++++ include/linux/hid.h | 11 +++++++++++ net/bluetooth/mgmt.c | 3 +++ 4 files changed, 25 insertions(+), 3 deletions(-) -- 2.34.1
From: Keenan Dong <keenanat2000@gmail.com> stable inclusion from stable-v6.6.134 commit f71695e81f4cb428f3c7e2138eae88199005b52c category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/14552 CVE: CVE-2026-43020 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=... -------------------------------- [ Upstream commit b8dbe9648d69059cfe3a28917bfbf7e61efd7f15 ] Load Long Term Keys stores the user-provided enc_size and later uses it to size fixed-size stack operations when replying to LE LTK requests. An enc_size larger than the 16-byte key buffer can therefore overflow the reply stack buffer. Reject oversized enc_size values while validating the management LTK record so invalid keys never reach the stored key state. Fixes: 346af67b8d11 ("Bluetooth: Add MGMT handlers for dealing with SMP LTK's") Reported-by: Keenan Dong <keenanat2000@gmail.com> Signed-off-by: Keenan Dong <keenanat2000@gmail.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Liu Kai <liukai284@huawei.com> --- net/bluetooth/mgmt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 79e8adf31b6b..a4825c0474a1 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -7260,6 +7260,9 @@ static bool ltk_is_valid(struct mgmt_ltk_info *key) if (key->initiator != 0x00 && key->initiator != 0x01) return false; + if (key->enc_size > sizeof(key->val)) + return false; + switch (key->addr.type) { case BDADDR_LE_PUBLIC: return true; -- 2.34.1
From: Lee Jones <lee@kernel.org> stable inclusion from stable-v6.6.134 commit c7a27bb4d0f6573ca0f9c7ef0b63291486239190 category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/14579 CVE: CVE-2026-43047 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=... -------------------------------- [ Upstream commit e716edafedad4952fe3a4a273d2e039a84e8681a ] It is possible for a malicious (or clumsy) device to respond to a specific report's feature request using a completely different report ID. This can cause confusion in the HID core resulting in nasty side-effects such as OOB writes. Add a check to ensure that the report ID in the response, matches the one that was requested. If it doesn't, omit reporting the raw event and return early. Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Liu Kai <liukai284@huawei.com> --- drivers/hid/hid-multitouch.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index b9e67b408a4b..945c96794b80 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -471,12 +471,19 @@ static void mt_get_feature(struct hid_device *hdev, struct hid_report *report) dev_warn(&hdev->dev, "failed to fetch feature %d\n", report->id); } else { + /* The report ID in the request and the response should match */ + if (report->id != buf[0]) { + hid_err(hdev, "Returned feature report did not match the request\n"); + goto free; + } + ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT, buf, size, 0); if (ret) dev_warn(&hdev->dev, "failed to report feature\n"); } +free: kfree(buf); } -- 2.34.1
From: Vicki Pfau <vi@endrift.com> mainline inclusion from mainline-v6.18-rc2 commit 1d64624243af8329b4b219d8c39e28ea448f9929 category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/14580 CVE: CVE-2026-43048 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... -------------------------------- hid_warn_ratelimited() is needed. Add the others as part of the block. Signed-off-by: Vicki Pfau <vi@endrift.com> Signed-off-by: Jiri Kosina <jkosina@suse.com> Conflicts: include/linux/hid.h [Context conflicts] Signed-off-by: Liu Kai <liukai284@huawei.com> --- include/linux/hid.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/hid.h b/include/linux/hid.h index 317ec8e5fb90..638efc37003e 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -1251,4 +1251,15 @@ int hid_pidff_init_with_quirks(struct hid_device *hid, __u32 initial_quirks); #define hid_dbg_once(hid, fmt, ...) \ dev_dbg_once(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_err_ratelimited(hid, fmt, ...) \ + dev_err_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_notice_ratelimited(hid, fmt, ...) \ + dev_notice_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_warn_ratelimited(hid, fmt, ...) \ + dev_warn_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_info_ratelimited(hid, fmt, ...) \ + dev_info_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_dbg_ratelimited(hid, fmt, ...) \ + dev_dbg_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__) + #endif -- 2.34.1
From: Lee Jones <lee@kernel.org> mainline inclusion from mainline-v7.0-rc5 commit 0a3fe972a7cb1404f693d6f1711f32bc1d244b1c category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/14580 CVE: CVE-2026-43048 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... -------------------------------- The memset() in hid_report_raw_event() has the good intention of clearing out bogus data by zeroing the area from the end of the incoming data string to the assumed end of the buffer. However, as we have previously seen, doing so can easily result in OOB reads and writes in the subsequent thread of execution. The current suggestion from one of the HID maintainers is to remove the memset() and simply return if the incoming event buffer size is not large enough to fill the associated report. Suggested-by Benjamin Tissoires <bentiss@kernel.org> Signed-off-by: Lee Jones <lee@kernel.org> [bentiss: changed the return value] Signed-off-by: Benjamin Tissoires <bentiss@kernel.org> Signed-off-by: Liu Kai <liukai284@huawei.com> --- drivers/hid/hid-core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index e3d728d67b53..0d1728120c90 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2017,9 +2017,10 @@ int hid_report_raw_event(struct hid_device *hid, enum hid_report_type type, u8 * rsize = max_buffer_size; if (csize < rsize) { - dbg_hid("report %d is too short, (%d < %d)\n", report->id, - csize, rsize); - memset(cdata + csize, 0, rsize - csize); + hid_warn_ratelimited(hid, "Event data for report %d was too short (%d vs %d)\n", + report->id, rsize, csize); + ret = -EINVAL; + goto out; } if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event) -- 2.34.1
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://atomgit.com/openeuler/kernel/merge_requests/22406 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/C7F... 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/22406 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/C7F...
participants (2)
-
Liu Kai -
patchwork bot