{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-40202","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2025-04-16T07:20:57.179Z","datePublished":"2025-11-12T21:56:34.527Z","dateUpdated":"2026-08-05T12:08:30.982Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T12:08:30.982Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nipmi: Rework user message limit handling\n\nThe limit on the number of user messages had a number of issues,\nimproper counting in some cases and a use after free.\n\nRestructure how this is all done to handle more in the receive message\nallocation routine, so all refcouting and user message limit counts\nare done in that routine.  It's a lot cleaner and safer."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerable paths are entered through ioctls on the `/dev/ipmiN` character device (`IPMICTL_SEND_MSG`, `IPMICTL_SET_GETS_EVENTS_CMD`, `IPMICTL_REGISTER_FOR_CMD`), i.e. local access to the machine. Although BMC-originated IPMB/LAN traffic also exercises the same miscounted paths, the reliable and documented trigger is the local device interface.\nAC:L - The counting imbalance is deterministic, not a race: `ipmi_set_gets_events()` sets `msg->user` without incrementing `nr_msgs` while delivery always decrements it, so a single `IPMICTL_SET_GETS_EVENTS_CMD` that drains queued events reliably underflows the counter and defeats the allocation limit. No memory-layout or timing conditions outside the attacker's control are required.\nPR:L - Neither `ipmi_devintf.c` nor `ipmi_msghandler.c` performs any capability check — reaching the bug only requires an open file descriptor on `/dev/ipmiN`, which server, appliance and embedded/telecom deployments commonly grant to an unprivileged monitoring/management group via udev so agents such as ipmitool can run without root.\nUI:N - The attacker performs everything itself with open()/ioctl() on the IPMI device; no victim action, mount, or file-open by another user is needed.\nS:U - The corrupted state (`struct ipmi_recv_msg`, `struct ipmi_user`, the driver's static watchdog/poweroff message objects) and all consequences stay within the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The fix removes a genuine use-after-free (`ipmi_free_recv_msg(msg)` followed by dereferencing `msg->user`) plus release of caller-owned message objects; a freed `ipmi_recv_msg`/`ipmi_user` that the attacker can reclaim via heap grooming yields a controlled read primitive, and IPMI messages carry BMC/management-plane data.\nI:H - The use-after-free performs an atomic decrement through a stale `msg->user` pointer — an attacker-placed replacement object turns that into an arbitrary 32-bit decrement primitive, and the double release of the watchdog/poweroff static messages corrupts driver state, both leveragable toward control-flow hijack.\nA:H - Underflowing `nr_msgs` makes the signed/unsigned comparison reject every further request with `-EBUSY`, permanently disabling IPMI management (the reported real-world failure), while simultaneously defeating the `max_msgs_per_user` guard that exists specifically to stop a rogue program exhausting kernel memory; the use-after-free additionally causes oopses."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/char/ipmi/ipmi_msghandler.c"],"versions":[{"version":"8e76741c3d8b20dfa2d6c30fa10ff927cfd93d82","lessThan":"f63723ca7d7623f9dae1990973cd158671f03c56","status":"affected","versionType":"git"},{"version":"8e76741c3d8b20dfa2d6c30fa10ff927cfd93d82","lessThan":"348121b29594d42d1635648fd3ed31dfa25351d5","status":"affected","versionType":"git"},{"version":"8e76741c3d8b20dfa2d6c30fa10ff927cfd93d82","lessThan":"53d6e403affbf6df2c859a0ea00ccfc1e72090ca","status":"affected","versionType":"git"},{"version":"8e76741c3d8b20dfa2d6c30fa10ff927cfd93d82","lessThan":"0ed73be9a2547ffb9b5c1d879ad9bfab73d920b5","status":"affected","versionType":"git"},{"version":"8e76741c3d8b20dfa2d6c30fa10ff927cfd93d82","lessThan":"b52da4054ee0bf9ecb44996f2c83236ff50b3812","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/char/ipmi/ipmi_msghandler.c"],"versions":[{"version":"5.19","status":"affected"},{"version":"0","lessThan":"5.19","status":"unaffected","versionType":"semver"},{"version":"6.1.157","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.113","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.54","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.17.4","lessThanOrEqual":"6.17.*","status":"unaffected","versionType":"semver"},{"version":"6.18","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.1.157"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.6.113"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.12.54"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.17.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.18"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/f63723ca7d7623f9dae1990973cd158671f03c56"},{"url":"https://git.kernel.org/stable/c/348121b29594d42d1635648fd3ed31dfa25351d5"},{"url":"https://git.kernel.org/stable/c/53d6e403affbf6df2c859a0ea00ccfc1e72090ca"},{"url":"https://git.kernel.org/stable/c/0ed73be9a2547ffb9b5c1d879ad9bfab73d920b5"},{"url":"https://git.kernel.org/stable/c/b52da4054ee0bf9ecb44996f2c83236ff50b3812"}],"title":"ipmi: Rework user message limit handling","x_generator":{"engine":"bippy-1.2.0"}}}}