CVE-2024-53198

xen: Fix the issue of resource not being properly released in xenbus_dev_probe()

State
Published
Severity
7.8 High
Published
Dec 27, 2024
Updated
Aug 5, 2026
Reserved
Nov 19, 2024

Read the record on cve.org

Description

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

xen: Fix the issue of resource not being properly released in xenbus_dev_probe()

This patch fixes an issue in the function xenbus_dev_probe(). In the xenbus_dev_probe() function, within the if (err) branch at line 313, the program incorrectly returns err directly without releasing the resources allocated by err = drv->probe(dev, id). As the return value is non-zero, the upper layers assume the processing logic has failed. However, the probe operation was performed earlier without a corresponding remove operation. Since the probe actually allocates resources, failing to perform the remove operation could lead to problems.

To fix this issue, we followed the resource release logic of the xenbus_dev_remove() function by adding a new block fail_remove before the fail_put block. After entering the branch if (err) at line 313, the function will use a goto statement to jump to the fail_remove block, ensuring that the previously acquired resources are correctly released, thus preventing the reference count leak.

This bug was identified by an experimental static analysis tool developed by our team. The tool specializes in analyzing reference count operations and detecting potential issues where resources are not properly managed. In this case, the tool flagged the missing release operation as a potential problem, which led to the development of this patch.

Scores

CVSSScoreVectorSource
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HLinux
3.15.5 MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HCISA-ADP

Weaknesses

  • CWE-401 Missing Release of Memory after Effective Lifetime

Affected Products

ProductVersions
LinuxLinux
  • 4bac07c993d03434ea902d3d4290d9e45944b66c to before 87106169b4ce26f85561f953d13d1fd86d99b612Affected
  • 4bac07c993d03434ea902d3d4290d9e45944b66c to before 0aa9e30b5b4af5dd504801689d6d84c584290a45Affected
  • 4bac07c993d03434ea902d3d4290d9e45944b66c to before e8823e6ff313465910edea07581627d85e68d9fdAffected
  • 4bac07c993d03434ea902d3d4290d9e45944b66c to before 3fc0996d2fefe61219375fd650601724b8cf2d30Affected
  • 4bac07c993d03434ea902d3d4290d9e45944b66c to before 804b96f8d0a02fa10b92f28b2e042f9128ed3ffcAffected
  • 4bac07c993d03434ea902d3d4290d9e45944b66c to before 217bdce88b104269b73603b84d0ab4dd04f481bcAffected
  • 4bac07c993d03434ea902d3d4290d9e45944b66c to before 2f977a4c82d35d063f5fe198bbc501c4b1c5ea0eAffected
  • 4bac07c993d03434ea902d3d4290d9e45944b66c to before afc545da381ba0c651b2658966ac737032676f01Affected
LinuxLinux
  • 2.6.23Affected
  • before 2.6.23Not affected
  • 5.4.287 through 5.4.*Not affected
  • 5.10.231 through 5.10.*Not affected
  • 5.15.174 through 5.15.*Not affected
  • 6.1.120 through 6.1.*Not affected
  • 6.6.64 through 6.6.*Not affected
  • 6.11.11 through 6.11.*Not affected
  • 6.12.2 through 6.12.*Not affected
  • 6.13 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.