libceph: fix potential use-after-free in have_mon_and_osd_map()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 6822d00b5462e7a9dfa11dcc60cc25823a2107c5 · < 3fc43120b22a3d4f1fbeff56a35ce2105b6a5683| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
libceph: fix potential use-after-free in have_mon_and_osd_map()
The wait loop in __ceph_open_session() can race with the client receiving a new monmap or osdmap shortly after the initial map is received. Both ceph_monc_handle_map() and handle_one_map() install a new map immediately after freeing the old one
kfree(monc->monmap); monc->monmap = monmap;
ceph_osdmap_destroy(osdc->osdmap); osdc->osdmap = newmap;
under client->monc.mutex and client->osdc.lock respectively, but because neither is taken in have_mon_and_osd_map() it's possible for client->monc.monmap->epoch and client->osdc.osdmap->epoch arms in
client->monc.monmap && client->monc.monmap->epoch && client->osdc.osdmap && client->osdc.osdmap->epoch;
condition to dereference an already freed map. This happens to be reproducible with generic/395 and generic/397 with KASAN enabled:
From the CVE record · Linux
The Linux kernel’s libceph client can dereference a freed monitor or OSD map when a new map arrives during Ceph session setup. The issue was reproduced during a local Ceph mount; the input does not establish an attacker-controlled trigger or authentication requirements.
Engineers running Linux kernels with the Ceph client should check their kernel’s status; affected versions are not specified.