keys: Pin request_key_auth payload in instantiate paths
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b5f545c880a2a47947ba2118b2509644ab7a2969 · < 7216ce8cb12fee44e309503955bb83806b106129| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
keys: Pin request_key_auth payload in instantiate paths
A: request_key() B: KEYCTL_INSTANTIATE_IOV ================ =========================
create auth key store rka in auth key wait for helper get auth key load rka from auth key copy user payload sleep on #PF
helper completed detach and free rka destroy auth key wake up use rka->target_key **USE-AFTER-FREE**
Give request_key_auth payloads a refcount. Take a payload reference while authkey->sem stabilizes the payload and revocation state. Hold that reference across the instantiate and reject paths. Drop the auth key owning reference from revoke and destroy.
[jarkko: Replaced the first two paragraphs of text with an actual concurrency scenario.]
From the CVE record · Linux
The Linux kernel’s key instantiation paths can use a request_key_auth payload after it has been freed. This can occur when concurrent key operations overlap with completion of a request_key() helper; the input does not specify authentication requirements or further impact.
Engineers running the Linux kernel should check their deployments; affected versions are not specified.