Skip to contentSkip to conversation

CVE-2025-38495: HID: core: ensure the allocated report buffer can contain the reserved report ID

DISCUSSION Greg Kroah-Hartman 2 participants 9 messages Jul 28, 2025 – Sep 30, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

HID: core: ensure the allocated report buffer can contain the reserved report ID

When the report ID is not used, the low level transport drivers expect the first byte to be 0. However, currently the allocated buffer not account for that extra byte, meaning that instead of having 8 guaranteed bytes for implement to be working, we only have 7.

The Linux kernel CVE team has assigned CVE-2025-38495 to this issue.

Affected and fixed versions
===========================

	Fixed in 6.1.147 with commit d3ed1d84a84538a39b3eb2055d6a97a936c108f2
	Fixed in 6.6.100 with commit fcda39a9c5b834346088c14b1374336b079466c1
	Fixed in 6.12.40 with commit a262370f385e53ff7470efdcdaf40468e5756717
	Fixed in 6.15.8 with commit a47d9d9895bad9ce0e840a39836f19ca0b2a343a
	Fixed in 6.16 with commit 4f15ee98304b96e164ff2340e1dfd6181c3f42aa

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2025-38495

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/hid/hid-core.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/d3ed1d84a84538a39b3eb2055d6a97a936c108f2
	https://git.kernel.org/stable/c/fcda39a9c5b834346088c14b1374336b079466c1
	https://git.kernel.org/stable/c/a262370f385e53ff7470efdcdaf40468e5756717
	https://git.kernel.org/stable/c/a47d9d9895bad9ce0e840a39836f19ca0b2a343a
	https://git.kernel.org/stable/c/4f15ee98304b96e164ff2340e1dfd6181c3f42aa
#1 lore raw
Quoted 10 lines · Greg Kroah-Hartman

In the Linux kernel, the following vulnerability has been resolved:

HID: core: ensure the allocated report buffer can contain the reserved report ID

When the report ID is not used, the low level transport drivers expect the first byte to be 0. However, currently the allocated buffer not account for that extra byte, meaning that instead of having 8 guaranteed bytes for implement to be working, we only have 7.

The Linux kernel CVE team has assigned CVE-2025-38495 to this issue.

This commit prepares for the next commit in the patch series. See
https://lore.kernel.org/all/[email protected]/

The patch series has 3 commits, with the main fix being the middle commit "HID: core: ensure __hid_request reserves the report ID as the first byte".

Unfortunately, the 1st and 3rd commit has CVE numbers assigned to them but not the actual fix.

Please assign CVE number to the middle commit.

Segue: Can we not have same CVE number for a patch series fixing a vuln?

Thanks,
Siddh

#2 lore raw
Quoted 15 lines · Siddh Raman Pant
Quoted 10 lines · Greg Kroah-Hartman

In the Linux kernel, the following vulnerability has been resolved:

HID: core: ensure the allocated report buffer can contain the reserved report ID

When the report ID is not used, the low level transport drivers expect the first byte to be 0. However, currently the allocated buffer not account for that extra byte, meaning that instead of having 8 guaranteed bytes for implement to be working, we only have 7.

The Linux kernel CVE team has assigned CVE-2025-38495 to this issue.

This commit prepares for the next commit in the patch series. See
https://lore.kernel.org/all/[email protected]/

Quoted 8 lines

The patch series has 3 commits, with the main fix being the middle commit "HID: core: ensure __hid_request reserves the report ID as the first byte".

Unfortunately, the 1st and 3rd commit has CVE numbers assigned to them but not the actual fix.

Please assign CVE number to the middle commit.

What git id is that?

And this commit on its own fixes a problem, so it should be a separate CVE, right?

Quoted 2 lines

Segue: Can we not have same CVE number for a patch series fixing a vuln?

We can, but generally it's just one-fix-per-cve.

thanks,

greg k-h

#3 lore raw
Quoted 1 line · On Tue, Sep 30 2025 at 16:19:44 +0530, [email protected] wrote:

What git id is that?

0d0777ccaa2d46609d05b66ba0096802a2746193

Quoted 2 lines

And this commit on its own fixes a problem, so it should be a separate CVE, right?

The reservation of 1st byte happens in the next commit.

Not sure why the change was broken up into two.

Thanks,
Siddh

#4 lore raw
Quoted 5 lines · Siddh Raman Pant
Quoted 1 line · On Tue, Sep 30 2025 at 16:19:44 +0530, [email protected] wrote:

What git id is that?

0d0777ccaa2d46609d05b66ba0096802a2746193

That commit id on its own does not "fix" anything that we can see, which is why it was not given a CVE.

Quoted 6 lines
Quoted 2 lines

And this commit on its own fixes a problem, so it should be a separate CVE, right?

The reservation of 1st byte happens in the next commit.

Not sure why the change was broken up into two.

Then the second change is the one that gets the CVE. Any "previous" commits in a series that were preparing for the real fix are not called out. As each CVE entry says, do NOT cherry-pick, but rather always take all of the commits in the stable release.

thanks,

greg k-h

#5 lore raw
Quoted 4 lines · On Tue, Sep 30 2025 at 16:29:03 +0530, [email protected] wrote:

Then the second change is the one that gets the CVE. Any "previous" commits in a series that were preparing for the real fix are not called out. As each CVE entry says, do NOT cherry-pick, but rather always take all of the commits in the stable release.

IMO it won't be nice to change an identifier now and a new ID should be assigned instead.

Thanks,
Siddh

#6 lore raw
Quoted 9 lines · Siddh Raman Pant
Quoted 4 lines · On Tue, Sep 30 2025 at 16:29:03 +0530, [email protected] wrote:

Then the second change is the one that gets the CVE. Any "previous" commits in a series that were preparing for the real fix are not called out. As each CVE entry says, do NOT cherry-pick, but rather always take all of the commits in the stable release.

IMO it won't be nice to change an identifier now and a new ID should be assigned instead.

I do not understand. We are not going to change anything here...

Let's start over. Is the CVE referenced here in the Subject line, and the git id it references not valid? Does it not fix a vulnerability as described? Is there some other commit that also fixes a vulnerability that should also be assigned to a new CVE? Or is something else wrong here?

thanks,

greg k-h

#7 lore raw
Quoted 2 lines · On Tue, Sep 30 2025 at 16:52:30 +0530, [email protected] wrote:

Is the CVE referenced here in the Subject line, and the git id it references not valid?

It is valid.

Quoted 2 lines

Is there some other commit that also fixes a vulnerability that should also be assigned to a new CVE?

Yes: 0d0777ccaa2d46609d05b66ba0096802a2746193 which is immediately after the commit in title, and fixes the underflow reported by syzkaller (see [1] and the commit message for the tested-by), which is the main bug, for which there is also a public exploit (see [2]).

[1] https://lore.kernel.org/all/[email protected]/t/#u

[2] https://github.com/xairy/kernel-exploits/tree/master/CVE-2025-38494

Thanks,
Siddh

#8 lore raw
Quoted 6 lines · Siddh Raman Pant
Quoted 2 lines · On Tue, Sep 30 2025 at 16:52:30 +0530, [email protected] wrote:

Is the CVE referenced here in the Subject line, and the git id it references not valid?

It is valid.

Great!

Quoted 11 lines
Quoted 2 lines

Is there some other commit that also fixes a vulnerability that should also be assigned to a new CVE?

Yes: 0d0777ccaa2d46609d05b66ba0096802a2746193 which is immediately after the commit in title, and fixes the underflow reported by syzkaller (see [1] and the commit message for the tested-by), which is the main bug, for which there is also a public exploit (see [2]).

[1] https://lore.kernel.org/all/[email protected]/t/#u

[2] https://github.com/xairy/kernel-exploits/tree/master/CVE-2025-38494

That is assigned to, and stopped by commit c2ca42f190b6 ("HID: core: do not bypass hid_hw_raw_request"), so that should be fine. And yes, you do need to have commit 0d0777ccaa2d ("HID: core: ensure __hid_request reserves the report ID as the first byte") applied in order to be able to apply c2ca42f190b6 ("HID: core: do not bypass hid_hw_raw_request"), but that's the case for MANY CVE ids that we call out, right?

Again, never cherry-pick :)

thanks,

greg k-h