1. 19 11月, 2020 1 次提交
  2. 17 11月, 2020 2 次提交
  3. 05 11月, 2020 1 次提交
  4. 31 10月, 2020 4 次提交
  5. 29 10月, 2020 3 次提交
  6. 28 10月, 2020 3 次提交
  7. 27 10月, 2020 1 次提交
  8. 26 10月, 2020 9 次提交
  9. 24 10月, 2020 5 次提交
    • V
      KVM: ioapic: break infinite recursion on lazy EOI · 77377064
      Vitaly Kuznetsov 提交于
      During shutdown the IOAPIC trigger mode is reset to edge triggered
      while the vfio-pci INTx is still registered with a resampler.
      This allows us to get into an infinite loop:
      
      ioapic_set_irq
        -> ioapic_lazy_update_eoi
        -> kvm_ioapic_update_eoi_one
        -> kvm_notify_acked_irq
        -> kvm_notify_acked_gsi
        -> (via irq_acked fn ptr) irqfd_resampler_ack
        -> kvm_set_irq
        -> (via set fn ptr) kvm_set_ioapic_irq
        -> kvm_ioapic_set_irq
        -> ioapic_set_irq
      
      Commit 8be8f932 ("kvm: ioapic: Restrict lazy EOI update to
      edge-triggered interrupts", 2020-05-04) acknowledges that this recursion
      loop exists and tries to avoid it at the call to ioapic_lazy_update_eoi,
      but at this point the scenario is already set, we have an edge interrupt
      with resampler on the same gsi.
      
      Fortunately, the only user of irq ack notifiers (in addition to resamplefd)
      is i8254 timer interrupt reinjection.  These are edge-triggered, so in
      principle they would need the call to kvm_ioapic_update_eoi_one from
      ioapic_lazy_update_eoi, but they already disable AVIC(*), so they don't
      need the lazy EOI behavior.  Therefore, remove the call to
      kvm_ioapic_update_eoi_one from ioapic_lazy_update_eoi.
      
      This fixes CVE-2020-27152.  Note that this issue cannot happen with
      SR-IOV assigned devices because virtual functions do not have INTx,
      only MSI.
      
      Fixes: f458d039 ("kvm: ioapic: Lazy update IOAPIC EOI")
      Suggested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Tested-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      77377064
    • P
      KVM: vmx: rename pi_init to avoid conflict with paride · a3ff25fc
      Paolo Bonzini 提交于
      allyesconfig results in:
      
      ld: drivers/block/paride/paride.o: in function `pi_init':
      (.text+0x1340): multiple definition of `pi_init'; arch/x86/kvm/vmx/posted_intr.o:posted_intr.c:(.init.text+0x0): first defined here
      make: *** [Makefile:1164: vmlinux] Error 1
      
      because commit:
      
      commit 8888cdd0
      Author: Xiaoyao Li <xiaoyao.li@intel.com>
      Date:   Wed Sep 23 11:31:11 2020 -0700
      
          KVM: VMX: Extract posted interrupt support to separate files
      
      added another pi_init(), though one already existed in the paride code.
      Reported-by: NJens Axboe <axboe@kernel.dk>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a3ff25fc
    • S
      KVM: x86/mmu: Avoid modulo operator on 64-bit value to fix i386 build · 764388ce
      Sean Christopherson 提交于
      Replace a modulo operator with the more common pattern for computing the
      gfn "offset" of a huge page to fix an i386 build error.
      
        arch/x86/kvm/mmu/tdp_mmu.c:212: undefined reference to `__umoddi3'
      
      In fact, almost all of tdp_mmu.c can be elided on 32-bit builds, but
      that is a much larger patch.
      
      Fixes: 2f2fad08 ("kvm: x86/mmu: Add functions to handle changed TDP SPTEs")
      Reported-by: NDaniel Díaz <daniel.diaz@linaro.org>
      Signed-off-by: NSean Christopherson <sean.j.christopherson@intel.com>
      Message-Id: <20201024031150.9318-1-sean.j.christopherson@intel.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      764388ce
    • E
      crypto: x86/poly1305 - add back a needed assignment · c3a98c3a
      Eric Biggers 提交于
      One of the assignments that was removed by commit 4a0c1de6 ("crypto:
      x86/poly1305 - Remove assignments with no effect") is actually needed,
      since it affects the return value.
      
      This fixes the following crypto self-test failure:
      
          alg: shash: poly1305-simd test failed (wrong result) on test vector 2, cfg="init+update+final aligned buffer"
      
      Fixes: 4a0c1de6 ("crypto: x86/poly1305 - Remove assignments with no effect")
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      c3a98c3a
    • R
      x86/uaccess: fix code generation in put_user() · 9c5743df
      Rasmus Villemoes 提交于
      Quoting https://gcc.gnu.org/onlinedocs/gcc/Local-Register-Variables.html:
      
        You can define a local register variable and associate it with a
        specified register...
      
        The only supported use for this feature is to specify registers for
        input and output operands when calling Extended asm (see Extended
        Asm). This may be necessary if the constraints for a particular
        machine don't provide sufficient control to select the desired
        register.
      
      On 32-bit x86, this is used to ensure that gcc will put an 8-byte value
      into the %edx:%eax pair, while all other cases will just use the single
      register %eax (%rax on x86-64).  While the _ASM_AX actually just expands
      to "%eax", note this comment next to get_user() which does something
      very similar:
      
       * The use of _ASM_DX as the register specifier is a bit of a
       * simplification, as gcc only cares about it as the starting point
       * and not size: for a 64-bit value it will use %ecx:%edx on 32 bits
       * (%ecx being the next register in gcc's x86 register sequence), and
       * %rdx on 64 bits.
      
      However, getting this to work requires that there is no code between the
      assignment to the local register variable and its use as an input to the
      asm() which can possibly clobber any of the registers involved -
      including evaluation of the expressions making up other inputs.
      
      In the current code, the ptr expression used directly as an input may
      cause such code to be emitted.  For example, Sean Christopherson
      observed that with KASAN enabled and ptr being current->set_child_tid
      (from chedule_tail()), the load of current->set_child_tid causes a call
      to __asan_load8() to be emitted immediately prior to the __put_user_4
      call, and Naresh Kamboju reports that various mmstress tests fail on
      KASAN-enabled builds.
      
      It's also possible to synthesize a broken case without KASAN if one uses
      "foo()" as the ptr argument, with foo being some "extern u64 __user
      *foo(void);" (though I don't know if that appears in real code).
      
      Fix it by making sure ptr gets evaluated before the assignment to
      __val_pu, and add a comment that __val_pu must be the last thing
      computed before the asm() is entered.
      
      Cc: Sean Christopherson <sean.j.christopherson@intel.com>
      Reported-by: NNaresh Kamboju <naresh.kamboju@linaro.org>
      Tested-by: NNaresh Kamboju <naresh.kamboju@linaro.org>
      Fixes: d55564cf ("x86: Make __put_user() generate an out-of-line call")
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9c5743df
  10. 23 10月, 2020 11 次提交