Skip to content
  1. Jun 01, 2023
    • Linus Torvalds's avatar
      Merge tag 'firewire-fixes-6.4-rc4' of... · 1874a42a
      Linus Torvalds authored
      Merge tag 'firewire-fixes-6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394
      
      Pull firewire fix from Takashi Sakamoto:
       "A single patch to use a flexible array rather than a zero-length one"
      
      * tag 'firewire-fixes-6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
        firewire: Replace zero-length array with flexible-array member
      1874a42a
    • Linus Torvalds's avatar
      Merge tag 'mailbox-fixes-6.4-rc5' of git://git.linaro.org/landing-teams/working/fujitsu/integration · cd69bf36
      Linus Torvalds authored
      Pull mailbox fix from Jassi Brar:
       "Fix missing mutex unlock in mailbox-test"
      
      * tag 'mailbox-fixes-6.4-rc5' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
        mailbox: mailbox-test: fix a locking issue in mbox_test_message_write()
      cd69bf36
    • Gustavo A. R. Silva's avatar
      firewire: Replace zero-length array with flexible-array member · 44205282
      Gustavo A. R. Silva authored
      
      
      Zero-length and one-element arrays are deprecated, and we are moving
      towards adopting C99 flexible-array members, instead.
      
      Address the following warnings found with GCC-13 and
      -fstrict-flex-arrays=3 enabled:
      sound/firewire/amdtp-stream.c: In function ‘build_it_pkt_header’:
      sound/firewire/amdtp-stream.c:694:17: warning: ‘generate_cip_header’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=]
        694 |                 generate_cip_header(s, cip_header, data_block_counter, syt);
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      sound/firewire/amdtp-stream.c:694:17: note: referencing argument 2 of type ‘__be32[2]’ {aka ‘unsigned int[2]’}
      sound/firewire/amdtp-stream.c:667:13: note: in a call to function ‘generate_cip_header’
        667 | static void generate_cip_header(struct amdtp_stream *s, __be32 cip_header[2],
            |             ^~~~~~~~~~~~~~~~~~~
      
      This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
      routines on memcpy() and help us make progress towards globally
      enabling -fstrict-flex-arrays=3 [1].
      
      Link: https://github.com/KSPP/linux/issues/21
      Link: https://github.com/KSPP/linux/issues/303
      Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1]
      Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Link: https://lore.kernel.org/r/ZHT0V3SpvHyxCv5W@work
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      44205282
    • Linus Torvalds's avatar
      Merge tag 'for-linus-2023060101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · f39dda98
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - Regression fix for overlong long timeouts during initialization on
         some Logitech Unifying devices (Bastien Nocera)
      
       - error handling and overflow fixes for Wacom driver (Denis Arefev,
         Jason Gerecke, Nikita Zhandarovich)
      
      * tag 'for-linus-2023060101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: logitech-hidpp: Handle timeout differently from busy
        HID: wacom: Add error check to wacom_parse_and_register()
        HID: google: add jewel USB id
        HID: wacom: avoid integer overflow in wacom_intuos_inout()
        HID: wacom: Check for string overflow from strscpy calls
      f39dda98
    • Linus Torvalds's avatar
      Merge tag 'ata-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata · ba059590
      Linus Torvalds authored
      Pull ata fix from Damien Le Moal:
      
       - Fix ata_find_dev() use of the device number to find a struct
         ata_device for a port. This addresses issues with some passthrough
         commands with libsas managed devices.
      
      * tag 'ata-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
        ata: libata-scsi: Use correct device no in ata_find_dev()
      ba059590
    • Linus Torvalds's avatar
      Merge tag '6.4-rc4-smb3-server-fixes' of git://git.samba.org/ksmbd · 88280037
      Linus Torvalds authored
      Pull smb server fixes from Steve French:
       "Eight server fixes (most also for stable):
      
         - Two fixes for uninitialized pointer reads (rename and link)
      
         - Fix potential UAF in oplock break
      
         - Two fixes for potential out of bound reads in negotiate
      
         - Fix crediting bug
      
         - Two fixes for xfstests (allocation size fix for test 694 and lookup
           issue shown by test 464)"
      
      * tag '6.4-rc4-smb3-server-fixes' of git://git.samba.org/ksmbd:
        ksmbd: call putname after using the last component
        ksmbd: fix incorrect AllocationSize set in smb2_get_info
        ksmbd: fix UAF issue from opinfo->conn
        ksmbd: fix multiple out-of-bounds read during context decoding
        ksmbd: fix slab-out-of-bounds read in smb2_handle_negotiate
        ksmbd: fix credit count leakage
        ksmbd: fix uninitialized pointer read in smb2_create_link()
        ksmbd: fix uninitialized pointer read in ksmbd_vfs_rename()
      88280037
    • Linus Torvalds's avatar
      Merge tag '6.4-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 · 929ed21d
      Linus Torvalds authored
      Pull smb client fixes from Steve French:
       "Four small smb3 client fixes:
      
         - two small fixes suggested by kernel test robot
      
         - small cleanup fix
      
         - update Paulo's email address in the maintainer file"
      
      * tag '6.4-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: address unused variable warning
        smb: delete an unnecessary statement
        smb3: missing null check in SMB2_change_notify
        smb3: update a reviewer email in MAINTAINERS file
      929ed21d
    • Dan Carpenter's avatar
      mailbox: mailbox-test: fix a locking issue in mbox_test_message_write() · 8fe72b76
      Dan Carpenter authored
      There was a bug where this code forgot to unlock the tdev->mutex if the
      kzalloc() failed.  Fix this issue, by moving the allocation outside the
      lock.
      
      Fixes: 2d1e952a
      
       ("mailbox: mailbox-test: Fix potential double-free in mbox_test_message_write()")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
      Reviewed-by: default avatarLee Jones <lee@kernel.org>
      Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
      8fe72b76
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 884fe9da
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
      
       - Fix 64K ARM page size support in bnxt_re and efa
      
       - bnxt_re fixes for a memory leak, incorrect error handling and a
         remove a bogus FW failure when running on a VF
      
       - Update MAINTAINERS for hns and efa
      
       - Fix two rxe regressions added this merge window in error unwind and
         incorrect spinlock primitives
      
       - hns gets a better algorithm for allocating page tables to avoid
         running out of resources, and a timeout adjustment
      
       - Fix a text case failure in hns
      
       - Use after free in irdma and fix incorrect construction of a WQE
         causing mis-execution
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/irdma: Fix Local Invalidate fencing
        RDMA/irdma: Prevent QP use after free
        MAINTAINERS: Update maintainer of Amazon EFA driver
        RDMA/bnxt_re: Do not enable congestion control on VFs
        RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx
        RDMA/bnxt_re: Fix a possible memory leak
        RDMA/hns: Modify the value of long message loopback slice
        RDMA/hns: Fix base address table allocation
        RDMA/hns: Fix timeout attr in query qp for HIP08
        RDMA/efa: Fix unsupported page sizes in device
        RDMA/rxe: Convert spin_{lock_bh,unlock_bh} to spin_{lock_irqsave,unlock_irqrestore}
        RDMA/rxe: Fix double unlock in rxe_qp.c
        MAINTAINERS: Update maintainers of HiSilicon RoCE
        RDMA/bnxt_re: Fix the page_size used during the MR creation
      884fe9da
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · fd2186d1
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "Fix two regressions in ext4 and a number of issues reported by syzbot"
      
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: enable the lazy init thread when remounting read/write
        ext4: fix fsync for non-directories
        ext4: add lockdep annotations for i_data_sem for ea_inode's
        ext4: disallow ea_inodes with extended attributes
        ext4: set lockdep subclass for the ea_inode in ext4_xattr_inode_cache_find()
        ext4: add EA_INODE checking to ext4_iget()
      fd2186d1
  2. May 31, 2023
    • Bastien Nocera's avatar
      HID: logitech-hidpp: Handle timeout differently from busy · 6199d23c
      Bastien Nocera authored
      If an attempt at contacting a receiver or a device fails because the
      receiver or device never responds, don't restart the communication, only
      restart it if the receiver or device answers that it's busy, as originally
      intended.
      
      This was the behaviour on communication timeout before commit 586e8fed
      
      
      ("HID: logitech-hidpp: Retry commands when device is busy").
      
      This fixes some overly long waits in a critical path on boot, when
      checking whether the device is connected by getting its HID++ version.
      
      Signed-off-by: default avatarBastien Nocera <hadess@hadess.net>
      Suggested-by: default avatarMark Lord <mlord@pobox.com>
      Fixes: 586e8fed
      
       ("HID: logitech-hidpp: Retry commands when device is busy")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=217412
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      6199d23c
    • Linus Torvalds's avatar
      Merge tag 'for-6.4-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 48b1320a
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "One bug fix and two build warning fixes:
      
         - call proper end bio callback for metadata RAID0 in a rare case of
           an unaligned block
      
         - fix uninitialized variable (reported by gcc 10.2)
      
         - fix warning about potential access beyond array bounds on mips64
           with 64k pages (runtime check would not allow that)"
      
      * tag 'for-6.4-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: fix csum_tree_block page iteration to avoid tripping on -Werror=array-bounds
        btrfs: fix an uninitialized variable warning in btrfs_log_inode
        btrfs: call btrfs_orig_bbio_end_io in btrfs_end_bio_work
      48b1320a
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v6.4-2-2023-05-30' of... · afead42f
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v6.4-2-2023-05-30' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix BPF CO-RE naming convention for checking the availability of
         fields on 'union perf_mem_data_src' on the running kernel
      
       - Remove the use of llvm-strip on BPF skel object files, not needed,
         fixes a build breakage when the llvm package, that contains it in
         most distros, isn't installed
      
       - Fix tools that use both evsel->{bpf_counter_list,bpf_filters},
         removing them from a union
      
       - Remove extra "--" from the 'perf ftrace latency' --use-nsec option,
         previously it was working only when using the '-n' alternative
      
       - Don't stop building when both binutils-devel and a C++ compiler isn't
         available to compile the alternative C++ demangle support code,
         disable that feature instead
      
       - Sync the linux/in.h and coresight-pmu.h header copies with the kernel
         sources
      
       - Fix relative include path to cs-etm.h
      
      * tag 'perf-tools-fixes-for-v6.4-2-2023-05-30' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf evsel: Separate bpf_counter_list and bpf_filters, can be used at the same time
        tools headers UAPI: Sync the linux/in.h with the kernel sources
        perf cs-etm: Copy kernel coresight-pmu.h header
        perf bpf: Do not use llvm-strip on BPF binary
        perf build: Don't compile demangle-cxx.cpp if not necessary
        perf arm: Fix include path to cs-etm.h
        perf bpf filter: Fix a broken perf sample data naming for BPF CO-RE
        perf ftrace latency: Remove unnecessary "--" from --use-nsec option
      afead42f
    • Linus Torvalds's avatar
      Merge tag 'regmap-fix-v6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap · 1683c329
      Linus Torvalds authored
      Pull regmap fixes from Mark Brown:
       "The most important fix here is for missing dropping of the RCU read
        lock when syncing maple tree register caches, the physical devices I
        have that use the code don't do any syncing so I'd only ever tested
        this with virtual devices and missed the fact that we need to drop the
        lock in order to write to buses that need to sleep.
      
        Otherwise there's a fix for an edge case when splitting up large batch
        writes which has been lurking for a long time, a check to make sure
        nobody writes new drivers with a bug that was found in several
        SoundWire drivers and a tweak to the way the new kunit tests are
        enabled to ensure they don't cause regmap to be enabled when it
        wouldn't otherwise be"
      
      * tag 'regmap-fix-v6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
        regmap: maple: Drop the RCU read lock while syncing registers
        regmap: sdw: check for invalid multi-register writes config
        regmap: Account for register length when chunking
        regmap: REGMAP_KUNIT should not select REGMAP
      1683c329
    • Linus Torvalds's avatar
      Merge tag 'modules-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux · 6d86b56f
      Linus Torvalds authored
      Pull modules fix from Luis Chamberlain:
       "A fix is provided for ia64. Even though ia64 is on life support it
        helps to fix issues if we can. Thanks to Linus for doing tons of the
        ia64 debugging"
      
      * tag 'modules-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux:
        module: fix module load for ia64
      6d86b56f
    • Theodore Ts'o's avatar
      ext4: enable the lazy init thread when remounting read/write · eb1f822c
      Theodore Ts'o authored
      In commit a44be64b ("ext4: don't clear SB_RDONLY when remounting
      r/w until quota is re-enabled") we defer clearing tyhe SB_RDONLY flag
      in struct super.  However, we didn't defer when we checked sb_rdonly()
      to determine the lazy itable init thread should be enabled, with the
      next result that the lazy inode table initialization would not be
      properly started.  This can cause generic/231 to fail in ext4's
      nojournal mode.
      
      Fix this by moving when we decide to start or stop the lazy itable
      init thread to after we clear the SB_RDONLY flag when we are
      remounting the file system read/write.
      
      Fixes a44be64b
      
       ("ext4: don't clear SB_RDONLY when remounting r/w until...")
      
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Link: https://lore.kernel.org/r/20230527035729.1001605-1-tytso@mit.edu
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      eb1f822c
    • Jan Kara's avatar
      ext4: fix fsync for non-directories · 1077b2d5
      Jan Kara authored
      Commit e360c6ed ("ext4: Drop special handling of journalled data
      from ext4_sync_file()") simplified ext4_sync_file() by dropping special
      handling of journalled data mode as it was not needed anymore. However
      that branch was also used for directories and symlinks and since the
      fastcommit code does not track metadata changes to non-regular files, the
      change has caused e.g. fsync(2) on directories to not commit transaction
      as it should. Fix the problem by adding handling for non-regular files.
      
      Fixes: e360c6ed
      
       ("ext4: Drop special handling of journalled data from ext4_sync_file()")
      Reported-by: default avatarEric Whitney <enwlinux@gmail.com>
      Link: https://lore.kernel.org/all/ZFqO3xVnmhL7zv1x@debian-BULLSEYE-live-builder-AMD64
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Tested-by: default avatarEric Whitney <enwlinux@gmail.com>
      Link: https://lore.kernel.org/r/20230524104453.8734-1-jack@suse.cz
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      1077b2d5
    • Theodore Ts'o's avatar
      ext4: add lockdep annotations for i_data_sem for ea_inode's · aff3bea9
      Theodore Ts'o authored
      
      
      Treat i_data_sem for ea_inodes as being in their own lockdep class to
      avoid lockdep complaints about ext4_setattr's use of inode_lock() on
      normal inodes potentially causing lock ordering with i_data_sem on
      ea_inodes in ext4_xattr_inode_write().  However, ea_inodes will be
      operated on by ext4_setattr(), so this isn't a problem.
      
      Cc: stable@kernel.org
      Link: https://syzkaller.appspot.com/bug?extid=298c5d8fb4a128bc27b0
      Reported-by: default avatar <syzbot+298c5d8fb4a128bc27b0@syzkaller.appspotmail.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Link: https://lore.kernel.org/r/20230524034951.779531-5-tytso@mit.edu
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      aff3bea9
    • Theodore Ts'o's avatar
      ext4: disallow ea_inodes with extended attributes · 2bc7e7c1
      Theodore Ts'o authored
      
      
      An ea_inode stores the value of an extended attribute; it can not have
      extended attributes itself, or this will cause recursive nightmares.
      Add a check in ext4_iget() to make sure this is the case.
      
      Cc: stable@kernel.org
      Reported-by: default avatar <syzbot+e44749b6ba4d0434cd47@syzkaller.appspotmail.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Link: https://lore.kernel.org/r/20230524034951.779531-4-tytso@mit.edu
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      2bc7e7c1
    • Theodore Ts'o's avatar
      ext4: set lockdep subclass for the ea_inode in ext4_xattr_inode_cache_find() · b928dfdc
      Theodore Ts'o authored
      If the ea_inode has been pushed out of the inode cache while there is
      still a reference in the mb_cache, the lockdep subclass will not be
      set on the inode, which can lead to some lockdep false positives.
      
      Fixes: 33d201e0
      
       ("ext4: fix lockdep warning about recursive inode locking")
      Cc: stable@kernel.org
      Reported-by: default avatar <syzbot+d4b971e744b1f5439336@syzkaller.appspotmail.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Link: https://lore.kernel.org/r/20230524034951.779531-3-tytso@mit.edu
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      b928dfdc
    • Song Liu's avatar
      module: fix module load for ia64 · db3e33dd
      Song Liu authored
      Frank reported boot regression in ia64 as:
      
      ELILO v3.16 for EFI/IA-64
      ..
      Uncompressing Linux... done
      Loading file AC100221.initrd.img...done
      [    0.000000] Linux version 6.4.0-rc3 (root@x4270) (ia64-linux-gcc
      (GCC) 12.2.0, GNU ld (GNU Binutils) 2.39) #1 SMP Thu May 25 15:52:20
      CEST 2023
      [    0.000000] efi: EFI v1.1 by HP
      [    0.000000] efi: SALsystab=0x3ee7a000 ACPI 2.0=0x3fe2a000
      ESI=0x3ee7b000 SMBIOS=0x3ee7c000 HCDP=0x3fe28000
      [    0.000000] PCDP: v3 at 0x3fe28000
      [    0.000000] earlycon: uart8250 at MMIO 0x00000000f4050000 (options
      '9600n8')
      [    0.000000] printk: bootconsole [uart8250] enabled
      [    0.000000] ACPI: Early table checksum verification disabled
      [    0.000000] ACPI: RSDP 0x000000003FE2A000 000028 (v02 HP    )
      [    0.000000] ACPI: XSDT 0x000000003FE2A02C 0000CC (v01 HP     rx2620
      00000000 HP   00000000)
      [...]
      [    3.793350] Run /init as init process
      Loading, please wait...
      Starting systemd-udevd version 252.6-1
      [    3.951100] ------------[ cut here ]------------
      [    3.951100] WARNING: CPU: 6 PID: 140 at kernel/module/main.c:1547
      __layout_sections+0x370/0x3c0
      [    3.949512] Unable to handle kernel paging request at virtual address
      1000000000000000
      [    3.951100] Modules linked in:
      [    3.951100] CPU: 6 PID: 140 Comm: (udev-worker) Not tainted 6.4.0-rc3 #1
      [    3.956161] (udev-worker)[142]: Oops 11003706212352 [1]
      [    3.951774] Hardware name: hp server rx2620                   , BIOS
      04.29
      11/30/2007
      [    3.951774]
      [    3.951774] Call Trace:
      [    3.958339] Unable to handle kernel paging request at virtual address
      1000000000000000
      [    3.956161] Modules linked in:
      [    3.951774]  [<a0000001000156d0>] show_stack.part.0+0x30/0x60
      [    3.951774]                                 sp=e000000183a67b20
      bsp=e000000183a61628
      [    3.956161]
      [    3.956161]
      
      which bisect to module_memory change [1].
      
      Debug showed that ia64 uses some special sections:
      
      __layout_sections: section .got (sh_flags 10000002) matched to MOD_INVALID
      __layout_sections: section .sdata (sh_flags 10000003) matched to MOD_INVALID
      __layout_sections: section .sbss (sh_flags 10000003) matched to MOD_INVALID
      
      All these sections are loaded to module core memory before [1].
      
      Fix ia64 boot by loading these sections to MOD_DATA (core rw data).
      
      [1] commit ac3b4328 ("module: replace module_layout with module_memory")
      
      Fixes: ac3b4328
      
       ("module: replace module_layout with module_memory")
      Reported-by: default avatarFrank Scheiner <frank.scheiner@web.de>
      Closes: https://lists.debian.org/debian-ia64/2023/05/msg00010.html
      Closes: https://marc.info/?l=linux-ia64&m=168509859125505
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      Tested-by: default avatarJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      db3e33dd
  3. May 30, 2023
    • Damien Le Moal's avatar
      ata: libata-scsi: Use correct device no in ata_find_dev() · 7f875850
      Damien Le Moal authored
      
      
      For devices not attached to a port multiplier and managed directly by
      libata, the device number passed to ata_find_dev() must always be lower
      than the maximum number of devices returned by ata_link_max_devices().
      That is 1 for SATA devices or 2 for an IDE link with master+slave
      devices. This device number is the SCSI device ID which matches these
      constraints as the IDs are generated per port and so never exceed the
      maximum number of devices for the link being used.
      
      However, for libsas managed devices, SCSI device IDs are assigned per
      struct scsi_host, leading to device IDs for SATA devices that can be
      well in excess of libata per-link maximum number of devices. This
      results in ata_find_dev() to always return NULL for libsas managed
      devices except for the first device of the target scsi_host with ID
      (device number) equal to 0. This issue is visible by executing the
      hdparm utility, which fails. E.g.:
      
      hdparm -i /dev/sdX
      /dev/sdX:
        HDIO_GET_IDENTITY failed: No message of desired type
      
      Fix this by rewriting ata_find_dev() to ignore the device number for
      non-PMP attached devices with a link with at most 1 device, that is SATA
      devices. For these, the device number 0 is always used to
      return the correct pointer to the struct ata_device of the port link.
      This change excludes IDE master/slave setups (maximum number of devices
      per link is 2) and port-multiplier attached devices. Also, to be
      consistant with the fact that SCSI device IDs and channel numbers used
      as device numbers are both unsigned int, change the devno argument of
      ata_find_dev() to unsigned int.
      
      Reported-by: default avatarXingui Yang <yangxingui@huawei.com>
      Fixes: 41bda9c9
      
       ("libata-link: update hotplug to handle PMP links")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
      Reviewed-by: default avatarJason Yan <yanaijie@huawei.com>
      7f875850
    • Mustafa Ismail's avatar
      RDMA/irdma: Fix Local Invalidate fencing · 5842d1d9
      Mustafa Ismail authored
      If the local invalidate fence is indicated in the WR, only the read fence
      is currently being set in WQE. Fix this to set both the read and local
      fence in the WQE.
      
      Fixes: b48c24c2
      
       ("RDMA/irdma: Implement device supported verb APIs")
      Link: https://lore.kernel.org/r/20230522155654.1309-4-shiraz.saleem@intel.com
      Signed-off-by: default avatarMustafa Ismail <mustafa.ismail@intel.com>
      Signed-off-by: default avatarShiraz Saleem <shiraz.saleem@intel.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      5842d1d9
    • Mustafa Ismail's avatar
      RDMA/irdma: Prevent QP use after free · c8f304d7
      Mustafa Ismail authored
      There is a window where the poll cq may use a QP that has been freed.
      This can happen if a CQE is polled before irdma_clean_cqes() can clear the
      CQE's related to the QP and the destroy QP races to free the QP memory.
      then the QP structures are used in irdma_poll_cq.  Fix this by moving the
      clearing of CQE's before the reference is removed and the QP is destroyed.
      
      Fixes: b48c24c2
      
       ("RDMA/irdma: Implement device supported verb APIs")
      Link: https://lore.kernel.org/r/20230522155654.1309-3-shiraz.saleem@intel.com
      Signed-off-by: default avatarMustafa Ismail <mustafa.ismail@intel.com>
      Signed-off-by: default avatarShiraz Saleem <shiraz.saleem@intel.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      c8f304d7
    • Michael Margolin's avatar
      MAINTAINERS: Update maintainer of Amazon EFA driver · ffe14de9
      Michael Margolin authored
      
      
      Change EFA driver maintainer from Gal Pressman to myself. Keep Gal as a
      reviewer at his request.
      
      Link: https://lore.kernel.org/r/20230525094444.12570-1-mrgolin@amazon.com
      Signed-off-by: default avatarMichael Margolin <mrgolin@amazon.com>
      Acked-by: default avatarGal Pressman <gal.pressman@linux.dev>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      ffe14de9
  4. May 29, 2023
    • Linus Torvalds's avatar
      Merge tag 'trace-v6.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace · 8b817fde
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "User events:
      
         - Use long instead of int for storing the enable set/clear bit, as it
           was found that big endian machines could end up using the wrong
           bits.
      
         - Split allocating mm and attaching it. This keeps the allocation
           separate from the registration and avoids various races.
      
         - Remove RCU locking around pin_user_pages_remote() as that can
           schedule. The RCU protection is no longer needed with the above
           split of mm allocation and attaching.
      
         - Rename the "link" fields of the various structs to something more
           meaningful.
      
         - Add comments around user_event_mm struct usage and locking
           requirements.
      
        Timerlat tracer:
      
         - Fix missed wakeup of timerlat thread caused by the timerlat
           interrupt triggering when tracing is off. The timer interrupt
           handler needs to always wake up the timerlat thread regardless if
           tracing is enabled or not, otherwise, it will never wake up.
      
        Histograms:
      
         - Fix regression of breaking the "stacktrace" modifier for variables.
           That modifier cannot be used for values, but can be used for
           variables that are passed from one histogram to the next. This was
           broken when adding the restriction to values as the variable logic
           used the same code.
      
         - Rename the special field "stacktrace" to "common_stacktrace".
      
           Special fields (that are not actually part of the event, but can
           act just like event fields, like 'comm' and 'timestamp') should be
           prefixed with 'common_' for consistency. To keep backward
           compatibility, 'stacktrace' can still be used (as with the special
           field 'cpu'), but can be overridden if the event has a field called
           'stacktrace'.
      
         - Update the synthetic event selftests to use the new name (synthetic
           events are created by histograms)
      
        Tracing bootup selftests:
      
         - Reorganize the code to keep artifacts of the selftests not compiled
           in when selftests are not configured.
      
         - Add various cond_resched() around the selftest code, as the
           softlock watchdog was triggering much more often. It appears that
           the kernel runs slower now with full debugging enabled.
      
         - While debugging ftrace with ftrace (using an instance ring buffer
           instead of the top level one), I found that the selftests were
           disabling prints to the debug instance.
      
           This should not happen, as the selftests only disable printing to
           the main buffer as the selftests examine the main buffer to see if
           it has what it expects, and prints can make the tests fail.
      
           Make the selftests only disable printing to the toplevel buffer,
           and leave the instance buffers alone"
      
      * tag 'trace-v6.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        tracing: Have function_graph selftest call cond_resched()
        tracing: Only make selftest conditionals affect the global_trace
        tracing: Make tracing_selftest_running/delete nops when not used
        tracing: Have tracer selftests call cond_resched() before running
        tracing: Move setting of tracing_selftest_running out of register_tracer()
        tracing/selftests: Update synthetic event selftest to use common_stacktrace
        tracing: Rename stacktrace field to common_stacktrace
        tracing/histograms: Allow variables to have some modifiers
        tracing/user_events: Document user_event_mm one-shot list usage
        tracing/user_events: Rename link fields for clarity
        tracing/user_events: Remove RCU lock while pinning pages
        tracing/user_events: Split up mm alloc and attach
        tracing/timerlat: Always wakeup the timerlat thread
        tracing/user_events: Use long vs int for atomic bit ops
      8b817fde
    • Linus Torvalds's avatar
      Merge tag 'v6.4-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 7a6c8e51
      Linus Torvalds authored
      Pull crypto fix from Herbert Xu:
       "Fix an alignment crash in x86/aria"
      
      * tag 'v6.4-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: x86/aria - Use 16 byte alignment for GFNI constant vectors
      7a6c8e51
    • Linus Torvalds's avatar
      Revert "module: error out early on concurrent load of the same module file" · ac2263b5
      Linus Torvalds authored
      This reverts commit 9828ed3f
      
      .
      
      Sadly, it does seem to cause failures to load modules. Johan Hovold reports:
      
       "This change breaks module loading during boot on the Lenovo Thinkpad
        X13s (aarch64).
      
        Specifically it results in indefinite probe deferral of the display
        and USB (ethernet) which makes it a pain to debug. Typing in the dark
        to acquire some logs reveals that other modules are missing as well"
      
      Since this was applied late as a "let's try this", I'm reverting it
      asap, and we can try to figure out what goes wrong later.  The excessive
      parallel module loading problem is annoying, but not noticeable in
      normal situations, and this was only meant as an optimistic workaround
      for a user-space bug.
      
      One possible solution may be to do the optimistic exclusive open first,
      and then use a lock to serialize loading if that fails.
      
      Reported-by: default avatarJohan Hovold <johan@kernel.org>
      Link: https://lore.kernel.org/lkml/ZHRpH-JXAxA6DnzR@hovoldconsulting.com/
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ac2263b5
    • Steven Rostedt (Google)'s avatar
      tracing: Have function_graph selftest call cond_resched() · a2d910f0
      Steven Rostedt (Google) authored
      
      
      When all kernel debugging is enabled (lockdep, KSAN, etc), the function
      graph enabling and disabling can take several seconds to complete. The
      function_graph selftest enables and disables function graph tracing
      several times. With full debugging enabled, the soft lockup watchdog was
      triggering because the selftest was running without ever scheduling.
      
      Add cond_resched() throughout the test to make sure it does not trigger
      the soft lockup detector.
      
      Link: https://lkml.kernel.org/r/20230528051742.1325503-6-rostedt@goodmis.org
      
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      a2d910f0
    • Steven Rostedt (Google)'s avatar
      tracing: Only make selftest conditionals affect the global_trace · ac9d2cb1
      Steven Rostedt (Google) authored
      
      
      The tracing_selftest_running and tracing_selftest_disabled variables were
      to keep trace_printk() and other writes from affecting the tracing
      selftests, as the tracing selftests would examine the ring buffer to see
      if it contained what it expected or not. trace_printk() and friends could
      add to the ring buffer and cause the selftests to fail (and then disable
      the tracer that was being tested). To keep that from happening, these
      variables were added and would keep trace_printk() and friends from
      writing to the ring buffer while the tests were going on.
      
      But this was only the top level ring buffer (owned by the global_trace
      instance). There is no reason to prevent writing into ring buffers of
      other instances via the trace_array_printk() and friends. For the
      functions that could be used by other instances, check if the global_trace
      is the tracer instance that is being written to before deciding to not
      allow the write.
      
      Link: https://lkml.kernel.org/r/20230528051742.1325503-5-rostedt@goodmis.org
      
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      ac9d2cb1
    • Steven Rostedt (Google)'s avatar
      tracing: Make tracing_selftest_running/delete nops when not used · a3ae76d7
      Steven Rostedt (Google) authored
      
      
      There's no reason to test the condition variables tracing_selftest_running
      or tracing_selftest_delete when tracing selftests are not enabled. Make
      them define 0s when not the selftests are not configured in.
      
      Link: https://lkml.kernel.org/r/20230528051742.1325503-4-rostedt@goodmis.org
      
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      a3ae76d7
    • Steven Rostedt (Google)'s avatar
      tracing: Have tracer selftests call cond_resched() before running · 9da705d4
      Steven Rostedt (Google) authored
      
      
      As there are more and more internal selftests being added to the Linux
      kernel (KSAN, lockdep, etc) the selftests are taking longer to run when
      these are enabled. Add a cond_resched() to the calling of
      do_run_tracer_selftest() to force a schedule if NEED_RESCHED is set,
      otherwise the soft lockup watchdog may trigger on boot up.
      
      Link: https://lkml.kernel.org/r/20230528051742.1325503-3-rostedt@goodmis.org
      
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      9da705d4
    • Steven Rostedt (Google)'s avatar
      tracing: Move setting of tracing_selftest_running out of register_tracer() · e8352cf5
      Steven Rostedt (Google) authored
      
      
      The variables tracing_selftest_running and tracing_selftest_disabled are
      only used for when CONFIG_FTRACE_STARTUP_TEST is enabled. Make them only
      visible within the selftest code. The setting of those variables are in
      the register_tracer() call, and set in a location where they do not need
      to be. Create a wrapper around run_tracer_selftest() called
      do_run_tracer_selftest() which sets those variables, and have
      register_tracer() call that instead.
      
      Having those variables only set within the CONFIG_FTRACE_STARTUP_TEST
      scope gets rid of them (and also the ability to remove testing against
      them) when the startup tests are not enabled (most cases).
      
      Link: https://lkml.kernel.org/r/20230528051742.1325503-2-rostedt@goodmis.org
      
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      e8352cf5
    • Linus Torvalds's avatar
      Merge tag 'phy-fixes-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy · e338142b
      Linus Torvalds authored
      Pull phy fixes from Vinod Koul:
      
       - init count imbalance fix in qcom-qmp-pcie and combo drivers
      
       - kernel doc header fix for qcom-snps driver
      
       - mediatek floating point comparison fix
      
       - amlogic fix register value
      
      * tag 'phy-fixes-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy:
        phy: qcom-snps: correct struct qcom_snps_hsphy kerneldoc
        phy: amlogic: phy-meson-g12a-mipi-dphy-analog: fix CNTL2_DIF_TX_CTL0 value
        phy: mediatek: rework the floating point comparisons to fixed point
        phy: qcom-qmp-pcie-msm8996: fix init-count imbalance
        phy: qcom-qmp-combo: fix init-count imbalance
      e338142b
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · dca389eb
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
       "Driver fixes for the at-hdmac, pl330, TI and IDXD drivers:
      
         - AT HDMAC driver fixes for Flow Controller bitfield, peripheral ID
           handling and potential NULL dereference check
      
         - PL330 function rename to avoid conflicts
      
         - build warning fix for pm function in TI driver
      
         - IDXD driver fix for passing freed memory"
      
      * tag 'dmaengine-fix-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
        dmaengine: at_hdmac: Extend the Flow Controller bitfield to three bits
        dmaengine: at_hdmac: Repair bitfield macros for peripheral ID handling
        dmaengine: pl330: rename _start to prevent build error
        dmaengine: at_xdmac: fix potential Oops in at_xdmac_prep_interleaved()
        dmaengine: ti: k3-udma: annotate pm function with __maybe_unused
        dmaengine: idxd: Fix passing freed memory in idxd_cdev_open()
      dca389eb
    • Theodore Ts'o's avatar
      ext4: add EA_INODE checking to ext4_iget() · b3e6bcb9
      Theodore Ts'o authored
      
      
      Add a new flag, EXT4_IGET_EA_INODE which indicates whether the inode
      is expected to have the EA_INODE flag or not.  If the flag is not
      set/clear as expected, then fail the iget() operation and mark the
      file system as corrupted.
      
      This commit also makes the ext4_iget() always perform the
      is_bad_inode() check even when the inode is already inode cache.  This
      allows us to remove the is_bad_inode() check from the callers of
      ext4_iget() in the ea_inode code.
      
      Reported-by: default avatar <syzbot+cbb68193bdb95af4340a@syzkaller.appspotmail.com>
      Reported-by: default avatar <syzbot+62120febbd1ee3c3c860@syzkaller.appspotmail.com>
      Reported-by: default avatar <syzbot+edce54daffee36421b4c@syzkaller.appspotmail.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Link: https://lore.kernel.org/r/20230524034951.779531-2-tytso@mit.edu
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      b3e6bcb9
  5. May 28, 2023
    • Linus Torvalds's avatar
      Linux 6.4-rc4 · 7877cb91
      Linus Torvalds authored
      v6.4-rc4
      7877cb91
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2023-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f8b2507c
      Linus Torvalds authored
      Pull x86 cpu fix from Thomas Gleixner:
       "A single fix for x86:
      
         - Prevent a bogus setting for the number of HT siblings, which is
           caused by the CPUID evaluation trainwreck of X86. That recomputes
           the value for each CPU, so the last CPU "wins". That can cause
           completely bogus sibling values"
      
      * tag 'x86-urgent-2023-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/topology: Fix erroneous smp_num_siblings on Intel Hybrid platforms
      f8b2507c
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2023-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2d5438f4
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
       "A small set of perf fixes:
      
         - Make the MSR-readout based CHA discovery work around broken
           discovery tables in some SPR firmwares.
      
         - Prevent saving PEBS configuration which has software bits set that
           cause a crash when restored into the relevant MSR"
      
      * tag 'perf-urgent-2023-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/uncore: Correct the number of CHAs on SPR
        perf/x86/intel: Save/restore cpuc->active_pebs_data_cfg when using guest PEBS
      2d5438f4
    • Linus Torvalds's avatar
      Merge tag 'objtool-urgent-2023-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · abbf7fa1
      Linus Torvalds authored
      Pull unwinder fixes from Thomas Gleixner:
       "A set of unwinder and tooling fixes:
      
         - Ensure that the stack pointer on x86 is aligned again so that the
           unwinder does not read past the end of the stack
      
         - Discard .note.gnu.property section which has a pointlessly
           different alignment than the other note sections. That confuses
           tooling of all sorts including readelf, libbpf and pahole"
      
      * tag 'objtool-urgent-2023-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/show_trace_log_lvl: Ensure stack pointer is aligned, again
        vmlinux.lds.h: Discard .note.gnu.property section
      abbf7fa1