libceph: Fix slab-out-of-bounds access in auth message processing
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4e7a5dcd1bbab6560fbc8ada29a840e7a20ed7bc · < 8517b6c8d2c759918ba0058cb6c7e14d59643202| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
libceph: Fix slab-out-of-bounds access in auth message processing
If a (potentially corrupted) message of type CEPH_MSG_AUTH_REPLY contains a positive value in its result field, it is treated as an error code by ceph_handle_auth_reply() and returned to handle_auth_reply(). Thereafter, an attempt is made to send the preallocated message of type CEPH_MSG_AUTH, where the returned value is interpreted as the size of the front segment to send. If the result value in the message is greater than the size of the memory buffer allocated for the front segment, an out-of-bounds access occurs, and the content of the memory region beyond this buffer is sent out.
This patch fixes the issue by treating only negative values in the result field as errors. Positive values are therefore treated as success in the same way as a zero value. Additionally, a BUG_ON is added to __send_prepared_auth_request() comparing the len parameter to front_alloc_len to prevent sending the message if it exceeds the bounds of the allocation and to make it easier to catch any logic flaws leading to this.
From the CVE record · Linux
The Linux kernel's libceph component can read beyond an allocated buffer when processing a potentially corrupted CEPH_MSG_AUTH_REPLY with a positive result value larger than the preallocated front segment. An attacker able to supply such a reply could cause memory beyond the buffer to be sent out. The input does not specify authentication requirements or user interaction.
Engineers running Linux kernels with libceph should check whether their kernel includes the fix; affected versions are not specified.