qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/3] virtio-blk: Treat read/write beyond end as


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 3/3] virtio-blk: Treat read/write beyond end as invalid
Date: Fri, 27 Jun 2014 11:56:37 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Jun 23, 2014 at 02:57:36PM +0200, Markus Armbruster wrote:
> Markus Armbruster <address@hidden> writes:
> 
> > Stefan Hajnoczi <address@hidden> writes:
> >
> >> On Thu, Jun 05, 2014 at 02:15:36PM +0200, Markus Armbruster wrote:
> >>> +    if (sector > total_sectors || nb_sectors > total_sectors - sector) {
> >>> +        return false;
> >>> +    }
> >>
> >> if (sector >= total_sectors || ...) {
> >
> > I suspect reading bdrv_check_byte_request() put the '>' in my brain:
> >
> >     if ((offset > len) || (len - offset < size))
> >         return -EIO;
> >
> > Don't we need offset >= len here?
> 
> Just remembered: we don't, because we allow I/O at offset len provided
> size is zero.
> 
> Same reasoning applies to my patch.

Okay.  I didn't remember the offset=eof length=0 thing.

Stefan

Attachment: pgpF6mqHMpABU.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]