hwrng: core - fix rng list on registration error
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2bbb6983887fefc8026beab01198d30f47b7bd22 · < 3a5834db2b1ce25649f330e78efe1ccde78967fd| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
hwrng: core - fix rng list on registration error
hwrng_register(rng) does the following:
1. Checks if rng has name and read methods set 2. Checks if the name already exists 3. Adds rng to global rng_list 4. May try to set rng to current_rng
If step 4 fails, it returns an error. However, it does not remove the rng from rng_list, causing a dangling reference which can result in use-after-free if the caller frees rng, since registration failed.
Add a list_del_init() cleanup step.
From the CVE record · Linux
The Linux kernel hwrng core can leave a dangling reference when registration fails while setting the current RNG. If the caller then frees the RNG, this can result in use-after-free. The input does not specify an attacker path or access requirements.
Engineers running the Linux kernel should check their versions; affected versions are not specified.