Re: [PATCH] KVM: fix the handling of dirty bitmaps to avoid overflows

Marcelo Tosatti <[email protected]> Mon, 12 Apr 2010 17:39:51 +0000
Newsgroups org.kernel.vger.kvm-ia64,org.kernel.vger.kvm,org.kernel.vger.kvm-ppc
Message-ID <[email protected]>
On Mon, Apr 12, 2010 at 07:35:35PM +0900, Takuya Yoshikawa wrote:
> This patch fixes a bug found by Avi during the review process
> of my dirty bitmap related work.
> 
> To ppc and ia64 people:
>   The fix is really simple but touches all architectures using
>   dirty bitmaps. So please check this will not suffer your part.
> 
> => 
> Int is not long enough to store the size of a dirty bitmap.
> 
> This patch fixes this problem with the introduction of a wrapper
> function to calculate the sizes of dirty bitmaps.
> 
> Note: in mark_page_dirty(), we have to consider the fact that
>   __set_bit() takes the offset as int, not long.
> 
> Signed-off-by: Takuya Yoshikawa <[email protected]>

Applied, thanks.