cluster_size - 1 is often used in bitwise mask operations in qed.h, so
this bug is probably a copy-paste error. qed_bytes_to_clusters() uses a
division and the denominator should be the full cluster_size value.
This bug can be used to leak heap memory to the guest with a QED file
where cluster_size <= 32 KB (the default is 64 KB) and table_size = 8 or
16 (the default is 4).
Fixes: CVE-2026-118594
Fixes: 298800cae7 ("qed: Table, L2 cache, and cluster functions")
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4737
Reported-by: oxsignal <awo@kakao.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>