Linux kernel race condition in rxrpc send state updates
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
Original description
In the Linux kernel, the following vulnerability has been resolved:
rxrpc: Fix update of call->tx_pending without holding lock
Currently, rxrpc_send_data() updates call->tx_pending just before it returns - but it won't be holding the call->user_mutex when it does this if a wait was interrupted by a signal. This would allow a parallel sendmsg() to race.
Further, both the callers of rxrpc_send_data() call it with the lock held, and then it returns an indication through the parameter list to say whether it has dropped the lock or not - after which the callers both just drop the lock if it's still held.
Fix this by:
(1) Moving the release of call->user_mutex down into rxrpc_send_data() and get rid of the indicator parameter. This makes it easier to see where the lock is held.
(2) After waiting, if the attempt to reacquire the mutex is interrupted, just return directly there rather than going to out_unlock
(3) Restricting the txb variable to inside the buffering loop and leaving ->tx_pending set until we've queued the buffer.
From the CVE record · Linux