dm era: fix NULL pointer dereference in metadata_open()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ eec40579d84873dfb7021eb24c50360f073237c5 · < 14e03ecd3b1b5fc03c082b27a2f8889f8290c30e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
dm era: fix NULL pointer dereference in metadata_open()
metadata_open() returns NULL when kzalloc_obj() fails, but the caller era_ctr() only checks IS_ERR(md). Since IS_ERR(NULL) returns false, the NULL pointer is treated as a valid result and later assigned to era->md, leading to a NULL pointer dereference when the metadata is accessed.
Fix this by returning ERR_PTR(-ENOMEM) on allocation failure, consistent with dm-cache-metadata.c, dm-thin-metadata.c, and dm-clone-metadata.c which all use ERR_PTR(-ENOMEM) for the same pattern.
From the CVE record · Linux
In the Linux kernel's dm era component, metadata_open() can return NULL if an allocation fails, but era_ctr() does not recognize it as an error. Accessing the metadata can then cause a NULL pointer dereference. The input does not specify an attacker path, authentication requirements, or user interaction.
Engineers running Linux kernels with the dm era component should check their versions; affected versions are not specified.