CVE-2022-50145
Severity CVSS v4.0:
Pending analysis
Type:
CWE-476
NULL Pointer Dereference
Publication date:
18/06/2025
Last modified:
20/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
dmaengine: sf-pdma: Add multithread support for a DMA channel<br />
<br />
When we get a DMA channel and try to use it in multiple threads it<br />
will cause oops and hanging the system.<br />
<br />
% echo 64 > /sys/module/dmatest/parameters/threads_per_chan<br />
% echo 10000 > /sys/module/dmatest/parameters/iterations<br />
% echo 1 > /sys/module/dmatest/parameters/run<br />
[ 89.480664] Unable to handle kernel NULL pointer dereference at virtual<br />
address 00000000000000a0<br />
[ 89.488725] Oops [#1]<br />
[ 89.494708] CPU: 2 PID: 1008 Comm: dma0chan0-copy0 Not tainted<br />
5.17.0-rc5<br />
[ 89.509385] epc : vchan_find_desc+0x32/0x46<br />
[ 89.513553] ra : sf_pdma_tx_status+0xca/0xd6<br />
<br />
This happens because of data race. Each thread rewrite channels&#39;s<br />
descriptor as soon as device_prep_dma_memcpy() is called. It leads to the<br />
situation when the driver thinks that it uses right descriptor that<br />
actually is freed or substituted for other one.<br />
<br />
With current fixes a descriptor changes its value only when it has<br />
been used. A new descriptor is acquired from vc->desc_issued queue that<br />
is already filled with descriptors that are ready to be sent. Threads<br />
have no direct access to DMA channel descriptor. Now it is just possible<br />
to queue a descriptor for further processing.
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.5 (including) | 5.10.137 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.15.61 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 5.18.18 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.19 (including) | 5.19.2 (excluding) |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/4c7350b1dd8a192af844de32fc99b9e34c876fda
- https://git.kernel.org/stable/c/5ab2782c944e324008ef5d658f2494a9f0e3c5ac
- https://git.kernel.org/stable/c/a93b3f1e11971a91b6441b6d47488f4492cc113f
- https://git.kernel.org/stable/c/b2cc5c465c2cb8ab697c3fd6583c614e3f6cfbcc
- https://git.kernel.org/stable/c/b9b4992f897be9b0b9e3a3b956cab6b75ccc3f11



