[PATCH openEuler-1.0-LTS 0/2] CVE-2026-43048
CVE-2026-43048 Lee Jones (1): 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 ++++--- include/linux/hid.h | 11 +++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) -- 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 [cherry-pick applied cleanly without conflicts, but the patch context differs.] 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 2053f3ee4395..4ea93c58d322 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -1196,4 +1196,15 @@ do { \ #define hid_dbg(hid, fmt, arg...) \ dev_dbg(&(hid)->dev, fmt, ##arg) +#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> Conflicts: drivers/hid/hid-core.c [cherry-pick applied cleanly without conflicts, but the patch context differs.] 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 c0446ee3d4a0..61b614072e05 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1576,9 +1576,10 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size, rsize = HID_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/22428 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/S2F... 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/22428 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/S2F...
participants (2)
-
Liu Kai -
patchwork bot