vfio/type1: prevent underflow of locked_vm via exec()
In the Linux kernel, the following vulnerability has been resolved: vfio/type1: prevent underflow of locked_vm via exec() When a vfio container is preserved across exec, the task does not change, but it gets a new mm with locked_vm=0, and loses the count from existing dma mappings. If the user later unmaps a dma mapping, locked_vm underflows to a large unsigned value, and a subsequent dma map request fails with ENOMEM in __account_locked_vm. To avoid underflow, grab and save the mm at the time a dma is mapped. Use that mm when adjusting locked_vm, rather than re-acquiring the saved task's mm, which may have changed. If the saved mm is dead, do nothing. locked_vm is incremented for existing mappings in a subsequent patch.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.10.173, 5.15.99, 6.1.16, 6.2.3
- CVEs
- CVE-2023-53171
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 15:43 UTC · Revision 1
Source evidence
vfio/type1: prevent underflow of locked_vm via exec()
core-osv · Original sourcePublished 15 Sept 2025, 14:04 UTC
In the Linux kernel, the following vulnerability has been resolved: vfio/type1: prevent underflow of locked_vm via exec() When a vfio container is preserved across exec, the task does not change, but it gets a new mm with locked_vm=0, and loses the count from existing dma mappings. If the user later unmaps a dma mapping, locked_vm underflows to a large unsigned value, and a subsequent dma map request fails with ENOMEM in __account_locked_vm. To avoid underflow, grab and save the mm at the time a dma is mapped. Use that mm when adjusting locked_vm, rather than re-acquiring the saved task's mm, which may have changed. If the saved mm is dead, do nothing. locked_vm is incremented for existing mappings in a subsequent patch.
osv:CVE-2023-53171
Kernel
Fixed versions: 5.10.173, 5.15.99, 6.1.16, 6.2.3
Complete source record
{
"id": "3b753fd5771caaf94b38d85b0ab4dcf38ba783278c81fa9698c67923cf7e9ccc",
"url": "https://osv.dev/vulnerability/CVE-2023-53171",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "vfio/type1: prevent underflow of locked_vm via exec()",
"summary": "In the Linux kernel, the following vulnerability has been resolved: vfio/type1: prevent underflow of locked_vm via exec() When a vfio container is preserved across exec, the task does not change, but it gets a new mm with locked_vm=0, and loses the count from existing dma mappings. If the user later unmaps a dma mapping, locked_vm underflows to a large unsigned value, and a subsequent dma map request fails with ENOMEM in __account_locked_vm. To avoid underflow, grab and save the mm at the time a dma is mapped. Use that mm when adjusting locked_vm, rather than re-acquiring the saved task's mm, which may have changed. If the saved mm is dead, do nothing. locked_vm is incremented for existing mappings in a subsequent patch.",
"evidence": "osv:CVE-2023-53171",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.10.173",
"evidence": "/affected/1/ranges"
},
{
"value": "5.15.99",
"evidence": "/affected/1/ranges"
},
{
"value": "6.1.16",
"evidence": "/affected/1/ranges"
},
{
"value": "6.2.3",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2023-53171",
"aliases": [
"CVE-2023-53171"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "73fa0d10d077d9521ee2dace2307ae2c9a965336"
},
{
"fixed": "5a271242716846cc016736fb76be2b40ee49b0c3"
},
{
"fixed": "eafb81c50da899dd80b340c841277acc4a1945b7"
},
{
"fixed": "a6b2aabe664098d5cf877ae0fd96459464a30e17"
},
{
"fixed": "b0790dff0760b7734cf0961f497ad64628ca550b"
},
{
"fixed": "046eca5018f8a5dd1dc2cedf87fb5843b9ea3026"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-53171.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "3.6.0"
},
{
"fixed": "5.10.173"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.11.0"
},
{
"fixed": "5.15.99"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "6.1.16"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.2.3"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-53171.json"
}
}
],
"modified": "2026-10-28T02:30:30.409145465Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/046eca5018f8a5dd1dc2cedf87fb5843b9ea3026",
"https://git.kernel.org/stable/c/5a271242716846cc016736fb76be2b40ee49b0c3",
"https://git.kernel.org/stable/c/a6b2aabe664098d5cf877ae0fd96459464a30e17",
"https://git.kernel.org/stable/c/b0790dff0760b7734cf0961f497ad64628ca550b",
"https://git.kernel.org/stable/c/eafb81c50da899dd80b340c841277acc4a1945b7",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53171.json",
"https://nvd.nist.gov/vuln/detail/CVE-2023-53171",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53171.json"
}
},
"related_cves": [
{
"value": "CVE-2023-53171",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 496937,
"published_at": "2025-09-15T14:04:04.544+00:00"
}