Skip to content
Snippets Groups Projects
  1. Jan 15, 2021
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/gkurz-gitlab/tags/9p-next-2021-01-15' into staging · a968a380
      Peter Maydell authored
      
      Fix for CVE-2021-20181
      
      # gpg: Signature made Fri 15 Jan 2021 08:52:19 GMT
      # gpg:                using RSA key B4828BAF943140CEF2A3491071D4D5E5822F73D6
      # gpg: Good signature from "Greg Kurz <groug@kaod.org>" [full]
      # gpg:                 aka "Gregory Kurz <gregory.kurz@free.fr>" [full]
      # gpg:                 aka "[jpeg image of size 3330]" [full]
      # Primary key fingerprint: B482 8BAF 9431 40CE F2A3  4910 71D4 D5E5 822F 73D6
      
      * remotes/gkurz-gitlab/tags/9p-next-2021-01-15:
        9pfs: Fully restart unreclaim loop (CVE-2021-20181)
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      a968a380
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/philmd-gitlab/tags/mips-20210114' into staging · 256af05f
      Peter Maydell authored
      
      MIPS patches queue
      
      - Simplify CPU/ISA definitions
      - Various maintenance code movements in translate.c
      - Convert part of the MSA ASE instructions to decodetree
      - Convert some instructions removed from Release 6 to decodetree
      - Remove deprecated 'fulong2e' machine alias
      
      # gpg: Signature made Thu 14 Jan 2021 16:16:29 GMT
      # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
      # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
      # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
      
      * remotes/philmd-gitlab/tags/mips-20210114: (69 commits)
        docs/system: Remove deprecated 'fulong2e' machine alias
        target/mips: Remove vendor specific CPU definitions
        target/mips: Remove CPU_NANOMIPS32 definition
        target/mips: Remove CPU_R5900 definition
        target/mips: Convert Rel6 LL/SC opcodes to decodetree
        target/mips: Convert Rel6 LLD/SCD opcodes to decodetree
        target/mips: Convert Rel6 LDL/LDR/SDL/SDR opcodes to decodetree
        target/mips: Convert Rel6 LWLE/LWRE/SWLE/SWRE opcodes to decodetree
        target/mips: Convert Rel6 LWL/LWR/SWL/SWR opcodes to decodetree
        target/mips: Convert Rel6 CACHE/PREF opcodes to decodetree
        target/mips: Convert Rel6 COP1X opcode to decodetree
        target/mips: Convert Rel6 Special2 opcode to decodetree
        target/mips: Remove now unreachable LSA/DLSA opcodes code
        target/mips: Introduce decodetree helpers for Release6 LSA/DLSA opcodes
        target/mips: Introduce decodetree helpers for MSA LSA/DLSA opcodes
        target/mips: Extract LSA/DLSA translation generators
        target/mips: Use decode_ase_msa() generated from decodetree
        target/mips: Introduce decode tree bindings for MSA ASE
        target/mips: Pass TCGCond argument to MSA gen_check_zero_element()
        target/mips: Extract MSA translation routines
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      256af05f
    • Greg Kurz's avatar
      9pfs: Fully restart unreclaim loop (CVE-2021-20181) · 89fbea87
      Greg Kurz authored
      Depending on the client activity, the server can be asked to open a huge
      number of file descriptors and eventually hit RLIMIT_NOFILE. This is
      currently mitigated using a reclaim logic : the server closes the file
      descriptors of idle fids, based on the assumption that it will be able
      to re-open them later. This assumption doesn't hold of course if the
      client requests the file to be unlinked. In this case, we loop on the
      entire fid list and mark all related fids as unreclaimable (the reclaim
      logic will just ignore them) and, of course, we open or re-open their
      file descriptors if needed since we're about to unlink the file.
      
      This is the purpose of v9fs_mark_fids_unreclaim(). Since the actual
      opening of a file can cause the coroutine to yield, another client
      request could possibly add a new fid that we may want to mark as
      non-reclaimable as well. The loop is thus restarted if the re-open
      request was actually transmitted to the backend. This is achieved
      by keeping a reference on the first fid (head) before traversing
      the list.
      
      This is wrong in several ways:
      - a potential clunk request from the client could tear the first
        fid down and cause the reference to be stale. This leads to a
        use-after-free error that can be detected with ASAN, using a
        custom 9p client
      - fids are added at the head of the list : restarting from the
        previous head will always miss fids added by a some other
        potential request
      
      All these problems could be avoided if fids were being added at the
      end of the list. This can be achieved with a QSIMPLEQ, but this is
      probably too much change for a bug fix. For now let's keep it
      simple and just restart the loop from the current head.
      
      Fixes: CVE-2021-20181
      Buglink: https://bugs.launchpad.net/qemu/+bug/1911666
      
      
      Reported-by: default avatarZero Day Initiative <zdi-disclosures@trendmicro.com>
      Reviewed-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
      Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
      Message-Id: <161064025265.1838153.15185571283519390907.stgit@bahia.lan>
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      89fbea87
  2. Jan 14, 2021
Loading