security/keys: fix missed RCU read section on lookup
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b2a4df200d570b2c33a57e1ebfa5896e4bc81b69 · < 50bb3435a5e627bfbdc52eb4536f49f88b3486b8| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
security/keys: fix missed RCU read section on lookup
Nicholas Carlini reports that the keyring code calls assoc_array_find() in find_key_to_update() without holding the RCU read lock, while the assoc_array_gc() code really is designed around removing the node from the tree and then freeing it after an RCU grace-period.
The regular key handling doesn't see this because holding the keyring semaphore hides any lifetime issues, but the persistent key handling uses a different model.
Instead of extending the keyring locking, just do the simple RCU locking that the assoc_array was designed for.
From the CVE record · Linux
The Linux kernel’s persistent key handling can call assoc_array_find() without an RCU read lock, creating a race with node removal and freeing. The reported weakness includes an out-of-bounds read, but the input does not establish how an attacker could trigger it or whether access or user interaction is required.
Anyone running the Linux kernel should check their version; affected versions were not provided.