Skip to content
  1. Nov 06, 2023
  2. Nov 03, 2023
  3. Oct 23, 2023
  4. Oct 03, 2023
    • Al Viro's avatar
      gfs2: fix an oops in gfs2_permission · 0abd1557
      Al Viro authored
      
      
      In RCU mode, we might race with gfs2_evict_inode(), which zeroes
      ->i_gl.  Freeing of the object it points to is RCU-delayed, so
      if we manage to fetch the pointer before it's been replaced with
      NULL, we are fine.  Check if we'd fetched NULL and treat that
      as "bail out and tell the caller to get out of RCU mode".
      
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      0abd1557
    • Bob Peterson's avatar
      gfs2: ignore negated quota changes · 4c6a0812
      Bob Peterson authored
      
      
      When lots of quota changes are made, there may be cases in which an
      inode's quota information is increased and then decreased, such as when
      blocks are added to a file, then deleted from it. If the timing is
      right, function do_qc can add pending quota changes to a transaction,
      then later, another call to do_qc can negate those changes, resulting
      in a net gain of 0. The quota_change information is recorded in the qc
      buffer (and qd element of the inode as well). The buffer is added to the
      transaction by the first call to do_qc, but a subsequent call changes
      the value from non-zero back to zero. At that point it's too late to
      remove the buffer_head from the transaction. Later, when the quota sync
      code is called, the zero-change qd element is discovered and flagged as
      an assert warning. If the fs is mounted with errors=panic, the kernel
      will panic.
      
      This is usually seen when files are truncated and the quota changes are
      negated by punch_hole/truncate which uses gfs2_quota_hold and
      gfs2_quota_unhold rather than block allocations that use gfs2_quota_lock
      and gfs2_quota_unlock which automatically do quota sync.
      
      This patch solves the problem by adding a check to qd_check_sync such
      that net-zero quota changes already added to the transaction are no
      longer deemed necessary to be synced, and skipped.
      
      In this case references are taken for the qd and the slot from do_qc
      so those need to be put. The normal sequence of events for a normal
      non-zero quota change is as follows:
      
      gfs2_quota_change
         do_qc
            qd_hold
            slot_hold
      
      Later, when the changes are to be synced:
      
      gfs2_quota_sync
         qd_fish
            qd_check_sync
               gets qd ref via lockref_get_not_dead
         do_sync
            do_qc(QC_SYNC)
               qd_put
      	    lockref_put_or_lock
         qd_unlock
            qd_put
               lockref_put_or_lock
      
      In the net-zero change case, we add a check to qd_check_sync so it puts
      the qd and slot references acquired in gfs2_quota_change and skip the
      unneeded sync.
      
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      4c6a0812
  5. Sep 22, 2023
  6. Sep 19, 2023
  7. Sep 18, 2023
  8. Sep 17, 2023
    • Song Liu's avatar
      x86/purgatory: Remove LTO flags · 75b2f7e4
      Song Liu authored
      
      
      -flto* implies -ffunction-sections. With LTO enabled, ld.lld generates
      multiple .text sections for purgatory.ro:
      
        $ readelf -S purgatory.ro  | grep " .text"
          [ 1] .text             PROGBITS         0000000000000000  00000040
          [ 7] .text.purgatory   PROGBITS         0000000000000000  000020e0
          [ 9] .text.warn        PROGBITS         0000000000000000  000021c0
          [13] .text.sha256_upda PROGBITS         0000000000000000  000022f0
          [15] .text.sha224_upda PROGBITS         0000000000000000  00002be0
          [17] .text.sha256_fina PROGBITS         0000000000000000  00002bf0
          [19] .text.sha224_fina PROGBITS         0000000000000000  00002cc0
      
      This causes WARNING from kexec_purgatory_setup_sechdrs():
      
        WARNING: CPU: 26 PID: 110894 at kernel/kexec_file.c:919
        kexec_load_purgatory+0x37f/0x390
      
      Fix this by disabling LTO for purgatory.
      
      [ AFAICT, x86 is the only arch that supports LTO and purgatory. ]
      
      We could also fix this with an explicit linker script to rejoin .text.*
      sections back into .text. However, given the benefit of LTOing purgatory
      is small, simply disable the production of more .text.* sections for now.
      
      Fixes: b33fff07 ("x86, build: allow LTO to be selected")
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarSami Tolvanen <samitolvanen@google.com>
      Link: https://lore.kernel.org/r/20230914170138.995606-1-song@kernel.org
      75b2f7e4
    • Kirill A. Shutemov's avatar
      x86/boot/compressed: Reserve more memory for page tables · f530ee95
      Kirill A. Shutemov authored
      
      
      The decompressor has a hard limit on the number of page tables it can
      allocate. This limit is defined at compile-time and will cause boot
      failure if it is reached.
      
      The kernel is very strict and calculates the limit precisely for the
      worst-case scenario based on the current configuration. However, it is
      easy to forget to adjust the limit when a new use-case arises. The
      worst-case scenario is rarely encountered during sanity checks.
      
      In the case of enabling 5-level paging, a use-case was overlooked. The
      limit needs to be increased by one to accommodate the additional level.
      This oversight went unnoticed until Aaron attempted to run the kernel
      via kexec with 5-level paging and unaccepted memory enabled.
      
      Update wost-case calculations to include 5-level paging.
      
      To address this issue, let's allocate some extra space for page tables.
      128K should be sufficient for any use-case. The logic can be simplified
      by using a single value for all kernel configurations.
      
      [ Also add a warning, should this memory run low - by Dave Hansen. ]
      
      Fixes: 34bbb000 ("x86/boot/compressed: Enable 5-level paging during decompression stage")
      Reported-by: default avatarAaron Lu <aaron.lu@intel.com>
      Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/20230915070221.10266-1-kirill.shutemov@linux.intel.com
      f530ee95
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.6' of... · f0b0d403
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Fix kernel-devel RPM and linux-headers Deb package
      
       - Fix too long argument list error in 'make modules_install'
      
      * tag 'kbuild-fixes-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: avoid long argument lists in make modules_install
        kbuild: fix kernel-devel RPM package and linux-headers Deb package
      f0b0d403
    • Linus Torvalds's avatar
      vm: fix move_vma() memory accounting being off · 3cec5049
      Linus Torvalds authored
      
      
      Commit 408579cd ("mm: Update do_vmi_align_munmap() return
      semantics") seems to have updated one of the callers of do_vmi_munmap()
      incorrectly: it used to check for the error case (which didn't
      change: negative means error).
      
      That commit changed the check to the success case (which did change:
      before that commit, 0 was success, and 1 was "success and lock
      downgraded".  After the change, it's always 0 for success, and the lock
      will have been released if requested).
      
      This didn't change any actual VM behavior _except_ for memory accounting
      when 'VM_ACCOUNT' was set on the vma.  Which made the wrong return value
      test fairly subtle, since everything continues to work.
      
      Or rather - it continues to work but the "Committed memory" accounting
      goes all wonky (Committed_AS value in /proc/meminfo), and depending on
      settings that then causes problems much much later as the VM relies on
      bogus statistics for its heuristics.
      
      Revert that one line of the change back to the original logic.
      
      Fixes: 408579cd ("mm: Update do_vmi_align_munmap() return semantics")
      Reported-by: default avatarChristoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
      Reported-bisected-and-tested-by: default avatarMichael Labiuk <michael.labiuk@virtuozzo.com>
      Cc: Bagas Sanjaya <bagasdotme@gmail.com>
      Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
      Link: https://lore.kernel.org/all/1694366957@msgid.manchmal.in-ulm.de/
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3cec5049
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · ad8a69f3
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "16 small(ish) fixes all in drivers.
      
        The major fixes are in pm8001 (fixes MSI-X issue going back to its
        origin), the qla2xxx endianness fix, which fixes a bug on big endian
        and the lpfc ones which can cause an oops on module removal without
        them"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: lpfc: Prevent use-after-free during rmmod with mapped NVMe rports
        scsi: lpfc: Early return after marking final NLP_DROPPED flag in dev_loss_tmo
        scsi: lpfc: Fix the NULL vs IS_ERR() bug for debugfs_create_file()
        scsi: target: core: Fix target_cmd_counter leak
        scsi: pm8001: Setup IRQs on resume
        scsi: pm80xx: Avoid leaking tags when processing OPC_INB_SET_CONTROLLER_CONFIG command
        scsi: pm80xx: Use phy-specific SAS address when sending PHY_START command
        scsi: ufs: core: Poll HCS.UCRDY before issuing a UIC command
        scsi: ufs: core: Move __ufshcd_send_uic_cmd() outside host_lock
        scsi: qedf: Add synchronization between I/O completions and abort
        scsi: target: Replace strlcpy() with strscpy()
        scsi: qla2xxx: Fix NULL vs IS_ERR() bug for debugfs_create_dir()
        scsi: qla2xxx: Use raw_smp_processor_id() instead of smp_processor_id()
        scsi: qla2xxx: Correct endianness for rqstlen and rsplen
        scsi: ppa: Fix accidentally reversed conditions for 16-bit and 32-bit EPP
        scsi: megaraid_sas: Fix deadlock on firmware crashdump
      ad8a69f3
    • Linus Torvalds's avatar
      Merge tag 'ata-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata · cc3e5afc
      Linus Torvalds authored
      Pull ata fixes from Damien Le Moal:
      
       - Fix link power management transitions to disallow unsupported states
         (Niklas)
      
       - A small string handling fix for the sata_mv driver (Christophe)
      
       - Clear port pending interrupts before reset, as per AHCI
         specifications (Szuying).
      
         Followup fixes for this one are to not clear ATA_PFLAG_EH_PENDING in
         ata_eh_reset() to allow EH to continue on with other actions recorded
         with error interrupts triggered before EH completes. And an
         additional fix to avoid thawing a port twice in EH (Niklas)
      
       - Small code style fixes in the pata_parport driver to silence the
         build bot as it keeps complaining about bad indentation (me)
      
       - A fix for the recent CDL code to avoid fetching sense data for
         successful commands when not necessary for correct operation (Niklas)
      
      * tag 'ata-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
        ata: libata-core: fetch sense data for successful commands iff CDL enabled
        ata: libata-eh: do not thaw the port twice in ata_eh_reset()
        ata: libata-eh: do not clear ATA_PFLAG_EH_PENDING in ata_eh_reset()
        ata: pata_parport: Fix code style issues
        ata: libahci: clear pending interrupt status
        ata: sata_mv: Fix incorrect string length computation in mv_dump_mem()
        ata: libata: disallow dev-initiated LPM transitions to unsupported states
      cc3e5afc
    • Linus Torvalds's avatar
      Merge tag 'usb-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · cce67b6b
      Linus Torvalds authored
      Pull USB fix from Greg KH:
       "Here is a single USB fix for a much-reported regression for 6.6-rc1.
      
        It resolves a crash in the typec debugfs code for many systems. It's
        been in linux-next with no reported issues, and many people have
        reported it resolving their problem with 6.6-rc1"
      
      * tag 'usb-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: typec: ucsi: Fix NULL pointer dereference
      cce67b6b
    • Linus Torvalds's avatar
      Merge tag 'driver-core-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · 205d0494
      Linus Torvalds authored
      Pull driver core fixes from Greg KH:
       "Here is a single driver core fix for a much-reported-by-sysbot issue
        that showed up in 6.6-rc1. It's been submitted by many people, all in
        the same way, so it obviously fixes things for them all.
      
        Also in here is a single documentation update adding riscv to the
        embargoed hardware document in case there are any future issues with
        that processor family.
      
        Both of these have been in linux-next with no reported problems"
      
      * tag 'driver-core-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        Documentation: embargoed-hardware-issues.rst: Add myself for RISC-V
        driver core: return an error when dev_set_name() hasn't happened
      205d0494
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · fd455e77
      Linus Torvalds authored
      Pull char/misc fix from Greg KH:
       "Here is a single patch for 6.6-rc2 that reverts a 6.5 change for the
        comedi subsystem that has ended up being incorrect and caused drivers
        that were working for people to be unable to be able to be selected to
        build at all.
      
        To fix this, the Kconfig change needs to be reverted and a future set
        of fixes for the ioport dependancies will show up in 6.7-rc1 (there's
        no rush for them.)
      
        This has been in linux-next with no reported issues"
      
      * tag 'char-misc-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        Revert "comedi: add HAS_IOPORT dependencies"
      fd455e77
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · c37f8efc
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "The main thing is the removal of 'probe_new' because all i2c client
        drivers are converted now. Thanks Uwe, this marks the end of a long
        conversion process.
      
        Other than that, we have a few Kconfig updates and driver bugfixes"
      
      * tag 'i2c-for-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: cadence: Fix the kernel-doc warnings
        i2c: aspeed: Reset the i2c controller when timeout occurs
        i2c: I2C_MLXCPLD on ARM64 should depend on ACPI
        i2c: Make I2C_ATR invisible
        i2c: Drop legacy callback .probe_new()
        w1: ds2482: Switch back to use struct i2c_driver's .probe()
      c37f8efc