Skip to content
  1. Apr 12, 2024
  2. Apr 11, 2024
    • Josh Poimboeuf's avatar
      x86/bugs: Clarify that syscall hardening isn't a BHI mitigation · 5f882f3b
      Josh Poimboeuf authored
      While syscall hardening helps prevent some BHI attacks, there's still
      other low-hanging fruit remaining.  Don't classify it as a mitigation
      and make it clear that the system may still be vulnerable if it doesn't
      have a HW or SW mitigation enabled.
      
      Fixes: ec9404e4
      
       ("x86/bhi: Add BHI mitigation knob")
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Sean Christopherson <seanjc@google.com>
      Link: https://lore.kernel.org/r/b5951dae3fdee7f1520d5136a27be3bdfe95f88b.1712813475.git.jpoimboe@kernel.org
      5f882f3b
    • Josh Poimboeuf's avatar
      x86/bugs: Fix BHI handling of RRSBA · 1cea8a28
      Josh Poimboeuf authored
      The ARCH_CAP_RRSBA check isn't correct: RRSBA may have already been
      disabled by the Spectre v2 mitigation (or can otherwise be disabled by
      the BHI mitigation itself if needed).  In that case retpolines are fine.
      
      Fixes: ec9404e4
      
       ("x86/bhi: Add BHI mitigation knob")
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Sean Christopherson <seanjc@google.com>
      Link: https://lore.kernel.org/r/6f56f13da34a0834b69163467449be7f58f253dc.1712813475.git.jpoimboe@kernel.org
      1cea8a28
    • Ingo Molnar's avatar
      x86/bugs: Rename various 'ia32_cap' variables to 'x86_arch_cap_msr' · d0485730
      Ingo Molnar authored
      
      
      So we are using the 'ia32_cap' value in a number of places,
      which got its name from MSR_IA32_ARCH_CAPABILITIES MSR register.
      
      But there's very little 'IA32' about it - this isn't 32-bit only
      code, nor does it originate from there, it's just a historic
      quirk that many Intel MSR names are prefixed with IA32_.
      
      This is already clear from the helper method around the MSR:
      x86_read_arch_cap_msr(), which doesn't have the IA32 prefix.
      
      So rename 'ia32_cap' to 'x86_arch_cap_msr' to be consistent with
      its role and with the naming of the helper function.
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Nikolay Borisov <nik.borisov@suse.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Sean Christopherson <seanjc@google.com>
      Link: https://lore.kernel.org/r/9592a18a814368e75f8f4b9d74d3883aa4fd1eaf.1712813475.git.jpoimboe@kernel.org
      d0485730
    • Josh Poimboeuf's avatar
      x86/bugs: Cache the value of MSR_IA32_ARCH_CAPABILITIES · cb2db5bb
      Josh Poimboeuf authored
      There's no need to keep reading MSR_IA32_ARCH_CAPABILITIES over and
      over.  It's even read in the BHI sysfs function which is a big no-no.
      Just read it once and cache it.
      
      Fixes: ec9404e4
      
       ("x86/bhi: Add BHI mitigation knob")
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Reviewed-by: default avatarNikolay Borisov <nik.borisov@suse.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Sean Christopherson <seanjc@google.com>
      Link: https://lore.kernel.org/r/9592a18a814368e75f8f4b9d74d3883aa4fd1eaf.1712813475.git.jpoimboe@kernel.org
      cb2db5bb
    • Josh Poimboeuf's avatar
      x86/bugs: Fix BHI documentation · dfe64890
      Josh Poimboeuf authored
      Fix up some inaccuracies in the BHI documentation.
      
      Fixes: ec9404e4
      
       ("x86/bhi: Add BHI mitigation knob")
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Reviewed-by: default avatarNikolay Borisov <nik.borisov@suse.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Sean Christopherson <seanjc@google.com>
      Link: https://lore.kernel.org/r/8c84f7451bfe0dd08543c6082a383f390d4aa7e2.1712813475.git.jpoimboe@kernel.org
      dfe64890
  3. Apr 10, 2024
  4. Apr 09, 2024
  5. Apr 08, 2024
    • Adam Dunlap's avatar
      x86/apic: Force native_apic_mem_read() to use the MOV instruction · 5ce344be
      Adam Dunlap authored
      
      
      When done from a virtual machine, instructions that touch APIC memory
      must be emulated. By convention, MMIO accesses are typically performed
      via io.h helpers such as readl() or writeq() to simplify instruction
      emulation/decoding (ex: in KVM hosts and SEV guests) [0].
      
      Currently, native_apic_mem_read() does not follow this convention,
      allowing the compiler to emit instructions other than the MOV
      instruction generated by readl(). In particular, when the kernel is
      compiled with clang and run as a SEV-ES or SEV-SNP guest, the compiler
      would emit a TESTL instruction which is not supported by the SEV-ES
      emulator, causing a boot failure in that environment. It is likely the
      same problem would happen in a TDX guest as that uses the same
      instruction emulator as SEV-ES.
      
      To make sure all emulators can emulate APIC memory reads via MOV, use
      the readl() function in native_apic_mem_read(). It is expected that any
      emulator would support MOV in any addressing mode as it is the most
      generic and is what is usually emitted currently.
      
      The TESTL instruction is emitted when native_apic_mem_read() is inlined
      into apic_mem_wait_icr_idle(). The emulator comes from
      insn_decode_mmio() in arch/x86/lib/insn-eval.c. It's not worth it to
      extend insn_decode_mmio() to support more instructions since, in theory,
      the compiler could choose to output nearly any instruction for such
      reads which would bloat the emulator beyond reason.
      
        [0] https://lore.kernel.org/all/20220405232939.73860-12-kirill.shutemov@linux.intel.com/
      
        [ bp: Massage commit message, fix typos. ]
      
      Signed-off-by: default avatarAdam Dunlap <acdunlap@google.com>
      Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Tested-by: default avatarKevin Loughlin <kevinloughlin@google.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20240318230927.2191933-1-acdunlap@google.com
      5ce344be
    • Linus Torvalds's avatar
      Linux 6.9-rc3 · fec50db7
      Linus Torvalds authored
      v6.9-rc3
      fec50db7
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2024-04-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9fe30842
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
      
       - Fix MCE timer reinit locking
      
       - Fix/improve CoCo guest random entropy pool init
      
       - Fix SEV-SNP late disable bugs
      
       - Fix false positive objtool build warning
      
       - Fix header dependency bug
      
       - Fix resctrl CPU offlining bug
      
      * tag 'x86-urgent-2024-04-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk
        x86/mce: Make sure to grab mce_sysfs_mutex in set_bank()
        x86/CPU/AMD: Track SNP host status with cc_platform_*()
        x86/cc: Add cc_platform_set/_clear() helpers
        x86/kvm/Kconfig: Have KVM_AMD_SEV select ARCH_HAS_CC_PLATFORM
        x86/coco: Require seeding RNG with RDRAND on CoCo systems
        x86/numa/32: Include missing <asm/pgtable_areas.h>
        x86/resctrl: Fix uninitialized memory read when last CPU of domain goes offline
      9fe30842
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2024-04-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3520c35e
      Linus Torvalds authored
      Pull timer fixes from Ingo Molnar:
       "Fix various timer bugs:
      
         - Fix a timer migration bug that may result in missed events
      
         - Fix timer migration group hierarchy event updates
      
         - Fix a PowerPC64 build warning
      
         - Fix a handful of DocBook annotation bugs"
      
      * tag 'timers-urgent-2024-04-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        timers/migration: Return early on deactivation
        timers/migration: Fix ignored event due to missing CPU update
        vdso: Use CONFIG_PAGE_SHIFT in vdso/datapage.h
        timers: Fix text inconsistencies and spelling
        tick/sched: Fix struct tick_sched doc warnings
        tick/sched: Fix various kernel-doc warnings
        timers: Fix kernel-doc format and add Return values
        time/timekeeping: Fix kernel-doc warnings and typos
        time/timecounter: Fix inline documentation
      3520c35e
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2024-04-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e2948eff
      Linus Torvalds authored
      Pull x86 perf fix from Ingo Molnar:
       "Fix a combined PEBS events bug on x86 Intel CPUs"
      
      * tag 'perf-urgent-2024-04-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel/ds: Don't clear ->pebs_data_cfg for the last PEBS event
      e2948eff
  6. Apr 07, 2024
    • Linus Torvalds's avatar
      Merge tag 'nfsd-6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux · f2f80ac8
      Linus Torvalds authored
      Pull nfsd fixes from Chuck Lever:
      
       - Address a slow memory leak with RPC-over-TCP
      
       - Prevent another NFS4ERR_DELAY loop during CREATE_SESSION
      
      * tag 'nfsd-6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
        nfsd: hold a lighter-weight client reference over CB_RECALL_ANY
        SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP
      f2f80ac8
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · cf17b950
      Linus Torvalds authored
      Pull i2c fix from Wolfram Sang:
       "A host driver build fix"
      
      * tag 'i2c-for-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: pxa: hide unused icr_bits[] variable
      cf17b950
    • Linus Torvalds's avatar
      Merge tag 'xfs-6.9-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 9520c192
      Linus Torvalds authored
      Pull xfs fix from Chandan Babu:
      
       - Allow creating new links to special files which were not associated
         with a project quota
      
      * tag 'xfs-6.9-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: allow cross-linking special files without project quota
      9520c192
    • Linus Torvalds's avatar
      Merge tag '6.9-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 · 119c2894
      Linus Torvalds authored
      Pull smb client fixes from Steve French:
      
       - fix to retry close to avoid potential handle leaks when server
         returns EBUSY
      
       - DFS fixes including a fix for potential use after free
      
       - fscache fix
      
       - minor strncpy cleanup
      
       - reconnect race fix
      
       - deal with various possible UAF race conditions tearing sessions down
      
      * tag '6.9-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        smb: client: fix potential UAF in cifs_signal_cifsd_for_reconnect()
        smb: client: fix potential UAF in smb2_is_network_name_deleted()
        smb: client: fix potential UAF in is_valid_oplock_break()
        smb: client: fix potential UAF in smb2_is_valid_oplock_break()
        smb: client: fix potential UAF in smb2_is_valid_lease_break()
        smb: client: fix potential UAF in cifs_stats_proc_show()
        smb: client: fix potential UAF in cifs_stats_proc_write()
        smb: client: fix potential UAF in cifs_dump_full_key()
        smb: client: fix potential UAF in cifs_debug_files_proc_show()
        smb3: retrying on failed server close
        smb: client: serialise cifs_construct_tcon() with cifs_mount_mutex
        smb: client: handle DFS tcons in cifs_construct_tcon()
        smb: client: refresh referral without acquiring refpath_lock
        smb: client: guarantee refcounted children from parent session
        cifs: Fix caching to try to do open O_WRONLY as rdwr on server
        smb: client: fix UAF in smb2_reconnect_server()
        smb: client: replace deprecated strncpy with strscpy
      119c2894
  7. Apr 06, 2024
    • Borislav Petkov (AMD)'s avatar
      x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk · b377c66a
      Borislav Petkov (AMD) authored
      srso_alias_untrain_ret() is special code, even if it is a dummy
      which is called in the !SRSO case, so annotate it like its real
      counterpart, to address the following objtool splat:
      
        vmlinux.o: warning: objtool: .export_symbol+0x2b290: data relocation to !ENDBR: srso_alias_untrain_ret+0x0
      
      Fixes: 4535e1a4
      
       ("x86/bugs: Fix the SRSO mitigation on Zen3/4")
      Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: https://lore.kernel.org/r/20240405144637.17908-1-bp@kernel.org
      b377c66a
    • Ingo Molnar's avatar
      Merge branch 'linus' into x86/urgent, to pick up dependent commit · 5f2ca44e
      Ingo Molnar authored
      We want to fix:
      
        0e110732
      
       ("x86/retpoline: Do the necessary fixup to the Zen3/4 srso return thunk for !SRSO")
      
      So merge in Linus's latest into x86/urgent to have it available.
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      5f2ca44e
    • Wolfram Sang's avatar
      Merge tag 'i2c-host-fixes-6.9-rc3' of... · 5ceeabb0
      Wolfram Sang authored
      Merge tag 'i2c-host-fixes-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux into i2c/for-current
      
      An unused const variable kind of error has been fixed by placing
      the definition of icr_bits[] inside the ifdef block where it is
      used.
      5ceeabb0
    • Linus Torvalds's avatar
      Merge tag 'firewire-fixes-6.9-rc2' of... · 6c6e47d6
      Linus Torvalds authored
      Merge tag 'firewire-fixes-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394
      
      Pull firewire fixes from Takashi Sakamoto:
       "The firewire-ohci kernel module has a parameter for verbose kernel
        logging. It is well-known that it logs the spurious IRQ for bus-reset
        event due to the unmasked register for IRQ event. This update fixes
        the issue"
      
      * tag 'firewire-fixes-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
        firewire: ohci: mask bus reset interrupts between ISR and bottom half
      6c6e47d6
    • Adam Goldman's avatar
      firewire: ohci: mask bus reset interrupts between ISR and bottom half · 752e3c53
      Adam Goldman authored
      In the FireWire OHCI interrupt handler, if a bus reset interrupt has
      occurred, mask bus reset interrupts until bus_reset_work has serviced and
      cleared the interrupt.
      
      Normally, we always leave bus reset interrupts masked. We infer the bus
      reset from the self-ID interrupt that happens shortly thereafter. A
      scenario where we unmask bus reset interrupts was introduced in 2008 in
      a007bb85: If
      OHCI_PARAM_DEBUG_BUSRESETS (8) is set in the debug parameter bitmask, we
      will unmask bus reset interrupts so we can log them.
      
      irq_handler logs the bus reset interrupt. However, we can't clear the bus
      reset event flag in irq_handler, because we won't service the event until
      later. irq_handler exits with the event flag still set. If the
      corresponding interrupt is still unmasked, the first bus reset will
      usually freeze the system due to irq_handler being called again each
      time it exits. This freeze can be reproduced by loading firewire_ohci
      with "modprobe firewire_ohci debug=-1" (to enable all debugging output).
      Apparently there are also some cases where bus_reset_work will get called
      soon enough to clear the event, and operation will continue normally.
      
      This freeze was first reported a few months after a007bb85
      
       was committed,
      but until now it was never fixed. The debug level could safely be set
      to -1 through sysfs after the module was loaded, but this would be
      ineffectual in logging bus reset interrupts since they were only
      unmasked during initialization.
      
      irq_handler will now leave the event flag set but mask bus reset
      interrupts, so irq_handler won't be called again and there will be no
      freeze. If OHCI_PARAM_DEBUG_BUSRESETS is enabled, bus_reset_work will
      unmask the interrupt after servicing the event, so future interrupts
      will be caught as desired.
      
      As a side effect to this change, OHCI_PARAM_DEBUG_BUSRESETS can now be
      enabled through sysfs in addition to during initial module loading.
      However, when enabled through sysfs, logging of bus reset interrupts will
      be effective only starting with the second bus reset, after
      bus_reset_work has executed.
      
      Signed-off-by: default avatarAdam Goldman <adamg@pobox.com>
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      752e3c53
    • Linus Torvalds's avatar
      Merge tag 'spi-fix-v6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 104db052
      Linus Torvalds authored
      Pull spi fixes from Mark Brown:
       "A few small driver specific fixes, the most important being the
        s3c64xx change which is likely to be hit during normal operation"
      
      * tag 'spi-fix-v6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: mchp-pci1xxx: Fix a possible null pointer dereference in pci1xxx_spi_probe
        spi: spi-fsl-lpspi: remove redundant spi_controller_put call
        spi: s3c64xx: Use DMA mode from fifo size
      104db052
    • Linus Torvalds's avatar
      Merge tag 'regulator-fix-v6.9-rc2' of... · 20668408
      Linus Torvalds authored
      Merge tag 'regulator-fix-v6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
      
      Pull regulator fix from Mark Brown:
       "One simple regualtor fix, fixing module autoloading on tps65132"
      
      * tag 'regulator-fix-v6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: tps65132: Add of_match table
      20668408