nbd: don't allow reconnect after disconnect
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b7aa3d39385dc2d95899f9e379623fef446a2acd · < a8ee6ecde2b7bfb58c8a3afe8a9d2b848f580739| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nbd: don't allow reconnect after disconnect
Following process can cause nbd_config UAF:
1) grab nbd_config temporarily;
2) nbd_genl_disconnect() flush all recv_work() and release the initial reference:
nbd_genl_disconnect nbd_disconnect_and_put nbd_disconnect flush_workqueue(nbd->recv_workq) if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF, ...)) nbd_config_put -> due to step 1), reference is still not zero
3) nbd_genl_reconfigure() queue recv_work() again;
nbd_genl_reconfigure config = nbd_get_config_unlocked(nbd) if (!config) -> succeed if (!test_bit(NBD_RT_BOUND, ...)) -> succeed nbd_reconnect_socket queue_work(nbd->recv_workq, &args->work)
From the CVE record · Linux
A disconnect followed by a reconnect can cause a use-after-free in the Linux kernel's nbd configuration. The described sequence involves nbd disconnect and reconfigure operations; the input does not specify whether authentication or user interaction is required.
Engineers running the Linux kernel with nbd should check their kernel versions against the vendor advisory; affected versions are not specified.