1. 17 7月, 2015 8 次提交
    • R
      crypto: avoid undefined behavior in nettle calls · d3462e37
      Radim Krčmář 提交于
      Calling a function pointer that was cast from an incompatible function
      results in undefined behavior.  'void *' isn't compatible with 'struct
      XXX *', so we can't cast to nettle_cipher_func, but have to provide a
      wrapper.  (Conversion from 'void *' to 'struct XXX *' might require
      computation, which won't be done if we drop argument's true type, and
      pointers can have different sizes so passing arguments on stack would
      bug.)
      
      Having two different prototypes based on nettle version doesn't make
      this solution any nicer.
      Reported-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      Message-Id: <1437062641-12684-3-git-send-email-rkrcmar@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d3462e37
    • R
      crypto: fix build with nettle >= 3.0.0 · becaeb72
      Radim Krčmář 提交于
      In nettle 3, cbc_encrypt() accepts 'nettle_cipher_func' instead of
      'nettle_crypt_func' and these two differ in 'const' qualifier of the
      first argument.  The build fails with:
      
        In file included from crypto/cipher.c:71:0:
        ./crypto/cipher-nettle.c: In function ‘qcrypto_cipher_encrypt’:
        ./crypto/cipher-nettle.c:154:38: error: passing argument 2 of
        ‘nettle_cbc_encrypt’ from incompatible pointer type
                 cbc_encrypt(ctx->ctx_encrypt, ctx->alg_encrypt,
                                                     ^
        In file included from ./crypto/cipher-nettle.c:24:0,
                         from crypto/cipher.c:71:
        /usr/include/nettle/cbc.h:48:1: note: expected
        ‘void (*)(const void *, size_t, uint8_t *, const uint8_t *)
        but argument is of type
        ‘void (*)(      void *, size_t, uint8_t *, const uint8_t *)
      
      To allow both versions, we switch to the new definition and #if typedef
      it for old versions.
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      Message-Id: <1436548682-9315-2-git-send-email-rkrcmar@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      becaeb72
    • P
      memory: fix refcount leak in memory_region_present · c6742b14
      Paolo Bonzini 提交于
      memory_region_present() leaks a reference to a MemoryRegion in the
      case "mr == container".  While fixing it, avoid reference counting
      altogether for memory_region_present(), by using RCU only.
      
      The return value could in principle be already invalid immediately
      after memory_region_present returns, but presumably the caller knows
      that and it's using memory_region_present to probe for devices that
      are unpluggable, or something like that.  The RCU critical section
      is needed anyway, because it protects as->current_map.
      Reported-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c6742b14
    • D
      RDMA: Fix error exits · 24b41d66
      Dr. David Alan Gilbert 提交于
      The error checks I added used 'break' after the error, but I'm
      in a switch inside the while loop, so they need to be 'goto out'.
      
      Spotted by coverity; entries 1311368 and 1311369
      
      Fixes: afcddefdSigned-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <1436555332-19076-1-git-send-email-dgilbert@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      24b41d66
    • G
      arm/xlnx-zynqmp: fix memory leak · 5348c62c
      Gonglei 提交于
      fix CID 1311372.
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Message-Id: <1436489490-236-4-git-send-email-arei.gonglei@huawei.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5348c62c
    • G
      ppc/spapr_drc: fix memory leak · 586d2142
      Gonglei 提交于
      fix CID 1311373.
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Message-Id: <1436489490-236-3-git-send-email-arei.gonglei@huawei.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      586d2142
    • J
      mips/kvm: Sign extend registers written to KVM · 02dae26a
      James Hogan 提交于
      In case we're running on a 64-bit host, be sure to sign extend the
      general purpose registers and hi/lo/pc before writing them to KVM, so as
      to take advantage of MIPS32/MIPS64 compatibility.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Leon Alrae <leon.alrae@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: kvm@vger.kernel.org
      Cc: qemu-stable@nongnu.org
      Message-Id: <1429871214-23514-3-git-send-email-james.hogan@imgtec.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      02dae26a
    • J
      mips/kvm: Fix Big endian 32-bit register access · f8b3e48b
      James Hogan 提交于
      Fix access to 32-bit registers on big endian targets. The pointer passed
      to the kernel must be for the actual 32-bit value, not a temporary
      64-bit value, otherwise on big endian systems the kernel will only
      interpret the upper half.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Leon Alrae <leon.alrae@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: kvm@vger.kernel.org
      Cc: qemu-stable@nongnu.org
      Message-Id: <1429871214-23514-2-git-send-email-james.hogan@imgtec.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f8b3e48b
  2. 16 7月, 2015 9 次提交
  3. 15 7月, 2015 23 次提交