]> 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:11:50 +0000 (13:11 +0100)
commitd061be4c8040ffb1110d537654a038b8b6ad39d2
tree33ca6f9f6ba3b726461f2a9075be32683cda3f92
parent845a92b74cf7a730200532ecb4482981cec9d006
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