kcm: fix strp_init() order and cleanup
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e5571240236c5652f3e079b1d5866716a7ad819c · < f865976baa85915c7672f351b74d5974b93215f6| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
kcm: fix strp_init() order and cleanup
strp_init() is called just a few lines above this csk->sk_user_data check, it also initializes strp->work etc., therefore, it is unnecessary to call strp_done() to cancel the freshly initialized work.
And if sk_user_data is already used by KCM, psock->strp should not be touched, particularly strp->work state, so we need to move strp_init() after the csk->sk_user_data check.
This also makes a lockdep warning reported by syzbot go away.
From the CVE record · Linux
The Linux kernel's KCM code initializes strp state before checking whether sk_user_data is already in use by KCM. This can touch state that should be left alone and trigger a lockdep warning. The input does not establish an attacker action, access requirement, or user-interaction requirement.
Engineers running the Linux kernel should check their KCM deployments; affected versions are not specified.