1. 20 3月, 2018 1 次提交
  2. 06 3月, 2018 1 次提交
  3. 22 2月, 2018 2 次提交
  4. 12 2月, 2018 1 次提交
    • D
      log: fix deadlock obtaining hostname (related CVE-2018-6764) · c2dc6698
      Daniel P. Berrangé 提交于
      The fix for CVE-2018-6764 introduced a potential deadlock scenario
      that gets triggered by the NSS module when virGetHostname() calls
      getaddrinfo to resolve the hostname:
      
       #0  0x00007f6e714b57e7 in futex_wait
       #1  futex_wait_simple
       #2  __pthread_once_slow
       #3  0x00007f6e71d16e7d in virOnce
       #4  0x00007f6e71d0997c in virLogInitialize
       #5  0x00007f6e71d0a09a in virLogVMessage
       #6  0x00007f6e71d09ffd in virLogMessage
       #7  0x00007f6e71d0db22 in virObjectNew
       #8  0x00007f6e71d0dbf1 in virObjectLockableNew
       #9  0x00007f6e71d0d3e5 in virMacMapNew
       #10 0x00007f6e71cdc50a in findLease
       #11 0x00007f6e71cdcc56 in _nss_libvirt_gethostbyname4_r
       #12 0x00007f6e724631fc in gaih_inet
       #13 0x00007f6e72464697 in __GI_getaddrinfo
       #14 0x00007f6e71d19e81 in virGetHostnameImpl
       #15 0x00007f6e71d1a057 in virGetHostnameQuiet
       #16 0x00007f6e71d09936 in virLogOnceInit
       #17 0x00007f6e71d09952 in virLogOnce
       #18 0x00007f6e714b5829 in __pthread_once_slow
       #19 0x00007f6e71d16e7d in virOnce
       #20 0x00007f6e71d0997c in virLogInitialize
       #21 0x00007f6e71d0a09a in virLogVMessage
       #22 0x00007f6e71d09ffd in virLogMessage
       #23 0x00007f6e71d0db22 in virObjectNew
       #24 0x00007f6e71d0dbf1 in virObjectLockableNew
       #25 0x00007f6e71d0d3e5 in virMacMapNew
       #26 0x00007f6e71cdc50a in findLease
       #27 0x00007f6e71cdc839 in _nss_libvirt_gethostbyname3_r
       #28 0x00007f6e71cdc724 in _nss_libvirt_gethostbyname2_r
       #29 0x00007f6e7248f72f in __gethostbyname2_r
       #30 0x00007f6e7248f494 in gethostbyname2
       #31 0x000056348c30c36d in hosts_keys
       #32 0x000056348c30b7d2 in main
      
      Fortunately the extra stuff virGetHostname does is totally irrelevant to
      the needs of the logging code, so we can just inline a call to the
      native hostname() syscall directly.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      c2dc6698
  5. 09 2月, 2018 1 次提交
  6. 31 1月, 2018 3 次提交
  7. 15 12月, 2017 1 次提交
  8. 23 11月, 2017 1 次提交
    • M
      Adjust backslash alignment syntax-check · d09429ab
      Martin Kletzander 提交于
      We have a check for backslash alignment that checks for two blanks preceding a
      backslash.  However there can be alignment done using a tabulator and in some
      cases one might be enough.  There are none currently, but I found out that was
      the case before. at some point.  so let's check for \t preceding the final
      backslash as well.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      d09429ab
  9. 03 11月, 2017 2 次提交
  10. 16 10月, 2017 1 次提交
  11. 25 9月, 2017 1 次提交
  12. 20 9月, 2017 1 次提交
    • D
      Stop linking tests/commandhelper to libvirt code · eae746b2
      Daniel P. Berrange 提交于
      The commandhelper binary is a helper for commandtest that
      validates what file handles were inherited. For this to
      work reliably we must not have any libraries that leak
      file descriptors into commandhelper. Unfortunately some
      versions of gnutls will intentionally open file handles
      at library load time via a constructor function.
      
      We previously hacked around this in
      
        commit 4cbc15d0
        Author: Martin Kletzander <mkletzan@redhat.com>
        Date:   Fri May 2 09:55:52 2014 +0200
      
          tests: don't fail with newer gnutls
      
          gnutls-3.3.0 and newer leaves 2 FDs open in order to be backwards
          compatible when it comes to chrooted binaries [1].  Linking
          commandhelper with gnutls then leaves these two FDs open and
          commandtest fails thanks to that.  This patch does not link
          commandhelper with libvirt.la, but rather only the utilities making
          the test pass.
      
          Based on suggestion from Daniel [2].
      
          [1] http://lists.gnutls.org/pipermail/gnutls-help/2014-April/003429.html
          [2] https://www.redhat.com/archives/libvir-list/2014-April/msg01119.html
      
      That fix relied on fact that while libvirt.so linked with
      gnutls, libvirt_util.la did not link to it.  With the
      introduction of the util/vircrypto.c file that assumption
      is no longer valid. We must not link to libvirt_util.la
      at all - only gnulib and libc can (hopefully) be relied
      on not to open random file descriptors in constructors.
      Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      eae746b2
  13. 26 6月, 2017 1 次提交
    • A
      HACKING: Drop from the git repository · d6725518
      Andrea Bolognani 提交于
      Despite being a generated file, HACKING has been tracked in
      the git repository along with actual source files. As far as
      I'm aware, it's the only generated file for which that happens.
      
      Times and times again, people[1] have committed changes to
      the source file without refreshing the generated copy at the
      same time.
      
      The rationale for tracking the generated file is to help out
      people who just cloned the git repository looking to contribue;
      however, README-hacking already contains enough information to
      get perspective contributors to a place where they can simply
      look at docs/hacking.html instead.
      
      [1] Mostly me, to be honest
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      d6725518
  14. 09 5月, 2017 1 次提交
    • M
      tests: Add virfilewrapper -- the new super "mock" · ae60ea48
      Martin Kletzander 提交于
      This mock (which is actually not mock at all, see later) can redirect
      all accesses to a path into another path.  There is no need to
      create mocks for particular directories, you just create a directory
      with all the data a redirect the test there.
      
      In the future, this should also be able to register callbacks for
      calls/paths, e.g. when the test is going to write into anything under
      "/sys/devices", call function fce();  Then in the open() call we would
      add information about the fd into some structure and in write() we
      would call fce() with parameters like @path to write to, @data to
      be written and pointer to optional return value, so that fce() itself
      could stop the call from happening or change its behaviour.  But
      that's an idea for a latter day.
      
      This is not a mock because it will not be preloaded, but compiled in
      the test itself.  See future patches for usage.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      ae60ea48
  15. 28 4月, 2017 1 次提交
  16. 25 4月, 2017 1 次提交
    • A
      autogen.sh: Improve and generalize · 6d532553
      Andrea Bolognani 提交于
      The goal is twofold: firstly, we want to extend the script so
      that it can deal with more than a single git submodule, and
      secondly we'd like to reduce the amount of duplicated code.
      Moreover, since we're making heavy changes to the code anyway,
      we might as well make sure it follows a somewhat consistent
      coding style too.
      
      To reduce code duplication, we introduce a new --dry-run
      option, which can be used by third parties to figure out
      whether calling autogen.sh is necessary or not: this allows
      us to get rid of the reimplementation of part of the logic
      in cfg.mk and guarantee they'll never get out of sync.
      
      Other changes include: making dirty submodules checking and
      cleaning entirely independent of other operations; removing
      the use of 'set -e' and handling errors explicitly instead;
      better parsing of command line arguments.
      6d532553
  17. 19 4月, 2017 1 次提交
    • D
      annotate all mocked functions with noinline · 728cacc8
      Daniel P. Berrange 提交于
      CLang's optimizer is more aggressive at inlining functions than
      gcc and so will often inline functions that our tests want to
      mock-override. This causes the test to fail in bizarre ways.
      
      We don't want to disable inlining completely, but we must at
      least prevent inlining of mocked functions. Fortunately there
      is a 'noinline' attribute that lets us control this per function.
      
      A syntax check rule is added that parses tests/*mock.c to extract
      the list of functions that are mocked (restricted to names starting
      with 'vir' prefix). It then checks that src/*.h header file to
      ensure it has a 'ATTRIBUTE_NOINLINE' annotation. This should prevent
      use from bit-rotting in future.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      728cacc8
  18. 12 4月, 2017 2 次提交
  19. 06 4月, 2017 1 次提交
  20. 27 3月, 2017 3 次提交
  21. 06 3月, 2017 1 次提交
    • M
      qemu: Enforce qemuSecurity wrappers · 4da534c0
      Michal Privoznik 提交于
      Now that we have some qemuSecurity wrappers over
      virSecurityManager APIs, lets make sure everybody sticks with
      them. We have them for a reason and calling virSecurityManager
      API directly instead of wrapper may lead into accidentally
      labelling a file on the host instead of namespace.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4da534c0
  22. 20 2月, 2017 1 次提交
    • P
      Disallow inclusion of files from src/conf into src/utils · b4c73106
      Peter Krempa 提交于
      The utils code should stay separated from other code (except for very
      well justified cases). Unfortunately commit 272769be
      made it trivial to break the separation (and not get slapped by the
      syntax-check rule) by adding -I src/conf to the CFLAGS for utils.
      
      Remove this shortcut and except the two offenders from the syntax check
      so that the codebase can be kept separated.
      b4c73106
  23. 06 12月, 2016 1 次提交
    • M
      nssmock: Prefer free() over VIR_FREE() · 1ef3ac82
      Michal Privoznik 提交于
      Problem with VIR_FREE() is that we are not linking
      libvirt-utils.so to our mock libs therefore there will be an
      unresolved symbol. Fortunately, nsstest that eventually links
      with the nssmock links also with libvirt-utils.so and thus the
      symbol is resolved after all. However, if one wants to run the
      test binary under valgrind it is impossible to do so. Because of
      the unresolved symbol.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1ef3ac82
  24. 11 11月, 2016 3 次提交
  25. 01 11月, 2016 1 次提交
  26. 13 10月, 2016 1 次提交
    • M
      src: Treat PID as signed · b7d2d4af
      Michal Privoznik 提交于
      This initially started as a fix of some debug printing in
      virCgroupDetect. However it turned out that other places suffer
      from the similar problem. While dealing with pids, esp. in cases
      where we cannot use pid_t for ABI stability reasons, we often
      chose an unsigned integer type. This makes no sense as pid_t is
      signed.
      Also, new syntax-check rule is introduced so we won't repeat this
      mistake.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b7d2d4af
  27. 12 10月, 2016 1 次提交
  28. 18 8月, 2016 3 次提交
  29. 26 6月, 2016 1 次提交
    • E
      examples: admin: Add some examples for the new admin APIs · fbb8205d
      Erik Skultety 提交于
      Some of the examples make use of asprintf and strtol functions (to keep
      things simple) which are prohibited to use within our code (enforced by
      syntax-check). Therefore besides adding some examples, this patch also updates
      cfg.mk to exclude examples directory from asprintf and strtol rules, as well as
      updates .gitignore to exclude all the new admin binaries created in the
      'examples' dir.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      fbb8205d