rxrpc: Fix call removal to use RCU safe deletion
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2baec2c3f854d1f79c7bb28386484e144e864a14 · < 3be718f659683ad89fad6f1eb66bee99727cae64| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
rxrpc: Fix call removal to use RCU safe deletion
Fix rxrpc call removal from the rxnet->calls list to use list_del_rcu() rather than list_del_init() to prevent stuffing up reading /proc/net/rxrpc/calls from potentially getting into an infinite loop.
This, however, means that list_empty() no longer works on an entry that's been deleted from the list, making it harder to detect prior deletion. Fix this by:
Firstly, make rxrpc_destroy_all_calls() only dump the first ten calls that are unexpectedly still on the list. Limiting the number of steps means there's no need to call cond_resched() or to remove calls from the list here, thereby eliminating the need for rxrpc_put_call() to check for that.
rxrpc_put_call() can then be fixed to unconditionally delete the call from the list as it is the only place that the deletion occurs.
From the CVE record · Linux
The Linux kernel's rxrpc call removal was not safe for concurrent readers. Reading /proc/net/rxrpc/calls could potentially enter an infinite loop; the input does not specify authentication requirements or any other user interaction.
Engineers running Linux kernels with rxrpc should check whether their kernel includes this fix; affected versions are not specified.