1. 16 3月, 2020 2 次提交
  2. 14 3月, 2020 2 次提交
  3. 13 3月, 2020 1 次提交
  4. 12 3月, 2020 1 次提交
  5. 11 3月, 2020 3 次提交
  6. 07 3月, 2020 2 次提交
  7. 06 3月, 2020 2 次提交
    • M
      virthread: Free thread name only after worker has finished · 9b3b93c5
      Michal Privoznik 提交于
      When spawning a thread via our virThread APIs we let pthread
      spawn this helper thread which sets couple of thread local
      variables (e.g. thread job name or thread worker name) and as of
      v6.1.0-40-gc85256b3 it also sets pthread name (which is then
      visible in `ps' output for instance). Only after these steps the
      intended function is called. However, just before calling it we
      free the buffer that holds the thread name which results in
      invalid memory reads:
      
      ==47027== Invalid read of size 1
      ==47027==    at 0x48389C2: strlen (vg_replace_strmem.c:459)
      ==47027==    by 0x58BB3D6: __vfprintf_internal (vfprintf-internal.c:1645)
      ==47027==    by 0x58CE6E0: __vasprintf_internal (vasprintf.c:57)
      ==47027==    by 0x574BA28: g_vasprintf (in /usr/lib64/libglib-2.0.so.0.6000.7)
      ==47027==    by 0x57240CC: g_strdup_vprintf (in /usr/lib64/libglib-2.0.so.0.6000.7)
      ==47027==    by 0x48E0EFA: vir_g_strdup_vprintf (glibcompat.c:209)
      ==47027==    by 0x493AA05: virLogVMessage (virlog.c:573)
      ==47027==    by 0x493A8FE: virLogMessage (virlog.c:513)
      ==47027==    by 0x4992FC7: virThreadJobClear (virthreadjob.c:121)
      ==47027==    by 0x4992844: virThreadHelper (virthread.c:237)
      ==47027==    by 0x5817496: start_thread (pthread_create.c:486)
      ==47027==    by 0x59563CE: clone (clone.S:95)
      
      The problem is that neither virThreadJobSetWorker() nor
      virThreadJobSet() create a copy of passed name. They just set a
      thread local variable to point to the buffer which is then
      freed. Moving the free towards the end of the wrapper function
      solves the issue.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      9b3b93c5
    • J
      e7741937
  8. 05 3月, 2020 5 次提交
  9. 26 2月, 2020 1 次提交
    • P
      virStorageFileGetMetadataRecurse: Allow format probing under special circumstances · ae9e6c2a
      Peter Krempa 提交于
      Allow format probing to work around lazy clients which did not specify
      their format in the overlay. Format probing will be allowed only, if we
      are able to probe the image, the probing result was successful and the
      probed image does not have any backing or data file.
      
      This relaxes the restrictions which were imposed in commit 3615e8b3
      in cases when we know that the image probing will not result in security
      issues or data corruption.
      
      We perform the image format detection and in the case that we were able
      to probe the format and the format does not specify a backing store (or
      doesn't support backing store) we can use this format.
      
      With pre-blockdev configurations this will restore the previous
      behaviour for the images mentioned above as qemu would probe the format
      anyways. It also improves error reporting compared to the old state as
      we now report that the backing chain will be broken in case when there
      is a backing file.
      
      In blockdev configurations this ensures that libvirt will not cause data
      corruption by ending the chain prematurely without notifying the user,
      but still allows the old semantics when the users forgot to specify the
      format.
      
      Users thus don't have to re-invent when image format detection is safe
      to do.
      
      The price for this is that libvirt will need to keep the image format
      detector still current and working or replace it by invocation of
      qemu-img.
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      ae9e6c2a
  10. 25 2月, 2020 11 次提交
  11. 24 2月, 2020 9 次提交
  12. 23 2月, 2020 1 次提交