procfs: fix possible double mmput() in do_procmap_query()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
procfs: fix possible double mmput() in do_procmap_query()
When user provides incorrectly sized buffer for build ID for PROCMAP_QUERY we return with -ENAMETOOLONG error. After recent changes this condition happens later, after we unlocked mmap_lock/per-VMA lock and did mmput(), so original goto out is now wrong and will double-mmput() mm_struct. Fix by jumping further to clean up only vm_file and name_buf.
From the CVE record · Linux
The Linux kernel’s procfs PROCMAP_QUERY handler can call mmput() twice when a user supplies an incorrectly sized build-ID buffer. This is triggered by a local query that returns an ENAMETOOLONG error; the input does not specify any authentication requirement.
Engineers running the Linux kernel should check affected versions against the vendor advisory; no version range is provided.