vdpa: solidrun: Fix UB bug with devres
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.6.636.11.106.12In the Linux kernel, the following vulnerability has been resolved:
vdpa: solidrun: Fix UB bug with devres
In psnet_open_pf_bar() and snet_open_vf_bar() a string later passed to pcim_iomap_regions() is placed on the stack. Neither pcim_iomap_regions() nor the functions it calls copy that string.
Should the string later ever be used, this, consequently, causes undefined behavior since the stack frame will by then have disappeared.
Fix the bug by allocating the strings on the heap through devm_kasprintf().
From the CVE record · Linux
The Linux kernel’s SolidRun vDPA code passes stack-allocated strings to pcim_iomap_regions() without copying them. If those strings are used after the stack frame disappears, undefined behavior can result. The input does not describe an attacker path or specify access, authentication, or user-interaction requirements.
Engineers running the Linux kernel should check whether their build includes the affected SolidRun vDPA code; affected versions are not specified.