[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
pgpF6mqHMpABU.pgp
Description: PGP signature
- Re: [Qemu-devel] [PATCH 1/3] virtio-blk: Factor common checks out of virtio_blk_handle_read/write(), (continued)
Re: [Qemu-devel] [PATCH 0/3] virtio-blk: Suppress error action on r/w beyond end, Paolo Bonzini, 2014/06/06
Re: [Qemu-devel] [PATCH 0/3] virtio-blk: Suppress error action on r/w beyond end, Markus Armbruster, 2014/06/26
Re: [Qemu-devel] [PATCH 0/3] virtio-blk: Suppress error action on r/w beyond end, Stefan Hajnoczi, 2014/06/27