This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] [PATCH] ioemu block device extent checks

On Wed, Feb 27, 2008 at 01:14:16PM +0000, Ian Jackson wrote:
> Daniel P. Berrange writes ("Re: [Xen-devel] [PATCH] ioemu block device extent 
> checks"):
> > I don't think this is correct - it allows a -ve  size / nb_sectors
> > value when autoextenable is set, and allows out of bounds reads.
> That's fine because it's only called like that as a the parent block
> driver.  Perhaps a different name would have been better.
> Out of bounds reads have to be permitted because the block size in the
> header may remain un-updated, so reads of newly-cloned blocks may
> fail.

Which is why I updated the the total_sectors count during writes...

> > I sent a patch to qemu-devel yuesterday which also uses the auto-extend
> > flag, but has separate checks for read vs writes. When doing a write that
> > would extend the device it increases the total_sectors count so that the
> > subsequent reads can be validated to be within the written bounds.
> Well, that seems like makework to me but fine if upstream accept it.

It could help prevent future bugs if some new code is written which is
expecting the total_sectors value to be correct - admitedly the existing
code has incorrect total_sectors count already, but I figure its worth
fixing this to avoid unexpected surprises in the future.

|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>