1. 16 Jun, 2023 7 commits
  2. 13 Jun, 2023 1 commit
    • Nico Boehr's avatar
      KVM: s390: fix KVM_S390_GET_CMMA_BITS for GFNs in memslot holes · 285cff4c
      Nico Boehr authored
      The KVM_S390_GET_CMMA_BITS ioctl may return incorrect values when userspace
      specifies a start_gfn outside of memslots.
      
      This can occur when a VM has multiple memslots with a hole in between:
      
      +-----+----------+--------+--------+
      | ... | Slot N-1 | <hole> | Slot N |
      +-----+----------+--------+--------+
            ^          ^        ^        ^
            |          |        |        |
      GFN   A          A+B      |        |
                                A+B+C    |
      			           A+B+C+D
      
      When userspace specifies a GFN in [A+B, A+B+C), it would expect to get the
      CMMA values of the first dirty page in Slot N. However, userspace may get a
      start_gfn of A+B+C+D with a count of 0, hence completely skipping over any
      dirty pages in slot N.
      
      The error is in kvm_s390_next_dirty_cmma(), which assumes
      gfn_to_memslot_approx() will return the memslot _below_ the specified GFN
      when the specified GFN lies outside a memslot. In reality it may return
      either the memslot below or above the specified GFN.
      
      When a memslot above the specified GFN is returned this happens:
      
      - ofs is calculated, but since the memslot's base_gfn is larger than the
        specified cur_gfn, ofs will underflow to a huge number.
      - ofs is passed to find_next_bit(). Since ofs will exceed the memslot's
        number of pages, the number of pages in the memslot is returned,
        completely skipping over all bits in the memslot userspace would be
        interested in.
      
      Fix this by resetting ofs to zero when a memslot _above_ cur_gfn is
      returned (cur_gfn < ms->base_gfn).
      Signed-off-by: default avatarNico Boehr <nrb@linux.ibm.com>
      Reviewed-by: default avatarClaudio Imbrenda <imbrenda@linux.ibm.com>
      Fixes: afdad616 ("KVM: s390: Fix storage attributes migration with memory slots")
      Message-Id: <20230324145424.293889-2-nrb@linux.ibm.com>
      Signed-off-by: default avatarClaudio Imbrenda <imbrenda@linux.ibm.com>
      Signed-off-by: default avatarJanosch Frank <frankja@linux.ibm.com>
      285cff4c
  3. 14 May, 2023 13 commits
  4. 13 May, 2023 17 commits
  5. 12 May, 2023 2 commits
    • Borislav Petkov (AMD)'s avatar
      x86/retbleed: Fix return thunk alignment · 9a48d604
      Borislav Petkov (AMD) authored
      SYM_FUNC_START_LOCAL_NOALIGN() adds an endbr leading to this layout
      (leaving only the last 2 bytes of the address):
      
        3bff <zen_untrain_ret>:
        3bff:       f3 0f 1e fa             endbr64
        3c03:       f6                      test   $0xcc,%bl
      
        3c04 <__x86_return_thunk>:
        3c04:       c3                      ret
        3c05:       cc                      int3
        3c06:       0f ae e8                lfence
      
      However, "the RET at __x86_return_thunk must be on a 64 byte boundary,
      for alignment within the BTB."
      
      Use SYM_START instead.
      Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9a48d604
    • Linus Torvalds's avatar
      Merge tag 'for-6.4-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 76c7f887
      Linus Torvalds authored
      Pull more btrfs fixes from David Sterba:
      
       - fix incorrect number of bitmap entries for space cache if loading is
         interrupted by some error
      
       - fix backref walking, this breaks a mode of LOGICAL_INO_V2 ioctl that
         is used in deduplication tools
      
       - zoned mode fixes:
            - properly finish zone reserved for relocation
            - correctly calculate super block zone end on ZNS
            - properly initialize new extent buffer for redirty
      
       - make mount option clear_cache work with block-group-tree, to rebuild
         free-space-tree instead of temporarily disabling it that would lead
         to a forced read-only mount
      
       - fix alignment check for offset when printing extent item
      
      * tag 'for-6.4-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: make clear_cache mount option to rebuild FST without disabling it
        btrfs: zero the buffer before marking it dirty in btrfs_redirty_list_add
        btrfs: zoned: fix full zone super block reading on ZNS
        btrfs: zoned: zone finish data relocation BG with last IO
        btrfs: fix backref walking not returning all inode refs
        btrfs: fix space cache inconsistency after error loading it from disk
        btrfs: print-tree: parent bytenr must be aligned to sector size
      76c7f887