Skip to content
Snippets Groups Projects
  1. Jun 10, 2020
    • Eric Blake's avatar
      nbd/server: Avoid long error message assertions CVE-2020-10761 · 5c4fe018
      Eric Blake authored
      
      Ever since commit 36683283 (v2.8), the server code asserts that error
      strings sent to the client are well-formed per the protocol by not
      exceeding the maximum string length of 4096.  At the time the server
      first started sending error messages, the assertion could not be
      triggered, because messages were completely under our control.
      However, over the years, we have added latent scenarios where a client
      could trigger the server to attempt an error message that would
      include the client's information if it passed other checks first:
      
      - requesting NBD_OPT_INFO/GO on an export name that is not present
        (commit 0cfae925 in v2.12 echoes the name)
      
      - requesting NBD_OPT_LIST/SET_META_CONTEXT on an export name that is
        not present (commit e7b1948d in v2.12 echoes the name)
      
      At the time, those were still safe because we flagged names larger
      than 256 bytes with a different message; but that changed in commit
      93676c88 (v4.2) when we raised the name limit to 4096 to match the NBD
      string limit.  (That commit also failed to change the magic number
      4096 in nbd_negotiate_send_rep_err to the just-introduced named
      constant.)  So with that commit, long client names appended to server
      text can now trigger the assertion, and thus be used as a denial of
      service attack against a server.  As a mitigating factor, if the
      server requires TLS, the client cannot trigger the problematic paths
      unless it first supplies TLS credentials, and such trusted clients are
      less likely to try to intentionally crash the server.
      
      We may later want to further sanitize the user-supplied strings we
      place into our error messages, such as scrubbing out control
      characters, but that is less important to the CVE fix, so it can be a
      later patch to the new nbd_sanitize_name.
      
      Consideration was given to changing the assertion in
      nbd_negotiate_send_rep_verr to instead merely log a server error and
      truncate the message, to avoid leaving a latent path that could
      trigger a future CVE DoS on any new error message.  However, this
      merely complicates the code for something that is already (correctly)
      flagging coding errors, and now that we are aware of the long message
      pitfall, we are less likely to introduce such errors in the future,
      which would make such error handling dead code.
      
      Reported-by: default avatarXueqiang Wei <xuwei@redhat.com>
      CC: qemu-stable@nongnu.org
      Fixes: https://bugzilla.redhat.com/1843684
      
       CVE-2020-10761
      Fixes: 93676c88
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20200610163741.3745251-2-eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      5c4fe018
  2. Jun 09, 2020
  3. Jun 08, 2020
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging · 49ee1155
      Peter Maydell authored
      
      linux-user pull request 20200605-v2
      
      Implement F_OFD_ fcntl() command, /proc/cpuinfo for hppa
      Fix socket(), prnctl() error codes, underflow in target_mremap,
          epoll_create() strace, oldumount for alpha
      User-mode build dependencies improvement
      
      # gpg: Signature made Sat 06 Jun 2020 14:15:36 BST
      # gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
      # gpg:                issuer "laurent@vivier.eu"
      # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
      # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
      # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
      # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
      
      * remotes/vivier2/tags/linux-user-for-5.1-pull-request:
        stubs: Restrict ui/win32-kbd-hook to system-mode
        hw/core: Restrict CpuClass::get_crash_info() to system-mode
        target/s390x: Restrict CpuClass::get_crash_info() to system-mode
        target/i386: Restrict CpuClass::get_crash_info() to system-mode
        arch_init: Remove unused 'qapi-commands-misc.h' include
        exec: Assert CPU migration is not used on user-only build
        target/riscv/cpu: Restrict CPU migration to system-mode
        stubs/Makefile: Reduce the user-mode object list
        util/Makefile: Reduce the user-mode object list
        tests/Makefile: Restrict some softmmu-only tests
        tests/Makefile: Only display TCG-related tests when TCG is available
        configure: Avoid building TCG when not needed
        Makefile: Only build virtiofsd if system-mode is enabled
        linux-user: implement OFD locks
        linux-user/mmap.c: fix integer underflow in target_mremap
        linux-user/strace.list: fix epoll_create{,1} -strace output
        linux-user: Add support for /proc/cpuinfo on hppa platform
        linux-user: return target error codes for socket() and prctl()
        linux-user, alpha: fix oldumount syscall
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      49ee1155
  4. Jun 05, 2020
Loading