1. 03 Apr, 2024 4 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 0f099dc9
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "ARM:
      
         - Ensure perf events programmed to count during guest execution are
           actually enabled before entering the guest in the nVHE
           configuration
      
         - Restore out-of-range handler for stage-2 translation faults
      
         - Several fixes to stage-2 TLB invalidations to avoid stale
           translations, possibly including partial walk caches
      
         - Fix early handling of architectural VHE-only systems to ensure E2H
           is appropriately set
      
         - Correct a format specifier warning in the arch_timer selftest
      
         - Make the KVM banner message correctly handle all of the possible
           configurations
      
        RISC-V:
      
         - Remove redundant semicolon in num_isa_ext_regs()
      
         - Fix APLIC setipnum_le/be write emulation
      
         - Fix APLIC in_clrip[x] read emulation
      
        x86:
      
         - Fix a bug in KVM_SET_CPUID{2,} where KVM looks at the wrong CPUID
           entries (old vs. new) and ultimately neglects to clear PV_UNHALT
           from vCPUs with HLT-exiting disabled
      
         - Documentation fixes for SEV
      
         - Fix compat ABI for KVM_MEMORY_ENCRYPT_OP
      
         - Fix a 14-year-old goof in a declaration shared by host and guest;
           the enabled field used by Linux when running as a guest pushes the
           size of "struct kvm_vcpu_pv_apf_data" from 64 to 68 bytes. This is
           really unconsequential because KVM never consumes anything beyond
           the first 64 bytes, but the resulting struct does not match the
           documentation
      
        Selftests:
      
         - Fix spelling mistake in arch_timer selftest"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (25 commits)
        KVM: arm64: Rationalise KVM banner output
        arm64: Fix early handling of FEAT_E2H0 not being implemented
        KVM: arm64: Ensure target address is granule-aligned for range TLBI
        KVM: arm64: Use TLBI_TTL_UNKNOWN in __kvm_tlb_flush_vmid_range()
        KVM: arm64: Don't pass a TLBI level hint when zapping table entries
        KVM: arm64: Don't defer TLB invalidation when zapping table entries
        KVM: selftests: Fix __GUEST_ASSERT() format warnings in ARM's arch timer test
        KVM: arm64: Fix out-of-IPA space translation fault handling
        KVM: arm64: Fix host-programmed guest events in nVHE
        RISC-V: KVM: Fix APLIC in_clrip[x] read emulation
        RISC-V: KVM: Fix APLIC setipnum_le/be write emulation
        RISC-V: KVM: Remove second semicolon
        KVM: selftests: Fix spelling mistake "trigged" -> "triggered"
        Documentation: kvm/sev: clarify usage of KVM_MEMORY_ENCRYPT_OP
        Documentation: kvm/sev: separate description of firmware
        KVM: SEV: fix compat ABI for KVM_MEMORY_ENCRYPT_OP
        KVM: selftests: Check that PV_UNHALT is cleared when HLT exiting is disabled
        KVM: x86: Use actual kvm_cpuid.base for clearing KVM_FEATURE_PV_UNHALT
        KVM: x86: Introduce __kvm_get_hypervisor_cpuid() helper
        KVM: SVM: Return -EINVAL instead of -EBUSY on attempt to re-init SEV/SEV-ES
        ...
      0f099dc9
    • Roberto Sassu's avatar
      security: Place security_path_post_mknod() where the original IMA call was · 701b3899
      Roberto Sassu authored
      Commit 08abce60 ("security: Introduce path_post_mknod hook")
      introduced security_path_post_mknod(), to replace the IMA-specific call
      to ima_post_path_mknod().
      
      For symmetry with security_path_mknod(), security_path_post_mknod() was
      called after a successful mknod operation, for any file type, rather
      than only for regular files at the time there was the IMA call.
      
      However, as reported by VFS maintainers, successful mknod operation does
      not mean that the dentry always has an inode attached to it (for
      example, not for FIFOs on a SAMBA mount).
      
      If that condition happens, the kernel crashes when
      security_path_post_mknod() attempts to verify if the inode associated to
      the dentry is private.
      
      Move security_path_post_mknod() where the ima_post_path_mknod() call was,
      which is obviously correct from IMA/EVM perspective. IMA/EVM are the only
      in-kernel users, and only need to inspect regular files.
      Reported-by: default avatarSteve French <smfrench@gmail.com>
      Closes: https://lore.kernel.org/linux-kernel/CAH2r5msAVzxCUHHG8VKrMPUKQHmBpE6K9_vjhgDa1uAvwx4ppw@mail.gmail.com/Suggested-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Fixes: 08abce60 ("security: Introduce path_post_mknod hook")
      Signed-off-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
      Reviewed-by: default avatarChristian Brauner <brauner@kernel.org>
      Reviewed-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      Acked-by: default avatarPaul Moore <paul@paul-moore.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      701b3899
    • Borislav Petkov (AMD)'s avatar
      x86/retpoline: Do the necessary fixup to the Zen3/4 srso return thunk for !SRSO · 0e110732
      Borislav Petkov (AMD) authored
      The srso_alias_untrain_ret() dummy thunk in the !CONFIG_MITIGATION_SRSO
      case is there only for the altenative in CALL_UNTRAIN_RET to have
      a symbol to resolve.
      
      However, testing with kernels which don't have CONFIG_MITIGATION_SRSO
      enabled, leads to the warning in patch_return() to fire:
      
        missing return thunk: srso_alias_untrain_ret+0x0/0x10-0x0: eb 0e 66 66 2e
        WARNING: CPU: 0 PID: 0 at arch/x86/kernel/alternative.c:826 apply_returns (arch/x86/kernel/alternative.c:826
      
      Put in a plain "ret" there so that gcc doesn't put a return thunk in
      in its place which special and gets checked.
      
      In addition:
      
        ERROR: modpost: "srso_alias_untrain_ret" [arch/x86/kvm/kvm-amd.ko] undefined!
        make[2]: *** [scripts/Makefile.modpost:145: Module.symvers] Chyba 1
        make[1]: *** [/usr/src/linux-6.8.3/Makefile:1873: modpost] Chyba 2
        make: *** [Makefile:240: __sub-make] Chyba 2
      
      since !SRSO builds would use the dummy return thunk as reported by
      petr.pisar@atlas.cz, https://bugzilla.kernel.org/show_bug.cgi?id=218679.
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Closes: https://lore.kernel.org/oe-lkp/202404020901.da75a60f-oliver.sang@intel.comSigned-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
      Link: https://lore.kernel.org/all/202404020901.da75a60f-oliver.sang@intel.com/Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0e110732
    • Linus Torvalds's avatar
      Merge tag 'selinux-pr-20240402' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux · 3e92c1e6
      Linus Torvalds authored
      Pull selinux fix from Paul Moore:
       "A single patch for SELinux to fix a problem where we could potentially
        dereference an error pointer if we failed to successfully mount
        selinuxfs"
      
      * tag 'selinux-pr-20240402' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
        selinux: avoid dereference of garbage after mount failure
      3e92c1e6
  2. 02 Apr, 2024 5 commits
    • Linus Torvalds's avatar
      Merge tag 'docs-6.9-fixes' of git://git.lwn.net/linux · b1e6ec0a
      Linus Torvalds authored
      Pull documentation fixes from Jonathan Corbet:
       "Four small documentation fixes"
      
      * tag 'docs-6.9-fixes' of git://git.lwn.net/linux:
        docs: zswap: fix shell command format
        tracing: Fix documentation on tp_printk cmdline option
        docs: Fix bitfield handling in kernel-doc
        Documentation: dev-tools: Add link to RV docs
      b1e6ec0a
    • Linus Torvalds's avatar
      Merge tag 'bcachefs-2024-04-01' of https://evilpiepirate.org/git/bcachefs · 67199a47
      Linus Torvalds authored
      Pull bcachefs fixes from Kent Overstreet:
       "Lots of fixes for situations with extreme filesystem damage.
      
        One fix ("Fix journal pins in btree write buffer") applicable to
        normal usage; also a dio performance fix.
      
        New repair/construction code is in the final stages, should be ready
        in about a week. Anyone that lost btree interior nodes (or a variety
        of other damage) as a result of the splitbrain bug will be able to
        repair then"
      
      * tag 'bcachefs-2024-04-01' of https://evilpiepirate.org/git/bcachefs: (32 commits)
        bcachefs: On emergency shutdown, print out current journal sequence number
        bcachefs: Fix overlapping extent repair
        bcachefs: Fix remove_dirent()
        bcachefs: Logged op errors should be ignored
        bcachefs: Improve -o norecovery; opts.recovery_pass_limit
        bcachefs: bch2_run_explicit_recovery_pass_persistent()
        bcachefs: Ensure bch_sb_field_ext always exists
        bcachefs: Flush journal immediately after replay if we did early repair
        bcachefs: Resume logged ops after fsck
        bcachefs: Add error messages to logged ops fns
        bcachefs: Split out recovery_passes.c
        bcachefs: fix backpointer for missing alloc key msg
        bcachefs: Fix bch2_btree_increase_depth()
        bcachefs: Kill bch2_bkey_ptr_data_type()
        bcachefs: Fix use after free in check_root_trans()
        bcachefs: Fix repair path for missing indirect extents
        bcachefs: Fix use after free in bch2_check_fix_ptrs()
        bcachefs: Fix btree node keys accounting in topology repair path
        bcachefs: Check btree ptr min_key in .invalid
        bcachefs: add REQ_SYNC and REQ_IDLE in write dio
        ...
      67199a47
    • Paolo Bonzini's avatar
      Merge tag 'kvm-riscv-fixes-6.9-1' of https://github.com/kvm-riscv/linux into HEAD · 9bc60f73
      Paolo Bonzini authored
      KVM/riscv fixes for 6.9, take #1
      
      - Fix spelling mistake in arch_timer selftest
      - Remove redundant semicolon in num_isa_ext_regs()
      - Fix APLIC setipnum_le/be write emulation
      - Fix APLIC in_clrip[x] read emulation
      9bc60f73
    • Paolo Bonzini's avatar
      Merge tag 'kvmarm-fixes-6.9-1' of... · 52b761b4
      Paolo Bonzini authored
      Merge tag 'kvmarm-fixes-6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
      
      KVM/arm64 fixes for 6.9, part #1
      
       - Ensure perf events programmed to count during guest execution
         are actually enabled before entering the guest in the nVHE
         configuration.
      
       - Restore out-of-range handler for stage-2 translation faults.
      
       - Several fixes to stage-2 TLB invalidations to avoid stale
         translations, possibly including partial walk caches.
      
       - Fix early handling of architectural VHE-only systems to ensure E2H is
         appropriately set.
      
       - Correct a format specifier warning in the arch_timer selftest.
      
       - Make the KVM banner message correctly handle all of the possible
         configurations.
      52b761b4
    • Christian Göttsche's avatar
      selinux: avoid dereference of garbage after mount failure · 37801a36
      Christian Göttsche authored
      In case kern_mount() fails and returns an error pointer return in the
      error branch instead of continuing and dereferencing the error pointer.
      
      While on it drop the never read static variable selinuxfs_mount.
      
      Cc: stable@vger.kernel.org
      Fixes: 0619f0f5 ("selinux: wrap selinuxfs state")
      Signed-off-by: default avatarChristian Göttsche <cgzones@googlemail.com>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      37801a36
  3. 01 Apr, 2024 31 commits