]> 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>
Thu, 8 Jan 2026 09:14:21 +0000 (10:14 +0100)
commit5d0d8c292531fe356c4e94dcfdf7d7212aca9957
tree3592542b9a25c2ebadff503cee2b2738c90e87c9
parent60560d13ff368415c96a0c1247bea16d427c0641
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