]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
libceph: make decode_pool() more resilient against corrupted osdmaps
authorIlya Dryomov <idryomov@gmail.com>
Tue, 2 Dec 2025 09:32:31 +0000 (10:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:52 +0000 (13:09 +0100)
commit145d140abda80e33331c5781d6603014fa75d258
tree645eab990286ab45cda9c088e2d0faa521c76630
parent7a146f34e5be96330467397c9fd9d3d851b2cbbe
libceph: make decode_pool() more resilient against corrupted osdmaps

commit 8c738512714e8c0aa18f8a10c072d5b01c83db39 upstream.

If the osdmap is (maliciously) corrupted such that the encoded length
of ceph_pg_pool envelope is less than what is expected for a particular
encoding version, out-of-bounds reads may ensue because the only bounds
check that is there is based on that length value.

This patch adds explicit bounds checks for each field that is decoded
or skipped.

Cc: stable@vger.kernel.org
Reported-by: ziming zhang <ezrakiez@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Tested-by: ziming zhang <ezrakiez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ceph/osdmap.c