net/smc: stop killed, freed and out_of_sync sharing a byte
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b286a0651e4404ab96cdfdcdad8a839a26b3751e · < db51a8658c11a82432b64999519a269c3aabb447| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net/smc: stop killed, freed and out_of_sync sharing a byte
The three connection state flags are single-bit bitfields, so they occupy one byte of struct smc_connection and every store to one is a read-modify-write of the other two:
u8 killed : 1; u8 freed : 1; u8 out_of_sync : 1;
They are not written under a common lock. smc_cdc_msg_validate() sets out_of_sync from the receive tasklet, while smc_conn_kill() sets killed from process context under lock_sock(), and the receive path does not defer to the backlog when the socket is owned -- smc_cdc_msg_recv() takes only bh_lock_sock().
Give each flag its own byte so a store no longer touches its neighbours. All readers test them as booleans and are unchanged. struct smc_connection grows by two bytes.
From the CVE record · Linux
In the Linux kernel's net/smc component, three connection-state flags share a byte, so concurrent updates can overwrite one another. The input does not establish how an attacker could trigger this, whether network or local access or authentication is needed, or whether user interaction is required.
Teams running Linux kernels with the affected net/smc code should check their versions; affected versions are not specified.