CVE-2026-68416

Source
https://cve.org/CVERecord?id=CVE-2026-68416
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-68416.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2026-68416
Downstream
Published
2026-08-10T12:04:36.582Z
Modified
2026-08-11T03:33:25.455281002Z
Summary
mtd: fix double free and WARN_ON in add_mtd_device() error paths
Details

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

mtd: fix double free and WARNON in addmtd_device() error paths

When deviceregister() or mtdnvmemadd() fails inside addmtddevice() for a partition, the error handling triggers mtdrelease() via putdevice() or deviceunregister(). mtdrelease() calls releasemtdpartition() which frees the mtdinfo structure. However, callers such as mtdaddpartition() and addmtdpartitions() also call free_partition() in their error paths, resulting in a double free.

Additionally, releasemtdpartition() hits WARNON(!listempty( &mtd->part.node)) because the partition node is still linked in the parent's partitions list when the release callback fires from the addmtddevice() error path.

Fix this by overriding dev->type and dev->release before putdevice() in the error paths, so that devicerelease() invokes a no-op function instead of mtdrelease(). For the mtdnvmemadd() failure case, deviceunregister() is replaced with devicedel() to separate the device removal from the final kobject reference drop, allowing the override to take effect before putdevice() is called.

The callers' error paths (listdel + freepartition) remain the sole owners of mtdinfo lifetime on addmtd_device() failure, which is the expected contract.

The normal partition teardown path is not affected: delmtddevice() goes through krefput() -> mtddevicerelease() -> deviceunregister() with dev->type still set to &mtddevtype, so mtdrelease() -> releasemtdpartition() continues to work correctly for the regular removal case.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/68xxx/CVE-2026-68416.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
19bfa9ebebb5ec0695def57eb1d80de7e9cab369
Fixed
ffe21a3545b439e7b11578a701c22a847c149561
Fixed
e1e96aca1bdf391e2f49531c270ffc134e5b49a5
Fixed
f98ae09c727dcf34f745c875661c64b642e4abfa
Fixed
820f983d641937a787e841ee4b93501f69f5683e
Fixed
9d4af746af8ce27eefc2338b2feaa1e01f28b6c3

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-68416.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.6.0
Fixed
6.6.148
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.101
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.18.42
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
7.1.6

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-68416.json"