1. 07 1月, 2020 1 次提交
  2. 03 1月, 2020 3 次提交
  3. 17 12月, 2019 1 次提交
  4. 10 12月, 2019 1 次提交
  5. 09 12月, 2019 3 次提交
  6. 03 12月, 2019 1 次提交
  7. 21 11月, 2019 5 次提交
  8. 15 11月, 2019 1 次提交
  9. 12 11月, 2019 1 次提交
  10. 25 10月, 2019 1 次提交
  11. 23 10月, 2019 1 次提交
  12. 21 10月, 2019 3 次提交
  13. 16 10月, 2019 3 次提交
  14. 15 10月, 2019 2 次提交
  15. 14 10月, 2019 7 次提交
    • M
      security_stack: Perform rollback if one of stacked drivers fails · 9d03e9ad
      Michal Privoznik 提交于
      In order to have multiple security drivers hidden under one
      virSecurity* call, we have virSecurityStack driver which holds a
      list of registered security drivers and for every virSecurity*
      call it iterates over the list and calls corresponding callback
      in real security drivers. For instance, for
      virSecurityManagerSetAllLabel() it calls
      domainSetSecurityAllLabel callback sequentially in NOP, DAC and
      (possibly) SELinux or AppArmor drivers. This works just fine if
      the callback from every driver returns success. Problem arises
      when one of the drivers fails. For instance, aforementioned
      SetAllLabel() succeeds for DAC but fails in SELinux in which
      case all files that DAC relabelled are now owned by qemu:qemu (or
      whomever runs qemu) and thus permissions are leaked. This is even
      more visible with XATTRs which remain set for DAC.
      
      The solution is to perform a rollback on failure, i.e. call
      opposite action on drivers that succeeded.
      
      I'm providing rollback only for set calls and intentionally
      omitting restore calls for two reasons:
      
      1) restore calls are less likely to fail (they merely remove
      XATTRs and chown()/setfilecon() file - all of these operations
      succeeded in set call),
      
      2) we are not really interested in restore failures - in a very
      few places we check for retval of a restore function we do so
      only to print a warning.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1740024Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NCole Robinson <crobinso@redhat.com>
      9d03e9ad
    • M
      security_stack: Turn list of nested drivers into a doubly linked list · cd355a52
      Michal Privoznik 提交于
      In near future we will need to walk through the list of internal
      drivers in reversed order. The simplest solution is to turn
      singly linked list into a doubly linked list.
      We will not need to start from the end really, so there's no tail
      pointer kept.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NCole Robinson <crobinso@redhat.com>
      cd355a52
    • M
      security: Introduce virSecurityManagerGetDriver() · 3f968a87
      Michal Privoznik 提交于
      This function returns the name of the secdriver. Since the name
      is invariant we don't really need to lock the manager - it won't
      change.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NCole Robinson <crobinso@redhat.com>
      3f968a87
    • M
      security: Rename virSecurityManagerGetDriver() to virSecurityManagerGetVirtDriver() · 81dbceea
      Michal Privoznik 提交于
      This function is in fact returning the name of the virtualization
      driver that registered the security manager/driver.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NCole Robinson <crobinso@redhat.com>
      81dbceea
    • M
      security: Pass @migrated to virSecurityManagerSetAllLabel · 458d0a8c
      Michal Privoznik 提交于
      In upcoming commits, virSecurityManagerSetAllLabel() will perform
      rollback in case of failure by calling
      virSecurityManagerRestoreAllLabel(). But in order to do that, the
      former needs to have @migrated argument so that it can be passed
      to the latter.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NCole Robinson <crobinso@redhat.com>
      458d0a8c
    • D
      build: remove use of usleep gnulib module in favour of g_usleep · 27cb4c1a
      Daniel P. Berrangé 提交于
      The usleep function was missing on older mingw versions, but we can rely
      on it existing everywhere these days. It may only support times upto 1
      second in duration though, so we'll prefer to use g_usleep instead.
      
      The commandhelper program is not changed since that can't link to glib.
      Fortunately it doesn't need to build on Windows platforms either.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      27cb4c1a
    • D
      build: link to glib library · cfbe9f12
      Daniel P. Berrangé 提交于
      Add the main glib.h to internal.h so that all common code can use it.
      
      Historically glib allowed applications to register an alternative
      memory allocator, so mixing g_malloc/g_free with malloc/free was not
      safe.
      
      This was feature was dropped in 2.46.0 with:
      
            commit 3be6ed60aa58095691bd697344765e715a327fc1
            Author: Alexander Larsson <alexl@redhat.com>
            Date:   Sat Jun 27 18:38:42 2015 +0200
      
              Deprecate and drop support for memory vtables
      
      Applications are still encourged to match g_malloc/g_free, but it is no
      longer a mandatory requirement for correctness, just stylistic. This is
      explicitly clarified in
      
          commit 1f24b36607bf708f037396014b2cdbc08d67b275
          Author: Daniel P. Berrangé <berrange@redhat.com>
          Date:   Thu Sep 5 14:37:54 2019 +0100
      
              gmem: clarify that g_malloc always uses the system allocator
      
      Applications can still use custom allocators in general, but they must
      do this by linking to a library that replaces the core malloc/free
      implemenentation entirely, instead of via a glib specific call.
      
      This means that libvirt does not need to be concerned about use of
      g_malloc/g_free causing an ABI change in the public libary, and can
      avoid memory copying when talking to external libraries.
      
      This patch probes for glib, which provides the foundation layer with
      a collection of data structures, helper APIs, and platform portability
      logic.
      
      Later patches will introduce linkage to gobject which provides the
      object type system, built on glib, and gio which providing objects
      for various interesting tasks, most notably including DBus client
      and server support and portable sockets APIs, but much more too.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      cfbe9f12
  16. 12 10月, 2019 6 次提交