1. 06 2月, 2015 2 次提交
    • M
      coverity: Model GLib string allocation partially · e4b77daa
      Markus Armbruster 提交于
      Without a model, Coverity can't know that the result of g_strdup()
      needs to be fed to g_free().
      
      One way to get such a model is to scan GLib, build a derived model
      file with cov-collect-models, and use that when scanning QEMU.
      Unfortunately, the Coverity Scan service we use doesn't support that.
      
      Thus, we're stuck with the other way: write a user model.  Doing that
      for all of GLib is hardly practical.  I'm doing it for the "String
      Utility Functions" we actually use that return dynamically allocated
      strings.
      
      In a local scan, this flags 20 additional RESOURCE_LEAKs.  The ones I
      checked look genuine.
      
      It also loses a NULL_RETURNS about ppce500_init() using
      qemu_find_file() without error checking.  I don't understand why.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      e4b77daa
    • M
      coverity: Improve model for GLib memory allocation · 9d7a4c66
      Markus Armbruster 提交于
      In current versions of GLib, g_new() may expand into g_malloc_n().
      When it does, Coverity can't see the memory allocation, because we
      don't model g_malloc_n().  Similarly for g_new0(), g_renew(),
      g_try_new(), g_try_new0(), g_try_renew().
      
      Model g_malloc_n(), g_malloc0_n(), g_realloc_n().  Model
      g_try_malloc_n(), g_try_malloc0_n(), g_try_realloc_n() by adding
      indeterminate out of memory conditions on top.
      
      To avoid undue duplication, replace the existing models for g_malloc()
      & friends by trivial wrappers around g_malloc_n() & friends.
      
      In a local scan, this flags four additional RESOURCE_LEAKs and one
      NULL_RETURNS.
      
      The NULL_RETURNS is a false positive: Coverity can now see that
      g_try_malloc(l1_sz * sizeof(uint64_t)) in
      qcow2_check_metadata_overlap() may return NULL, but is too stupid to
      recognize that a loop executing l1_sz times won't be entered then.
      
      Three out of the four RESOURCE_LEAKs appear genuine.  The false
      positive is in ppce500_prep_device_tree(): the pointer dies, but a
      pointer to a struct member escapes, and we get the pointer back for
      freeing with container_of().  Too funky for Coverity.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      9d7a4c66
  2. 04 2月, 2015 11 次提交
  3. 03 2月, 2015 11 次提交
  4. 02 2月, 2015 11 次提交
  5. 30 1月, 2015 2 次提交
  6. 29 1月, 2015 2 次提交
  7. 28 1月, 2015 1 次提交
    • P
      Merge remote-tracking branch 'remotes/riku/tags/pull-linux-user-20150127' into staging · 83761b92
      Peter Maydell 提交于
      linux-user updates since last pull request
      
      # gpg: Signature made Tue 27 Jan 2015 20:52:54 GMT using RSA key ID DE3C9BC0
      # gpg: Good signature from "Riku Voipio <riku.voipio@iki.fi>"
      # gpg:                 aka "Riku Voipio <riku.voipio@linaro.org>"
      
      * remotes/riku/tags/pull-linux-user-20150127:
        linux-user: support target-to-host SCM_CREDENTIALS
        linux-user: Fix broken m68k signal handling on 64 bit hosts
        mips64-linux-user: Fix definition of struct sigaltstack
        linux-user: Fix ioctl cmd type mismatch on 64-bit targets
        linux-user: translate resource also for prlimit64
        linux-user/signal.c: Remove unnecessary wrapper copy_siginfo_to_user
        linux-user/main.c: Mark end_exclusive() as possibly unused
        linux-user/main.c: Call cpu_exec_start/end on all target archs
        linux-user/arm/nwfpe: Delete unused aCC array
        linux-user/alpha: Add define for NR_shmat to enable shmat syscall
        linux-user/signal.c: Remove current_exec_domain_sig()
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      83761b92