|
From: | Eric Blake |
Subject: | Re: [Qemu-devel] [PATCH 8/8] qcow2: Read outside array bounds in qcow2_pre_write_overlap_check() |
Date: | Fri, 31 Aug 2018 10:05:19 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 08/31/2018 08:32 AM, Liam Merwick wrote:
The fix looks correct, but to prevent the problem from happening again, I'd suggest you also add a compile-time BUG_ON that fails if the array size gets out of sync again due to another addition of another overlap detection bit.Good idea. There is no generic BUG_ON in QEMU (just a few private copies) or BUILD_BUG_ON. I can add a commit that introduces a copy of include/linux/build_bug.h from the Linux kernel and use BUILD_BUG_ON in this commit. Is there any reason not to do that?
We already have the generic QEMU_BUILD_BUG_ON() used throughout the tree; that's the one to use here, rather than adding yet another macro with a similar functionality.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |