qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] ac9d00: block: fix crash on zero-length unali


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] ac9d00: block: fix crash on zero-length unaligned write an...
Date: Mon, 10 Feb 2020 10:15:16 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: ac9d00bf7b47acae6b0e42910d9ed55fef3af5b8
      
https://github.com/qemu/qemu/commit/ac9d00bf7b47acae6b0e42910d9ed55fef3af5b8
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2020-02-07 (Fri, 07 Feb 2020)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: fix crash on zero-length unaligned write and read

Commit 7a3f542fbd "block/io: refactor padding" occasionally dropped
aligning for zero-length request: bdrv_init_padding() blindly return
false if bytes == 0, like there is nothing to align.

This leads the following command to crash:

./qemu-io --image-opts -c 'write 1 0' \
  driver=blkdebug,align=512,image.driver=null-co,image.size=512

>> qemu-io: block/io.c:1955: bdrv_aligned_pwritev: Assertion
    `(offset & (align - 1)) == 0' failed.
>> Aborted (core dumped)

Prior to 7a3f542fbd we does aligning of such zero requests. Instead of
recovering this behavior let's just do nothing on such requests as it
is useless.

Note that driver may have special meaning of zero-length reqeusts, like
qcow2_co_pwritev_compressed_part, so we can't skip any zero-length
operation. But for unaligned ones, we can't pass it to driver anyway.

This commit also fixes crash in iotest 80 running with -nocache:

./check -nocache -qcow2 80

which crashes on same assertion due to trying to read empty extra data
in qcow2_do_read_snapshots().

Cc: address@hidden # v4.2
Fixes: 7a3f542fbd
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 11a18c84db4a71497d3d40769688a01b6f64b2ad
      
https://github.com/qemu/qemu/commit/11a18c84db4a71497d3d40769688a01b6f64b2ad
  Author: Philippe Mathieu-Daudé <address@hidden>
  Date:   2020-02-07 (Fri, 07 Feb 2020)

  Changed paths:
    M hw/core/machine.c

  Log Message:
  -----------
  hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host

Commit ed65fd1a2750 ("virtio-blk: switch off scsi-passthrough by
default") changed the default value of the 'scsi' property of
virtio-blk, which is only available on Linux hosts. It also added
an unconditional compat entry for 2.4 or earlier machines.

Trying to set this property on a pre-2.5 machine on OSX, we get:

   Unexpected error in object_property_find() at qom/object.c:1201:
   qemu-system-x86_64: -device virtio-blk-pci,id=scsi0,drive=drive0: can't 
apply global virtio-blk-device.scsi=true: Property '.scsi' not found

Fix this error by marking the property optional.

Fixes: ed65fd1a27 ("virtio-blk: switch off scsi-passthrough by default")
Suggested-by: Cornelia Huck <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 81a23caf47956778c5a5056ad656d1ef92bf9659
      
https://github.com/qemu/qemu/commit/81a23caf47956778c5a5056ad656d1ef92bf9659
  Author: Peter Maydell <address@hidden>
  Date:   2020-02-10 (Mon, 10 Feb 2020)

  Changed paths:
    M block/io.c
    M hw/core/machine.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into 
staging

Pull request

# gpg: Signature made Mon 10 Feb 2020 09:23:42 GMT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>" [full]
# gpg:                 aka "Stefan Hajnoczi <address@hidden>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host
  block: fix crash on zero-length unaligned write and read

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/2b8a51cdb3e8...81a23caf4795



reply via email to

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