udmabuf: validate ubuf->pagecount
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ fbb0de795078190a9834b3409e4b009cfb18a6d4 · < 2b6dd600dd72573c23ea180b5b0b2f1813405882| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
udmabuf: validate ubuf->pagecount
Syzbot has reported GPF in sg_alloc_append_table_from_pages(). The problem was in ubuf->pages == ZERO_PTR.
ubuf->pagecount is calculated from arguments passed from user-space. If user creates udmabuf with list.size == 0 then ubuf->pagecount will be also equal to zero; it causes kmalloc_array() to return ZERO_PTR.
Fix it by validating ubuf->pagecount before passing it to kmalloc_array().
From the CVE record · Linux
The Linux kernel's udmabuf code does not validate a page count derived from user-space arguments. A local user who creates a udmabuf with a zero-sized list can trigger a kernel fault; the input does not specify authentication requirements.
Engineers running Linux kernels with udmabuf should check whether their kernel includes the fix; affected versions are not specified.