Changelog in Linux kernel 5.4.282

 
ACPI: battery: create alarm sysfs attribute atomically [+ + +]
Author: Thomas Weißschuh <[email protected]>
Date:   Sun Jun 9 09:27:16 2024 +0200

    ACPI: battery: create alarm sysfs attribute atomically
    
    [ Upstream commit a231eed10ed5a290129fda36ad7bcc263c53ff7d ]
    
    Let the power supply core register the attribute.
    This ensures that the attribute is created before the device is
    announced to userspace, avoid a race condition.
    
    Signed-off-by: Thomas Weißschuh <[email protected]>
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ACPI: SBS: manage alarm sysfs attribute through psy core [+ + +]
Author: Thomas Weißschuh <[email protected]>
Date:   Sun Jun 9 13:13:28 2024 +0200

    ACPI: SBS: manage alarm sysfs attribute through psy core
    
    [ Upstream commit 6bad28cfc30988a845fb3f59a99f4b8a4ce8fe95 ]
    
    Let the power supply core register the attribute.
    
    This ensures that the attribute is created before the device is
    announced to userspace, avoiding a race condition.
    
    Signed-off-by: Thomas Weißschuh <[email protected]>
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
af_packet: Handle outgoing VLAN packets without hardware offloading [+ + +]
Author: Chengen Du <[email protected]>
Date:   Sat Jul 13 19:47:35 2024 +0800

    af_packet: Handle outgoing VLAN packets without hardware offloading
    
    commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream.
    
    The issue initially stems from libpcap. The ethertype will be overwritten
    as the VLAN TPID if the network interface lacks hardware VLAN offloading.
    In the outbound packet path, if hardware VLAN offloading is unavailable,
    the VLAN tag is inserted into the payload but then cleared from the sk_buff
    struct. Consequently, this can lead to a false negative when checking for
    the presence of a VLAN tag, causing the packet sniffing outcome to lack
    VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing
    tool may be unable to parse packets as expected.
    
    The TCI-TPID is missing because the prb_fill_vlan_info() function does not
    modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the
    payload and not in the sk_buff struct. The skb_vlan_tag_present() function
    only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header
    is stripped, preventing the packet capturing tool from determining the
    correct TCI-TPID value. Additionally, the protocol in SLL is incorrect,
    which means the packet capturing tool cannot parse the L3 header correctly.
    
    Link: https://github.com/the-tcpdump-group/libpcap/issues/1105
    Link: https://lore.kernel.org/netdev/[email protected]/T/#u
    Fixes: 393e52e33c6c ("packet: deliver VLAN TCI to userspace")
    Cc: [email protected]
    Signed-off-by: Chengen Du <[email protected]>
    Reviewed-by: Willem de Bruijn <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ALSA: hda/hdmi: Yet more pin fix for HP EliteDesk 800 G4 [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Tue Aug 6 08:49:16 2024 +0200

    ALSA: hda/hdmi: Yet more pin fix for HP EliteDesk 800 G4
    
    commit 176fd1511dd9086ab4fa9323cb232177c6235288 upstream.
    
    HP EliteDesk 800 G4 (PCI SSID 103c:83e2) is another Kabylake machine
    where BIOS misses the HDMI pin initializations.  Add the quirk entry.
    
    Cc: <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: hda: Add HP MP9 G4 Retail System AMS to force connect list [+ + +]
Author: Steven 'Steve' Kendall <[email protected]>
Date:   Tue Aug 6 00:08:24 2024 +0000

    ALSA: hda: Add HP MP9 G4 Retail System AMS to force connect list
    
    commit 7e1e206b99f4b3345aeb49d94584a420b7887f1d upstream.
    
    In recent HP UEFI firmware (likely v2.15 and above, tested on 2.27),
    these pins are incorrectly set for HDMI/DP audio. Tested on
    HP MP9 G4 Retail System AMS. Tested audio with two monitors connected
    via DisplayPort.
    
    Link: https://forum.manjaro.org/t/intel-cannon-lake-pch-cavs-conexant-cx20632-no-sound-at-hdmi-or-displayport/133494
    Link: https://bbs.archlinux.org/viewtopic.php?id=270523
    Signed-off-by: Steven 'Steve' Kendall <[email protected]>
    Cc: <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: line6: Fix racy access to midibuf [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Mon Aug 5 15:01:28 2024 +0200

    ALSA: line6: Fix racy access to midibuf
    
    commit 15b7a03205b31bc5623378c190d22b7ff60026f1 upstream.
    
    There can be concurrent accesses to line6 midibuf from both the URB
    completion callback and the rawmidi API access.  This could be a cause
    of KMSAN warning triggered by syzkaller below (so put as reported-by
    here).
    
    This patch protects the midibuf call of the former code path with a
    spinlock for avoiding the possible races.
    
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/[email protected]
    Cc: <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: usb-audio: Correct surround channels in UAC1 channel map [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Wed Jul 31 16:19:41 2024 +0200

    ALSA: usb-audio: Correct surround channels in UAC1 channel map
    
    commit b7b7e1ab7619deb3b299b5e5c619c3e6f183a12d upstream.
    
    USB-audio driver puts SNDRV_CHMAP_SL and _SR as left and right
    surround channels for UAC1 channel map, respectively.  But they should
    have been SNDRV_CHMAP_RL and _RR; the current value *_SL and _SR are
    rather "side" channels, not "surround".  I guess I took those
    mistakenly when I read the spec mentioning "surround left".
    
    This patch corrects those entries to be the right channels.
    
    Suggested-by: Sylvain BERTRAND <[email protected]>
    Closes: https://lore.kernel.orgZ/qIyJD8lhd8hFhlC@freedom
    Fixes: 04324ccc75f9 ("ALSA: usb-audio: add channel map support")
    Cc: <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
apparmor: Fix null pointer deref when receiving skb during sock creation [+ + +]
Author: Xiao Liang <[email protected]>
Date:   Sat Sep 2 08:48:38 2023 +0800

    apparmor: Fix null pointer deref when receiving skb during sock creation
    
    [ Upstream commit fce09ea314505a52f2436397608fa0a5d0934fb1 ]
    
    The panic below is observed when receiving ICMP packets with secmark set
    while an ICMP raw socket is being created. SK_CTX(sk)->label is updated
    in apparmor_socket_post_create(), but the packet is delivered to the
    socket before that, causing the null pointer dereference.
    Drop the packet if label context is not set.
    
        BUG: kernel NULL pointer dereference, address: 000000000000004c
        #PF: supervisor read access in kernel mode
        #PF: error_code(0x0000) - not-present page
        PGD 0 P4D 0
        Oops: 0000 [#1] PREEMPT SMP NOPTI
        CPU: 0 PID: 407 Comm: a.out Not tainted 6.4.12-arch1-1 #1 3e6fa2753a2d75925c34ecb78e22e85a65d083df
        Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/28/2020
        RIP: 0010:aa_label_next_confined+0xb/0x40
        Code: 00 00 48 89 ef e8 d5 25 0c 00 e9 66 ff ff ff 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 0f 1f 00 0f 1f 44 00 00 89 f0 <8b> 77 4c 39 c6 7e 1f 48 63 d0 48 8d 14 d7 eb 0b 83 c0 01 48 83 c2
        RSP: 0018:ffffa92940003b08 EFLAGS: 00010246
        RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000000000000e
        RDX: ffffa92940003be8 RSI: 0000000000000000 RDI: 0000000000000000
        RBP: ffff8b57471e7800 R08: ffff8b574c642400 R09: 0000000000000002
        R10: ffffffffbd820eeb R11: ffffffffbeb7ff00 R12: ffff8b574c642400
        R13: 0000000000000001 R14: 0000000000000001 R15: 0000000000000000
        FS:  00007fb092ea7640(0000) GS:ffff8b577bc00000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 000000000000004c CR3: 00000001020f2005 CR4: 00000000007706f0
        PKRU: 55555554
        Call Trace:
         <IRQ>
         ? __die+0x23/0x70
         ? page_fault_oops+0x171/0x4e0
         ? exc_page_fault+0x7f/0x180
         ? asm_exc_page_fault+0x26/0x30
         ? aa_label_next_confined+0xb/0x40
         apparmor_secmark_check+0xec/0x330
         security_sock_rcv_skb+0x35/0x50
         sk_filter_trim_cap+0x47/0x250
         sock_queue_rcv_skb_reason+0x20/0x60
         raw_rcv+0x13c/0x210
         raw_local_deliver+0x1f3/0x250
         ip_protocol_deliver_rcu+0x4f/0x2f0
         ip_local_deliver_finish+0x76/0xa0
         __netif_receive_skb_one_core+0x89/0xa0
         netif_receive_skb+0x119/0x170
         ? __netdev_alloc_skb+0x3d/0x140
         vmxnet3_rq_rx_complete+0xb23/0x1010 [vmxnet3 56a84f9c97178c57a43a24ec073b45a9d6f01f3a]
         vmxnet3_poll_rx_only+0x36/0xb0 [vmxnet3 56a84f9c97178c57a43a24ec073b45a9d6f01f3a]
         __napi_poll+0x28/0x1b0
         net_rx_action+0x2a4/0x380
         __do_softirq+0xd1/0x2c8
         __irq_exit_rcu+0xbb/0xf0
         common_interrupt+0x86/0xa0
         </IRQ>
         <TASK>
         asm_common_interrupt+0x26/0x40
        RIP: 0010:apparmor_socket_post_create+0xb/0x200
        Code: 08 48 85 ff 75 a1 eb b1 0f 1f 80 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 0f 1f 44 00 00 41 54 <55> 48 89 fd 53 45 85 c0 0f 84 b2 00 00 00 48 8b 1d 80 56 3f 02 48
        RSP: 0018:ffffa92940ce7e50 EFLAGS: 00000286
        RAX: ffffffffbc756440 RBX: 0000000000000000 RCX: 0000000000000001
        RDX: 0000000000000003 RSI: 0000000000000002 RDI: ffff8b574eaab740
        RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000
        R10: ffff8b57444cec70 R11: 0000000000000000 R12: 0000000000000003
        R13: 0000000000000002 R14: ffff8b574eaab740 R15: ffffffffbd8e4748
         ? __pfx_apparmor_socket_post_create+0x10/0x10
         security_socket_post_create+0x4b/0x80
         __sock_create+0x176/0x1f0
         __sys_socket+0x89/0x100
         __x64_sys_socket+0x17/0x20
         do_syscall_64+0x5d/0x90
         ? do_syscall_64+0x6c/0x90
         ? do_syscall_64+0x6c/0x90
         ? do_syscall_64+0x6c/0x90
         entry_SYSCALL_64_after_hwframe+0x72/0xdc
    
    Fixes: ab9f2115081a ("apparmor: Allow filtering based on secmark policy")
    Signed-off-by: Xiao Liang <[email protected]>
    Signed-off-by: John Johansen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
arm64: Add Neoverse-V2 part [+ + +]
Author: Besar Wicaksono <[email protected]>
Date:   Fri Aug 9 11:34:15 2024 +0100

    arm64: Add Neoverse-V2 part
    
    [ Upstream commit f4d9d9dcc70b96b5e5d7801bd5fbf8491b07b13d ]
    
    Add the part number and MIDR for Neoverse-V2
    
    Signed-off-by: Besar Wicaksono <[email protected]>
    Reviewed-by: James Clark <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    [ Mark: trivial backport ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: cpufeature: Fix the visibility of compat hwcaps [+ + +]
Author: Amit Daniel Kachhap <[email protected]>
Date:   Thu Nov 3 13:52:32 2022 +0530

    arm64: cpufeature: Fix the visibility of compat hwcaps
    
    commit 85f1506337f0c79a4955edfeee86a18628e3735f upstream.
    
    Commit 237405ebef58 ("arm64: cpufeature: Force HWCAP to be based on the
    sysreg visible to user-space") forced the hwcaps to use sanitised
    user-space view of the id registers. However, the ID register structures
    used to select few compat cpufeatures (vfp, crc32, ...) are masked and
    hence such hwcaps do not appear in /proc/cpuinfo anymore for PER_LINUX32
    personality.
    
    Add the ID register structures explicitly and set the relevant entry as
    visible. As these ID registers are now of type visible so make them
    available in 64-bit userspace by making necessary changes in register
    emulation logic and documentation.
    
    While at it, update the comment for structure ftr_generic_32bits[] which
    lists the ID register that use it.
    
    Fixes: 237405ebef58 ("arm64: cpufeature: Force HWCAP to be based on the sysreg visible to user-space")
    Cc: Suzuki K Poulose <[email protected]>
    Reviewed-by: James Morse <[email protected]>
    Signed-off-by: Amit Daniel Kachhap <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Catalin Marinas <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

arm64: cpufeature: Force HWCAP to be based on the sysreg visible to user-space [+ + +]
Author: James Morse <[email protected]>
Date:   Fri Aug 9 11:34:14 2024 +0100

    arm64: cpufeature: Force HWCAP to be based on the sysreg visible to user-space
    
    [ Upstream commit 237405ebef580a7352a52129b2465c117145eafa ]
    
    arm64 advertises hardware features to user-space via HWCAPs, and by
    emulating access to the CPUs id registers. The cpufeature code has a
    sanitised system-wide view of an id register, and a sanitised user-space
    view of an id register, where some features use their 'safe' value
    instead of the hardware value.
    
    It is currently possible for a HWCAP to be advertised where the user-space
    view of the id register does not show the feature as supported.
    Erratum workaround need to remove both the HWCAP, and the feature from
    the user-space view of the id register. This involves duplicating the
    code, and spreading it over cpufeature.c and cpu_errata.c.
    
    Make the HWCAP code use the user-space view of id registers. This ensures
    the values never diverge, and allows erratum workaround to remove HWCAP
    by modifying the user-space view of the id register.
    
    Signed-off-by: James Morse <[email protected]>
    Reviewed-by: Suzuki K Poulose <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Catalin Marinas <[email protected]>
    [ Mark: fixup lack of 'width' parameter ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: cputype: Add Cortex-A720 definitions [+ + +]
Author: Mark Rutland <[email protected]>
Date:   Fri Aug 9 11:34:20 2024 +0100

    arm64: cputype: Add Cortex-A720 definitions
    
    [ Upstream commit add332c40328cf06fe35e4b3cde8ec315c4629e5 ]
    
    Add cputype definitions for Cortex-A720. These will be used for errata
    detection in subsequent patches.
    
    These values can be found in Table A-186 ("MIDR_EL1 bit descriptions")
    in issue 0002-05 of the Cortex-A720 TRM, which can be found at:
    
      https://developer.arm.com/documentation/102530/0002/?lang=en
    
    Signed-off-by: Mark Rutland <[email protected]>
    Cc: James Morse <[email protected]>
    Cc: Will Deacon <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Catalin Marinas <[email protected]>
    [ Mark: trivial backport ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: cputype: Add Cortex-A725 definitions [+ + +]
Author: Mark Rutland <[email protected]>
Date:   Fri Aug 9 11:34:25 2024 +0100

    arm64: cputype: Add Cortex-A725 definitions
    
    [ Upstream commit 9ef54a384526911095db465e77acc1cb5266b32c ]
    
    Add cputype definitions for Cortex-A725. These will be used for errata
    detection in subsequent patches.
    
    These values can be found in the Cortex-A725 TRM:
    
      https://developer.arm.com/documentation/107652/0001/
    
    ... in table A-247 ("MIDR_EL1 bit descriptions").
    
    Signed-off-by: Mark Rutland <[email protected]>
    Cc: James Morse <[email protected]>
    Cc: Will Deacon <[email protected]>
    Reviewed-by: Anshuman Khandual <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Catalin Marinas <[email protected]>
    [ Mark: trivial backport ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: cputype: Add Cortex-X1C definitions [+ + +]
Author: Mark Rutland <[email protected]>
Date:   Fri Aug 9 11:34:24 2024 +0100

    arm64: cputype: Add Cortex-X1C definitions
    
    [ Upstream commit 58d245e03c324d083a0ec3b9ab8ebd46ec9848d7 ]
    
    Add cputype definitions for Cortex-X1C. These will be used for errata
    detection in subsequent patches.
    
    These values can be found in the Cortex-X1C TRM:
    
      https://developer.arm.com/documentation/101968/0002/
    
    ... in section B2.107 ("MIDR_EL1, Main ID Register, EL1").
    
    Signed-off-by: Mark Rutland <[email protected]>
    Cc: James Morse <[email protected]>
    Cc: Will Deacon <[email protected]>
    Reviewed-by: Anshuman Khandual <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Catalin Marinas <[email protected]>
    [ Mark: trivial backport ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: cputype: Add Cortex-X3 definitions [+ + +]
Author: Mark Rutland <[email protected]>
Date:   Fri Aug 9 11:34:19 2024 +0100

    arm64: cputype: Add Cortex-X3 definitions
    
    [ Upstream commit be5a6f238700f38b534456608588723fba96c5ab ]
    
    Add cputype definitions for Cortex-X3. These will be used for errata
    detection in subsequent patches.
    
    These values can be found in Table A-263 ("MIDR_EL1 bit descriptions")
    in issue 07 of the Cortex-X3 TRM, which can be found at:
    
      https://developer.arm.com/documentation/101593/0102/?lang=en
    
    Signed-off-by: Mark Rutland <[email protected]>
    Cc: James Morse <[email protected]>
    Cc: Will Deacon <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Catalin Marinas <[email protected]>
    [ Mark: trivial backport ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: cputype: Add Cortex-X4 definitions [+ + +]
Author: Mark Rutland <[email protected]>
Date:   Fri Aug 9 11:34:16 2024 +0100

    arm64: cputype: Add Cortex-X4 definitions
    
    [ Upstream commit 02a0a04676fa7796d9cbc9eb5ca120aaa194d2dd ]
    
    Add cputype definitions for Cortex-X4. These will be used for errata
    detection in subsequent patches.
    
    These values can be found in Table B-249 ("MIDR_EL1 bit descriptions")
    in issue 0002-05 of the Cortex-X4 TRM, which can be found at:
    
      https://developer.arm.com/documentation/102484/0002/?lang=en
    
    Signed-off-by: Mark Rutland <[email protected]>
    Cc: Catalin Marinas <[email protected]>
    Cc: James Morse <[email protected]>
    Cc: Will Deacon <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    [ Mark: fix conflict (dealt with upstream via a later merge) ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: cputype: Add Cortex-X925 definitions [+ + +]
Author: Mark Rutland <[email protected]>
Date:   Fri Aug 9 11:34:21 2024 +0100

    arm64: cputype: Add Cortex-X925 definitions
    
    [ Upstream commit fd2ff5f0b320f418288e7a1f919f648fbc8a0dfc ]
    
    Add cputype definitions for Cortex-X925. These will be used for errata
    detection in subsequent patches.
    
    These values can be found in Table A-285 ("MIDR_EL1 bit descriptions")
    in issue 0001-05 of the Cortex-X925 TRM, which can be found at:
    
      https://developer.arm.com/documentation/102807/0001/?lang=en
    
    Signed-off-by: Mark Rutland <[email protected]>
    Cc: James Morse <[email protected]>
    Cc: Will Deacon <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Catalin Marinas <[email protected]>
    [ Mark: trivial backport ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: cputype: Add Neoverse-V3 definitions [+ + +]
Author: Mark Rutland <[email protected]>
Date:   Fri Aug 9 11:34:17 2024 +0100

    arm64: cputype: Add Neoverse-V3 definitions
    
    [ Upstream commit 0ce85db6c2141b7ffb95709d76fc55a27ff3cdc1 ]
    
    Add cputype definitions for Neoverse-V3. These will be used for errata
    detection in subsequent patches.
    
    These values can be found in Table B-249 ("MIDR_EL1 bit descriptions")
    in issue 0001-04 of the Neoverse-V3 TRM, which can be found at:
    
      https://developer.arm.com/documentation/107734/0001/?lang=en
    
    Signed-off-by: Mark Rutland <[email protected]>
    Cc: Catalin Marinas <[email protected]>
    Cc: James Morse <[email protected]>
    Cc: Will Deacon <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    [ Mark: trivial backport ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: dts: amlogic: gx: correct hdmi clocks [+ + +]
Author: Jerome Brunet <[email protected]>
Date:   Wed Jun 26 17:27:30 2024 +0200

    arm64: dts: amlogic: gx: correct hdmi clocks
    
    [ Upstream commit 0602ba0dcd0e76067a0b7543e92b2de3fb231073 ]
    
    The clocks provided to HDMI tx are not consistent between gx and g12:
    * gx receives the peripheral clock as 'isfr' while g12 receives it as
      'iahb'
    * g12 gets the HDMI system clock as 'isfr' but gx does not even get it.
      It surely needs that clock since the driver is directly poking around
      the clock controller's registers for that clock.
    
    Align gx SoCs with g12 and provide:
     * the HDMI peripheral clock as 'iahb'
     * the HDMI system clock as 'isfr'
    
    Fixes: 6939db7e0dbf ("ARM64: dts: meson-gx: Add support for HDMI output")
    Signed-off-by: Jerome Brunet <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Neil Armstrong <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: dts: mediatek: mt7622: fix "emmc" pinctrl mux [+ + +]
Author: Rafał Miłecki <[email protected]>
Date:   Tue Jun 4 09:49:16 2024 +0200

    arm64: dts: mediatek: mt7622: fix "emmc" pinctrl mux
    
    [ Upstream commit aebba1030a5766cdf894ed4ab0cac7aed5aee9c1 ]
    
    Value "emmc_rst" is a group name and should be part of the "groups"
    property.
    
    This fixes:
    arch/arm64/boot/dts/mediatek/mt7622-rfb1.dtb: pinctrl@10211000: emmc-pins-default:mux:function: ['emmc', 'emmc_rst'] is too long
            from schema $id: http://devicetree.org/schemas/pinctrl/mediatek,mt7622-pinctrl.yaml#
    arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dtb: pinctrl@10211000: emmc-pins-default:mux:function: ['emmc', 'emmc_rst'] is too long
            from schema $id: http://devicetree.org/schemas/pinctrl/mediatek,mt7622-pinctrl.yaml#
    
    Fixes: 3725ba3f5574 ("arm64: dts: mt7622: add pinctrl related device nodes")
    Fixes: 0b6286dd96c0 ("arm64: dts: mt7622: add bananapi BPI-R64 board")
    Signed-off-by: Rafał Miłecki <[email protected]>
    Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: dts: qcom: msm8996: specify UFS core_clk frequencies [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Mon Apr 8 03:04:31 2024 +0300

    arm64: dts: qcom: msm8996: specify UFS core_clk frequencies
    
    [ Upstream commit 02f838b7f8cdfb7a96b7f08e7f6716f230bdecba ]
    
    Follow the example of other platforms and specify core_clk frequencies
    in the frequency table in addition to the core_clk_src frequencies. The
    driver should be setting the leaf frequency instead of some interim
    clock freq.
    
    Suggested-by: Nitin Rawat <[email protected]>
    Fixes: 57fc67ef0d35 ("arm64: dts: qcom: msm8996: Add ufs related nodes")
    Reviewed-by: Konrad Dybcio <[email protected]>
    Reviewed-by: Manivannan Sadhasivam <[email protected]>
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: dts: qcom: sdm845: add power-domain to UFS PHY [+ + +]
Author: Dmitry Baryshkov <[email protected]>
Date:   Wed May 1 19:19:32 2024 +0300

    arm64: dts: qcom: sdm845: add power-domain to UFS PHY
    
    [ Upstream commit fd39ae8b9bc10419b1e4b849cdbc6755a967ade1 ]
    
    The UFS PHY is powered on via the UFS_PHY_GDSC power domain. Add
    corresponding power-domain the the PHY node.
    
    Fixes: cc16687fbd74 ("arm64: dts: qcom: sdm845: add UFS controller")
    Signed-off-by: Dmitry Baryshkov <[email protected]>
    Reviewed-by: Konrad Dybcio <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: dts: rockchip: Increase VOP clk rate on RK3328 [+ + +]
Author: Jonas Karlman <[email protected]>
Date:   Sat Jun 15 17:03:52 2024 +0000

    arm64: dts: rockchip: Increase VOP clk rate on RK3328
    
    [ Upstream commit 0f2ddb128fa20f8441d903285632f2c69e90fae1 ]
    
    The VOP on RK3328 needs to run at a higher rate in order to produce a
    proper 3840x2160 signal.
    
    Change to use 300MHz for VIO clk and 400MHz for VOP clk, same rates used
    by vendor 4.4 kernel.
    
    Fixes: 52e02d377a72 ("arm64: dts: rockchip: add core dtsi file for RK3328 SoCs")
    Signed-off-by: Jonas Karlman <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Heiko Stuebner <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: errata: Add workaround for Arm errata 3194386 and 3312417 [+ + +]
Author: Mark Rutland <[email protected]>
Date:   Fri Aug 9 11:34:18 2024 +0100

    arm64: errata: Add workaround for Arm errata 3194386 and 3312417
    
    [ Upstream commit 7187bb7d0b5c7dfa18ca82e9e5c75e13861b1d88 ]
    
    Cortex-X4 and Neoverse-V3 suffer from errata whereby an MSR to the SSBS
    special-purpose register does not affect subsequent speculative
    instructions, permitting speculative store bypassing for a window of
    time. This is described in their Software Developer Errata Notice (SDEN)
    documents:
    
    * Cortex-X4 SDEN v8.0, erratum 3194386:
      https://developer.arm.com/documentation/SDEN-2432808/0800/
    
    * Neoverse-V3 SDEN v6.0, erratum 3312417:
      https://developer.arm.com/documentation/SDEN-2891958/0600/
    
    To workaround these errata, it is necessary to place a speculation
    barrier (SB) after MSR to the SSBS special-purpose register. This patch
    adds the requisite SB after writes to SSBS within the kernel, and hides
    the presence of SSBS from EL0 such that userspace software which cares
    about SSBS will manipulate this via prctl(PR_GET_SPECULATION_CTRL, ...).
    
    Signed-off-by: Mark Rutland <[email protected]>
    Cc: Catalin Marinas <[email protected]>
    Cc: James Morse <[email protected]>
    Cc: Will Deacon <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Will Deacon <[email protected]>
    [ Mark: fix conflicts & renames, drop unneeded cpucaps.h, fold in user_feature_fixup() ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: errata: Expand speculative SSBS workaround [+ + +]
Author: Mark Rutland <[email protected]>
Date:   Fri Aug 9 11:34:23 2024 +0100

    arm64: errata: Expand speculative SSBS workaround
    
    [ Upstream commit 75b3c43eab594bfbd8184ec8ee1a6b820950819a ]
    
    A number of Arm Ltd CPUs suffer from errata whereby an MSR to the SSBS
    special-purpose register does not affect subsequent speculative
    instructions, permitting speculative store bypassing for a window of
    time.
    
    We worked around this for Cortex-X4 and Neoverse-V3, in commit:
    
      7187bb7d0b5c7dfa ("arm64: errata: Add workaround for Arm errata 3194386 and 3312417")
    
    ... as per their Software Developer Errata Notice (SDEN) documents:
    
    * Cortex-X4 SDEN v8.0, erratum 3194386:
      https://developer.arm.com/documentation/SDEN-2432808/0800/
    
    * Neoverse-V3 SDEN v6.0, erratum 3312417:
      https://developer.arm.com/documentation/SDEN-2891958/0600/
    
    Since then, similar errata have been published for a number of other Arm Ltd
    CPUs, for which the mitigation is the same. This is described in their
    respective SDEN documents:
    
    * Cortex-A710 SDEN v19.0, errataum 3324338
      https://developer.arm.com/documentation/SDEN-1775101/1900/?lang=en
    
    * Cortex-A720 SDEN v11.0, erratum 3456091
      https://developer.arm.com/documentation/SDEN-2439421/1100/?lang=en
    
    * Cortex-X2 SDEN v19.0, erratum 3324338
      https://developer.arm.com/documentation/SDEN-1775100/1900/?lang=en
    
    * Cortex-X3 SDEN v14.0, erratum 3324335
      https://developer.arm.com/documentation/SDEN-2055130/1400/?lang=en
    
    * Cortex-X925 SDEN v8.0, erratum 3324334
      https://developer.arm.com/documentation/109108/800/?lang=en
    
    * Neoverse-N2 SDEN v17.0, erratum 3324339
      https://developer.arm.com/documentation/SDEN-1982442/1700/?lang=en
    
    * Neoverse-V2 SDEN v9.0, erratum 3324336
      https://developer.arm.com/documentation/SDEN-2332927/900/?lang=en
    
    Note that due to shared design lineage, some CPUs share the same erratum
    number.
    
    Add these to the existing mitigation under CONFIG_ARM64_ERRATUM_3194386.
    As listing all of the erratum IDs in the runtime description would be
    unwieldy, this is reduced to:
    
            "SSBS not fully self-synchronizing"
    
    ... matching the description of the errata in all of the SDENs.
    
    Signed-off-by: Mark Rutland <[email protected]>
    Cc: James Morse <[email protected]>
    Cc: Will Deacon <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Catalin Marinas <[email protected]>
    [ Mark: fix conflicts and renames ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: errata: Expand speculative SSBS workaround (again) [+ + +]
Author: Mark Rutland <[email protected]>
Date:   Fri Aug 9 11:34:26 2024 +0100

    arm64: errata: Expand speculative SSBS workaround (again)
    
    [ Upstream commit adeec61a4723fd3e39da68db4cc4d924e6d7f641 ]
    
    A number of Arm Ltd CPUs suffer from errata whereby an MSR to the SSBS
    special-purpose register does not affect subsequent speculative
    instructions, permitting speculative store bypassing for a window of
    time.
    
    We worked around this for a number of CPUs in commits:
    
    * 7187bb7d0b5c7dfa ("arm64: errata: Add workaround for Arm errata 3194386 and 3312417")
    * 75b3c43eab594bfb ("arm64: errata: Expand speculative SSBS workaround")
    
    Since then, similar errata have been published for a number of other Arm
    Ltd CPUs, for which the same mitigation is sufficient. This is described
    in their respective Software Developer Errata Notice (SDEN) documents:
    
    * Cortex-A76 (MP052) SDEN v31.0, erratum 3324349
      https://developer.arm.com/documentation/SDEN-885749/3100/
    
    * Cortex-A77 (MP074) SDEN v19.0, erratum 3324348
      https://developer.arm.com/documentation/SDEN-1152370/1900/
    
    * Cortex-A78 (MP102) SDEN v21.0, erratum 3324344
      https://developer.arm.com/documentation/SDEN-1401784/2100/
    
    * Cortex-A78C (MP138) SDEN v16.0, erratum 3324346
      https://developer.arm.com/documentation/SDEN-1707916/1600/
    
    * Cortex-A78C (MP154) SDEN v10.0, erratum 3324347
      https://developer.arm.com/documentation/SDEN-2004089/1000/
    
    * Cortex-A725 (MP190) SDEN v5.0, erratum 3456106
      https://developer.arm.com/documentation/SDEN-2832921/0500/
    
    * Cortex-X1 (MP077) SDEN v21.0, erratum 3324344
      https://developer.arm.com/documentation/SDEN-1401782/2100/
    
    * Cortex-X1C (MP136) SDEN v16.0, erratum 3324346
      https://developer.arm.com/documentation/SDEN-1707914/1600/
    
    * Neoverse-N1 (MP050) SDEN v32.0, erratum 3324349
      https://developer.arm.com/documentation/SDEN-885747/3200/
    
    * Neoverse-V1 (MP076) SDEN v19.0, erratum 3324341
      https://developer.arm.com/documentation/SDEN-1401781/1900/
    
    Note that due to the manner in which Arm develops IP and tracks errata,
    some CPUs share a common erratum number and some CPUs have multiple
    erratum numbers for the same HW issue.
    
    On parts without SB, it is necessary to use ISB for the workaround. The
    spec_bar() macro used in the mitigation will expand to a "DSB SY; ISB"
    sequence in this case, which is sufficient on all affected parts.
    
    Enable the existing mitigation by adding the relevant MIDRs to
    erratum_spec_ssbs_list. The list is sorted alphanumerically (involving
    moving Neoverse-V3 after Neoverse-V2) so that this is easy to audit and
    potentially extend again in future. The Kconfig text is also updated to
    clarify the set of affected parts and the mitigation.
    
    Signed-off-by: Mark Rutland <[email protected]>
    Cc: James Morse <[email protected]>
    Cc: Will Deacon <[email protected]>
    Reviewed-by: Anshuman Khandual <[email protected]>
    Acked-by: Will Deacon <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Catalin Marinas <[email protected]>
    [ Mark: fix conflicts in silicon-errata.rst ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

arm64: errata: Unify speculative SSBS errata logic [+ + +]
Author: Mark Rutland <[email protected]>
Date:   Fri Aug 9 11:34:22 2024 +0100

    arm64: errata: Unify speculative SSBS errata logic
    
    [ Upstream commit ec768766608092087dfb5c1fc45a16a6f524dee2 ]
    
    Cortex-X4 erratum 3194386 and Neoverse-V3 erratum 3312417 are identical,
    with duplicate Kconfig text and some unsightly ifdeffery. While we try
    to share code behind CONFIG_ARM64_WORKAROUND_SPECULATIVE_SSBS, having
    separate options results in a fair amount of boilerplate code, and this
    will only get worse as we expand the set of affected CPUs.
    
    To reduce this boilerplate, unify the two behind a common Kconfig
    option. This removes the duplicate text and Kconfig logic, and removes
    the need for the intermediate ARM64_WORKAROUND_SPECULATIVE_SSBS option.
    The set of affected CPUs is described as a list so that this can easily
    be extended.
    
    I've used ARM64_ERRATUM_3194386 (matching the Neoverse-V3 erratum ID) as
    the common option, matching the way we use ARM64_ERRATUM_1319367 to
    cover Cortex-A57 erratum 1319537 and Cortex-A72 erratum 1319367.
    
    Signed-off-by: Mark Rutland <[email protected]>
    Cc: James Morse <[email protected]>
    Cc: Will Deacon <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Catalin Marinas <[email protected]>
    [ Mark: fix conflicts & renames, drop unneeded cpucaps.h ]
    Signed-off-by: Mark Rutland <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
ARM: dts: imx6qdl-kontron-samx6i: fix board reset [+ + +]
Author: Michael Walle <[email protected]>
Date:   Mon Jun 17 11:13:31 2024 +0200

    ARM: dts: imx6qdl-kontron-samx6i: fix board reset
    
    [ Upstream commit b972d6b3b46345023aee56a95df8e2c137aa4ee4 ]
    
    On i.MX6 the board is reset by the watchdog. But in turn to do a
    complete board reset, we have to assert the WDOG_B output which is
    routed also to the CPLD which then do a complete power-cycle of the
    board.
    
    Fixes: 2125212785c9 ("ARM: dts: imx6qdl-kontron-samx6i: add Kontron SMARC SoM Support")
    Signed-off-by: Michael Walle <[email protected]>
    Signed-off-by: Shawn Guo <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ARM: dts: imx6qdl-kontron-samx6i: fix PCIe reset polarity [+ + +]
Author: Michael Walle <[email protected]>
Date:   Mon Jun 17 11:13:38 2024 +0200

    ARM: dts: imx6qdl-kontron-samx6i: fix PCIe reset polarity
    
    [ Upstream commit df35c6e9027cf9affe699e632a48082ab1bbba4c ]
    
    The PCIe reset line is active low. Fix it.
    
    Fixes: 2a51f9dae13d ("ARM: dts: imx6qdl-kontron-samx6i: Add iMX6-based Kontron SMARC-sAMX6i module")
    Signed-off-by: Michael Walle <[email protected]>
    Signed-off-by: Shawn Guo <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ARM: dts: imx6qdl-kontron-samx6i: fix PHY reset [+ + +]
Author: Michael Walle <[email protected]>
Date:   Mon Jun 17 11:13:30 2024 +0200

    ARM: dts: imx6qdl-kontron-samx6i: fix PHY reset
    
    [ Upstream commit edfea889a049abe80f0d55c0365bf60fbade272f ]
    
    The PHY reset line is connected to both the SoC (GPIO1_25) and
    the CPLD. We must not use the GPIO1_25 as it will drive against
    the output buffer of the CPLD. Instead there is another GPIO
    (GPIO2_01), an input to the CPLD, which will tell the CPLD to
    assert the PHY reset line.
    
    Fixes: 2a51f9dae13d ("ARM: dts: imx6qdl-kontron-samx6i: Add iMX6-based Kontron SMARC-sAMX6i module")
    Fixes: 5694eed98cca ("ARM: dts: imx6qdl-kontron-samx6i: move phy reset into phy-node")
    Signed-off-by: Michael Walle <[email protected]>
    Signed-off-by: Shawn Guo <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ARM: dts: imx6qdl-kontron-samx6i: fix phy-mode [+ + +]
Author: Michael Walle <[email protected]>
Date:   Mon Jun 17 11:13:29 2024 +0200

    ARM: dts: imx6qdl-kontron-samx6i: fix phy-mode
    
    commit 0df3c7d7a73d75153090637392c0b73a63cdc24a upstream.
    
    The i.MX6 cannot add any RGMII delays. The PHY has to add both the RX
    and TX delays on the RGMII interface. Fix the interface mode. While at
    it, use the new phy-connection-type property name.
    
    Fixes: 5694eed98cca ("ARM: dts: imx6qdl-kontron-samx6i: move phy reset into phy-node")
    Signed-off-by: Michael Walle <[email protected]>
    Signed-off-by: Shawn Guo <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ARM: dts: imx6qdl-kontron-samx6i: move phy reset into phy-node [+ + +]
Author: Marco Felsch <[email protected]>
Date:   Tue Jul 26 15:05:20 2022 +0200

    ARM: dts: imx6qdl-kontron-samx6i: move phy reset into phy-node
    
    [ Upstream commit 5694eed98cca5c164ebb5b831b65b4c9eee4b2d5 ]
    
    Add ethernet-phy node so we can drop the deprecated fec phy-reset-gpios
    property. The reset-assert-us value is taken from the existing logic
    since the fec driver will add an 1ms assert delay per default if
    phy-reset-gpios is used and phy-reset-duration is not specified.
    
    Signed-off-by: Marco Felsch <[email protected]>
    Signed-off-by: Shawn Guo <[email protected]>
    Stable-dep-of: edfea889a049 ("ARM: dts: imx6qdl-kontron-samx6i: fix PHY reset")
    Signed-off-by: Sasha Levin <[email protected]>

 
ASoC: Intel: Convert to new X86 CPU match macros [+ + +]
Author: Thomas Gleixner <[email protected]>
Date:   Fri Mar 20 14:14:04 2020 +0100

    ASoC: Intel: Convert to new X86 CPU match macros
    
    [ Upstream commit d51ba9c6663d7171681be357f672503f4e2ccdc1 ]
    
    The new macro set has a consistent namespace and uses C99 initializers
    instead of the grufty C89 ones.
    
    Get rid the of the local macro wrappers for consistency.
    
    Signed-off-by: Thomas Gleixner <[email protected]>
    Signed-off-by: Borislav Petkov <[email protected]>
    Reviewed-by: Greg Kroah-Hartman <[email protected]>
    Link: https://lkml.kernel.org/r/[email protected]
    Stable-dep-of: 9931f7d5d251 ("ASoC: Intel: use soc_intel_is_byt_cr() only when IOSF_MBI is reachable")
    Signed-off-by: Sasha Levin <[email protected]>

ASoC: Intel: Move soc_intel_is_foo() helpers to a generic header [+ + +]
Author: Hans de Goede <[email protected]>
Date:   Mon Oct 18 16:33:22 2021 +0200

    ASoC: Intel: Move soc_intel_is_foo() helpers to a generic header
    
    [ Upstream commit cd45c9bf8b43cd387e167cf166ae5c517f56d658 ]
    
    The soc_intel_is_foo() helpers from
    sound/soc/intel/common/soc-intel-quirks.h are useful outside of the
    sound subsystem too.
    
    Move these to include/linux/platform_data/x86/soc.h, so that
    other code can use them too.
    
    Suggested-by: Andy Shevchenko <[email protected]>
    Reviewed-by: Andy Shevchenko <[email protected]>
    Acked-by: Mark Brown <[email protected]>
    Signed-off-by: Hans de Goede <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Stable-dep-of: 9931f7d5d251 ("ASoC: Intel: use soc_intel_is_byt_cr() only when IOSF_MBI is reachable")
    Signed-off-by: Sasha Levin <[email protected]>

ASoC: Intel: use soc_intel_is_byt_cr() only when IOSF_MBI is reachable [+ + +]
Author: Pierre-Louis Bossart <[email protected]>
Date:   Mon Jul 22 10:30:02 2024 +0200

    ASoC: Intel: use soc_intel_is_byt_cr() only when IOSF_MBI is reachable
    
    [ Upstream commit 9931f7d5d251882a147cc5811060097df43e79f5 ]
    
    the Intel kbuild bot reports a link failure when IOSF_MBI is built-in
    but the Merrifield driver is configured as a module. The
    soc-intel-quirks.h is included for Merrifield platforms, but IOSF_MBI
    is not selected for that platform.
    
    ld.lld: error: undefined symbol: iosf_mbi_read
    >>> referenced by atom.c
    >>>               sound/soc/sof/intel/atom.o:(atom_machine_select) in archive vmlinux.a
    
    This patch forces the use of the fallback static inline when IOSF_MBI is not reachable.
    
    Fixes: 536cfd2f375d ("ASoC: Intel: use common helpers to detect CPUs")
    Reported-by: kernel test robot <[email protected]>
    Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
    Suggested-by: Takashi Iwai <[email protected]>
    Signed-off-by: Pierre-Louis Bossart <[email protected]>
    Reviewed-by: Péter Ujfalusi <[email protected]>
    Reviewed-by: Bard Liao <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ASoC: max98088: Check for clk_prepare_enable() error [+ + +]
Author: Chen Ni <[email protected]>
Date:   Fri Jun 28 16:05:34 2024 +0800

    ASoC: max98088: Check for clk_prepare_enable() error
    
    [ Upstream commit 1a70579723fde3624a72dfea6e79e55be6e36659 ]
    
    clk_prepare_enable() may fail, so we should better check its return
    value and propagate it in the case of error.
    
    Fixes: 62a7fc32a628 ("ASoC: max98088: Add master clock handling")
    Signed-off-by: Chen Ni <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
binder: fix hang of unregistered readers [+ + +]
Author: Carlos Llamas <[email protected]>
Date:   Thu Jul 11 20:14:51 2024 +0000

    binder: fix hang of unregistered readers
    
    commit 31643d84b8c3d9c846aa0e20bc033e46c68c7e7d upstream.
    
    With the introduction of binder_available_for_proc_work_ilocked() in
    commit 1b77e9dcc3da ("ANDROID: binder: remove proc waitqueue") a binder
    thread can only "wait_for_proc_work" after its thread->looper has been
    marked as BINDER_LOOPER_STATE_{ENTERED|REGISTERED}.
    
    This means an unregistered reader risks waiting indefinitely for work
    since it never gets added to the proc->waiting_threads. If there are no
    further references to its waitqueue either the task will hang. The same
    applies to readers using the (e)poll interface.
    
    I couldn't find the rationale behind this restriction. So this patch
    restores the previous behavior of allowing unregistered threads to
    "wait_for_proc_work". Note that an error message for this scenario,
    which had previously become unreachable, is now re-enabled.
    
    Fixes: 1b77e9dcc3da ("ANDROID: binder: remove proc waitqueue")
    Cc: [email protected]
    Cc: Martijn Coenen <[email protected]>
    Cc: Arve Hjønnevåg <[email protected]>
    Signed-off-by: Carlos Llamas <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Bluetooth: btusb: Add Realtek RTL8852BE support ID 0x13d3:0x3591 [+ + +]
Author: WangYuli <[email protected]>
Date:   Sat Jun 22 12:09:59 2024 +0800

    Bluetooth: btusb: Add Realtek RTL8852BE support ID 0x13d3:0x3591
    
    commit 473a89b4ed7fd52a419340f7c540d5c8fc96fc75 upstream.
    
    Add the support ID(0x13d3, 0x3591) to usb_device_id table for
    Realtek RTL8852BE.
    
    The device table is as follows:
    
    T:  Bus=01 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#=  5 Spd=12   MxCh= 0
    D:  Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=13d3 ProdID=3591 Rev= 0.00
    S:  Manufacturer=Realtek
    S:  Product=Bluetooth Radio
    S:  SerialNumber=00e04c000001
    C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
    E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
    I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
    E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
    I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
    E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
    I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
    I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
    I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
    I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
    
    Cc: [email protected]
    Signed-off-by: Wentao Guan <[email protected]>
    Signed-off-by: WangYuli <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Erpeng Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: btusb: Add RTL8852BE device 0489:e125 to device tables [+ + +]
Author: Hilda Wu <[email protected]>
Date:   Mon Jun 17 17:05:18 2024 +0800

    Bluetooth: btusb: Add RTL8852BE device 0489:e125 to device tables
    
    commit 295ef07a9dae6182ad4b689aa8c6a7dbba21474c upstream.
    
    Add the support ID 0489:e125 to usb_device_id table for
    Realtek RTL8852B chip.
    
    The device info from /sys/kernel/debug/usb/devices as below.
    
    T:  Bus=01 Lev=01 Prnt=01 Port=07 Cnt=03 Dev#=  5 Spd=12   MxCh= 0
    D:  Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=0489 ProdID=e125 Rev= 0.00
    S:  Manufacturer=Realtek
    S:  Product=Bluetooth Radio
    S:  SerialNumber=00e04c000001
    C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
    E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
    I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
    E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
    I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
    E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
    I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
    I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
    I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
    I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
    
    Signed-off-by: Hilda Wu <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Erpeng Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: l2cap: always unlock channel in l2cap_conless_channel() [+ + +]
Author: Dmitry Antipov <[email protected]>
Date:   Wed Jul 31 12:19:36 2024 +0300

    Bluetooth: l2cap: always unlock channel in l2cap_conless_channel()
    
    [ Upstream commit c531e63871c0b50c8c4e62c048535a08886fba3e ]
    
    Add missing call to 'l2cap_chan_unlock()' on receive error handling
    path in 'l2cap_conless_channel()'.
    
    Fixes: a24cce144b98 ("Bluetooth: Fix reference counting of global L2CAP channels")
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=45ac74737e866894acb0
    Signed-off-by: Dmitry Antipov <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
bna: adjust 'name' buf size of bna_tcb and bna_ccb structures [+ + +]
Author: Alexey Kodanev <[email protected]>
Date:   Mon Jul 8 10:50:08 2024 +0000

    bna: adjust 'name' buf size of bna_tcb and bna_ccb structures
    
    [ Upstream commit c9741a03dc8e491e57b95fba0058ab46b7e506da ]
    
    To have enough space to write all possible sprintf() args. Currently
    'name' size is 16, but the first '%s' specifier may already need at
    least 16 characters, since 'bnad->netdev->name' is used there.
    
    For '%d' specifiers, assume that they require:
     * 1 char for 'tx_id + tx_info->tcb[i]->id' sum, BNAD_MAX_TXQ_PER_TX is 8
     * 2 chars for 'rx_id + rx_info->rx_ctrl[i].ccb->id', BNAD_MAX_RXP_PER_RX
       is 16
    
    And replace sprintf with snprintf.
    
    Detected using the static analysis tool - Svace.
    
    Fixes: 8b230ed8ec96 ("bna: Brocade 10Gb Ethernet device driver")
    Signed-off-by: Alexey Kodanev <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
bnxt_re: Fix imm_data endianness [+ + +]
Author: Jack Wang <[email protected]>
Date:   Wed Jul 10 14:21:02 2024 +0200

    bnxt_re: Fix imm_data endianness
    
    [ Upstream commit 95b087f87b780daafad1dbb2c84e81b729d5d33f ]
    
    When map a device between servers with MLX and BCM RoCE nics, RTRS
    server complain about unknown imm type, and can't map the device,
    
    After more debug, it seems bnxt_re wrongly handle the
    imm_data, this patch fixed the compat issue with MLX for us.
    
    In off list discussion, Selvin confirmed HW is working in little endian format
    and all data needs to be converted to LE while providing.
    
    This patch fix the endianness for imm_data
    
    Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
    Signed-off-by: Jack Wang <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Acked-by: Selvin Xavier <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
bpf: Fix a segment issue when downgrading gso_size [+ + +]
Author: Fred Li <[email protected]>
Date:   Fri Jul 19 10:46:53 2024 +0800

    bpf: Fix a segment issue when downgrading gso_size
    
    [ Upstream commit fa5ef655615a01533035c6139248c5b33aa27028 ]
    
    Linearize the skb when downgrading gso_size because it may trigger a
    BUG_ON() later when the skb is segmented as described in [1,2].
    
    Fixes: 2be7e212d5419 ("bpf: add bpf_skb_adjust_room helper")
    Signed-off-by: Fred Li <[email protected]>
    Signed-off-by: Daniel Borkmann <[email protected]>
    Reviewed-by: Willem de Bruijn <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Link: https://lore.kernel.org/all/[email protected] [1]
    Link: https://lore.kernel.org/all/[email protected] [2]
    Link: https://lore.kernel.org/bpf/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

bpf: kprobe: remove unused declaring of bpf_kprobe_override [+ + +]
Author: Menglong Dong <[email protected]>
Date:   Mon Aug 5 14:01:21 2024 +0900

    bpf: kprobe: remove unused declaring of bpf_kprobe_override
    
    [ Upstream commit 0e8b53979ac86eddb3fd76264025a70071a25574 ]
    
    After the commit 66665ad2f102 ("tracing/kprobe: bpf: Compare instruction
    pointer with original one"), "bpf_kprobe_override" is not used anywhere
    anymore, and we can remove it now.
    
    Link: https://lore.kernel.org/all/[email protected]/
    
    Fixes: 66665ad2f102 ("tracing/kprobe: bpf: Compare instruction pointer with original one")
    Signed-off-by: Menglong Dong <[email protected]>
    Acked-by: Jiri Olsa <[email protected]>
    Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
btrfs: fix bitmap leak when loading free space cache on duplicate entry [+ + +]
Author: Filipe Manana <[email protected]>
Date:   Wed Jul 3 15:40:59 2024 +0100

    btrfs: fix bitmap leak when loading free space cache on duplicate entry
    
    [ Upstream commit 320d8dc612660da84c3b70a28658bb38069e5a9a ]
    
    If we failed to link a free space entry because there's already a
    conflicting entry for the same offset, we free the free space entry but
    we don't free the associated bitmap that we had just allocated before.
    Fix that by freeing the bitmap before freeing the entry.
    
    Reviewed-by: Johannes Thumshirn <[email protected]>
    Signed-off-by: Filipe Manana <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
char: tpm: Fix possible memory leak in tpm_bios_measurements_open() [+ + +]
Author: Joe Hattori <[email protected]>
Date:   Thu Jun 27 15:31:09 2024 +0900

    char: tpm: Fix possible memory leak in tpm_bios_measurements_open()
    
    commit 5d8e2971e817bb64225fc0b6327a78752f58a9aa upstream.
    
    In tpm_bios_measurements_open(), get_device() is called on the device
    embedded in struct tpm_chip. In the error path, however, put_device() is
    not called. This results in a reference count leak, which prevents the
    device from being properly released. This commit makes sure to call
    put_device() when the seq_open() call fails.
    
    Cc: [email protected] # +v4.18
    Fixes: 9b01b5356629 ("tpm: Move shared eventlog functions to common.c")
    Signed-off-by: Joe Hattori <[email protected]>
    Signed-off-by: Jarkko Sakkinen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
clk: davinci: da8xx-cfgchip: Initialize clk_init_data before use [+ + +]
Author: Bastien Curutchet <[email protected]>
Date:   Thu Jul 18 13:55:34 2024 +0200

    clk: davinci: da8xx-cfgchip: Initialize clk_init_data before use
    
    commit a83b22754e351f13fb46596c85f667dc33da71ec upstream.
    
    The flag attribute of the struct clk_init_data isn't initialized before
    the devm_clk_hw_register() call. This can lead to unexpected behavior
    during registration.
    
    Initialize the entire clk_init_data to zero at declaration.
    
    Cc: [email protected]
    Fixes: 58e1e2d2cd89 ("clk: davinci: cfgchip: Add TI DA8XX USB PHY clocks")
    Signed-off-by: Bastien Curutchet <[email protected]>
    Reviewed-by: David Lechner <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
clocksource/drivers/sh_cmt: Address race condition for clock events [+ + +]
Author: Niklas Söderlund <[email protected]>
Date:   Tue Jul 2 21:02:30 2024 +0200

    clocksource/drivers/sh_cmt: Address race condition for clock events
    
    [ Upstream commit db19d3aa77612983a02bd223b3f273f896b243cf ]
    
    There is a race condition in the CMT interrupt handler. In the interrupt
    handler the driver sets a driver private flag, FLAG_IRQCONTEXT. This
    flag is used to indicate any call to set_next_event() should not be
    directly propagated to the device, but instead cached. This is done as
    the interrupt handler itself reprograms the device when needed before it
    completes and this avoids this operation to take place twice.
    
    It is unclear why this design was chosen, my suspicion is to allow the
    struct clock_event_device.event_handler callback, which is called while
    the FLAG_IRQCONTEXT is set, can update the next event without having to
    write to the device twice.
    
    Unfortunately there is a race between when the FLAG_IRQCONTEXT flag is
    set and later cleared where the interrupt handler have already started to
    write the next event to the device. If set_next_event() is called in
    this window the value is only cached in the driver but not written. This
    leads to the board to misbehave, or worse lockup and produce a splat.
    
       rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
       rcu:     0-...!: (0 ticks this GP) idle=f5e0/0/0x0 softirq=519/519 fqs=0 (false positive?)
       rcu:     (detected by 1, t=6502 jiffies, g=-595, q=77 ncpus=2)
       Sending NMI from CPU 1 to CPUs 0:
       NMI backtrace for cpu 0
       CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.10.0-rc5-arm64-renesas-00019-g74a6f86eaf1c-dirty #20
       Hardware name: Renesas Salvator-X 2nd version board based on r8a77965 (DT)
       pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
       pc : tick_check_broadcast_expired+0xc/0x40
       lr : cpu_idle_poll.isra.0+0x8c/0x168
       sp : ffff800081c63d70
       x29: ffff800081c63d70 x28: 00000000580000c8 x27: 00000000bfee5610
       x26: 0000000000000027 x25: 0000000000000000 x24: 0000000000000000
       x23: ffff00007fbb9100 x22: ffff8000818f1008 x21: ffff8000800ef07c
       x20: ffff800081c79ec0 x19: ffff800081c70c28 x18: 0000000000000000
       x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffffc2c717d8
       x14: 0000000000000000 x13: ffff000009c18080 x12: ffff8000825f7fc0
       x11: 0000000000000000 x10: ffff8000818f3cd4 x9 : 0000000000000028
       x8 : ffff800081c79ec0 x7 : ffff800081c73000 x6 : 0000000000000000
       x5 : 0000000000000000 x4 : ffff7ffffe286000 x3 : 0000000000000000
       x2 : ffff7ffffe286000 x1 : ffff800082972900 x0 : ffff8000818f1008
       Call trace:
        tick_check_broadcast_expired+0xc/0x40
        do_idle+0x9c/0x280
        cpu_startup_entry+0x34/0x40
        kernel_init+0x0/0x11c
        do_one_initcall+0x0/0x260
        __primary_switched+0x80/0x88
       rcu: rcu_preempt kthread timer wakeup didn't happen for 6501 jiffies! g-595 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402
       rcu:     Possible timer handling issue on cpu=0 timer-softirq=262
       rcu: rcu_preempt kthread starved for 6502 jiffies! g-595 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 ->cpu=0
       rcu:     Unless rcu_preempt kthread gets sufficient CPU time, OOM is now expected behavior.
       rcu: RCU grace-period kthread stack dump:
       task:rcu_preempt     state:I stack:0     pid:15    tgid:15    ppid:2      flags:0x00000008
       Call trace:
        __switch_to+0xbc/0x100
        __schedule+0x358/0xbe0
        schedule+0x48/0x148
        schedule_timeout+0xc4/0x138
        rcu_gp_fqs_loop+0x12c/0x764
        rcu_gp_kthread+0x208/0x298
        kthread+0x10c/0x110
        ret_from_fork+0x10/0x20
    
    The design have been part of the driver since it was first merged in
    early 2009. It becomes increasingly harder to trigger the issue the
    older kernel version one tries. It only takes a few boots on v6.10-rc5,
    while hundreds of boots are needed to trigger it on v5.10.
    
    Close the race condition by using the CMT channel lock for the two
    competing sections. The channel lock was added to the driver after its
    initial design.
    
    Signed-off-by: Niklas Söderlund <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Daniel Lezcano <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
decompress_bunzip2: fix rare decompression failure [+ + +]
Author: Ross Lagerwall <[email protected]>
Date:   Wed Jul 17 17:20:16 2024 +0100

    decompress_bunzip2: fix rare decompression failure
    
    commit bf6acd5d16057d7accbbb1bf7dc6d8c56eeb4ecc upstream.
    
    The decompression code parses a huffman tree and counts the number of
    symbols for a given bit length.  In rare cases, there may be >= 256
    symbols with a given bit length, causing the unsigned char to overflow.
    This causes a decompression failure later when the code tries and fails to
    find the bit length for a given symbol.
    
    Since the maximum number of symbols is 258, use unsigned short instead.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: bc22c17e12c1 ("bzip2/lzma: library support for gzip, bzip2 and lzma decompression")
    Signed-off-by: Ross Lagerwall <[email protected]>
    Cc: Alain Knaff <[email protected]>
    Cc: "H. Peter Anvin" <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
dev/parport: fix the array out-of-bounds risk [+ + +]
Author: tuhaowen <[email protected]>
Date:   Mon Jul 8 16:04:30 2024 +0800

    dev/parport: fix the array out-of-bounds risk
    
    [ Upstream commit ab11dac93d2d568d151b1918d7b84c2d02bacbd5 ]
    
    Fixed array out-of-bounds issues caused by sprintf
    by replacing it with snprintf for safer data copying,
    ensuring the destination buffer is not overflowed.
    
    Below is the stack trace I encountered during the actual issue:
    
    [ 66.575408s] [pid:5118,cpu4,QThread,4]Kernel panic - not syncing: stack-protector:
    Kernel stack is corrupted in: do_hardware_base_addr+0xcc/0xd0 [parport]
    [ 66.575408s] [pid:5118,cpu4,QThread,5]CPU: 4 PID: 5118 Comm:
    QThread Tainted: G S W O 5.10.97-arm64-desktop #7100.57021.2
    [ 66.575439s] [pid:5118,cpu4,QThread,6]TGID: 5087 Comm: EFileApp
    [ 66.575439s] [pid:5118,cpu4,QThread,7]Hardware name: HUAWEI HUAWEI QingYun
    PGUX-W515x-B081/SP1PANGUXM, BIOS 1.00.07 04/29/2024
    [ 66.575439s] [pid:5118,cpu4,QThread,8]Call trace:
    [ 66.575469s] [pid:5118,cpu4,QThread,9] dump_backtrace+0x0/0x1c0
    [ 66.575469s] [pid:5118,cpu4,QThread,0] show_stack+0x14/0x20
    [ 66.575469s] [pid:5118,cpu4,QThread,1] dump_stack+0xd4/0x10c
    [ 66.575500s] [pid:5118,cpu4,QThread,2] panic+0x1d8/0x3bc
    [ 66.575500s] [pid:5118,cpu4,QThread,3] __stack_chk_fail+0x2c/0x38
    [ 66.575500s] [pid:5118,cpu4,QThread,4] do_hardware_base_addr+0xcc/0xd0 [parport]
    
    Signed-off-by: tuhaowen <[email protected]>
    Cc: stable <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
devres: Fix memory leakage caused by driver API devm_free_percpu() [+ + +]
Author: Zijun Hu <[email protected]>
Date:   Tue Jul 2 22:51:51 2024 +0800

    devres: Fix memory leakage caused by driver API devm_free_percpu()
    
    [ Upstream commit bd50a974097bb82d52a458bd3ee39fb723129a0c ]
    
    It will cause memory leakage when use driver API devm_free_percpu()
    to free memory allocated by devm_alloc_percpu(), fixed by using
    devres_release() instead of devres_destroy() within devm_free_percpu().
    
    Fixes: ff86aae3b411 ("devres: add devm_alloc_percpu()")
    Cc: [email protected]
    Signed-off-by: Zijun Hu <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
dma: fix call order in dmam_free_coherent [+ + +]
Author: Lance Richardson <[email protected]>
Date:   Thu Jul 18 14:38:24 2024 +0000

    dma: fix call order in dmam_free_coherent
    
    [ Upstream commit 28e8b7406d3a1f5329a03aa25a43aa28e087cb20 ]
    
    dmam_free_coherent() frees a DMA allocation, which makes the
    freed vaddr available for reuse, then calls devres_destroy()
    to remove and free the data structure used to track the DMA
    allocation. Between the two calls, it is possible for a
    concurrent task to make an allocation with the same vaddr
    and add it to the devres list.
    
    If this happens, there will be two entries in the devres list
    with the same vaddr and devres_destroy() can free the wrong
    entry, triggering the WARN_ON() in dmam_match.
    
    Fix by destroying the devres entry before freeing the DMA
    allocation.
    
    Tested:
      kokonut //net/encryption
        http://sponge2/b9145fe6-0f72-4325-ac2f-a84d81075b03
    
    Fixes: 9ac7849e35f7 ("devres: device resource management")
    Signed-off-by: Lance Richardson <[email protected]>
    Signed-off-by: Christoph Hellwig <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
driver core: Cast to (void *) with __force for __percpu pointer [+ + +]
Author: Andy Shevchenko <[email protected]>
Date:   Thu Apr 1 20:10:30 2021 +0300

    driver core: Cast to (void *) with __force for __percpu pointer
    
    [ Upstream commit d7aa44f5a1f86cb40659eef06035d8d92604b9d5 ]
    
    Sparse is not happy:
    
      drivers/base/devres.c:1230:9: warning: cast removes address space '__percpu' of expression
    
    Use __force attribute to make it happy.
    
    Signed-off-by: Andy Shevchenko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Stable-dep-of: bd50a974097b ("devres: Fix memory leakage caused by driver API devm_free_percpu()")
    Signed-off-by: Sasha Levin <[email protected]>

driver core: Fix uevent_show() vs driver detach race [+ + +]
Author: Dan Williams <[email protected]>
Date:   Fri Jul 12 12:42:09 2024 -0700

    driver core: Fix uevent_show() vs driver detach race
    
    commit 15fffc6a5624b13b428bb1c6e9088e32a55eb82c upstream.
    
    uevent_show() wants to de-reference dev->driver->name. There is no clean
    way for a device attribute to de-reference dev->driver unless that
    attribute is defined via (struct device_driver).dev_groups. Instead, the
    anti-pattern of taking the device_lock() in the attribute handler risks
    deadlocks with code paths that remove device attributes while holding
    the lock.
    
    This deadlock is typically invisible to lockdep given the device_lock()
    is marked lockdep_set_novalidate_class(), but some subsystems allocate a
    local lockdep key for @dev->mutex to reveal reports of the form:
    
     ======================================================
     WARNING: possible circular locking dependency detected
     6.10.0-rc7+ #275 Tainted: G           OE    N
     ------------------------------------------------------
     modprobe/2374 is trying to acquire lock:
     ffff8c2270070de0 (kn->active#6){++++}-{0:0}, at: __kernfs_remove+0xde/0x220
    
     but task is already holding lock:
     ffff8c22016e88f8 (&cxl_root_key){+.+.}-{3:3}, at: device_release_driver_internal+0x39/0x210
    
     which lock already depends on the new lock.
    
     the existing dependency chain (in reverse order) is:
    
     -> #1 (&cxl_root_key){+.+.}-{3:3}:
            __mutex_lock+0x99/0xc30
            uevent_show+0xac/0x130
            dev_attr_show+0x18/0x40
            sysfs_kf_seq_show+0xac/0xf0
            seq_read_iter+0x110/0x450
            vfs_read+0x25b/0x340
            ksys_read+0x67/0xf0
            do_syscall_64+0x75/0x190
            entry_SYSCALL_64_after_hwframe+0x76/0x7e
    
     -> #0 (kn->active#6){++++}-{0:0}:
            __lock_acquire+0x121a/0x1fa0
            lock_acquire+0xd6/0x2e0
            kernfs_drain+0x1e9/0x200
            __kernfs_remove+0xde/0x220
            kernfs_remove_by_name_ns+0x5e/0xa0
            device_del+0x168/0x410
            device_unregister+0x13/0x60
            devres_release_all+0xb8/0x110
            device_unbind_cleanup+0xe/0x70
            device_release_driver_internal+0x1c7/0x210
            driver_detach+0x47/0x90
            bus_remove_driver+0x6c/0xf0
            cxl_acpi_exit+0xc/0x11 [cxl_acpi]
            __do_sys_delete_module.isra.0+0x181/0x260
            do_syscall_64+0x75/0x190
            entry_SYSCALL_64_after_hwframe+0x76/0x7e
    
    The observation though is that driver objects are typically much longer
    lived than device objects. It is reasonable to perform lockless
    de-reference of a @driver pointer even if it is racing detach from a
    device. Given the infrequency of driver unregistration, use
    synchronize_rcu() in module_remove_driver() to close any potential
    races.  It is potentially overkill to suffer synchronize_rcu() just to
    handle the rare module removal racing uevent_show() event.
    
    Thanks to Tetsuo Handa for the debug analysis of the syzbot report [1].
    
    Fixes: c0a40097f0bc ("drivers: core: synchronize really_probe() and dev_uevent()")
    Reported-by: [email protected]
    Reported-by: Tetsuo Handa <[email protected]>
    Closes: http://lore.kernel.org/[email protected] [1]
    Link: http://lore.kernel.org/[email protected]
    Cc: [email protected]
    Cc: Ashish Sangwan <[email protected]>
    Cc: Namjae Jeon <[email protected]>
    Cc: Dirk Behme <[email protected]>
    Cc: Greg Kroah-Hartman <[email protected]>
    Cc: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Dan Williams <[email protected]>
    Link: https://lore.kernel.org/r/172081332794.577428.9738802016494057132.stgit@dwillia2-xfh.jf.intel.com
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/amd/display: Check for NULL pointer [+ + +]
Author: Sung Joon Kim <[email protected]>
Date:   Mon Jul 8 19:29:49 2024 -0400

    drm/amd/display: Check for NULL pointer
    
    commit 4ab68e168ae1695f7c04fae98930740aaf7c50fa upstream.
    
    [why & how]
    Need to make sure plane_state is initialized
    before accessing its members.
    
    Cc: Mario Limonciello <[email protected]>
    Cc: Alex Deucher <[email protected]>
    Cc: [email protected]
    Reviewed-by: Xi (Alex) Liu <[email protected]>
    Signed-off-by: Sung Joon Kim <[email protected]>
    Signed-off-by: Aurabindo Pillai <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit 295d91cbc700651782a60572f83c24861607b648)
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/amdgpu: Fix the null pointer dereference to ras_manager [+ + +]
Author: Ma Jun <[email protected]>
Date:   Sat May 11 15:48:02 2024 +0800

    drm/amdgpu: Fix the null pointer dereference to ras_manager
    
    [ Upstream commit 4c11d30c95576937c6c35e6f29884761f2dddb43 ]
    
    Check ras_manager before using it
    
    Signed-off-by: Ma Jun <[email protected]>
    Reviewed-by: Lijo Lazar <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/bridge: analogix_dp: properly handle zero sized AUX transactions [+ + +]
Author: Lucas Stach <[email protected]>
Date:   Mon Mar 18 21:39:23 2024 +0100

    drm/bridge: analogix_dp: properly handle zero sized AUX transactions
    
    commit e82290a2e0e8ec5e836ecad1ca025021b3855c2d upstream.
    
    Address only transactions without any data are valid and should not
    be flagged as short transactions. Simply return the message size when
    no transaction errors occured.
    
    CC: [email protected]
    Signed-off-by: Lucas Stach <[email protected]>
    Reviewed-by: Robert Foss <[email protected]>
    Signed-off-by: Robert Foss <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/client: fix null pointer dereference in drm_client_modeset_probe [+ + +]
Author: Ma Ke <[email protected]>
Date:   Fri Aug 2 12:47:36 2024 +0800

    drm/client: fix null pointer dereference in drm_client_modeset_probe
    
    commit 113fd6372a5bb3689aba8ef5b8a265ed1529a78f upstream.
    
    In drm_client_modeset_probe(), the return value of drm_mode_duplicate() is
    assigned to modeset->mode, which will lead to a possible NULL pointer
    dereference on failure of drm_mode_duplicate(). Add a check to avoid npd.
    
    Cc: [email protected]
    Fixes: cf13909aee05 ("drm/fb-helper: Move out modeset config code")
    Signed-off-by: Ma Ke <[email protected]>
    Reviewed-by: Thomas Zimmermann <[email protected]>
    Signed-off-by: Thomas Zimmermann <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/etnaviv: fix DMA direction handling for cached RW buffers [+ + +]
Author: Lucas Stach <[email protected]>
Date:   Fri Jun 21 19:11:06 2024 +0200

    drm/etnaviv: fix DMA direction handling for cached RW buffers
    
    [ Upstream commit 58979ad6330a70450ed78837be3095107d022ea9 ]
    
    The dma sync operation needs to be done with DMA_BIDIRECTIONAL when
    the BO is prepared for both read and write operations.
    
    Fixes: a8c21a5451d8 ("drm/etnaviv: add initial etnaviv DRM driver")
    Signed-off-by: Lucas Stach <[email protected]>
    Reviewed-by: Philipp Zabel <[email protected]>
    Reviewed-by: Christian Gmeiner <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/gma500: fix null pointer dereference in cdv_intel_lvds_get_modes [+ + +]
Author: Ma Ke <[email protected]>
Date:   Tue Jul 9 19:33:11 2024 +0800

    drm/gma500: fix null pointer dereference in cdv_intel_lvds_get_modes
    
    commit cb520c3f366c77e8d69e4e2e2781a8ce48d98e79 upstream.
    
    In cdv_intel_lvds_get_modes(), the return value of drm_mode_duplicate()
    is assigned to mode, which will lead to a NULL pointer dereference on
    failure of drm_mode_duplicate(). Add a check to avoid npd.
    
    Cc: [email protected]
    Fixes: 6a227d5fd6c4 ("gma500: Add support for Cedarview")
    Signed-off-by: Ma Ke <[email protected]>
    Signed-off-by: Patrik Jakobsson <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes [+ + +]
Author: Ma Ke <[email protected]>
Date:   Tue Jul 9 17:20:11 2024 +0800

    drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes
    
    commit 2df7aac81070987b0f052985856aa325a38debf6 upstream.
    
    In psb_intel_lvds_get_modes(), the return value of drm_mode_duplicate() is
    assigned to mode, which will lead to a possible NULL pointer dereference
    on failure of drm_mode_duplicate(). Add a check to avoid npd.
    
    Cc: [email protected]
    Fixes: 89c78134cc54 ("gma500: Add Poulsbo support")
    Signed-off-by: Ma Ke <[email protected]>
    Signed-off-by: Patrik Jakobsson <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/i915/gem: Fix Virtual Memory mapping boundaries calculation [+ + +]
Author: Andi Shyti <[email protected]>
Date:   Fri Aug 2 10:38:50 2024 +0200

    drm/i915/gem: Fix Virtual Memory mapping boundaries calculation
    
    commit 8bdd9ef7e9b1b2a73e394712b72b22055e0e26c3 upstream.
    
    Calculating the size of the mapped area as the lesser value
    between the requested size and the actual size does not consider
    the partial mapping offset. This can cause page fault access.
    
    Fix the calculation of the starting and ending addresses, the
    total size is now deduced from the difference between the end and
    start addresses.
    
    Additionally, the calculations have been rewritten in a clearer
    and more understandable form.
    
    Fixes: c58305af1835 ("drm/i915: Use remap_io_mapping() to prefault all PTE in a single pass")
    Reported-by: Jann Horn <[email protected]>
    Co-developed-by: Chris Wilson <[email protected]>
    Signed-off-by: Chris Wilson <[email protected]>
    Signed-off-by: Andi Shyti <[email protected]>
    Cc: Joonas Lahtinen <[email protected]>
    Cc: Matthew Auld <[email protected]>
    Cc: Rodrigo Vivi <[email protected]>
    Cc: <[email protected]> # v4.9+
    Reviewed-by: Jann Horn <[email protected]>
    Reviewed-by: Jonathan Cavitt <[email protected]>
    [Joonas: Add Requires: tag]
    Requires: 60a2066c5005 ("drm/i915/gem: Adjust vma offset for framebuffer mmap offset")
    Signed-off-by: Joonas Lahtinen <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    (cherry picked from commit 97b6784753da06d9d40232328efc5c5367e53417)
    Signed-off-by: Joonas Lahtinen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/mgag200: Set DDC timeout in milliseconds [+ + +]
Author: Thomas Zimmermann <[email protected]>
Date:   Mon May 13 14:51:06 2024 +0200

    drm/mgag200: Set DDC timeout in milliseconds
    
    commit ecde5db1598aecab54cc392282c15114f526f05f upstream.
    
    Compute the i2c timeout in jiffies from a value in milliseconds. The
    original values of 2 jiffies equals 2 milliseconds if HZ has been
    configured to a value of 1000. This corresponds to 2.2 milliseconds
    used by most other DRM drivers. Update mgag200 accordingly.
    
    Signed-off-by: Thomas Zimmermann <[email protected]>
    Reviewed-by: Jocelyn Falempe <[email protected]>
    Fixes: 414c45310625 ("mgag200: initial g200se driver (v2)")
    Cc: Dave Airlie <[email protected]>
    Cc: Maarten Lankhorst <[email protected]>
    Cc: Maxime Ripard <[email protected]>
    Cc: Thomas Zimmermann <[email protected]>
    Cc: Jocelyn Falempe <[email protected]>
    Cc: [email protected]
    Cc: <[email protected]> # v3.5+
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/nouveau: prime: fix refcount underflow [+ + +]
Author: Danilo Krummrich <[email protected]>
Date:   Thu Jul 18 18:58:46 2024 +0200

    drm/nouveau: prime: fix refcount underflow
    
    [ Upstream commit a9bf3efc33f1fbf88787a277f7349459283c9b95 ]
    
    Calling nouveau_bo_ref() on a nouveau_bo without initializing it (and
    hence the backing ttm_bo) leads to a refcount underflow.
    
    Instead of calling nouveau_bo_ref() in the unwind path of
    drm_gem_object_init(), clean things up manually.
    
    Fixes: ab9ccb96a6e6 ("drm/nouveau: use prime helpers")
    Reviewed-by: Ben Skeggs <[email protected]>
    Reviewed-by: Christian König <[email protected]>
    Signed-off-by: Danilo Krummrich <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    (cherry picked from commit 1b93f3e89d03cfc576636e195466a0d728ad8de5)
    Signed-off-by: Danilo Krummrich <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/panfrost: Mark simple_ondemand governor as softdep [+ + +]
Author: Dragan Simic <[email protected]>
Date:   Mon Jun 17 22:17:48 2024 +0200

    drm/panfrost: Mark simple_ondemand governor as softdep
    
    commit 80f4e62730a91572b7fdc657f7bb747e107ae308 upstream.
    
    Panfrost DRM driver uses devfreq to perform DVFS, while using simple_ondemand
    devfreq governor by default.  This causes driver initialization to fail on
    boot when simple_ondemand governor isn't built into the kernel statically,
    as a result of the missing module dependency and, consequently, the required
    governor module not being included in the initial ramdisk.  Thus, let's mark
    simple_ondemand governor as a softdep for Panfrost, to have its kernel module
    included in the initial ramdisk.
    
    This is a rather longstanding issue that has forced distributions to build
    devfreq governors statically into their kernels, [1][2] or has forced users
    to introduce some unnecessary workarounds. [3]
    
    For future reference, not having support for the simple_ondemand governor in
    the initial ramdisk produces errors in the kernel log similar to these below,
    which were taken from a Pine64 RockPro64:
    
      panfrost ff9a0000.gpu: [drm:panfrost_devfreq_init [panfrost]] *ERROR* Couldn't initialize GPU devfreq
      panfrost ff9a0000.gpu: Fatal error during GPU init
      panfrost: probe of ff9a0000.gpu failed with error -22
    
    Having simple_ondemand marked as a softdep for Panfrost may not resolve this
    issue for all Linux distributions.  In particular, it will remain unresolved
    for the distributions whose utilities for the initial ramdisk generation do
    not handle the available softdep information [4] properly yet.  However, some
    Linux distributions already handle softdeps properly while generating their
    initial ramdisks, [5] and this is a prerequisite step in the right direction
    for the distributions that don't handle them properly yet.
    
    [1] https://gitlab.manjaro.org/manjaro-arm/packages/core/linux/-/blob/linux61/config?ref_type=heads#L8180
    [2] https://salsa.debian.org/kernel-team/linux/-/merge_requests/1066
    [3] https://forum.pine64.org/showthread.php?tid=15458
    [4] https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/commit/?id=49d8e0b59052999de577ab732b719cfbeb89504d
    [5] https://github.com/archlinux/mkinitcpio/commit/97ac4d37aae084a050be512f6d8f4489054668ad
    
    Cc: Diederik de Haas <[email protected]>
    Cc: Furkan Kardame <[email protected]>
    Cc: [email protected]
    Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver")
    Signed-off-by: Dragan Simic <[email protected]>
    Reviewed-by: Steven Price <[email protected]>
    Reviewed-by: Boris Brezillon <[email protected]>
    Signed-off-by: Steven Price <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/4e1e00422a14db4e2a80870afb704405da16fd1b.1718655077.git.dsimic@manjaro.org
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/qxl: Add check for drm_cvt_mode [+ + +]
Author: Chen Ni <[email protected]>
Date:   Fri Jun 21 15:10:31 2024 +0800

    drm/qxl: Add check for drm_cvt_mode
    
    [ Upstream commit 7bd09a2db0f617377027a2bb0b9179e6959edff3 ]
    
    Add check for the return value of drm_cvt_mode() and return the error if
    it fails in order to avoid NULL pointer dereference.
    
    Fixes: 1b043677d4be ("drm/qxl: add qxl_add_mode helper function")
    Signed-off-by: Chen Ni <[email protected]>
    Reviewed-by: Heng Qi <[email protected]>
    Signed-off-by: Maxime Ripard <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/vmwgfx: Fix overlay when using Screen Targets [+ + +]
Author: Ian Forbes <[email protected]>
Date:   Fri Jul 19 11:36:27 2024 -0500

    drm/vmwgfx: Fix overlay when using Screen Targets
    
    [ Upstream commit cb372a505a994cb39aa75acfb8b3bcf94787cf94 ]
    
    This code was never updated to support Screen Targets.
    Fixes a bug where Xv playback displays a green screen instead of actual
    video contents when 3D acceleration is disabled in the guest.
    
    Fixes: c8261a961ece ("vmwgfx: Major KMS refactoring / cleanup in preparation of screen targets")
    Reported-by: Doug Brown <[email protected]>
    Closes: https://lore.kernel.org/all/[email protected]
    Signed-off-by: Ian Forbes <[email protected]>
    Tested-by: Doug Brown <[email protected]>
    Signed-off-by: Zack Rusin <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
EDAC, i10nm: make skx_common.o a separate module [+ + +]
Author: Arnd Bergmann <[email protected]>
Date:   Wed May 29 11:51:11 2024 +0200

    EDAC, i10nm: make skx_common.o a separate module
    
    [ Upstream commit 123b158635505c89ed0d3ef45c5845ff9030a466 ]
    
    Commit 598afa050403 ("kbuild: warn objects shared among multiple modules")
    was added to track down cases where the same object is linked into
    multiple modules. This can cause serious problems if some modules are
    builtin while others are not.
    
    That test triggers this warning:
    
    scripts/Makefile.build:236: drivers/edac/Makefile: skx_common.o is added to multiple modules: i10nm_edac skx_edac
    
    Make this a separate module instead.
    
    [Tony: Added more background details to commit message]
    
    Fixes: d4dc89d069aa ("EDAC, i10nm: Add a driver for Intel 10nm server processors")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Tony Luck <[email protected]>
    Link: https://lore.kernel.org/all/[email protected]/
    Signed-off-by: Sasha Levin <[email protected]>

 
EDAC, skx: Retrieve and print retry_rd_err_log registers [+ + +]
Author: Tony Luck <[email protected]>
Date:   Thu Aug 15 14:53:28 2019 -0700

    EDAC, skx: Retrieve and print retry_rd_err_log registers
    
    [ Upstream commit e80634a75aba90e7485cd1fdb463fcac5d45f14d ]
    
    Skylake logs some additional useful information in per-channel
    registers in addition the the architectural status/addr/misc
    logged in the machine check bank.
    
    Pick up this information and add it to the EDAC log:
    
            retry_rd_err_[five 32-bit register values]
    
    Sorry, no definitions for these registers. OEMs and DIMM vendors
    will be able to use them to isolate which cells in the DIMM are
    causing problems.
    
            correrrcnt[per rank corrected error counts]
    
    Note that if additional errors are logged while these registers are
    being read, you may see a jumble of values some from earlier errors,
    others from later errors (since the registers report the most recent
    logged error). The correrrcnt registers provide error counts per possible
    rank. If these counts only change by one since the previous error logged
    for this channel, then it is safe to assume that the registers logged
    provide a coherent view of one error.
    
    With this change EDAC logs look like this:
    
    EDAC MC4: 1 CE memory read error on CPU_SrcID#2_MC#0_Chan#1_DIMM#0 (channel:1 slot:0 page:0x8f26018 offset:0x0 grain:32 syndrome:0x0 -  err_code:0x0101:0x0091 socket:2 imc:0 rank:0 bg:0 ba:0 row:0x1f880 col:0x200 retry_rd_err_log[0001a209 00000000 00000001 04800001 0001f880] correrrcnt[0001 0000 0000 0000 0000 0000 0000 0000])
    
    Acked-by: Aristeu Rozanski <[email protected]>
    Signed-off-by: Tony Luck <[email protected]>
    Stable-dep-of: 123b15863550 ("EDAC, i10nm: make skx_common.o a separate module")
    Signed-off-by: Sasha Levin <[email protected]>

 
EDAC, skx_common: Refactor so that we initialize "dev" in result of adxl decode. [+ + +]
Author: Tony Luck <[email protected]>
Date:   Thu Aug 15 14:18:59 2019 -0700

    EDAC, skx_common: Refactor so that we initialize "dev" in result of adxl decode.
    
    [ Upstream commit 29b8e84fbc23cb2b70317b745641ea0569426872 ]
    
    Simplifies the code a little.
    
    Acked-by: Aristeu Rozanski <[email protected]>
    Signed-off-by: Tony Luck <[email protected]>
    Stable-dep-of: 123b15863550 ("EDAC, i10nm: make skx_common.o a separate module")
    Signed-off-by: Sasha Levin <[email protected]>
 
EDAC/skx_common: Add new ADXL components for 2-level memory [+ + +]
Author: Qiuxu Zhuo <[email protected]>
Date:   Fri Jun 11 10:01:18 2021 -0700

    EDAC/skx_common: Add new ADXL components for 2-level memory
    
    [ Upstream commit 2f4348e5a86198704368a699a7c4cdeb21d569f5 ]
    
    Some Intel servers may configure memory in 2 levels, using
    fast "near" memory (e.g. DDR) as a cache for larger, slower,
    "far" memory (e.g. 3D X-point).
    
    In these configurations the BIOS ADXL address translation for
    an address in a 2-level memory range will provide details of
    both the "near" and far components.
    
    Current exported ADXL components are only for 1-level memory
    system or for 2nd level memory of 2-level memory system. So
    add new ADXL components for 1st level memory of 2-level memory
    system to fully support 2-level memory system and the detection
    of memory error source(1st level memory or 2nd level memory).
    
    Signed-off-by: Qiuxu Zhuo <[email protected]>
    Signed-off-by: Tony Luck <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Stable-dep-of: 123b15863550 ("EDAC, i10nm: make skx_common.o a separate module")
    Signed-off-by: Sasha Levin <[email protected]>

 
exec: Fix ToCToU between perm check and set-uid/gid usage [+ + +]
Author: Kees Cook <[email protected]>
Date:   Thu Aug 8 11:39:08 2024 -0700

    exec: Fix ToCToU between perm check and set-uid/gid usage
    
    commit f50733b45d865f91db90919f8311e2127ce5a0cb upstream.
    
    When opening a file for exec via do_filp_open(), permission checking is
    done against the file's metadata at that moment, and on success, a file
    pointer is passed back. Much later in the execve() code path, the file
    metadata (specifically mode, uid, and gid) is used to determine if/how
    to set the uid and gid. However, those values may have changed since the
    permissions check, meaning the execution may gain unintended privileges.
    
    For example, if a file could change permissions from executable and not
    set-id:
    
    ---------x 1 root root 16048 Aug  7 13:16 target
    
    to set-id and non-executable:
    
    ---S------ 1 root root 16048 Aug  7 13:16 target
    
    it is possible to gain root privileges when execution should have been
    disallowed.
    
    While this race condition is rare in real-world scenarios, it has been
    observed (and proven exploitable) when package managers are updating
    the setuid bits of installed programs. Such files start with being
    world-executable but then are adjusted to be group-exec with a set-uid
    bit. For example, "chmod o-x,u+s target" makes "target" executable only
    by uid "root" and gid "cdrom", while also becoming setuid-root:
    
    -rwxr-xr-x 1 root cdrom 16048 Aug  7 13:16 target
    
    becomes:
    
    -rwsr-xr-- 1 root cdrom 16048 Aug  7 13:16 target
    
    But racing the chmod means users without group "cdrom" membership can
    get the permission to execute "target" just before the chmod, and when
    the chmod finishes, the exec reaches brpm_fill_uid(), and performs the
    setuid to root, violating the expressed authorization of "only cdrom
    group members can setuid to root".
    
    Re-check that we still have execute permissions in case the metadata
    has changed. It would be better to keep a copy from the perm-check time,
    but until we can do that refactoring, the least-bad option is to do a
    full inode_permission() call (under inode lock). It is understood that
    this is safe against dead-locks, but hardly optimal.
    
    Reported-by: Marco Vanotti <[email protected]>
    Tested-by: Marco Vanotti <[email protected]>
    Suggested-by: Linus Torvalds <[email protected]>
    Cc: [email protected]
    Cc: Eric Biederman <[email protected]>
    Cc: Alexander Viro <[email protected]>
    Cc: Christian Brauner <[email protected]>
    Signed-off-by: Kees Cook <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ext4: avoid writing unitialized memory to disk in EA inodes [+ + +]
Author: Jan Kara <[email protected]>
Date:   Thu Jun 13 17:02:34 2024 +0200

    ext4: avoid writing unitialized memory to disk in EA inodes
    
    [ Upstream commit 65121eff3e4c8c90f8126debf3c369228691c591 ]
    
    If the extended attribute size is not a multiple of block size, the last
    block in the EA inode will have uninitialized tail which will get
    written to disk. We will never expose the data to userspace but still
    this is not a good practice so just zero out the tail of the block as it
    isn't going to cause a noticeable performance overhead.
    
    Fixes: e50e5129f384 ("ext4: xattr-in-inode support")
    Reported-by: [email protected]
    Reported-by: Hugh Dickins <[email protected]>
    Signed-off-by: Jan Kara <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ext4: check dot and dotdot of dx_root before making dir indexed [+ + +]
Author: Baokun Li <[email protected]>
Date:   Tue Jul 2 21:23:48 2024 +0800

    ext4: check dot and dotdot of dx_root before making dir indexed
    
    commit 50ea741def587a64e08879ce6c6a30131f7111e7 upstream.
    
    Syzbot reports a issue as follows:
    ============================================
    BUG: unable to handle page fault for address: ffffed11022e24fe
    PGD 23ffee067 P4D 23ffee067 PUD 0
    Oops: Oops: 0000 [#1] PREEMPT SMP KASAN PTI
    CPU: 0 PID: 5079 Comm: syz-executor306 Not tainted 6.10.0-rc5-g55027e689933 #0
    Call Trace:
     <TASK>
     make_indexed_dir+0xdaf/0x13c0 fs/ext4/namei.c:2341
     ext4_add_entry+0x222a/0x25d0 fs/ext4/namei.c:2451
     ext4_rename fs/ext4/namei.c:3936 [inline]
     ext4_rename2+0x26e5/0x4370 fs/ext4/namei.c:4214
    [...]
    ============================================
    
    The immediate cause of this problem is that there is only one valid dentry
    for the block to be split during do_split, so split==0 results in out of
    bounds accesses to the map triggering the issue.
    
        do_split
          unsigned split
          dx_make_map
           count = 1
          split = count/2 = 0;
          continued = hash2 == map[split - 1].hash;
           ---> map[4294967295]
    
    The maximum length of a filename is 255 and the minimum block size is 1024,
    so it is always guaranteed that the number of entries is greater than or
    equal to 2 when do_split() is called.
    
    But syzbot's crafted image has no dot and dotdot in dir, and the dentry
    distribution in dirblock is as follows:
    
      bus     dentry1          hole           dentry2           free
    |xx--|xx-------------|...............|xx-------------|...............|
    0   12 (8+248)=256  268     256     524 (8+256)=264 788     236     1024
    
    So when renaming dentry1 increases its name_len length by 1, neither hole
    nor free is sufficient to hold the new dentry, and make_indexed_dir() is
    called.
    
    In make_indexed_dir() it is assumed that the first two entries of the
    dirblock must be dot and dotdot, so bus and dentry1 are left in dx_root
    because they are treated as dot and dotdot, and only dentry2 is moved
    to the new leaf block. That's why count is equal to 1.
    
    Therefore add the ext4_check_dx_root() helper function to add more sanity
    checks to dot and dotdot before starting the conversion to avoid the above
    issue.
    
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=ae688d469e36fb5138d0
    Fixes: ac27a0ec112a ("[PATCH] ext4: initial copy of files from ext3")
    Cc: [email protected]
    Signed-off-by: Baokun Li <[email protected]>
    Reviewed-by: Jan Kara <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ext4: fix wrong unit use in ext4_mb_find_by_goal [+ + +]
Author: Kemeng Shi <[email protected]>
Date:   Sat Jun 3 23:03:11 2023 +0800

    ext4: fix wrong unit use in ext4_mb_find_by_goal
    
    [ Upstream commit 99c515e3a860576ba90c11acbc1d6488dfca6463 ]
    
    We need start in block unit while fe_start is in cluster unit. Use
    ext4_grp_offs_to_block helper to convert fe_start to get start in
    block unit.
    
    Signed-off-by: Kemeng Shi <[email protected]>
    Reviewed-by: Ojaswin Mujoo <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ext4: make sure the first directory block is not a hole [+ + +]
Author: Baokun Li <[email protected]>
Date:   Tue Jul 2 21:23:49 2024 +0800

    ext4: make sure the first directory block is not a hole
    
    commit f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6 upstream.
    
    The syzbot constructs a directory that has no dirblock but is non-inline,
    i.e. the first directory block is a hole. And no errors are reported when
    creating files in this directory in the following flow.
    
        ext4_mknod
         ...
          ext4_add_entry
            // Read block 0
            ext4_read_dirblock(dir, block, DIRENT)
              bh = ext4_bread(NULL, inode, block, 0)
              if (!bh && (type == INDEX || type == DIRENT_HTREE))
              // The first directory block is a hole
              // But type == DIRENT, so no error is reported.
    
    After that, we get a directory block without '.' and '..' but with a valid
    dentry. This may cause some code that relies on dot or dotdot (such as
    make_indexed_dir()) to crash.
    
    Therefore when ext4_read_dirblock() finds that the first directory block
    is a hole report that the filesystem is corrupted and return an error to
    avoid loading corrupted data from disk causing something bad.
    
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=ae688d469e36fb5138d0
    Fixes: 4e19d6b65fb4 ("ext4: allow directory holes")
    Cc: [email protected]
    Signed-off-by: Baokun Li <[email protected]>
    Reviewed-by: Jan Kara <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
f2fs: fix to don't dirty inode for readonly filesystem [+ + +]
Author: Chao Yu <[email protected]>
Date:   Tue Jun 4 15:56:36 2024 +0800

    f2fs: fix to don't dirty inode for readonly filesystem
    
    commit 192b8fb8d1c8ca3c87366ebbef599fa80bb626b8 upstream.
    
    syzbot reports f2fs bug as below:
    
    kernel BUG at fs/f2fs/inode.c:933!
    RIP: 0010:f2fs_evict_inode+0x1576/0x1590 fs/f2fs/inode.c:933
    Call Trace:
     evict+0x2a4/0x620 fs/inode.c:664
     dispose_list fs/inode.c:697 [inline]
     evict_inodes+0x5f8/0x690 fs/inode.c:747
     generic_shutdown_super+0x9d/0x2c0 fs/super.c:675
     kill_block_super+0x44/0x90 fs/super.c:1667
     kill_f2fs_super+0x303/0x3b0 fs/f2fs/super.c:4894
     deactivate_locked_super+0xc1/0x130 fs/super.c:484
     cleanup_mnt+0x426/0x4c0 fs/namespace.c:1256
     task_work_run+0x24a/0x300 kernel/task_work.c:180
     ptrace_notify+0x2cd/0x380 kernel/signal.c:2399
     ptrace_report_syscall include/linux/ptrace.h:411 [inline]
     ptrace_report_syscall_exit include/linux/ptrace.h:473 [inline]
     syscall_exit_work kernel/entry/common.c:251 [inline]
     syscall_exit_to_user_mode_prepare kernel/entry/common.c:278 [inline]
     __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline]
     syscall_exit_to_user_mode+0x15c/0x280 kernel/entry/common.c:296
     do_syscall_64+0x50/0x110 arch/x86/entry/common.c:88
     entry_SYSCALL_64_after_hwframe+0x63/0x6b
    
    The root cause is:
    - do_sys_open
     - f2fs_lookup
      - __f2fs_find_entry
       - f2fs_i_depth_write
        - f2fs_mark_inode_dirty_sync
         - f2fs_dirty_inode
          - set_inode_flag(inode, FI_DIRTY_INODE)
    
    - umount
     - kill_f2fs_super
      - kill_block_super
       - generic_shutdown_super
        - sync_filesystem
        : sb is readonly, skip sync_filesystem()
        - evict_inodes
         - iput
          - f2fs_evict_inode
           - f2fs_bug_on(sbi, is_inode_flag_set(inode, FI_DIRTY_INODE))
           : trigger kernel panic
    
    When we try to repair i_current_depth in readonly filesystem, let's
    skip dirty inode to avoid panic in later f2fs_evict_inode().
    
    Cc: [email protected]
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/linux-f2fs-devel/[email protected]
    Signed-off-by: Chao Yu <[email protected]>
    Signed-off-by: Jaegeuk Kim <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
firmware: turris-mox-rwtm: Fix checking return value of wait_for_completion_timeout() [+ + +]
Author: Marek Behún <[email protected]>
Date:   Mon Jul 15 13:59:11 2024 +0200

    firmware: turris-mox-rwtm: Fix checking return value of wait_for_completion_timeout()
    
    [ Upstream commit 8467cfe821ac3526f7598682ad5f90689fa8cc49 ]
    
    The wait_for_completion_timeout() function returns 0 if timed out, and a
    positive value if completed. Fix the usage of this function.
    
    Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver")
    Fixes: 2eab59cf0d20 ("firmware: turris-mox-rwtm: fail probing when firmware does not support hwrng")
    Signed-off-by: Marek Behún <[email protected]>
    Reviewed-by: Ilpo Järvinen <[email protected]>
    Reviewed-by: Andy Shevchenko <[email protected]>
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

firmware: turris-mox-rwtm: Initialize completion before mailbox [+ + +]
Author: Marek Behún <[email protected]>
Date:   Mon Jul 15 13:59:12 2024 +0200

    firmware: turris-mox-rwtm: Initialize completion before mailbox
    
    [ Upstream commit 49e24c80d3c81c43e2a56101449e1eea32fcf292 ]
    
    Initialize the completion before the mailbox channel is requested.
    
    Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver")
    Signed-off-by: Marek Behún <[email protected]>
    Reviewed-by: Andy Shevchenko <[email protected]>
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
Linux: Fix gcc 4.9 build issue in 5.4.y [+ + +]
Author: Jari Ruusu <[email protected]>
Date:   Fri Jul 26 09:53:18 2024 +0000

    Fix gcc 4.9 build issue in 5.4.y
    
    Some older systems still compile kernels with old gcc version.
    These warnings and errors show up when compiling with gcc 4.9.2
    
     error: "__GCC4_has_attribute___uninitialized__" is not defined [-Werror=undef]
    
    Upstream won't need this because newer kernels are not compilable with gcc 4.9.
    
    Subject: gcc-4.9 warning/error fix for 5.10.223-rc1
    Fixes: fd7eea27a3ae ("Compiler Attributes: Add __uninitialized macro")
    Signed-off-by: Jari Ruusu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
fs/nilfs2: remove some unused macros to tame gcc [+ + +]
Author: Alex Shi <[email protected]>
Date:   Tue Dec 15 20:45:27 2020 -0800

    fs/nilfs2: remove some unused macros to tame gcc
    
    [ Upstream commit e7920b3e9d9f5470d5ff7d883e72a47addc0a137 ]
    
    There some macros are unused and cause gcc warning. Remove them.
    
      fs/nilfs2/segment.c:137:0: warning: macro "nilfs_cnt32_gt" is not used [-Wunused-macros]
      fs/nilfs2/segment.c:144:0: warning: macro "nilfs_cnt32_le" is not used [-Wunused-macros]
      fs/nilfs2/segment.c:143:0: warning: macro "nilfs_cnt32_lt" is not used [-Wunused-macros]
    
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Ryusuke Konishi <[email protected]>
    Signed-off-by: Alex Shi <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Stable-dep-of: 0f3819e8c483 ("nilfs2: avoid undefined behavior in nilfs_cnt32_ge macro")
    Signed-off-by: Sasha Levin <[email protected]>

 
genirq/irqdesc: Honor caller provided affinity in alloc_desc() [+ + +]
Author: Shay Drory <[email protected]>
Date:   Tue Aug 6 10:20:44 2024 +0300

    genirq/irqdesc: Honor caller provided affinity in alloc_desc()
    
    commit edbbaae42a56f9a2b39c52ef2504dfb3fb0a7858 upstream.
    
    Currently, whenever a caller is providing an affinity hint for an
    interrupt, the allocation code uses it to calculate the node and copies the
    cpumask into irq_desc::affinity.
    
    If the affinity for the interrupt is not marked 'managed' then the startup
    of the interrupt ignores irq_desc::affinity and uses the system default
    affinity mask.
    
    Prevent this by setting the IRQD_AFFINITY_SET flag for the interrupt in the
    allocator, which causes irq_setup_affinity() to use irq_desc::affinity on
    interrupt startup if the mask contains an online CPU.
    
    [ tglx: Massaged changelog ]
    
    Fixes: 45ddcecbfa94 ("genirq: Use affinity hint in irqdesc allocation")
    Signed-off-by: Shay Drory <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: <[email protected]>
    Link: https://lore.kernel.org/all/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
genirq: Allow irq_chip registration functions to take a const irq_chip [+ + +]
Author: Marc Zyngier <[email protected]>
Date:   Wed Feb 9 16:25:59 2022 +0000

    genirq: Allow irq_chip registration functions to take a const irq_chip
    
    [ Upstream commit 393e1280f765661cf39785e967676a4e57324126 ]
    
    In order to let a const irqchip be fed to the irqchip layer, adjust
    the various prototypes. An extra cast in irq_set_chip()() is required
    to avoid a warning.
    
    Signed-off-by: Marc Zyngier <[email protected]>
    Acked-by: Linus Walleij <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

genirq: Allow the PM device to originate from irq domain [+ + +]
Author: Marc Zyngier <[email protected]>
Date:   Tue Feb 1 12:02:59 2022 +0000

    genirq: Allow the PM device to originate from irq domain
    
    [ Upstream commit 1f8863bfb5ca500ea1c7669b16b1931ba27fce20 ]
    
    As a preparation to moving the reference to the device used for
    runtime power management, add a new 'dev' field to the irqdomain
    structure for that exact purpose.
    
    The irq_chip_pm_{get,put}() helpers are made aware of the dual
    location via a new private helper.
    
    No functional change intended.
    
    Signed-off-by: Marc Zyngier <[email protected]>
    Reviewed-by: Geert Uytterhoeven <[email protected]>
    Tested-by: Geert Uytterhoeven <[email protected]>
    Tested-by: Tony Lindgren <[email protected]>
    Acked-by: Bartosz Golaszewski <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Stable-dep-of: 33b1c47d1fc0 ("irqchip/imx-irqsteer: Handle runtime power management correctly")
    Signed-off-by: Sasha Levin <[email protected]>

 
gss_krb5: Fix the error handling path for crypto_sync_skcipher_setkey [+ + +]
Author: Gaosheng Cui <[email protected]>
Date:   Sat Jul 6 14:50:08 2024 +0800

    gss_krb5: Fix the error handling path for crypto_sync_skcipher_setkey
    
    [ Upstream commit a3123341dc358952ce2bf8067fbdfb7eaadf71bb ]
    
    If we fail to call crypto_sync_skcipher_setkey, we should free the
    memory allocation for cipher, replace err_return with err_free_cipher
    to free the memory of cipher.
    
    Fixes: 4891f2d008e4 ("gss_krb5: import functionality to derive keys into the kernel")
    Signed-off-by: Gaosheng Cui <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Signed-off-by: Chuck Lever <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
hfs: fix to initialize fields of hfs_inode_info after hfs_alloc_inode() [+ + +]
Author: Chao Yu <[email protected]>
Date:   Sun Jun 16 09:38:41 2024 +0800

    hfs: fix to initialize fields of hfs_inode_info after hfs_alloc_inode()
    
    commit 26a2ed107929a855155429b11e1293b83e6b2a8b upstream.
    
    Syzbot reports uninitialized value access issue as below:
    
    loop0: detected capacity change from 0 to 64
    =====================================================
    BUG: KMSAN: uninit-value in hfs_revalidate_dentry+0x307/0x3f0 fs/hfs/sysdep.c:30
     hfs_revalidate_dentry+0x307/0x3f0 fs/hfs/sysdep.c:30
     d_revalidate fs/namei.c:862 [inline]
     lookup_fast+0x89e/0x8e0 fs/namei.c:1649
     walk_component fs/namei.c:2001 [inline]
     link_path_walk+0x817/0x1480 fs/namei.c:2332
     path_lookupat+0xd9/0x6f0 fs/namei.c:2485
     filename_lookup+0x22e/0x740 fs/namei.c:2515
     user_path_at_empty+0x8b/0x390 fs/namei.c:2924
     user_path_at include/linux/namei.h:57 [inline]
     do_mount fs/namespace.c:3689 [inline]
     __do_sys_mount fs/namespace.c:3898 [inline]
     __se_sys_mount+0x66b/0x810 fs/namespace.c:3875
     __x64_sys_mount+0xe4/0x140 fs/namespace.c:3875
     do_syscall_x64 arch/x86/entry/common.c:52 [inline]
     do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
     entry_SYSCALL_64_after_hwframe+0x63/0x6b
    
    BUG: KMSAN: uninit-value in hfs_ext_read_extent fs/hfs/extent.c:196 [inline]
    BUG: KMSAN: uninit-value in hfs_get_block+0x92d/0x1620 fs/hfs/extent.c:366
     hfs_ext_read_extent fs/hfs/extent.c:196 [inline]
     hfs_get_block+0x92d/0x1620 fs/hfs/extent.c:366
     block_read_full_folio+0x4ff/0x11b0 fs/buffer.c:2271
     hfs_read_folio+0x55/0x60 fs/hfs/inode.c:39
     filemap_read_folio+0x148/0x4f0 mm/filemap.c:2426
     do_read_cache_folio+0x7c8/0xd90 mm/filemap.c:3553
     do_read_cache_page mm/filemap.c:3595 [inline]
     read_cache_page+0xfb/0x2f0 mm/filemap.c:3604
     read_mapping_page include/linux/pagemap.h:755 [inline]
     hfs_btree_open+0x928/0x1ae0 fs/hfs/btree.c:78
     hfs_mdb_get+0x260c/0x3000 fs/hfs/mdb.c:204
     hfs_fill_super+0x1fb1/0x2790 fs/hfs/super.c:406
     mount_bdev+0x628/0x920 fs/super.c:1359
     hfs_mount+0xcd/0xe0 fs/hfs/super.c:456
     legacy_get_tree+0x167/0x2e0 fs/fs_context.c:610
     vfs_get_tree+0xdc/0x5d0 fs/super.c:1489
     do_new_mount+0x7a9/0x16f0 fs/namespace.c:3145
     path_mount+0xf98/0x26a0 fs/namespace.c:3475
     do_mount fs/namespace.c:3488 [inline]
     __do_sys_mount fs/namespace.c:3697 [inline]
     __se_sys_mount+0x919/0x9e0 fs/namespace.c:3674
     __ia32_sys_mount+0x15b/0x1b0 fs/namespace.c:3674
     do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline]
     __do_fast_syscall_32+0xa2/0x100 arch/x86/entry/common.c:178
     do_fast_syscall_32+0x37/0x80 arch/x86/entry/common.c:203
     do_SYSENTER_32+0x1f/0x30 arch/x86/entry/common.c:246
     entry_SYSENTER_compat_after_hwframe+0x70/0x82
    
    Uninit was created at:
     __alloc_pages+0x9a6/0xe00 mm/page_alloc.c:4590
     __alloc_pages_node include/linux/gfp.h:238 [inline]
     alloc_pages_node include/linux/gfp.h:261 [inline]
     alloc_slab_page mm/slub.c:2190 [inline]
     allocate_slab mm/slub.c:2354 [inline]
     new_slab+0x2d7/0x1400 mm/slub.c:2407
     ___slab_alloc+0x16b5/0x3970 mm/slub.c:3540
     __slab_alloc mm/slub.c:3625 [inline]
     __slab_alloc_node mm/slub.c:3678 [inline]
     slab_alloc_node mm/slub.c:3850 [inline]
     kmem_cache_alloc_lru+0x64d/0xb30 mm/slub.c:3879
     alloc_inode_sb include/linux/fs.h:3018 [inline]
     hfs_alloc_inode+0x5a/0xc0 fs/hfs/super.c:165
     alloc_inode+0x83/0x440 fs/inode.c:260
     new_inode_pseudo fs/inode.c:1005 [inline]
     new_inode+0x38/0x4f0 fs/inode.c:1031
     hfs_new_inode+0x61/0x1010 fs/hfs/inode.c:186
     hfs_mkdir+0x54/0x250 fs/hfs/dir.c:228
     vfs_mkdir+0x49a/0x700 fs/namei.c:4126
     do_mkdirat+0x529/0x810 fs/namei.c:4149
     __do_sys_mkdirat fs/namei.c:4164 [inline]
     __se_sys_mkdirat fs/namei.c:4162 [inline]
     __x64_sys_mkdirat+0xc8/0x120 fs/namei.c:4162
     do_syscall_x64 arch/x86/entry/common.c:52 [inline]
     do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
     entry_SYSCALL_64_after_hwframe+0x63/0x6b
    
    It missed to initialize .tz_secondswest, .cached_start and .cached_blocks
    fields in struct hfs_inode_info after hfs_alloc_inode(), fix it.
    
    Cc: [email protected]
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/linux-fsdevel/[email protected]
    Signed-off-by: Chao Yu <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Christian Brauner <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
hfsplus: fix to avoid false alarm of circular locking [+ + +]
Author: Chao Yu <[email protected]>
Date:   Fri Jun 7 22:23:04 2024 +0800

    hfsplus: fix to avoid false alarm of circular locking
    
    [ Upstream commit be4edd1642ee205ed7bbf66edc0453b1be1fb8d7 ]
    
    Syzbot report potential ABBA deadlock as below:
    
    loop0: detected capacity change from 0 to 1024
    ======================================================
    WARNING: possible circular locking dependency detected
    6.9.0-syzkaller-10323-g8f6a15f095a6 #0 Not tainted
    ------------------------------------------------------
    syz-executor171/5344 is trying to acquire lock:
    ffff88807cb980b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x811/0xb50 fs/hfsplus/extents.c:595
    
    but task is already holding lock:
    ffff88807a930108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2da/0xb50 fs/hfsplus/extents.c:576
    
    which lock already depends on the new lock.
    
    the existing dependency chain (in reverse order) is:
    
    -> #1 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}:
           lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
           __mutex_lock_common kernel/locking/mutex.c:608 [inline]
           __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
           hfsplus_file_extend+0x21b/0x1b70 fs/hfsplus/extents.c:457
           hfsplus_bmap_reserve+0x105/0x4e0 fs/hfsplus/btree.c:358
           hfsplus_rename_cat+0x1d0/0x1050 fs/hfsplus/catalog.c:456
           hfsplus_rename+0x12e/0x1c0 fs/hfsplus/dir.c:552
           vfs_rename+0xbdb/0xf00 fs/namei.c:4887
           do_renameat2+0xd94/0x13f0 fs/namei.c:5044
           __do_sys_rename fs/namei.c:5091 [inline]
           __se_sys_rename fs/namei.c:5089 [inline]
           __x64_sys_rename+0x86/0xa0 fs/namei.c:5089
           do_syscall_x64 arch/x86/entry/common.c:52 [inline]
           do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
           entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
    -> #0 (&tree->tree_lock){+.+.}-{3:3}:
           check_prev_add kernel/locking/lockdep.c:3134 [inline]
           check_prevs_add kernel/locking/lockdep.c:3253 [inline]
           validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869
           __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
           lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
           __mutex_lock_common kernel/locking/mutex.c:608 [inline]
           __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
           hfsplus_file_truncate+0x811/0xb50 fs/hfsplus/extents.c:595
           hfsplus_setattr+0x1ce/0x280 fs/hfsplus/inode.c:265
           notify_change+0xb9d/0xe70 fs/attr.c:497
           do_truncate+0x220/0x310 fs/open.c:65
           handle_truncate fs/namei.c:3308 [inline]
           do_open fs/namei.c:3654 [inline]
           path_openat+0x2a3d/0x3280 fs/namei.c:3807
           do_filp_open+0x235/0x490 fs/namei.c:3834
           do_sys_openat2+0x13e/0x1d0 fs/open.c:1406
           do_sys_open fs/open.c:1421 [inline]
           __do_sys_creat fs/open.c:1497 [inline]
           __se_sys_creat fs/open.c:1491 [inline]
           __x64_sys_creat+0x123/0x170 fs/open.c:1491
           do_syscall_x64 arch/x86/entry/common.c:52 [inline]
           do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
           entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
    other info that might help us debug this:
    
     Possible unsafe locking scenario:
    
           CPU0                    CPU1
           ----                    ----
      lock(&HFSPLUS_I(inode)->extents_lock);
                                   lock(&tree->tree_lock);
                                   lock(&HFSPLUS_I(inode)->extents_lock);
      lock(&tree->tree_lock);
    
    This is a false alarm as tree_lock mutex are different, one is
    from sbi->cat_tree, and another is from sbi->ext_tree:
    
    Thread A                        Thread B
    - hfsplus_rename
     - hfsplus_rename_cat
      - hfs_find_init
       - mutext_lock(cat_tree->tree_lock)
                                    - hfsplus_setattr
                                     - hfsplus_file_truncate
                                      - mutex_lock(hip->extents_lock)
                                      - hfs_find_init
                                       - mutext_lock(ext_tree->tree_lock)
      - hfs_bmap_reserve
       - hfsplus_file_extend
        - mutex_lock(hip->extents_lock)
    
    So, let's call mutex_lock_nested for tree_lock mutex lock, and pass
    correct lock class for it.
    
    Fixes: 31651c607151 ("hfsplus: avoid deadlock on file truncation")
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/linux-fsdevel/[email protected]
    Cc: Ernesto A. Fernández <[email protected]>
    Signed-off-by: Chao Yu <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Christian Brauner <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
HID: wacom: Modify pen IDs [+ + +]
Author: Tatsunosuke Tobita <[email protected]>
Date:   Tue Jul 9 14:57:28 2024 +0900

    HID: wacom: Modify pen IDs
    
    commit f0d17d696dfce77c9abc830e4ac2d677890a2dad upstream.
    
    The pen ID, 0x80842, was not the correct ID for wacom driver to
    treat. The ID was corrected to 0x8842.
    Also, 0x4200 was not the expected ID used on any Wacom device.
    Therefore, 0x4200 was removed.
    
    Signed-off-by: Tatsunosuke Tobita <[email protected]>
    Signed-off-by: Tatsunosuke Tobita <[email protected]>
    Fixes: bfdc750c4cb2 ("HID: wacom: add three styli to wacom_intuos_get_tool_type")
    Cc: [email protected] #6.2
    Reviewed-by: Ping Cheng <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Benjamin Tissoires <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
hwmon: (adt7475) Fix default duty on fan is disabled [+ + +]
Author: Wayne Tung <[email protected]>
Date:   Mon Jul 1 15:32:52 2024 +0800

    hwmon: (adt7475) Fix default duty on fan is disabled
    
    [ Upstream commit 39b24cced70fdc336dbc0070f8b3bde61d8513a8 ]
    
    According to the comments on fan is disabled, we change to manual mode
    and set the duty cycle to 0.
    For setting the duty cycle part, the register is wrong. Fix it.
    
    Fixes: 1c301fc5394f ("hwmon: Add a driver for the ADT7475 hardware monitoring chip")
    Signed-off-by: Wayne Tung <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

hwmon: (max6697) Fix swapped temp{1,8} critical alarms [+ + +]
Author: Guenter Roeck <[email protected]>
Date:   Sat Jul 13 12:03:53 2024 -0700

    hwmon: (max6697) Fix swapped temp{1,8} critical alarms
    
    [ Upstream commit 1ea3fd1eb9869fcdcbc9c68f9728bfc47b9503f1 ]
    
    The critical alarm bit for the local temperature sensor (temp1) is in
    bit 7 of register 0x45 (not bit 6), and the critical alarm bit for remote
    temperature sensor 7 (temp8) is in bit 6 (not bit 7).
    
    This only affects MAX6581 since all other chips supported by this driver
    do not support those critical alarms.
    
    Fixes: 5372d2d71c46 ("hwmon: Driver for Maxim MAX6697 and compatibles")
    Reviewed-by: Tzung-Bi Shih <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

hwmon: (max6697) Fix underflow when writing limit attributes [+ + +]
Author: Guenter Roeck <[email protected]>
Date:   Sat Jul 13 14:26:19 2024 -0700

    hwmon: (max6697) Fix underflow when writing limit attributes
    
    [ Upstream commit cbf7467828cd4ec7ceac7a8b5b5ddb2f69f07b0e ]
    
    Using DIV_ROUND_CLOSEST() on an unbound value can result in underflows.
    Indeed, module test scripts report:
    
    temp1_max: Suspected underflow: [min=0, read 255000, written -9223372036854775808]
    temp1_crit: Suspected underflow: [min=0, read 255000, written -9223372036854775808]
    
    Fix by introducing an extra set of clamping.
    
    Fixes: 5372d2d71c46 ("hwmon: Driver for Maxim MAX6697 and compatibles")
    Reviewed-by: Tzung-Bi Shih <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
hwrng: amd - Convert PCIBIOS_* return codes to errnos [+ + +]
Author: Ilpo Järvinen <[email protected]>
Date:   Mon May 27 16:26:15 2024 +0300

    hwrng: amd - Convert PCIBIOS_* return codes to errnos
    
    commit 14cba6ace79627a57fb9058582b03f0ed3832390 upstream.
    
    amd_rng_mod_init() uses pci_read_config_dword() that returns PCIBIOS_*
    codes. The return code is then returned as is but amd_rng_mod_init() is
    a module_init() function that should return normal errnos.
    
    Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal
    errno before returning it.
    
    Fixes: 96d63c0297cc ("[PATCH] Add AMD HW RNG driver")
    Cc: [email protected]
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
i2c: smbus: Don't filter out duplicate alerts [+ + +]
Author: Corey Minyard <[email protected]>
Date:   Thu Nov 21 10:10:51 2019 +0100

    i2c: smbus: Don't filter out duplicate alerts
    
    [ Upstream commit dca0dd28fa5e0a1ec41a623dbaf667601fc62331 ]
    
    Getting the same alert twice in a row is legal and normal,
    especially on a fast device (like running in qemu).  Kind of
    like interrupts.  So don't report duplicate alerts, and deliver
    them normally.
    
    [JD: Fixed subject]
    
    Signed-off-by: Corey Minyard <[email protected]>
    Signed-off-by: Jean Delvare <[email protected]>
    Reviewed-by: Benjamin Tissoires <[email protected]>
    Signed-off-by: Wolfram Sang <[email protected]>
    Stable-dep-of: 37c526f00bc1 ("i2c: smbus: Improve handling of stuck alerts")
    Signed-off-by: Sasha Levin <[email protected]>

i2c: smbus: Improve handling of stuck alerts [+ + +]
Author: Guenter Roeck <[email protected]>
Date:   Mon Jan 10 09:28:56 2022 -0800

    i2c: smbus: Improve handling of stuck alerts
    
    [ Upstream commit 37c526f00bc1c4f847fc800085f8f009d2e11be6 ]
    
    The following messages were observed while testing alert functionality
    on systems with multiple I2C devices on a single bus if alert was active
    on more than one chip.
    
    smbus_alert 3-000c: SMBALERT# from dev 0x0c, flag 0
    smbus_alert 3-000c: no driver alert()!
    
    and:
    
    smbus_alert 3-000c: SMBALERT# from dev 0x28, flag 0
    
    Once it starts, this message repeats forever at high rate. There is no
    device at any of the reported addresses.
    
    Analysis shows that this is seen if multiple devices have the alert pin
    active. Apparently some devices do not support SMBus arbitration correctly.
    They keep sending address bits after detecting an address collision and
    handle the collision not at all or too late.
    Specifically, address 0x0c is seen with ADT7461A at address 0x4c and
    ADM1021 at address 0x18 if alert is active on both chips. Address 0x28 is
    seen with ADT7483 at address 0x2a and ADT7461 at address 0x4c if alert is
    active on both chips.
    
    Once the system is in bad state (alert is set by more than one chip),
    it often only recovers by power cycling.
    
    To reduce the impact of this problem, abort the endless loop in
    smbus_alert() if the same address is read more than once and not
    handled by a driver.
    
    Fixes: b5527a7766f0 ("i2c: Add SMBus alert support")
    Signed-off-by: Guenter Roeck <[email protected]>
    [wsa: it also fixed an interrupt storm in one of my experiments]
    Tested-by: Wolfram Sang <[email protected]>
    [wsa: rebased, moved a comment as well, improved the 'invalid' value]
    Signed-off-by: Wolfram Sang <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

i2c: smbus: Send alert notifications to all devices if source not found [+ + +]
Author: Guenter Roeck <[email protected]>
Date:   Tue Jul 30 07:19:41 2024 -0700

    i2c: smbus: Send alert notifications to all devices if source not found
    
    [ Upstream commit f6c29f710c1ff2590109f83be3e212b86c01e0f3 ]
    
    If a SMBus alert is received and the originating device is not found,
    the reason may be that the address reported on the SMBus alert address
    is corrupted, for example because multiple devices asserted alert and
    do not correctly implement SMBus arbitration.
    
    If this happens, call alert handlers on all devices connected to the
    given I2C bus, in the hope that this cleans up the situation.
    
    This change reliably fixed the problem on a system with multiple devices
    on a single bus. Example log where the device on address 0x18 (ADM1021)
    and on address 0x4c (ADT7461A) both had the alert line asserted:
    
    smbus_alert 3-000c: SMBALERT# from dev 0x0c, flag 0
    smbus_alert 3-000c: no driver alert()!
    smbus_alert 3-000c: SMBALERT# from dev 0x0c, flag 0
    smbus_alert 3-000c: no driver alert()!
    lm90 3-0018: temp1 out of range, please check!
    lm90 3-0018: Disabling ALERT#
    lm90 3-0029: Everything OK
    lm90 3-002a: Everything OK
    lm90 3-004c: temp1 out of range, please check!
    lm90 3-004c: temp2 out of range, please check!
    lm90 3-004c: Disabling ALERT#
    
    Fixes: b5527a7766f0 ("i2c: Add SMBus alert support")
    Signed-off-by: Guenter Roeck <[email protected]>
    [wsa: fixed a typo in the commit message]
    Signed-off-by: Wolfram Sang <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
Input: elan_i2c - do not leave interrupt disabled on suspend failure [+ + +]
Author: Dmitry Torokhov <[email protected]>
Date:   Thu Jun 6 23:02:48 2024 -0700

    Input: elan_i2c - do not leave interrupt disabled on suspend failure
    
    [ Upstream commit 5f82c1e04721e7cd98e604eb4e58f0724d8e5a65 ]
    
    Make sure interrupts are not left disabled when we fail to suspend the
    touch controller.
    
    Fixes: 6696777c6506 ("Input: add driver for Elan I2C/SMbus touchpad")
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Dmitry Torokhov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

Input: qt1050 - handle CHIP_ID reading error [+ + +]
Author: Andrei Lalaev <[email protected]>
Date:   Mon Jun 17 20:30:18 2024 +0200

    Input: qt1050 - handle CHIP_ID reading error
    
    [ Upstream commit 866a5c7e2781cf1b019072288f1f5c64186dcb63 ]
    
    If the device is missing, we get the following error:
    
      qt1050 3-0041: ID -1340767592 not supported
    
    Let's handle this situation and print more informative error
    when reading of CHIP_ID fails:
    
      qt1050 3-0041: Failed to read chip ID: -6
    
    Fixes: cbebf5addec1 ("Input: qt1050 - add Microchip AT42QT1050 support")
    Signed-off-by: Andrei Lalaev <[email protected]>
    Reviewed-by: Marco Felsch <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Dmitry Torokhov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
ipv4: Fix incorrect source address in Record Route option [+ + +]
Author: Ido Schimmel <[email protected]>
Date:   Thu Jul 18 15:34:07 2024 +0300

    ipv4: Fix incorrect source address in Record Route option
    
    [ Upstream commit cc73bbab4b1fb8a4f53a24645871dafa5f81266a ]
    
    The Record Route IP option records the addresses of the routers that
    routed the packet. In the case of forwarded packets, the kernel performs
    a route lookup via fib_lookup() and fills in the preferred source
    address of the matched route.
    
    The lookup is performed with the DS field of the forwarded packet, but
    using the RT_TOS() macro which only masks one of the two ECN bits. If
    the packet is ECT(0) or CE, the matched route might be different than
    the route via which the packet was forwarded as the input path masks
    both of the ECN bits, resulting in the wrong address being filled in the
    Record Route option.
    
    Fix by masking both of the ECN bits.
    
    Fixes: 8e36360ae876 ("ipv4: Remove route key identity dependencies in ip_rt_get_source().")
    Signed-off-by: Ido Schimmel <[email protected]>
    Reviewed-by: Guillaume Nault <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
ipv6: fix ndisc_is_useropt() handling for PIO [+ + +]
Author: Maciej Żenczykowski <[email protected]>
Date:   Mon Jul 29 17:17:48 2024 -0700

    ipv6: fix ndisc_is_useropt() handling for PIO
    
    [ Upstream commit a46c68debf3be3a477a69ccbf0a1d050df841676 ]
    
    The current logic only works if the PIO is between two
    other ND user options.  This fixes it so that the PIO
    can also be either before or after other ND user options
    (for example the first or last option in the RA).
    
    side note: there's actually Android tests verifying
    a portion of the old broken behaviour, so:
      https://android-review.googlesource.com/c/kernel/tests/+/3196704
    fixes those up.
    
    Cc: Jen Linkova <[email protected]>
    Cc: Lorenzo Colitti <[email protected]>
    Cc: Patrick Rohr <[email protected]>
    Cc: David Ahern <[email protected]>
    Cc: YOSHIFUJI Hideaki / 吉藤英明 <[email protected]>
    Cc: Jakub Kicinski <[email protected]>
    Signed-off-by: Maciej Żenczykowski <[email protected]>
    Fixes: 048c796beb6e ("ipv6: adjust ndisc_is_useropt() to also return true for PIO")
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ipv6: take care of scope when choosing the src addr [+ + +]
Author: Nicolas Dichtel <[email protected]>
Date:   Wed Jul 10 10:14:29 2024 +0200

    ipv6: take care of scope when choosing the src addr
    
    commit abb9a68d2c64dd9b128ae1f2e635e4d805e7ce64 upstream.
    
    When the source address is selected, the scope must be checked. For
    example, if a loopback address is assigned to the vrf device, it must not
    be chosen for packets sent outside.
    
    CC: [email protected]
    Fixes: afbac6010aec ("net: ipv6: Address selection needs to consider L3 domains")
    Signed-off-by: Nicolas Dichtel <[email protected]>
    Reviewed-by: David Ahern <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ipvs: Avoid unnecessary calls to skb_is_gso_sctp [+ + +]
Author: Ismael Luceno <[email protected]>
Date:   Thu May 23 18:54:44 2024 +0200

    ipvs: Avoid unnecessary calls to skb_is_gso_sctp
    
    [ Upstream commit 53796b03295cf7ab1fc8600016fa6dfbf4a494a0 ]
    
    In the context of the SCTP SNAT/DNAT handler, these calls can only
    return true.
    
    Fixes: e10d3ba4d434 ("ipvs: Fix checksumming on GSO of SCTP packets")
    Signed-off-by: Ismael Luceno <[email protected]>
    Acked-by: Julian Anastasov <[email protected]>
    Acked-by: Simon Horman <[email protected]>
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
irqchip/imx-irqsteer: Add runtime PM support [+ + +]
Author: Lucas Stach <[email protected]>
Date:   Wed Apr 6 18:37:01 2022 +0200

    irqchip/imx-irqsteer: Add runtime PM support
    
    [ Upstream commit 4730d2233311d86cad9dc510318d1b40e4b53cf2 ]
    
    There are now SoCs that integrate the irqsteer controller within
    a separate power domain. In order to allow this domain to be
    powered down when not needed, add runtime PM support to the driver.
    
    Signed-off-by: Lucas Stach <[email protected]>
    Signed-off-by: Marc Zyngier <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Stable-dep-of: 33b1c47d1fc0 ("irqchip/imx-irqsteer: Handle runtime power management correctly")
    Signed-off-by: Sasha Levin <[email protected]>

irqchip/imx-irqsteer: Constify irq_chip struct [+ + +]
Author: Lucas Stach <[email protected]>
Date:   Wed Apr 6 18:37:00 2022 +0200

    irqchip/imx-irqsteer: Constify irq_chip struct
    
    [ Upstream commit e9a50f12e579a48e124ac5adb93dafc35f0a46b8 ]
    
    The imx_irqsteer_irq_chip struct is constant data.
    
    Signed-off-by: Lucas Stach <[email protected]>
    Signed-off-by: Marc Zyngier <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Stable-dep-of: 33b1c47d1fc0 ("irqchip/imx-irqsteer: Handle runtime power management correctly")
    Signed-off-by: Sasha Levin <[email protected]>

irqchip/imx-irqsteer: Handle runtime power management correctly [+ + +]
Author: Shenwei Wang <[email protected]>
Date:   Wed Jul 3 11:32:50 2024 -0500

    irqchip/imx-irqsteer: Handle runtime power management correctly
    
    [ Upstream commit 33b1c47d1fc0b5f06a393bb915db85baacba18ea ]
    
    The power domain is automatically activated from clk_prepare(). However, on
    certain platforms like i.MX8QM and i.MX8QXP, the power-on handling invokes
    sleeping functions, which triggers the 'scheduling while atomic' bug in the
    context switch path during device probing:
    
     BUG: scheduling while atomic: kworker/u13:1/48/0x00000002
     Call trace:
      __schedule_bug+0x54/0x6c
      __schedule+0x7f0/0xa94
      schedule+0x5c/0xc4
      schedule_preempt_disabled+0x24/0x40
      __mutex_lock.constprop.0+0x2c0/0x540
      __mutex_lock_slowpath+0x14/0x20
      mutex_lock+0x48/0x54
      clk_prepare_lock+0x44/0xa0
      clk_prepare+0x20/0x44
      imx_irqsteer_resume+0x28/0xe0
      pm_generic_runtime_resume+0x2c/0x44
      __genpd_runtime_resume+0x30/0x80
      genpd_runtime_resume+0xc8/0x2c0
      __rpm_callback+0x48/0x1d8
      rpm_callback+0x6c/0x78
      rpm_resume+0x490/0x6b4
      __pm_runtime_resume+0x50/0x94
      irq_chip_pm_get+0x2c/0xa0
      __irq_do_set_handler+0x178/0x24c
      irq_set_chained_handler_and_data+0x60/0xa4
      mxc_gpio_probe+0x160/0x4b0
    
    Cure this by implementing the irq_bus_lock/sync_unlock() interrupt chip
    callbacks and handle power management in them as they are invoked from
    non-atomic context.
    
    [ tglx: Rewrote change log, added Fixes tag ]
    
    Fixes: 0136afa08967 ("irqchip: Add driver for imx-irqsteer controller")
    Signed-off-by: Shenwei Wang <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
irqchip/mbigen: Fix mbigen node address layout [+ + +]
Author: Yipeng Zou <[email protected]>
Date:   Tue Jul 30 09:44:00 2024 +0800

    irqchip/mbigen: Fix mbigen node address layout
    
    [ Upstream commit 6be6cba9c4371d27f78d900ccfe34bb880d9ee20 ]
    
    The mbigen interrupt chip has its per node registers located in a
    contiguous region of page sized chunks. The code maps them into virtual
    address space as a contiguous region and determines the address of a node
    by using the node ID as index.
    
                        mbigen chip
           |-----------------|------------|--------------|
       mgn_node_0         mgn_node_1     ...         mgn_node_i
    |--------------|   |--------------|       |----------------------|
    [0x0000, 0x0x0FFF] [0x1000, 0x1FFF]    [i*0x1000, (i+1)*0x1000 - 1]
    
    This works correctly up to 10 nodes, but then fails because the 11th's
    array slot is used for the MGN_CLEAR registers.
    
                             mbigen chip
        |-----------|--------|--------|---------------|--------|
    mgn_node_0  mgn_node_1  ...  mgn_clear_register  ...   mgn_node_i
                                |-----------------|
                                 [0xA000, 0xAFFF]
    
    Skip the MGN_CLEAR register space when calculating the offset for node IDs
    greater than or equal to ten.
    
    Fixes: a6c2f87b8820 ("irqchip/mbigen: Implement the mbigen irq chip operation functions")
    Signed-off-by: Yipeng Zou <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Link: https://lore.kernel.org/all/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
jbd2: avoid memleak in jbd2_journal_write_metadata_buffer [+ + +]
Author: Kemeng Shi <[email protected]>
Date:   Tue May 14 19:24:30 2024 +0800

    jbd2: avoid memleak in jbd2_journal_write_metadata_buffer
    
    [ Upstream commit cc102aa24638b90e04364d64e4f58a1fa91a1976 ]
    
    The new_bh is from alloc_buffer_head, we should call free_buffer_head to
    free it in error case.
    
    Signed-off-by: Kemeng Shi <[email protected]>
    Reviewed-by: Zhang Yi <[email protected]>
    Reviewed-by: Jan Kara <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
jfs: Fix array-index-out-of-bounds in diFree [+ + +]
Author: Jeongjun Park <[email protected]>
Date:   Thu May 30 22:28:09 2024 +0900

    jfs: Fix array-index-out-of-bounds in diFree
    
    [ Upstream commit f73f969b2eb39ad8056f6c7f3a295fa2f85e313a ]
    
    Reported-by: [email protected]
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Jeongjun Park <[email protected]>
    Signed-off-by: Dave Kleikamp <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
kbuild: Fix '-S -c' in x86 stack protector scripts [+ + +]
Author: Nathan Chancellor <[email protected]>
Date:   Fri Jul 26 11:05:00 2024 -0700

    kbuild: Fix '-S -c' in x86 stack protector scripts
    
    commit 3415b10a03945b0da4a635e146750dfe5ce0f448 upstream.
    
    After a recent change in clang to stop consuming all instances of '-S'
    and '-c' [1], the stack protector scripts break due to the kernel's use
    of -Werror=unused-command-line-argument to catch cases where flags are
    not being properly consumed by the compiler driver:
    
      $ echo | clang -o - -x c - -S -c -Werror=unused-command-line-argument
      clang: error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument]
    
    This results in CONFIG_STACKPROTECTOR getting disabled because
    CONFIG_CC_HAS_SANE_STACKPROTECTOR is no longer set.
    
    '-c' and '-S' both instruct the compiler to stop at different stages of
    the pipeline ('-S' after compiling, '-c' after assembling), so having
    them present together in the same command makes little sense. In this
    case, the test wants to stop before assembling because it is looking at
    the textual assembly output of the compiler for either '%fs' or '%gs',
    so remove '-c' from the list of arguments to resolve the error.
    
    All versions of GCC continue to work after this change, along with
    versions of clang that do or do not contain the change mentioned above.
    
    Cc: [email protected]
    Fixes: 4f7fd4d7a791 ("[PATCH] Add the -fstack-protector option to the CFLAGS")
    Fixes: 60a5317ff0f4 ("x86: implement x86_32 stack protector")
    Link: https://github.com/llvm/llvm-project/commit/6461e537815f7fa68cef06842505353cf5600e9c [1]
    Signed-off-by: Nathan Chancellor <[email protected]>
    Signed-off-by: Masahiro Yamada <[email protected]>
    [nathan: Fixed conflict in 32-bit version due to lack of 3fb0fdb3bbe7]
    Signed-off-by: Nathan Chancellor <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
kdb: address -Wformat-security warnings [+ + +]
Author: Arnd Bergmann <[email protected]>
Date:   Tue May 28 14:11:48 2024 +0200

    kdb: address -Wformat-security warnings
    
    [ Upstream commit 70867efacf4370b6c7cdfc7a5b11300e9ef7de64 ]
    
    When -Wformat-security is not disabled, using a string pointer
    as a format causes a warning:
    
    kernel/debug/kdb/kdb_io.c: In function 'kdb_read':
    kernel/debug/kdb/kdb_io.c:365:36: error: format not a string literal and no format arguments [-Werror=format-security]
      365 |                         kdb_printf(kdb_prompt_str);
          |                                    ^~~~~~~~~~~~~~
    kernel/debug/kdb/kdb_io.c: In function 'kdb_getstr':
    kernel/debug/kdb/kdb_io.c:456:20: error: format not a string literal and no format arguments [-Werror=format-security]
      456 |         kdb_printf(kdb_prompt_str);
          |                    ^~~~~~~~~~~~~~
    
    Use an explcit "%s" format instead.
    
    Signed-off-by: Arnd Bergmann <[email protected]>
    Fixes: 5d5314d6795f ("kdb: core for kgdb back end (1 of 2)")
    Reviewed-by: Douglas Anderson <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Daniel Thompson <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

kdb: Use the passed prompt in kdb_position_cursor() [+ + +]
Author: Douglas Anderson <[email protected]>
Date:   Tue May 28 07:11:48 2024 -0700

    kdb: Use the passed prompt in kdb_position_cursor()
    
    [ Upstream commit e2e821095949cde46256034975a90f88626a2a73 ]
    
    The function kdb_position_cursor() takes in a "prompt" parameter but
    never uses it. This doesn't _really_ matter since all current callers
    of the function pass the same value and it's a global variable, but
    it's a bit ugly. Let's clean it up.
    
    Found by code inspection. This patch is expected to functionally be a
    no-op.
    
    Fixes: 09b35989421d ("kdb: Use format-strings rather than '\0' injection in kdb_read()")
    Signed-off-by: Douglas Anderson <[email protected]>
    Link: https://lore.kernel.org/r/20240528071144.1.I0feb49839c6b6f4f2c4bf34764f5e95de3f55a66@changeid
    Signed-off-by: Daniel Thompson <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
kobject_uevent: Fix OOB access within zap_modalias_env() [+ + +]
Author: Zijun Hu <[email protected]>
Date:   Thu May 30 21:14:37 2024 +0800

    kobject_uevent: Fix OOB access within zap_modalias_env()
    
    commit dd6e9894b451e7c85cceb8e9dc5432679a70e7dc upstream.
    
    zap_modalias_env() wrongly calculates size of memory block to move, so
    will cause OOB memory access issue if variable MODALIAS is not the last
    one within its @env parameter, fixed by correcting size to memmove.
    
    Fixes: 9b3fa47d4a76 ("kobject: fix suppressing modalias in uevents delivered over netlink")
    Cc: [email protected]
    Signed-off-by: Zijun Hu <[email protected]>
    Reviewed-by: Lk Sii <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
leds: ss4200: Convert PCIBIOS_* return codes to errnos [+ + +]
Author: Ilpo Järvinen <[email protected]>
Date:   Mon May 27 16:27:00 2024 +0300

    leds: ss4200: Convert PCIBIOS_* return codes to errnos
    
    commit ce068e83976140badb19c7f1307926b4b562fac4 upstream.
    
    ich7_lpc_probe() uses pci_read_config_dword() that returns PCIBIOS_*
    codes. The error handling code assumes incorrectly it's a normal errno
    and checks for < 0. The return code is returned from the probe function
    as is but probe functions should return normal errnos.
    
    Remove < 0 from the check and convert PCIBIOS_* returns code using
    pcibios_err_to_errno() into normal errno before returning it.
    
    Fixes: a328e95b82c1 ("leds: LED driver for Intel NAS SS4200 series (v5)")
    Cc:  <[email protected]>
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

leds: trigger: Unregister sysfs attributes before calling deactivate() [+ + +]
Author: Hans de Goede <[email protected]>
Date:   Sat May 4 18:25:33 2024 +0200

    leds: trigger: Unregister sysfs attributes before calling deactivate()
    
    [ Upstream commit c0dc9adf9474ecb7106e60e5472577375aedaed3 ]
    
    Triggers which have trigger specific sysfs attributes typically store
    related data in trigger-data allocated by the activate() callback and
    freed by the deactivate() callback.
    
    Calling device_remove_groups() after calling deactivate() leaves a window
    where the sysfs attributes show/store functions could be called after
    deactivation and then operate on the just freed trigger-data.
    
    Move the device_remove_groups() call to before deactivate() to close
    this race window.
    
    This also makes the deactivation path properly do things in reverse order
    of the activation path which calls the activate() callback before calling
    device_add_groups().
    
    Fixes: a7e7a3156300 ("leds: triggers: add device attribute support")
    Cc: Uwe Kleine-König <[email protected]>
    Signed-off-by: Hans de Goede <[email protected]>
    Acked-by: Uwe Kleine-König <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
lib: objagg: Fix general protection fault [+ + +]
Author: Ido Schimmel <[email protected]>
Date:   Thu Jun 6 16:49:41 2024 +0200

    lib: objagg: Fix general protection fault
    
    [ Upstream commit b4a3a89fffcdf09702b1f161b914e52abca1894d ]
    
    The library supports aggregation of objects into other objects only if
    the parent object does not have a parent itself. That is, nesting is not
    supported.
    
    Aggregation happens in two cases: Without and with hints, where hints
    are a pre-computed recommendation on how to aggregate the provided
    objects.
    
    Nesting is not possible in the first case due to a check that prevents
    it, but in the second case there is no check because the assumption is
    that nesting cannot happen when creating objects based on hints. The
    violation of this assumption leads to various warnings and eventually to
    a general protection fault [1].
    
    Before fixing the root cause, error out when nesting happens and warn.
    
    [1]
    general protection fault, probably for non-canonical address 0xdead000000000d90: 0000 [#1] PREEMPT SMP PTI
    CPU: 1 PID: 1083 Comm: kworker/1:9 Tainted: G        W          6.9.0-rc6-custom-gd9b4f1cca7fb #7
    Hardware name: Mellanox Technologies Ltd. MSN3700/VMOD0005, BIOS 5.11 01/06/2019
    Workqueue: mlxsw_core mlxsw_sp_acl_tcam_vregion_rehash_work
    RIP: 0010:mlxsw_sp_acl_erp_bf_insert+0x25/0x80
    [...]
    Call Trace:
     <TASK>
     mlxsw_sp_acl_atcam_entry_add+0x256/0x3c0
     mlxsw_sp_acl_tcam_entry_create+0x5e/0xa0
     mlxsw_sp_acl_tcam_vchunk_migrate_one+0x16b/0x270
     mlxsw_sp_acl_tcam_vregion_rehash_work+0xbe/0x510
     process_one_work+0x151/0x370
     worker_thread+0x2cb/0x3e0
     kthread+0xd0/0x100
     ret_from_fork+0x34/0x50
     ret_from_fork_asm+0x1a/0x30
     </TASK>
    
    Fixes: 9069a3817d82 ("lib: objagg: implement optimization hints assembly and use hints for object creation")
    Reported-by: Alexander Zubkov <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>
    Reviewed-by: Amit Cohen <[email protected]>
    Tested-by: Alexander Zubkov <[email protected]>
    Signed-off-by: Petr Machata <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
libbpf: Fix no-args func prototype BTF dumping syntax [+ + +]
Author: Andrii Nakryiko <[email protected]>
Date:   Fri Jul 12 15:44:42 2024 -0700

    libbpf: Fix no-args func prototype BTF dumping syntax
    
    [ Upstream commit 189f1a976e426011e6a5588f1d3ceedf71fe2965 ]
    
    For all these years libbpf's BTF dumper has been emitting not strictly
    valid syntax for function prototypes that have no input arguments.
    
    Instead of `int (*blah)()` we should emit `int (*blah)(void)`.
    
    This is not normally a problem, but it manifests when we get kfuncs in
    vmlinux.h that have no input arguments. Due to compiler internal
    specifics, we get no BTF information for such kfuncs, if they are not
    declared with proper `(void)`.
    
    The fix is trivial. We also need to adjust a few ancient tests that
    happily assumed `()` is correct.
    
    Fixes: 351131b51c7a ("libbpf: add btf_dump API for BTF-to-C conversion")
    Reported-by: Tejun Heo <[email protected]>
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Signed-off-by: Daniel Borkmann <[email protected]>
    Acked-by: Stanislav Fomichev <[email protected]>
    Link: https://lore.kernel.org/bpf/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
Linux: Linux 5.4.282 [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Mon Aug 19 05:33:54 2024 +0200

    Linux 5.4.282
    
    Link: https://lore.kernel.org/r/[email protected]
    Tested-by: Florian Fainelli <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Tested-by: Jon Hunter <[email protected]>
    Tested-by: Florian Fainelli <[email protected]>
    Tested-by: Linux Kernel Functional Testing <[email protected]>
    Tested-by: Harshit Mogalapalli <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
m68k: amiga: Turn off Warp1260 interrupts during boot [+ + +]
Author: Paolo Pisati <[email protected]>
Date:   Sat Jun 1 17:32:54 2024 +0200

    m68k: amiga: Turn off Warp1260 interrupts during boot
    
    commit 1d8491d3e726984343dd8c3cdbe2f2b47cfdd928 upstream.
    
    On an Amiga 1200 equipped with a Warp1260 accelerator, an interrupt
    storm coming from the accelerator board causes the machine to crash in
    local_irq_enable() or auto_irq_enable().  Disabling interrupts for the
    Warp1260 in amiga_parse_bootinfo() fixes the problem.
    
    Link: https://lore.kernel.org/r/[email protected]
    Cc: stable <[email protected]>
    Signed-off-by: Paolo Pisati <[email protected]>
    Reviewed-by: Michael Schmitz <[email protected]>
    Reviewed-by: Geert Uytterhoeven <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Geert Uytterhoeven <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

m68k: atari: Fix TT bootup freeze / unexpected (SCU) interrupt messages [+ + +]
Author: Eero Tamminen <[email protected]>
Date:   Mon Jun 24 17:49:01 2024 +0300

    m68k: atari: Fix TT bootup freeze / unexpected (SCU) interrupt messages
    
    [ Upstream commit f70065a9fd988983b2c693631b801f25a615fc04 ]
    
    Avoid freeze on Atari TT / MegaSTe boot with continuous messages of:
    
            unexpected interrupt from 112
    
    Which was due to VBL interrupt being enabled in SCU sys mask, but there
    being no handler for that any more.
    
    (Bug and fix were first verified on real Atari TT HW by Christian,
     this patch later on in Hatari emulator.)
    
    Fixes: 1fa0b29f3a43f9dd ("fbdev: Kill Atari vblank cursor blinking")
    Reported-by: Nicolas Pomarède <[email protected]>
    Closes: https://listengine.tuxfamily.org/lists.tuxfamily.org/hatari-devel/2024/06/msg00016.html
    Closes: https://lore.kernel.org/all/[email protected]
    Tested-by: Christian Zietz <[email protected]>
    Signed-off-by: Eero Tamminen <[email protected]>
    Reviewed-by: Michael Schmitz <[email protected]>
    Reviewed-by: Geert Uytterhoeven <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Geert Uytterhoeven <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

m68k: cmpxchg: Fix return value for default case in __arch_xchg() [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Tue Jul 2 05:41:17 2024 +0200

    m68k: cmpxchg: Fix return value for default case in __arch_xchg()
    
    [ Upstream commit 21b9e722ad28c19c2bc83f18f540b3dbd89bf762 ]
    
    The return value of __invalid_xchg_size() is assigned to tmp instead of
    the return variable x. Assign it to x instead.
    
    Fixes: 2501cf768e4009a0 ("m68k: Fix xchg/cmpxchg to fail to link if given an inappropriate pointer")
    Signed-off-by: Thorsten Blum <[email protected]>
    Reviewed-by: Geert Uytterhoeven <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Geert Uytterhoeven <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
macintosh/therm_windtunnel: fix module unload. [+ + +]
Author: Nick Bowler <[email protected]>
Date:   Wed Jul 10 23:54:17 2024 -0400

    macintosh/therm_windtunnel: fix module unload.
    
    [ Upstream commit fd748e177194ebcbbaf98df75152a30e08230cc6 ]
    
    The of_device_unregister call in therm_windtunnel's module_exit procedure
    does not fully reverse the effects of of_platform_device_create in the
    module_init prodedure.  Once you unload this module, it is impossible
    to load it ever again since only the first of_platform_device_create
    call on the fan node succeeds.
    
    This driver predates first git commit, and it turns out back then
    of_platform_device_create worked differently than it does today.
    So this is actually an old regression.
    
    The appropriate function to undo of_platform_device_create now appears
    to be of_platform_device_destroy, and switching to use this makes it
    possible to unload and load the module as expected.
    
    Signed-off-by: Nick Bowler <[email protected]>
    Fixes: c6e126de43e7 ("of: Keep track of populated platform devices")
    Signed-off-by: Michael Ellerman <[email protected]>
    Link: https://msgid.link/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
md/raid5: avoid BUG_ON() while continue reshape after reassembling [+ + +]
Author: Yu Kuai <[email protected]>
Date:   Tue Jun 11 21:22:51 2024 +0800

    md/raid5: avoid BUG_ON() while continue reshape after reassembling
    
    [ Upstream commit 305a5170dc5cf3d395bb4c4e9239bca6d0b54b49 ]
    
    Currently, mdadm support --revert-reshape to abort the reshape while
    reassembling, as the test 07revert-grow. However, following BUG_ON()
    can be triggerred by the test:
    
    kernel BUG at drivers/md/raid5.c:6278!
    invalid opcode: 0000 [#1] PREEMPT SMP PTI
    irq event stamp: 158985
    CPU: 6 PID: 891 Comm: md0_reshape Not tainted 6.9.0-03335-g7592a0b0049a #94
    RIP: 0010:reshape_request+0x3f1/0xe60
    Call Trace:
     <TASK>
     raid5_sync_request+0x43d/0x550
     md_do_sync+0xb7a/0x2110
     md_thread+0x294/0x2b0
     kthread+0x147/0x1c0
     ret_from_fork+0x59/0x70
     ret_from_fork_asm+0x1a/0x30
     </TASK>
    
    Root cause is that --revert-reshape update the raid_disks from 5 to 4,
    while reshape position is still set, and after reassembling the array,
    reshape position will be read from super block, then during reshape the
    checking of 'writepos' that is caculated by old reshape position will
    fail.
    
    Fix this panic the easy way first, by converting the BUG_ON() to
    WARN_ON(), and stop the reshape if checkings fail.
    
    Noted that mdadm must fix --revert-shape as well, and probably md/raid
    should enhance metadata validation as well, however this means
    reassemble will fail and there must be user tools to fix the wrong
    metadata.
    
    Signed-off-by: Yu Kuai <[email protected]>
    Signed-off-by: Song Liu <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control() [+ + +]
Author: Zheng Yejian <[email protected]>
Date:   Thu May 9 20:44:14 2024 +0800

    media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
    
    [ Upstream commit 2052138b7da52ad5ccaf74f736d00f39a1c9198c ]
    
    Infinite log printing occurs during fuzz test:
    
      rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
      ...
      dvb-usb: schedule remote query interval to 100 msecs.
      dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
      dvb-usb: bulk message failed: -22 (1/0)
      dvb-usb: bulk message failed: -22 (1/0)
      dvb-usb: bulk message failed: -22 (1/0)
      ...
      dvb-usb: bulk message failed: -22 (1/0)
    
    Looking into the codes, there is a loop in dvb_usb_read_remote_control(),
    that is in rc_core_dvb_usb_remote_init() create a work that will call
    dvb_usb_read_remote_control(), and this work will reschedule itself at
    'rc_interval' intervals to recursively call dvb_usb_read_remote_control(),
    see following code snippet:
    
      rc_core_dvb_usb_remote_init() {
        ...
        INIT_DELAYED_WORK(&d->rc_query_work, dvb_usb_read_remote_control);
        schedule_delayed_work(&d->rc_query_work,
                              msecs_to_jiffies(rc_interval));
        ...
      }
    
      dvb_usb_read_remote_control() {
        ...
        err = d->props.rc.core.rc_query(d);
        if (err)
          err(...)  // Did not return even if query failed
        schedule_delayed_work(&d->rc_query_work,
                              msecs_to_jiffies(rc_interval));
      }
    
    When the infinite log printing occurs, the query callback
    'd->props.rc.core.rc_query' is cxusb_rc_query(). And the log is due to
    the failure of finding a valid 'generic_bulk_ctrl_endpoint'
    in usb_bulk_msg(), see following code snippet:
    
      cxusb_rc_query() {
        cxusb_ctrl_msg() {
          dvb_usb_generic_rw() {
            ret = usb_bulk_msg(d->udev, usb_sndbulkpipe(d->udev,
                               d->props.generic_bulk_ctrl_endpoint),...);
            if (ret)
              err("bulk message failed: %d (%d/%d)",ret,wlen,actlen);
              ...
          }
      ...
      }
    
    By analyzing the corresponding USB descriptor, it shows that the
    bNumEndpoints is 0 in its interface descriptor, but
    the 'generic_bulk_ctrl_endpoint' is 1, that means user don't configure
    a valid endpoint for 'generic_bulk_ctrl_endpoint', therefore this
    'invalid' USB device should be rejected before it calls into
    dvb_usb_read_remote_control().
    
    To fix it, we need to add endpoint check for 'generic_bulk_ctrl_endpoint'.
    And as Sean suggested, the same check and clear halts should be done for
    'generic_bulk_ctrl_endpoint_response'. So introduce
    dvb_usb_check_bulk_endpoint() to do it for both of them.
    
    Fixes: 4d43e13f723e ("V4L/DVB (4643): Multi-input patch for DVB-USB device")
    Signed-off-by: Zheng Yejian <[email protected]>
    Signed-off-by: Sean Young <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

media: imon: Fix race getting ictx->lock [+ + +]
Author: Ricardo Ribalda <[email protected]>
Date:   Mon May 6 21:10:27 2024 +0000

    media: imon: Fix race getting ictx->lock
    
    [ Upstream commit 24147897507cd3a7d63745d1518a638bf4132238 ]
    
    Lets fix a race between mutex_is_lock() and mutex_lock().
    
    <-mutex is not locked
    if (!mutex_is_locked(&ictx->lock)) {
            unlock = true; <- mutex is locked externaly
            mutex_lock(&ictx->lock);
    }
    
    Let's use mutex_trylock() that does mutex_is_lock() and mutex_lock()
    atomically.
    
    Fix the following cocci warning:
    drivers/media/rc/imon.c:1167:1-7: preceding lock on line 1153
    
    Fixes: 23ef710e1a6c ("[media] imon: add conditional locking in change_protocol")
    Signed-off-by: Ricardo Ribalda <[email protected]>
    Signed-off-by: Sean Young <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

media: renesas: vsp1: Fix _irqsave and _irq mix [+ + +]
Author: Laurent Pinchart <[email protected]>
Date:   Sun May 5 20:22:27 2024 +0300

    media: renesas: vsp1: Fix _irqsave and _irq mix
    
    [ Upstream commit 57edbbcf5258c378a9b9d0c80d33b03a010b22c8 ]
    
    The histogram support mixes _irqsave and _irq, causing the following
    smatch warning:
    
         drivers/media/platform/renesas/vsp1/vsp1_histo.c:153 histo_stop_streaming()
         warn: mixing irqsave and irq
    
    The histo_stop_streaming() calls spin_lock_irqsave() followed by
    wait_event_lock_irq(). The former hints that interrupts may be disabled
    by the caller, while the latter reenables interrupts unconditionally.
    This doesn't cause any real bug, as the function is always called with
    interrupts enabled, but the pattern is still incorrect.
    
    Fix the problem by using spin_lock_irq() instead of spin_lock_irqsave()
    in histo_stop_streaming(). While at it, switch to spin_lock_irq() and
    spin_lock() as appropriate elsewhere.
    
    Fixes: 99362e32332b ("[media] v4l: vsp1: Add histogram support")
    Reported-by: Dan Carpenter <[email protected]>
    Closes: https://lore.kernel.org/linux-renesas-soc/[email protected]/
    Reviewed-by: Kieran Bingham <[email protected]>
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

media: renesas: vsp1: Store RPF partition configuration per RPF instance [+ + +]
Author: Laurent Pinchart <[email protected]>
Date:   Sun Nov 19 03:11:51 2023 +0200

    media: renesas: vsp1: Store RPF partition configuration per RPF instance
    
    [ Upstream commit a213bc09b1025c771ee722ee341af1d84375db8a ]
    
    The vsp1_partition structure stores the RPF partition configuration in a
    single field for all RPF instances, while each RPF can have its own
    configuration. Fix it by storing the configuration separately for each
    RPF instance.
    
    Signed-off-by: Laurent Pinchart <[email protected]>
    Fixes: ab45e8585182 ("media: v4l: vsp1: Allow entities to participate in the partition algorithm")
    Reviewed-by: Jacopo Mondi <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

media: Revert "media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()" [+ + +]
Author: Sean Young <[email protected]>
Date:   Thu Aug 8 10:35:19 2024 +0200

    media: Revert "media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()"
    
    commit 0c84bde4f37ba27d50e4c70ecacd33fe4a57030d upstream.
    
    This reverts commit 2052138b7da52ad5ccaf74f736d00f39a1c9198c.
    
    This breaks the TeVii s480 dual DVB-S2 S660. The device has a bulk in
    endpoint but no corresponding out endpoint, so the device does not pass
    the "has both receive and send bulk endpoint" test.
    
    Seemingly this device does not use dvb_usb_generic_rw() so I have tried
    removing the generic_bulk_ctrl_endpoint entry, but this resulted in
    different problems.
    
    As we have no explanation yet, revert.
    
    $ dmesg | grep -i -e dvb -e dw21 -e usb\ 4
    [    0.999122] usb 1-1: new high-speed USB device number 2 using ehci-pci
    [    1.023123] usb 4-1: new high-speed USB device number 2 using ehci-pci
    [    1.130247] usb 1-1: New USB device found, idVendor=9022, idProduct=d482,
    +bcdDevice= 0.01
    [    1.130257] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    [    1.152323] usb 4-1: New USB device found, idVendor=9022, idProduct=d481,
    +bcdDevice= 0.01
    [    1.152329] usb 4-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    [    6.701033] dvb-usb: found a 'TeVii S480.2 USB' in cold state, will try to
    +load a firmware
    [    6.701178] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw'
    [    6.701179] dw2102: start downloading DW210X firmware
    [    6.703715] dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in cold
    +state, will try to load a firmware
    [    6.703974] dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.20.fw'
    [    6.756432] usb 1-1: USB disconnect, device number 2
    [    6.862119] dvb-usb: found a 'TeVii S480.2 USB' in warm state.
    [    6.862194] dvb-usb: TeVii S480.2 USB error while loading driver (-22)
    [    6.862209] dvb-usb: found a 'TeVii S480.1 USB' in cold state, will try to
    +load a firmware
    [    6.862244] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw'
    [    6.862245] dw2102: start downloading DW210X firmware
    [    6.914811] usb 4-1: USB disconnect, device number 2
    [    7.014131] dvb-usb: found a 'TeVii S480.1 USB' in warm state.
    [    7.014487] dvb-usb: TeVii S480.1 USB error while loading driver (-22)
    [    7.014538] usbcore: registered new interface driver dw2102
    
    Closes: https://lore.kernel.org/stable/20240801165146.38991f60@mir/
    
    Fixes: 2052138b7da5 ("media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()")
    Reported-by: Stefan Lippers-Hollmann <[email protected]>
    Cc: [email protected]
    Signed-off-by: Sean Young <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: uvcvideo: Allow entity-defined get_info and get_cur [+ + +]
Author: Ricardo Ribalda <[email protected]>
Date:   Wed Dec 23 14:35:21 2020 +0100

    media: uvcvideo: Allow entity-defined get_info and get_cur
    
    [ Upstream commit 65900c581d014499f0f8ceabfc02c652e9a88771 ]
    
    Allows controls to get their properties and current value
    from an entity-defined function instead of via a query to the USB
    device.
    
    Signed-off-by: Ricardo Ribalda <[email protected]>
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Stable-dep-of: 86419686e66d ("media: uvcvideo: Override default flags")
    Signed-off-by: Sasha Levin <[email protected]>

media: uvcvideo: Fix the bandwdith quirk on USB 3.x [+ + +]
Author: Michal Pecio <[email protected]>
Date:   Sun Apr 14 19:00:40 2024 +0200

    media: uvcvideo: Fix the bandwdith quirk on USB 3.x
    
    [ Upstream commit 9e3d55fbd160b3ca376599a68b4cddfdc67d4153 ]
    
    The bandwidth fixup quirk doesn't know that SuperSpeed exists and has
    the same 8 service intervals per millisecond as High Speed, hence its
    calculations are wrong.
    
    Assume that all speeds from HS up use 8 intervals per millisecond.
    
    No further changes are needed, updated code has been confirmed to work
    with all speeds from FS to SS.
    
    Signed-off-by: Michal Pecio <[email protected]>
    Reviewed-by: Ricardo Ribalda <[email protected]>
    Reviewed-by: Laurent Pinchart <[email protected]>
    Link: https://lore.kernel.org/r/20240414190040.2255a0bc@foxbook
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

media: uvcvideo: Ignore empty TS packets [+ + +]
Author: Ricardo Ribalda <[email protected]>
Date:   Sat Mar 23 10:48:03 2024 +0000

    media: uvcvideo: Ignore empty TS packets
    
    [ Upstream commit 5cd7c25f6f0576073b3d03bc4cfb1e8ca63a1195 ]
    
    Some SunplusIT cameras took a borderline interpretation of the UVC 1.5
    standard, and fill the PTS and SCR fields with invalid data if the
    package does not contain data.
    
    "STC must be captured when the first video data of a video frame is put
    on the USB bus."
    
    Some SunplusIT devices send, e.g.,
    
    buffer: 0xa7755c00 len 000012 header:0x8c stc 00000000 sof 0000 pts 00000000
    buffer: 0xa7755c00 len 000012 header:0x8c stc 00000000 sof 0000 pts 00000000
    buffer: 0xa7755c00 len 000668 header:0x8c stc 73779dba sof 070c pts 7376d37a
    
    While the UVC specification meant that the first two packets shouldn't
    have had the SCR bit set in the header.
    
    This borderline/buggy interpretation has been implemented in a variety
    of devices, from directly SunplusIT and from other OEMs that rebrand
    SunplusIT products. So quirking based on VID:PID will be problematic.
    
    All the affected modules have the following extension unit:
    VideoControl Interface Descriptor:
      guidExtensionCode         {82066163-7050-ab49-b8cc-b3855e8d221d}
    
    But the vendor plans to use that GUID in the future and fix the bug,
    this means that we should use heuristic to figure out the broken
    packets.
    
    This patch takes care of this.
    
    lsusb of one of the affected cameras:
    
    Bus 001 Device 003: ID 1bcf:2a01 Sunplus Innovation Technology Inc.
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.01
      bDeviceClass          239 Miscellaneous Device
      bDeviceSubClass         2 ?
      bDeviceProtocol         1 Interface Association
      bMaxPacketSize0        64
      idVendor           0x1bcf Sunplus Innovation Technology Inc.
      idProduct          0x2a01
      bcdDevice            0.02
      iManufacturer           1 SunplusIT Inc
      iProduct                2 HanChen Wise Camera
      iSerial                 3 01.00.00
      bNumConfigurations      1
    
    Tested-by: HungNien Chen <[email protected]>
    Reviewed-by: Sergey Senozhatsky <[email protected]>
    Reviewed-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Ricardo Ribalda <[email protected]>
    Reviewed-by: Tomasz Figa <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

media: uvcvideo: Override default flags [+ + +]
Author: Daniel Schaefer <[email protected]>
Date:   Sun Jun 2 14:50:53 2024 +0800

    media: uvcvideo: Override default flags
    
    [ Upstream commit 86419686e66da5b90a07fb8a40ab138fe97189b5 ]
    
    When the UVC device has a control that is readonly it doesn't set the
    SET_CUR flag. For example the privacy control has SET_CUR flag set in
    the defaults in the `uvc_ctrls` variable. Even if the device does not
    have it set, it's not cleared by uvc_ctrl_get_flags().
    
    Originally written with assignment in commit 859086ae3636 ("media:
    uvcvideo: Apply flags from device to actual properties"). But changed to
    |= in commit 0dc68cabdb62 ("media: uvcvideo: Prevent setting unavailable
    flags"). It would not clear the default flags.
    
    With this patch applied the correct flags are reported to user space.
    Tested with:
    
    ```
    > v4l2-ctl --list-ctrls | grep privacy
    privacy 0x009a0910 (bool)   : default=0 value=0 flags=read-only
    ```
    
    Signed-off-by: Daniel Schaefer <[email protected]>
    Fixes: 0dc68cabdb62 ("media: uvcvideo: Prevent setting unavailable flags")
    Reviewed-by: Ricardo Ribalda <[email protected]>
    Reviewed-by: Laurent Pinchart <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

media: uvcvideo: Use entity get_cur in uvc_ctrl_set [+ + +]
Author: Yunke Cao <[email protected]>
Date:   Thu Jul 7 10:53:31 2022 +0200

    media: uvcvideo: Use entity get_cur in uvc_ctrl_set
    
    commit 5f36851c36b30f713f588ed2b60aa7b4512e2c76 upstream.
    
    Entity controls should get_cur using an entity-defined function
    instead of via a query. Fix this in uvc_ctrl_set.
    
    Fixes: 65900c581d01 ("media: uvcvideo: Allow entity-defined get_info and get_cur")
    Signed-off-by: Yunke Cao <[email protected]>
    Reviewed-by: Ricardo Ribalda <[email protected]>
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: venus: fix use after free in vdec_close [+ + +]
Author: Dikshita Agarwal <[email protected]>
Date:   Thu May 9 10:44:29 2024 +0530

    media: venus: fix use after free in vdec_close
    
    commit a0157b5aa34eb43ec4c5510f9c260bbb03be937e upstream.
    
    There appears to be a possible use after free with vdec_close().
    The firmware will add buffer release work to the work queue through
    HFI callbacks as a normal part of decoding. Randomly closing the
    decoder device from userspace during normal decoding can incur
    a read after free for inst.
    
    Fix it by cancelling the work in vdec_close.
    
    Cc: [email protected]
    Fixes: af2c3834c8ca ("[media] media: venus: adding core part and helper functions")
    Signed-off-by: Dikshita Agarwal <[email protected]>
    Acked-by: Vikash Garodia <[email protected]>
    Signed-off-by: Stanimir Varbanov <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mfd: omap-usb-tll: Use struct_size to allocate tll [+ + +]
Author: Javier Carrasco <[email protected]>
Date:   Wed Jun 26 21:37:03 2024 +0200

    mfd: omap-usb-tll: Use struct_size to allocate tll
    
    [ Upstream commit 40176714c818b0b6a2ca8213cdb7654fbd49b742 ]
    
    Commit 16c2004d9e4d ("mfd: omap-usb-tll: Allocate driver data at once")
    changed the memory allocation of 'tll' to consolidate it into a single
    allocation, introducing an incorrect size calculation.
    
    In particular, the allocation for the array of pointers was converted
    into a single-pointer allocation.
    
    The memory allocation used to occur in two steps:
    
    tll = devm_kzalloc(dev, sizeof(struct usbtll_omap), GFP_KERNEL);
    tll->ch_clk = devm_kzalloc(dev, sizeof(struct clk *) * tll->nch,
                               GFP_KERNEL);
    
    And it turned that into the following allocation:
    
    tll = devm_kzalloc(dev, sizeof(*tll) + sizeof(tll->ch_clk[nch]),
                       GFP_KERNEL);
    
    sizeof(tll->ch_clk[nch]) returns the size of a single pointer instead of
    the expected nch pointers.
    
    This bug went unnoticed because the allocation size was small enough to
    fit within the minimum size of a memory allocation for this particular
    case [1].
    
    The complete allocation can still be done at once with the struct_size
    macro, which comes in handy for structures with a trailing flexible
    array.
    
    Fix the memory allocation to obtain the original size again.
    
    Link: https://lore.kernel.org/all/202406261121.2FFD65647@keescook/ [1]
    Fixes: 16c2004d9e4d ("mfd: omap-usb-tll: Allocate driver data at once")
    Reviewed-by: Kees Cook <[email protected]>
    Signed-off-by: Javier Carrasco <[email protected]>
    Fixes: commit 16c2004d9e4d ("mfd: omap-usb-tll: Allocate driver data at once")
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
MIPS: Octeron: remove source file executable bit [+ + +]
Author: Dominique Martinet <[email protected]>
Date:   Fri Jul 5 16:48:30 2024 +0900

    MIPS: Octeron: remove source file executable bit
    
    [ Upstream commit 89c7f5078935872cf47a713a645affb5037be694 ]
    
    This does not matter the least, but there is no other .[ch] file in the
    repo that is executable, so clean this up.
    
    Fixes: 29b83a64df3b ("MIPS: Octeon: Add PCIe link status check")
    Signed-off-by: Dominique Martinet <[email protected]>
    Signed-off-by: Thomas Bogendoerfer <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

MIPS: SMP-CPS: Fix address for GCR_ACCESS register for CM3 and later [+ + +]
Author: Gregory CLEMENT <[email protected]>
Date:   Mon Jul 22 15:15:39 2024 +0200

    MIPS: SMP-CPS: Fix address for GCR_ACCESS register for CM3 and later
    
    [ Upstream commit a263e5f309f32301e1f3ad113293f4e68a82a646 ]
    
    When the CM block migrated from CM2.5 to CM3.0, the address offset for
    the Global CSR Access Privilege register was modified. We saw this in
    the "MIPS64 I6500 Multiprocessing System Programmer's Guide," it is
    stated that "the Global CSR Access Privilege register is located at
    offset 0x0120" in section 5.4. It is at least the same for I6400.
    
    This fix allows to use the VP cores in SMP mode if the reset values
    were modified by the bootloader.
    
    Based on the work of Vladimir Kondratiev
    <[email protected]> and the feedback from Jiaxun Yang
    <[email protected]>.
    
    Fixes: 197e89e0984a ("MIPS: mips-cm: Implement mips_cm_revision")
    Signed-off-by: Gregory CLEMENT <[email protected]>
    Reviewed-by: Jiaxun Yang <[email protected]>
    Signed-off-by: Thomas Bogendoerfer <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
mISDN: Fix a use after free in hfcmulti_tx() [+ + +]
Author: Dan Carpenter <[email protected]>
Date:   Wed Jul 24 11:08:18 2024 -0500

    mISDN: Fix a use after free in hfcmulti_tx()
    
    [ Upstream commit 61ab751451f5ebd0b98e02276a44e23a10110402 ]
    
    Don't dereference *sp after calling dev_kfree_skb(*sp).
    
    Fixes: af69fb3a8ffa ("Add mISDN HFC multiport driver")
    Signed-off-by: Dan Carpenter <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
mlxsw: spectrum_acl_erp: Fix object nesting warning [+ + +]
Author: Ido Schimmel <[email protected]>
Date:   Thu Jun 6 16:49:42 2024 +0200

    mlxsw: spectrum_acl_erp: Fix object nesting warning
    
    [ Upstream commit 97d833ceb27dc19f8777d63f90be4a27b5daeedf ]
    
    ACLs in Spectrum-2 and newer ASICs can reside in the algorithmic TCAM
    (A-TCAM) or in the ordinary circuit TCAM (C-TCAM). The former can
    contain more ACLs (i.e., tc filters), but the number of masks in each
    region (i.e., tc chain) is limited.
    
    In order to mitigate the effects of the above limitation, the device
    allows filters to share a single mask if their masks only differ in up
    to 8 consecutive bits. For example, dst_ip/25 can be represented using
    dst_ip/24 with a delta of 1 bit. The C-TCAM does not have a limit on the
    number of masks being used (and therefore does not support mask
    aggregation), but can contain a limited number of filters.
    
    The driver uses the "objagg" library to perform the mask aggregation by
    passing it objects that consist of the filter's mask and whether the
    filter is to be inserted into the A-TCAM or the C-TCAM since filters in
    different TCAMs cannot share a mask.
    
    The set of created objects is dependent on the insertion order of the
    filters and is not necessarily optimal. Therefore, the driver will
    periodically ask the library to compute a more optimal set ("hints") by
    looking at all the existing objects.
    
    When the library asks the driver whether two objects can be aggregated
    the driver only compares the provided masks and ignores the A-TCAM /
    C-TCAM indication. This is the right thing to do since the goal is to
    move as many filters as possible to the A-TCAM. The driver also forbids
    two identical masks from being aggregated since this can only happen if
    one was intentionally put in the C-TCAM to avoid a conflict in the
    A-TCAM.
    
    The above can result in the following set of hints:
    
    H1: {mask X, A-TCAM} -> H2: {mask Y, A-TCAM} // X is Y + delta
    H3: {mask Y, C-TCAM} -> H4: {mask Z, A-TCAM} // Y is Z + delta
    
    After getting the hints from the library the driver will start migrating
    filters from one region to another while consulting the computed hints
    and instructing the device to perform a lookup in both regions during
    the transition.
    
    Assuming a filter with mask X is being migrated into the A-TCAM in the
    new region, the hints lookup will return H1. Since H2 is the parent of
    H1, the library will try to find the object associated with it and
    create it if necessary in which case another hints lookup (recursive)
    will be performed. This hints lookup for {mask Y, A-TCAM} will either
    return H2 or H3 since the driver passes the library an object comparison
    function that ignores the A-TCAM / C-TCAM indication.
    
    This can eventually lead to nested objects which are not supported by
    the library [1].
    
    Fix by removing the object comparison function from both the driver and
    the library as the driver was the only user. That way the lookup will
    only return exact matches.
    
    I do not have a reliable reproducer that can reproduce the issue in a
    timely manner, but before the fix the issue would reproduce in several
    minutes and with the fix it does not reproduce in over an hour.
    
    Note that the current usefulness of the hints is limited because they
    include the C-TCAM indication and represent aggregation that cannot
    actually happen. This will be addressed in net-next.
    
    [1]
    WARNING: CPU: 0 PID: 153 at lib/objagg.c:170 objagg_obj_parent_assign+0xb5/0xd0
    Modules linked in:
    CPU: 0 PID: 153 Comm: kworker/0:18 Not tainted 6.9.0-rc6-custom-g70fbc2c1c38b #42
    Hardware name: Mellanox Technologies Ltd. MSN3700C/VMOD0008, BIOS 5.11 10/10/2018
    Workqueue: mlxsw_core mlxsw_sp_acl_tcam_vregion_rehash_work
    RIP: 0010:objagg_obj_parent_assign+0xb5/0xd0
    [...]
    Call Trace:
     <TASK>
     __objagg_obj_get+0x2bb/0x580
     objagg_obj_get+0xe/0x80
     mlxsw_sp_acl_erp_mask_get+0xb5/0xf0
     mlxsw_sp_acl_atcam_entry_add+0xe8/0x3c0
     mlxsw_sp_acl_tcam_entry_create+0x5e/0xa0
     mlxsw_sp_acl_tcam_vchunk_migrate_one+0x16b/0x270
     mlxsw_sp_acl_tcam_vregion_rehash_work+0xbe/0x510
     process_one_work+0x151/0x370
    
    Fixes: 9069a3817d82 ("lib: objagg: implement optimization hints assembly and use hints for object creation")
    Signed-off-by: Ido Schimmel <[email protected]>
    Reviewed-by: Amit Cohen <[email protected]>
    Tested-by: Alexander Zubkov <[email protected]>
    Signed-off-by: Petr Machata <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
mm: avoid overflows in dirty throttling logic [+ + +]
Author: Jan Kara <[email protected]>
Date:   Fri Jun 21 16:42:38 2024 +0200

    mm: avoid overflows in dirty throttling logic
    
    [ Upstream commit 385d838df280eba6c8680f9777bfa0d0bfe7e8b2 ]
    
    The dirty throttling logic is interspersed with assumptions that dirty
    limits in PAGE_SIZE units fit into 32-bit (so that various multiplications
    fit into 64-bits).  If limits end up being larger, we will hit overflows,
    possible divisions by 0 etc.  Fix these problems by never allowing so
    large dirty limits as they have dubious practical value anyway.  For
    dirty_bytes / dirty_background_bytes interfaces we can just refuse to set
    so large limits.  For dirty_ratio / dirty_background_ratio it isn't so
    simple as the dirty limit is computed from the amount of available memory
    which can change due to memory hotplug etc.  So when converting dirty
    limits from ratios to numbers of pages, we just don't allow the result to
    exceed UINT_MAX.
    
    This is root-only triggerable problem which occurs when the operator
    sets dirty limits to >16 TB.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Jan Kara <[email protected]>
    Reported-by: Zach O'Keefe <[email protected]>
    Reviewed-By: Zach O'Keefe <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
mtd: make mtd_test.c a separate module [+ + +]
Author: Arnd Bergmann <[email protected]>
Date:   Wed May 29 11:50:39 2024 +0200

    mtd: make mtd_test.c a separate module
    
    [ Upstream commit a5cf054d325e6f362e82fe6d124a1871a4af8174 ]
    
    This file gets linked into nine different modules, which causes a warning:
    
    scripts/Makefile.build:236: drivers/mtd/tests/Makefile: mtd_test.o is added to multiple modules: mtd_nandbiterrs mtd_oobtest mtd_pagetest mtd_readtest mtd_speedtest mtd_stresstest mtd_subpagetest mtd_torturetest
    
    Make it a separate module instead.
    
    Fixes: a995c792280d ("mtd: tests: rename sources in order to link a helper object")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Miquel Raynal <[email protected]>
    Link: https://lore.kernel.org/linux-mtd/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
net/iucv: fix use after free in iucv_sock_close() [+ + +]
Author: Alexandra Winter <[email protected]>
Date:   Mon Jul 29 14:28:16 2024 +0200

    net/iucv: fix use after free in iucv_sock_close()
    
    [ Upstream commit f558120cd709682b739207b48cf7479fd9568431 ]
    
    iucv_sever_path() is called from process context and from bh context.
    iucv->path is used as indicator whether somebody else is taking care of
    severing the path (or it is already removed / never existed).
    This needs to be done with atomic compare and swap, otherwise there is a
    small window where iucv_sock_close() will try to work with a path that has
    already been severed and freed by iucv_callback_connrej() called by
    iucv_tasklet_fn().
    
    Example:
    [452744.123844] Call Trace:
    [452744.123845] ([<0000001e87f03880>] 0x1e87f03880)
    [452744.123966]  [<00000000d593001e>] iucv_path_sever+0x96/0x138
    [452744.124330]  [<000003ff801ddbca>] iucv_sever_path+0xc2/0xd0 [af_iucv]
    [452744.124336]  [<000003ff801e01b6>] iucv_sock_close+0xa6/0x310 [af_iucv]
    [452744.124341]  [<000003ff801e08cc>] iucv_sock_release+0x3c/0xd0 [af_iucv]
    [452744.124345]  [<00000000d574794e>] __sock_release+0x5e/0xe8
    [452744.124815]  [<00000000d5747a0c>] sock_close+0x34/0x48
    [452744.124820]  [<00000000d5421642>] __fput+0xba/0x268
    [452744.124826]  [<00000000d51b382c>] task_work_run+0xbc/0xf0
    [452744.124832]  [<00000000d5145710>] do_notify_resume+0x88/0x90
    [452744.124841]  [<00000000d5978096>] system_call+0xe2/0x2c8
    [452744.125319] Last Breaking-Event-Address:
    [452744.125321]  [<00000000d5930018>] iucv_path_sever+0x90/0x138
    [452744.125324]
    [452744.125325] Kernel panic - not syncing: Fatal exception in interrupt
    
    Note that bh_lock_sock() is not serializing the tasklet context against
    process context, because the check for sock_owned_by_user() and
    corresponding handling is missing.
    
    Ideas for a future clean-up patch:
    A) Correct usage of bh_lock_sock() in tasklet context, as described in
    Link: https://lore.kernel.org/netdev/1280155406.2899.407.camel@edumazet-laptop/
    Re-enqueue, if needed. This may require adding return values to the
    tasklet functions and thus changes to all users of iucv.
    
    B) Change iucv tasklet into worker and use only lock_sock() in af_iucv.
    
    Fixes: 7d316b945352 ("af_iucv: remove IUCV-pathes completely")
    Reviewed-by: Halil Pasic <[email protected]>
    Signed-off-by: Alexandra Winter <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
net/mlx5e: Add a check for the return value from mlx5_port_set_eth_ptys [+ + +]
Author: Shahar Shitrit <[email protected]>
Date:   Tue Jul 30 09:16:37 2024 +0300

    net/mlx5e: Add a check for the return value from mlx5_port_set_eth_ptys
    
    [ Upstream commit 3f8e82a020a5c22f9b791f4ac499b8e18007fbda ]
    
    Since the documentation for mlx5_toggle_port_link states that it should
    only be used after setting the port register, we add a check for the
    return value from mlx5_port_set_eth_ptys to ensure the register was
    successfully set before calling it.
    
    Fixes: 667daedaecd1 ("net/mlx5e: Toggle link only after modifying port parameters")
    Signed-off-by: Shahar Shitrit <[email protected]>
    Reviewed-by: Carolina Jubran <[email protected]>
    Signed-off-by: Tariq Toukan <[email protected]>
    Reviewed-by: Wojciech Drewek <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
net/smc: Allow SMC-D 1MB DMB allocations [+ + +]
Author: Stefan Raspl <[email protected]>
Date:   Mon Aug 9 10:10:14 2021 +0200

    net/smc: Allow SMC-D 1MB DMB allocations
    
    [ Upstream commit 67161779a9ea926fccee8de047ae66cbd3482b91 ]
    
    Commit a3fe3d01bd0d7 ("net/smc: introduce sg-logic for RMBs") introduced
    a restriction for RMB allocations as used by SMC-R. However, SMC-D does
    not use scatter-gather lists to back its DMBs, yet it was limited by
    this restriction, still.
    This patch exempts SMC, but limits allocations to the maximum RMB/DMB
    size respectively.
    
    Signed-off-by: Stefan Raspl <[email protected]>
    Signed-off-by: Guvenc Gulce <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Stable-dep-of: 3ac14b9dfbd3 ("net/smc: set rmb's SG_MAX_SINGLE_ALLOC limitation only when CONFIG_ARCH_NO_SG_CHAIN is defined")
    Signed-off-by: Sasha Levin <[email protected]>

net/smc: set rmb's SG_MAX_SINGLE_ALLOC limitation only when CONFIG_ARCH_NO_SG_CHAIN is defined [+ + +]
Author: Guangguan Wang <[email protected]>
Date:   Mon Jun 3 11:00:18 2024 +0800

    net/smc: set rmb's SG_MAX_SINGLE_ALLOC limitation only when CONFIG_ARCH_NO_SG_CHAIN is defined
    
    [ Upstream commit 3ac14b9dfbd345e891d48d89f6c2fa519848f0f4 ]
    
    SG_MAX_SINGLE_ALLOC is used to limit maximum number of entries that
    will be allocated in one piece of scatterlist. When the entries of
    scatterlist exceeds SG_MAX_SINGLE_ALLOC, sg chain will be used. From
    commit 7c703e54cc71 ("arch: switch the default on ARCH_HAS_SG_CHAIN"),
    we can know that the macro CONFIG_ARCH_NO_SG_CHAIN is used to identify
    whether sg chain is supported. So, SMC-R's rmb buffer should be limited
    by SG_MAX_SINGLE_ALLOC only when the macro CONFIG_ARCH_NO_SG_CHAIN is
    defined.
    
    Fixes: a3fe3d01bd0d ("net/smc: introduce sg-logic for RMBs")
    Signed-off-by: Guangguan Wang <[email protected]>
    Co-developed-by: Wen Gu <[email protected]>
    Signed-off-by: Wen Gu <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
net: bonding: correctly annotate RCU in bond_should_notify_peers() [+ + +]
Author: Johannes Berg <[email protected]>
Date:   Fri Jul 19 09:41:18 2024 -0700

    net: bonding: correctly annotate RCU in bond_should_notify_peers()
    
    [ Upstream commit 3ba359c0cd6eb5ea772125a7aededb4a2d516684 ]
    
    RCU use in bond_should_notify_peers() looks wrong, since it does
    rcu_dereference(), leaves the critical section, and uses the
    pointer after that.
    
    Luckily, it's called either inside a nested RCU critical section
    or with the RTNL held.
    
    Annotate it with rcu_dereference_rtnl() instead, and remove the
    inner RCU critical section.
    
    Fixes: 4cb4f97b7e36 ("bonding: rebuild the lock use for bond_mii_monitor()")
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Johannes Berg <[email protected]>
    Acked-by: Jay Vosburgh <[email protected]>
    Link: https://patch.msgid.link/20240719094119.35c62455087d.I68eb9c0f02545b364b79a59f2110f2cf5682a8e2@changeid
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: fec: Fix FEC_ECR_EN1588 being cleared on link-down [+ + +]
Author: Csókás, Bence <[email protected]>
Date:   Wed Jun 19 14:31:11 2024 +0200

    net: fec: Fix FEC_ECR_EN1588 being cleared on link-down
    
    [ Upstream commit c32fe1986f27cac329767d3497986e306cad1d5e ]
    
    FEC_ECR_EN1588 bit gets cleared after MAC reset in `fec_stop()`, which
    makes all 1588 functionality shut down, and all the extended registers
    disappear, on link-down, making the adapter fall back to compatibility
    "dumb mode". However, some functionality needs to be retained (e.g. PPS)
    even without link.
    
    Fixes: 6605b730c061 ("FEC: Add time stamping code and a PTP hardware clock")
    Cc: Richard Cochran <[email protected]>
    Reviewed-by: Andrew Lunn <[email protected]>
    Link: https://lore.kernel.org/netdev/[email protected]/
    Signed-off-by: Csókás, Bence <[email protected]>
    Reviewed-by: Wei Fang <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: fec: Refactor: #define magic constants [+ + +]
Author: Csókás Bence <[email protected]>
Date:   Mon Feb 12 16:37:17 2024 +0100

    net: fec: Refactor: #define magic constants
    
    [ Upstream commit ff049886671ccd4e624a30ec464cb20e4c39a313 ]
    
    Add defines for bits of ECR, RCR control registers, TX watermark etc.
    
    Signed-off-by: Csókás Bence <[email protected]>
    Reviewed-by: Andrew Lunn <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Stable-dep-of: c32fe1986f27 ("net: fec: Fix FEC_ECR_EN1588 being cleared on link-down")
    Signed-off-by: Sasha Levin <[email protected]>

net: fec: Stop PPS on driver remove [+ + +]
Author: Csókás, Bence <[email protected]>
Date:   Wed Aug 7 10:09:56 2024 +0200

    net: fec: Stop PPS on driver remove
    
    [ Upstream commit 8fee6d5ad5fa18c270eedb2a2cdf58dbadefb94b ]
    
    PPS was not stopped in `fec_ptp_stop()`, called when
    the adapter was removed. Consequentially, you couldn't
    safely reload the driver with the PPS signal on.
    
    Fixes: 32cba57ba74b ("net: fec: introduce fec_ptp_stop and use in probe fail path")
    Reviewed-by: Fabio Estevam <[email protected]>
    Link: https://lore.kernel.org/netdev/CAOMZO5BzcZR8PwKKwBssQq_wAGzVgf1ffwe_nhpQJjviTdxy-w@mail.gmail.com/T/#m01dcb810bfc451a492140f6797ca77443d0cb79f
    Signed-off-by: Csókás, Bence <[email protected]>
    Reviewed-by: Andrew Lunn <[email protected]>
    Reviewed-by: Frank Li <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: linkwatch: use system_unbound_wq [+ + +]
Author: Eric Dumazet <[email protected]>
Date:   Mon Aug 5 08:58:21 2024 +0000

    net: linkwatch: use system_unbound_wq
    
    [ Upstream commit 3e7917c0cdad835a5121520fc5686d954b7a61ab ]
    
    linkwatch_event() grabs possibly very contended RTNL mutex.
    
    system_wq is not suitable for such work.
    
    Inspired by many noisy syzbot reports.
    
    3 locks held by kworker/0:7/5266:
     #0: ffff888015480948 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3206 [inline]
     #0: ffff888015480948 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3312
     #1: ffffc90003f6fd00 ((linkwatch_work).work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3207 [inline]
     , at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3312
     #2: ffffffff8fa6f208 (rtnl_mutex){+.+.}-{3:3}, at: linkwatch_event+0xe/0x60 net/core/link_watch.c:276
    
    Reported-by: syzbot <[email protected]>
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reviewed-by: Kuniyuki Iwashima <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: netconsole: Disable target before netpoll cleanup [+ + +]
Author: Breno Leitao <[email protected]>
Date:   Fri Jul 12 07:34:15 2024 -0700

    net: netconsole: Disable target before netpoll cleanup
    
    commit 97d9fba9a812cada5484667a46e14a4c976ca330 upstream.
    
    Currently, netconsole cleans up the netpoll structure before disabling
    the target. This approach can lead to race conditions, as message
    senders (write_ext_msg() and write_msg()) check if the target is
    enabled before using netpoll. The sender can validate that the target is
    enabled, but, the netpoll might be de-allocated already, causing
    undesired behaviours.
    
    This patch reverses the order of operations:
    1. Disable the target
    2. Clean up the netpoll structure
    
    This change eliminates the potential race condition, ensuring that
    no messages are sent through a partially cleaned-up netpoll structure.
    
    Fixes: 2382b15bcc39 ("netconsole: take care of NETDEV_UNREGISTER event")
    Cc: [email protected]
    Signed-off-by: Breno Leitao <[email protected]>
    Reviewed-by: Eric Dumazet <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: nexthop: Initialize all fields in dumped nexthops [+ + +]
Author: Petr Machata <[email protected]>
Date:   Tue Jul 23 18:04:16 2024 +0200

    net: nexthop: Initialize all fields in dumped nexthops
    
    [ Upstream commit 6d745cd0e9720282cd291d36b9db528aea18add2 ]
    
    struct nexthop_grp contains two reserved fields that are not initialized by
    nla_put_nh_group(), and carry garbage. This can be observed e.g. with
    strace (edited for clarity):
    
        # ip nexthop add id 1 dev lo
        # ip nexthop add id 101 group 1
        # strace -e recvmsg ip nexthop get id 101
        ...
        recvmsg(... [{nla_len=12, nla_type=NHA_GROUP},
                     [{id=1, weight=0, resvd1=0x69, resvd2=0x67}]] ...) = 52
    
    The fields are reserved and therefore not currently used. But as they are, they
    leak kernel memory, and the fact they are not just zero complicates repurposing
    of the fields for new ends. Initialize the full structure.
    
    Fixes: 430a049190de ("nexthop: Add support for nexthop groups")
    Signed-off-by: Petr Machata <[email protected]>
    Reviewed-by: Ido Schimmel <[email protected]>
    Reviewed-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: usb: qmi_wwan: fix memory leak for not ip packets [+ + +]
Author: Daniele Palmas <[email protected]>
Date:   Thu Aug 1 15:55:12 2024 +0200

    net: usb: qmi_wwan: fix memory leak for not ip packets
    
    [ Upstream commit 7ab107544b777c3bd7feb9fe447367d8edd5b202 ]
    
    Free the unused skb when not ip packets arrive.
    
    Fixes: c6adf77953bc ("net: usb: qmi_wwan: add qmap mux protocol support")
    Signed-off-by: Daniele Palmas <[email protected]>
    Acked-by: Bjørn Mork <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: usb: sr9700: fix uninitialized variable use in sr_mdio_read [+ + +]
Author: Ma Ke <[email protected]>
Date:   Thu Jul 25 10:29:42 2024 +0800

    net: usb: sr9700: fix uninitialized variable use in sr_mdio_read
    
    commit 08f3a5c38087d1569e982a121aad1e6acbf145ce upstream.
    
    It could lead to error happen because the variable res is not updated if
    the call to sr_share_read_word returns an error. In this particular case
    error code was returned and res stayed uninitialized. Same issue also
    applies to sr_read_reg.
    
    This can be avoided by checking the return value of sr_share_read_word
    and sr_read_reg, and propagating the error if the read operation failed.
    
    Found by code review.
    
    Cc: [email protected]
    Fixes: c9b37458e956 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
    Signed-off-by: Ma Ke <[email protected]>
    Reviewed-by: Shigeru Yoshida <[email protected]>
    Reviewed-by: Hariprasad Kelam <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
netfilter: ctnetlink: use helper function to calculate expect ID [+ + +]
Author: Pablo Neira Ayuso <[email protected]>
Date:   Sat Jul 13 16:47:38 2024 +0200

    netfilter: ctnetlink: use helper function to calculate expect ID
    
    [ Upstream commit 782161895eb4ac45cf7cfa8db375bd4766cb8299 ]
    
    Delete expectation path is missing a call to the nf_expect_get_id()
    helper function to calculate the expectation ID, otherwise LSB of the
    expectation object address is leaked to userspace.
    
    Fixes: 3c79107631db ("netfilter: ctnetlink: don't use conntrack/expect object addresses as id")
    Reported-by: [email protected]
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

netfilter: ipset: Add list flush to cancel_gc [+ + +]
Author: Alexander Maltsev <[email protected]>
Date:   Wed Apr 17 18:51:41 2024 +0500

    netfilter: ipset: Add list flush to cancel_gc
    
    [ Upstream commit c1193d9bbbd379defe9be3c6de566de684de8a6f ]
    
    Flushing list in cancel_gc drops references to other lists right away,
    without waiting for RCU to destroy list. Fixes race when referenced
    ipsets can't be destroyed while referring list is scheduled for destroy.
    
    Fixes: 97f7cf1cd80e ("netfilter: ipset: fix performance regression in swap operation")
    Signed-off-by: Alexander Maltsev <[email protected]>
    Acked-by: Jozsef Kadlecsik <[email protected]>
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

netfilter: nf_tables: prefer nft_chain_validate [+ + +]
Author: Florian Westphal <[email protected]>
Date:   Mon Aug 12 12:28:48 2024 +0200

    netfilter: nf_tables: prefer nft_chain_validate
    
    commit cff3bd012a9512ac5ed858d38e6ed65f6391008c upstream.
    
    nft_chain_validate already performs loop detection because a cycle will
    result in a call stack overflow (ctx->level >= NFT_JUMP_STACK_SIZE).
    
    It also follows maps via ->validate callback in nft_lookup, so there
    appears no reason to iterate the maps again.
    
    nf_tables_check_loops() and all its helper functions can be removed.
    This improves ruleset load time significantly, from 23s down to 12s.
    
    This also fixes a crash bug. Old loop detection code can result in
    unbounded recursion:
    
    BUG: TASK stack guard page was hit at ....
    Oops: stack guard page: 0000 [#1] PREEMPT SMP KASAN
    CPU: 4 PID: 1539 Comm: nft Not tainted 6.10.0-rc5+ #1
    [..]
    
    with a suitable ruleset during validation of register stores.
    
    I can't see any actual reason to attempt to check for this from
    nft_validate_register_store(), at this point the transaction is still in
    progress, so we don't have a full picture of the rule graph.
    
    For nf-next it might make sense to either remove it or make this depend
    on table->validate_state in case we could catch an error earlier
    (for improved error reporting to userspace).
    
    Fixes: 20a69341f2d0 ("netfilter: nf_tables: add netlink set API")
    Signed-off-by: Florian Westphal <[email protected]>
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

netfilter: nf_tables: rise cap on SELinux secmark context [+ + +]
Author: Pablo Neira Ayuso <[email protected]>
Date:   Mon Jun 3 20:16:59 2024 +0200

    netfilter: nf_tables: rise cap on SELinux secmark context
    
    [ Upstream commit e29630247be24c3987e2b048f8e152771b32d38b ]
    
    secmark context is artificially limited 256 bytes, rise it to 4Kbytes.
    
    Fixes: fb961945457f ("netfilter: nf_tables: add SECMARK support")
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

netfilter: nf_tables: set element extended ACK reporting support [+ + +]
Author: Pablo Neira Ayuso <[email protected]>
Date:   Mon Aug 12 12:28:46 2024 +0200

    netfilter: nf_tables: set element extended ACK reporting support
    
    commit b53c116642502b0c85ecef78bff4f826a7dd4145 upstream.
    
    Report the element that causes problems via netlink extended ACK for set
    element commands.
    
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

netfilter: nf_tables: use timestamp to check for set element timeout [+ + +]
Author: Pablo Neira Ayuso <[email protected]>
Date:   Mon Aug 12 12:28:47 2024 +0200

    netfilter: nf_tables: use timestamp to check for set element timeout
    
    commit 7395dfacfff65e9938ac0889dafa1ab01e987d15 upstream
    
    Add a timestamp field at the beginning of the transaction, store it
    in the nftables per-netns area.
    
    Update set backend .insert, .deactivate and sync gc path to use the
    timestamp, this avoids that an element expires while control plane
    transaction is still unfinished.
    
    .lookup and .update, which are used from packet path, still use the
    current time to check if the element has expired. And .get path and dump
    also since this runs lockless under rcu read size lock. Then, there is
    async gc which also needs to check the current time since it runs
    asynchronously from a workqueue.
    
    [ NB: rbtree GC updates has been excluded because GC is asynchronous. ]
    
    Fixes: c3e1b005ed1c ("netfilter: nf_tables: add set element timeout support")
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
nilfs2: avoid undefined behavior in nilfs_cnt32_ge macro [+ + +]
Author: Ryusuke Konishi <[email protected]>
Date:   Wed Jul 3 03:35:12 2024 +0900

    nilfs2: avoid undefined behavior in nilfs_cnt32_ge macro
    
    [ Upstream commit 0f3819e8c483771a59cf9d3190cd68a7a990083c ]
    
    According to the C standard 3.4.3p3, the result of signed integer overflow
    is undefined.  The macro nilfs_cnt32_ge(), which compares two sequence
    numbers, uses signed integer subtraction that can overflow, and therefore
    the result of the calculation may differ from what is expected due to
    undefined behavior in different environments.
    
    Similar to an earlier change to the jiffies-related comparison macros in
    commit 5a581b367b5d ("jiffies: Avoid undefined behavior from signed
    overflow"), avoid this potential issue by changing the definition of the
    macro to perform the subtraction as unsigned integers, then cast the
    result to a signed integer for comparison.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 9ff05123e3bf ("nilfs2: segment constructor")
    Signed-off-by: Ryusuke Konishi <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

nilfs2: handle inconsistent state in nilfs_btnode_create_block() [+ + +]
Author: Ryusuke Konishi <[email protected]>
Date:   Thu Jul 25 14:20:07 2024 +0900

    nilfs2: handle inconsistent state in nilfs_btnode_create_block()
    
    commit 4811f7af6090e8f5a398fbdd766f903ef6c0d787 upstream.
    
    Syzbot reported that a buffer state inconsistency was detected in
    nilfs_btnode_create_block(), triggering a kernel bug.
    
    It is not appropriate to treat this inconsistency as a bug; it can occur
    if the argument block address (the buffer index of the newly created
    block) is a virtual block number and has been reallocated due to
    corruption of the bitmap used to manage its allocation state.
    
    So, modify nilfs_btnode_create_block() and its callers to treat it as a
    possible filesystem error, rather than triggering a kernel bug.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: a60be987d45d ("nilfs2: B-tree node cache")
    Signed-off-by: Ryusuke Konishi <[email protected]>
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=89cc4f2324ed37988b60
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ntp: Clamp maxerror and esterror to operating range [+ + +]
Author: Justin Stitt <[email protected]>
Date:   Fri May 17 20:22:44 2024 +0000

    ntp: Clamp maxerror and esterror to operating range
    
    [ Upstream commit 87d571d6fb77ec342a985afa8744bb9bb75b3622 ]
    
    Using syzkaller alongside the newly reintroduced signed integer overflow
    sanitizer spits out this report:
    
    UBSAN: signed-integer-overflow in ../kernel/time/ntp.c:461:16
    9223372036854775807 + 500 cannot be represented in type 'long'
    Call Trace:
     handle_overflow+0x171/0x1b0
     second_overflow+0x2d6/0x500
     accumulate_nsecs_to_secs+0x60/0x160
     timekeeping_advance+0x1fe/0x890
     update_wall_time+0x10/0x30
    
    time_maxerror is unconditionally incremented and the result is checked
    against NTP_PHASE_LIMIT, but the increment itself can overflow, resulting
    in wrap-around to negative space.
    
    Before commit eea83d896e31 ("ntp: NTP4 user space bits update") the user
    supplied value was sanity checked to be in the operating range. That change
    removed the sanity check and relied on clamping in handle_overflow() which
    does not work correctly when the user supplied value is in the overflow
    zone of the '+ 500' operation.
    
    The operation requires CAP_SYS_TIME and the side effect of the overflow is
    NTP getting out of sync.
    
    Miroslav confirmed that the input value should be clamped to the operating
    range and the same applies to time_esterror. The latter is not used by the
    kernel, but the value still should be in the operating range as it was
    before the sanity check got removed.
    
    Clamp them to the operating range.
    
    [ tglx: Changed it to clamping and included time_esterror ]
    
    Fixes: eea83d896e31 ("ntp: NTP4 user space bits update")
    Signed-off-by: Justin Stitt <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: Miroslav Lichvar <[email protected]>
    Link: https://lore.kernel.org/all/[email protected]
    Closes: https://github.com/KSPP/linux/issues/354
    Signed-off-by: Sasha Levin <[email protected]>
    [ cast things to long long to fix compiler warnings - gregkh ]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ntp: Safeguard against time_constant overflow [+ + +]
Author: Justin Stitt <[email protected]>
Date:   Fri May 17 00:47:10 2024 +0000

    ntp: Safeguard against time_constant overflow
    
    commit 06c03c8edce333b9ad9c6b207d93d3a5ae7c10c0 upstream.
    
    Using syzkaller with the recently reintroduced signed integer overflow
    sanitizer produces this UBSAN report:
    
    UBSAN: signed-integer-overflow in ../kernel/time/ntp.c:738:18
    9223372036854775806 + 4 cannot be represented in type 'long'
    Call Trace:
     handle_overflow+0x171/0x1b0
     __do_adjtimex+0x1236/0x1440
     do_adjtimex+0x2be/0x740
    
    The user supplied time_constant value is incremented by four and then
    clamped to the operating range.
    
    Before commit eea83d896e31 ("ntp: NTP4 user space bits update") the user
    supplied value was sanity checked to be in the operating range. That change
    removed the sanity check and relied on clamping after incrementing which
    does not work correctly when the user supplied value is in the overflow
    zone of the '+ 4' operation.
    
    The operation requires CAP_SYS_TIME and the side effect of the overflow is
    NTP getting out of sync.
    
    Similar to the fixups for time_maxerror and time_esterror, clamp the user
    space supplied value to the operating range.
    
    [ tglx: Switch to clamping ]
    
    Fixes: eea83d896e31 ("ntp: NTP4 user space bits update")
    Signed-off-by: Justin Stitt <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: Miroslav Lichvar <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/all/[email protected]
    Closes: https://github.com/KSPP/linux/issues/352
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
nvme-pci: add missing condition check for existence of mapped data [+ + +]
Author: Leon Romanovsky <[email protected]>
Date:   Wed Jul 24 13:31:14 2024 +0300

    nvme-pci: add missing condition check for existence of mapped data
    
    [ Upstream commit c31fad1470389666ac7169fe43aa65bf5b7e2cfd ]
    
    nvme_map_data() is called when request has physical segments, hence
    the nvme_unmap_data() should have same condition to avoid dereference.
    
    Fixes: 4aedb705437f ("nvme-pci: split metadata handling from nvme_map_data / nvme_unmap_data")
    Signed-off-by: Leon Romanovsky <[email protected]>
    Reviewed-by: Christoph Hellwig <[email protected]>
    Reviewed-by: Nitesh Shetty <[email protected]>
    Signed-off-by: Keith Busch <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
nvme/pci: Add APST quirk for Lenovo N60z laptop [+ + +]
Author: WangYuli <[email protected]>
Date:   Mon Jul 15 17:31:44 2024 +0800

    nvme/pci: Add APST quirk for Lenovo N60z laptop
    
    commit ab091ec536cb7b271983c0c063b17f62f3591583 upstream.
    
    There is a hardware power-saving problem with the Lenovo N60z
    board. When turn it on and leave it for 10 hours, there is a
    20% chance that a nvme disk will not wake up until reboot.
    
    Link: https://lore.kernel.org/all/2B5581C46AC6E335+9c7a81f1-05fb-4fd0-9fbb-108757c21628@uniontech.com
    Signed-off-by: hmy <[email protected]>
    Signed-off-by: Wentao Guan <[email protected]>
    Signed-off-by: WangYuli <[email protected]>
    Signed-off-by: Keith Busch <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
parport: Convert printk(KERN_ to pr_( [+ + +]
Author: Joe Perches <[email protected]>
Date:   Fri Apr 3 14:43:16 2020 +0100

    parport: Convert printk(KERN_<LEVEL> to pr_<level>(
    
    [ Upstream commit decf26f6ec25dac868782dc1751623a87d147831 ]
    
    Use the more common kernel style.
    
    Miscellanea:
    
    o Coalesce formats
    o Realign arguments
    
    Signed-off-by: Joe Perches <[email protected]>
    Reviewed-by: Randy Dunlap <[email protected]>
    Signed-off-by: Sudip Mukherjee <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Stable-dep-of: ab11dac93d2d ("dev/parport: fix the array out-of-bounds risk")
    Signed-off-by: Sasha Levin <[email protected]>

parport: Standardize use of printmode [+ + +]
Author: Joe Perches <[email protected]>
Date:   Fri Apr 3 14:43:22 2020 +0100

    parport: Standardize use of printmode
    
    [ Upstream commit a6abfdff4fe5dd19d1f1b37d72ba34cd4492fd4d ]
    
    Standardize the define and the uses of printmode.
    
    Miscellanea:
    
    o Add missing statement termination ; where necessary
    
    Signed-off-by: Joe Perches <[email protected]>
    Reviewed-by: Randy Dunlap <[email protected]>
    Signed-off-by: Sudip Mukherjee <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Stable-dep-of: ab11dac93d2d ("dev/parport: fix the array out-of-bounds risk")
    Signed-off-by: Sasha Levin <[email protected]>

 
PCI: Add Edimax Vendor ID to pci_ids.h [+ + +]
Author: FUJITA Tomonori <[email protected]>
Date:   Mon Jun 24 08:55:01 2024 +0900

    PCI: Add Edimax Vendor ID to pci_ids.h
    
    [ Upstream commit eee5528890d54b22b46f833002355a5ee94c3bb4 ]
    
    Add the Edimax Vendor ID (0x1432) for an ethernet driver for Tehuti
    Networks TN40xx chips. This ID can be used for Realtek 8180 and Ralink
    rt28xx wireless drivers.
    
    Signed-off-by: FUJITA Tomonori <[email protected]>
    Acked-by: Bjorn Helgaas <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

PCI: Fix resource double counting on remove & rescan [+ + +]
Author: Ilpo Järvinen <[email protected]>
Date:   Tue May 7 13:25:16 2024 +0300

    PCI: Fix resource double counting on remove & rescan
    
    [ Upstream commit 903534fa7d30214d8ba840ab1cd9e917e0c88e41 ]
    
    pbus_size_mem() keeps the size of the optional resources in
    children_add_size. When calculating the PCI bridge window size,
    calculate_memsize() lower bounds size by old_size before adding
    children_add_size and performing the window size alignment. This
    results in double counting for the resources in children_add_size
    because old_size may be based on the previous size of the bridge
    window after it has already included children_add_size (that is,
    size1 in pbus_size_mem() from an earlier invocation of that
    function).
    
    As a result, on repeated remove of the bus & rescan cycles the resource
    size keeps increasing when children_add_size is non-zero as can be seen
    from this extract:
    
      iomem0:  23fffd00000-23fffdfffff : PCI Bus 0000:03    # 1MiB
      iomem1:  20000000000-200001fffff : PCI Bus 0000:03    # 2MiB
      iomem2:  20000000000-200002fffff : PCI Bus 0000:03    # 3MiB
      iomem3:  20000000000-200003fffff : PCI Bus 0000:03    # 4MiB
      iomem4:  20000000000-200004fffff : PCI Bus 0000:03    # 5MiB
    
    Solve the double counting by moving old_size check later in
    calculate_memsize() so that children_add_size is already accounted for.
    
    After the patch, the bridge window retains its size as expected:
    
      iomem0:  23fffd00000-23fffdfffff : PCI Bus 0000:03    # 1MiB
      iomem1:  20000000000-200000fffff : PCI Bus 0000:03    # 1MiB
      iomem2:  20000000000-200000fffff : PCI Bus 0000:03    # 1MiB
    
    Fixes: a4ac9fea016f ("PCI : Calculate right add_size")
    Link: https://lore.kernel.org/r/[email protected]
    Tested-by: Lidong Wang <[email protected]>
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Bjorn Helgaas <[email protected]>
    Reviewed-by: Mika Westerberg <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

PCI: hv: Return zero, not garbage, when reading PCI_INTERRUPT_PIN [+ + +]
Author: Wei Liu <[email protected]>
Date:   Mon Jul 1 20:26:05 2024 +0000

    PCI: hv: Return zero, not garbage, when reading PCI_INTERRUPT_PIN
    
    commit fea93a3e5d5e6a09eb153866d2ce60ea3287a70d upstream.
    
    The intent of the code snippet is to always return 0 for both
    PCI_INTERRUPT_LINE and PCI_INTERRUPT_PIN.
    
    The check misses PCI_INTERRUPT_PIN. This patch fixes that.
    
    This is discovered by this call in VFIO:
    
        pci_read_config_byte(vdev->pdev, PCI_INTERRUPT_PIN, &pin);
    
    The old code does not set *val to 0 because it misses the check for
    PCI_INTERRUPT_PIN. Garbage is returned in that case.
    
    Fixes: 4daace0d8ce8 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs")
    Link: https://lore.kernel.org/linux-pci/[email protected]
    Signed-off-by: Wei Liu <[email protected]>
    Signed-off-by: Krzysztof Wilczyński <[email protected]>
    Reviewed-by: Michael Kelley <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

PCI: rockchip: Make 'ep-gpios' DT property optional [+ + +]
Author: Chen-Yu Tsai <[email protected]>
Date:   Fri Jan 22 00:23:18 2021 +0800

    PCI: rockchip: Make 'ep-gpios' DT property optional
    
    [ Upstream commit 58adbfb3ebec460e8b58875c682bafd866808e80 ]
    
    The Rockchip PCIe controller DT binding clearly states that 'ep-gpios' is
    an optional property. And indeed there are boards that don't require it.
    
    Make the driver follow the binding by using devm_gpiod_get_optional()
    instead of devm_gpiod_get().
    
    [bhelgaas: tidy whitespace]
    Link: https://lore.kernel.org/r/[email protected]
    Fixes: e77f847df54c ("PCI: rockchip: Add Rockchip PCIe controller support")
    Fixes: 956cd99b35a8 ("PCI: rockchip: Separate common code from RC driver")
    Fixes: 964bac9455be ("PCI: rockchip: Split out rockchip_pcie_parse_dt() to parse DT")
    Signed-off-by: Chen-Yu Tsai <[email protected]>
    Signed-off-by: Lorenzo Pieralisi <[email protected]>
    Signed-off-by: Bjorn Helgaas <[email protected]>
    Stable-dep-of: 840b7a5edf88 ("PCI: rockchip: Use GPIOD_OUT_LOW flag while requesting ep_gpio")
    Signed-off-by: Sasha Levin <[email protected]>

PCI: rockchip: Use GPIOD_OUT_LOW flag while requesting ep_gpio [+ + +]
Author: Manivannan Sadhasivam <[email protected]>
Date:   Tue Apr 16 11:12:35 2024 +0530

    PCI: rockchip: Use GPIOD_OUT_LOW flag while requesting ep_gpio
    
    [ Upstream commit 840b7a5edf88fe678c60dee88a135647c0ea4375 ]
    
    Rockchip platforms use 'GPIO_ACTIVE_HIGH' flag in the devicetree definition
    for ep_gpio. This means, whatever the logical value set by the driver for
    the ep_gpio, physical line will output the same logic level.
    
    For instance,
    
      gpiod_set_value_cansleep(rockchip->ep_gpio, 0); --> Level low
      gpiod_set_value_cansleep(rockchip->ep_gpio, 1); --> Level high
    
    But while requesting the ep_gpio, GPIOD_OUT_HIGH flag is currently used.
    Now, this also causes the physical line to output 'high' creating trouble
    for endpoint devices during host reboot.
    
    When host reboot happens, the ep_gpio will initially output 'low' due to
    the GPIO getting reset to its POR value. Then during host controller probe,
    it will output 'high' due to GPIOD_OUT_HIGH flag. Then during
    rockchip_pcie_host_init_port(), it will first output 'low' and then 'high'
    indicating the completion of controller initialization.
    
    On the endpoint side, each output 'low' of ep_gpio is accounted for PERST#
    assert and 'high' for PERST# deassert. With the above mentioned flow during
    host reboot, endpoint will witness below state changes for PERST#:
    
      (1) PERST# assert - GPIO POR state
      (2) PERST# deassert - GPIOD_OUT_HIGH while requesting GPIO
      (3) PERST# assert - rockchip_pcie_host_init_port()
      (4) PERST# deassert - rockchip_pcie_host_init_port()
    
    Now the time interval between (2) and (3) is very short as both happen
    during the driver probe(), and this results in a race in the endpoint.
    Because, before completing the PERST# deassertion in (2), endpoint got
    another PERST# assert in (3).
    
    A proper way to fix this issue is to change the GPIOD_OUT_HIGH flag in (2)
    to GPIOD_OUT_LOW. Because the usual convention is to request the GPIO with
    a state corresponding to its 'initial/default' value and let the driver
    change the state of the GPIO when required.
    
    As per that, the ep_gpio should be requested with GPIOD_OUT_LOW as it
    corresponds to the POR value of '0' (PERST# assert in the endpoint). Then
    the driver can change the state of the ep_gpio later in
    rockchip_pcie_host_init_port() as per the initialization sequence.
    
    This fixes the firmware crash issue in Qcom based modems connected to
    Rockpro64 based board.
    
    Fixes: e77f847df54c ("PCI: rockchip: Add Rockchip PCIe controller support")
    Closes: https://lore.kernel.org/mhi/20240402045647.GG2933@thinkpad/
    Link: https://lore.kernel.org/linux-pci/[email protected]
    Reported-by: Slark Xiao <[email protected]>
    Signed-off-by: Manivannan Sadhasivam <[email protected]>
    Signed-off-by: Krzysztof Wilczyński <[email protected]>
    Signed-off-by: Bjorn Helgaas <[email protected]>
    Reviewed-by: Niklas Cassel <[email protected]>
    Cc: [email protected]      # v4.9
    Signed-off-by: Sasha Levin <[email protected]>

 
perf report: Fix condition in sort__sym_cmp() [+ + +]
Author: Namhyung Kim <[email protected]>
Date:   Fri Jun 21 10:05:25 2024 -0700

    perf report: Fix condition in sort__sym_cmp()
    
    [ Upstream commit cb39d05e67dc24985ff9f5150e71040fa4d60ab8 ]
    
    It's expected that both hist entries are in the same hists when
    comparing two.  But the current code in the function checks one without
    dso sort key and other with the key.  This would make the condition true
    in any case.
    
    I guess the intention of the original commit was to add '!' for the
    right side too.  But as it should be the same, let's just remove it.
    
    Fixes: 69849fc5d2119 ("perf hists: Move sort__has_dso into struct perf_hpp_list")
    Reviewed-by: Kan Liang <[email protected]>
    Signed-off-by: Namhyung Kim <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
perf/x86/intel/pt: Fix a topa_entry base address calculation [+ + +]
Author: Adrian Hunter <[email protected]>
Date:   Mon Jun 24 23:10:56 2024 +0300

    perf/x86/intel/pt: Fix a topa_entry base address calculation
    
    commit ad97196379d0b8cb24ef3d5006978a6554e6467f upstream.
    
    topa_entry->base is a bit-field. Bit-fields are not promoted to a 64-bit
    type, even if the underlying type is 64-bit, and so, if necessary, must
    be cast to a larger type when calculations are done.
    
    Fix a topa_entry->base address calculation by adding a cast.
    
    Without the cast, the address was limited to 36-bits i.e. 64GiB.
    
    The address calculation is used on systems that do not support Multiple
    Entry ToPA (only Broadwell), and affects physical addresses on or above
    64GiB. Instead of writing to the correct address, the address comprising
    the first 36 bits would be written to.
    
    Intel PT snapshot and sampling modes are not affected.
    
    Fixes: 52ca9ced3f70 ("perf/x86/intel/pt: Add Intel PT PMU driver")
    Reported-by: Dave Hansen <[email protected]>
    Signed-off-by: Adrian Hunter <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

perf/x86/intel/pt: Fix pt_topa_entry_for_page() address calculation [+ + +]
Author: Adrian Hunter <[email protected]>
Date:   Mon Jun 24 23:10:57 2024 +0300

    perf/x86/intel/pt: Fix pt_topa_entry_for_page() address calculation
    
    [ Upstream commit 3520b251dcae2b4a27b95cd6f745c54fd658bda5 ]
    
    Currently, perf allocates an array of page pointers which is limited in
    size by MAX_PAGE_ORDER. That in turn limits the maximum Intel PT buffer
    size to 2GiB. Should that limitation be lifted, the Intel PT driver can
    support larger sizes, except for one calculation in
    pt_topa_entry_for_page(), which is limited to 32-bits.
    
    Fix pt_topa_entry_for_page() address calculation by adding a cast.
    
    Fixes: 39152ee51b77 ("perf/x86/intel/pt: Get rid of reverse lookup table for ToPA")
    Signed-off-by: Adrian Hunter <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

perf/x86/intel/pt: Fix topa_entry base length [+ + +]
Author: Marco Cavenati <[email protected]>
Date:   Mon Jun 24 23:10:55 2024 +0300

    perf/x86/intel/pt: Fix topa_entry base length
    
    commit 5638bd722a44bbe97c1a7b3fae5b9efddb3e70ff upstream.
    
    topa_entry->base needs to store a pfn.  It obviously needs to be
    large enough to store the largest possible x86 pfn which is
    MAXPHYADDR-PAGE_SIZE (52-12).  So it is 4 bits too small.
    
    Increase the size of topa_entry->base from 36 bits to 40 bits.
    
    Note, systems where physical addresses can be 256TiB or more are affected.
    
    [ Adrian: Amend commit message as suggested by Dave Hansen ]
    
    Fixes: 52ca9ced3f70 ("perf/x86/intel/pt: Add Intel PT PMU driver")
    Signed-off-by: Marco Cavenati <[email protected]>
    Signed-off-by: Adrian Hunter <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Reviewed-by: Adrian Hunter <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
perf: Fix perf_aux_size() for greater-than 32-bit size [+ + +]
Author: Adrian Hunter <[email protected]>
Date:   Mon Jun 24 23:10:58 2024 +0300

    perf: Fix perf_aux_size() for greater-than 32-bit size
    
    [ Upstream commit 3df94a5b1078dfe2b0c03f027d018800faf44c82 ]
    
    perf_buffer->aux_nr_pages uses a 32-bit type, so a cast is needed to
    calculate a 64-bit size.
    
    Fixes: 45bfb2e50471 ("perf: Add AUX area to ring buffer for raw data streams")
    Signed-off-by: Adrian Hunter <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

perf: Prevent passing zero nr_pages to rb_alloc_aux() [+ + +]
Author: Adrian Hunter <[email protected]>
Date:   Mon Jun 24 23:10:59 2024 +0300

    perf: Prevent passing zero nr_pages to rb_alloc_aux()
    
    [ Upstream commit dbc48c8f41c208082cfa95e973560134489e3309 ]
    
    nr_pages is unsigned long but gets passed to rb_alloc_aux() as an int,
    and is stored as an int.
    
    Only power-of-2 values are accepted, so if nr_pages is a 64_bit value, it
    will be passed to rb_alloc_aux() as zero.
    
    That is not ideal because:
     1. the value is incorrect
     2. rb_alloc_aux() is at risk of misbehaving, although it manages to
     return -ENOMEM in that case, it is a result of passing zero to get_order()
     even though the get_order() result is documented to be undefined in that
     case.
    
    Fix by simply validating the maximum supported value in the first place.
    Use -ENOMEM error code for consistency with the current error code that
    is returned in that case.
    
    Fixes: 45bfb2e50471 ("perf: Add AUX area to ring buffer for raw data streams")
    Signed-off-by: Adrian Hunter <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
pinctrl: core: fix possible memory leak when pinctrl_enable() fails [+ + +]
Author: Yang Yingliang <[email protected]>
Date:   Thu Jun 6 10:37:02 2024 +0800

    pinctrl: core: fix possible memory leak when pinctrl_enable() fails
    
    [ Upstream commit ae1cf4759972c5fe665ee4c5e0c29de66fe3cf4a ]
    
    In devm_pinctrl_register(), if pinctrl_enable() fails in pinctrl_register(),
    the "pctldev" has not been added to dev resources, so devm_pinctrl_dev_release()
    can not be called, it leads memory leak.
    
    Introduce pinctrl_uninit_controller(), call it in the error path to free memory.
    
    Fixes: 5038a66dad01 ("pinctrl: core: delete incorrect free in pinctrl_enable()")
    Signed-off-by: Yang Yingliang <[email protected]>
    Reviewed-by: Dan Carpenter <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Linus Walleij <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

pinctrl: freescale: mxs: Fix refcount of child [+ + +]
Author: Peng Fan <[email protected]>
Date:   Sat May 4 21:20:16 2024 +0800

    pinctrl: freescale: mxs: Fix refcount of child
    
    [ Upstream commit 7f500f2011c0bbb6e1cacab74b4c99222e60248e ]
    
    of_get_next_child() will increase refcount of the returned node, need
    use of_node_put() on it when done.
    
    Per current implementation, 'child' will be override by
    for_each_child_of_node(np, child), so use of_get_child_count to avoid
    refcount leakage.
    
    Fixes: 17723111e64f ("pinctrl: add pinctrl-mxs support")
    Signed-off-by: Peng Fan <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Linus Walleij <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

pinctrl: single: fix possible memory leak when pinctrl_enable() fails [+ + +]
Author: Yang Yingliang <[email protected]>
Date:   Thu Jun 6 10:37:03 2024 +0800

    pinctrl: single: fix possible memory leak when pinctrl_enable() fails
    
    [ Upstream commit 8f773bfbdd428819328a2d185976cfc6ae811cd3 ]
    
    This driver calls pinctrl_register_and_init() which is not
    devm_ managed, it will leads memory leak if pinctrl_enable()
    fails. Replace it with devm_pinctrl_register_and_init().
    And call pcs_free_resources() if pinctrl_enable() fails.
    
    Fixes: 5038a66dad01 ("pinctrl: core: delete incorrect free in pinctrl_enable()")
    Signed-off-by: Yang Yingliang <[email protected]>
    Reviewed-by: Dan Carpenter <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Linus Walleij <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

pinctrl: ti: ti-iodelay: Drop if block with always false condition [+ + +]
Author: Uwe Kleine-König <[email protected]>
Date:   Mon Oct 9 10:38:39 2023 +0200

    pinctrl: ti: ti-iodelay: Drop if block with always false condition
    
    [ Upstream commit 88b3f108502bc45e6ebd005702add46759f3f45a ]
    
    ti_iodelay_remove() is only called after ti_iodelay_probe() completed
    successfully. In this case platform_set_drvdata() was called with a
    non-NULL argument and so platform_get_drvdata() won't return NULL.
    
    Simplify by removing the if block with the always false condition.
    
    Signed-off-by: Uwe Kleine-König <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Linus Walleij <[email protected]>
    Stable-dep-of: 9b401f4a7170 ("pinctrl: ti: ti-iodelay: fix possible memory leak when pinctrl_enable() fails")
    Signed-off-by: Sasha Levin <[email protected]>

pinctrl: ti: ti-iodelay: fix possible memory leak when pinctrl_enable() fails [+ + +]
Author: Yang Yingliang <[email protected]>
Date:   Thu Jun 6 10:37:04 2024 +0800

    pinctrl: ti: ti-iodelay: fix possible memory leak when pinctrl_enable() fails
    
    [ Upstream commit 9b401f4a7170125365160c9af267a41ff6b39001 ]
    
    This driver calls pinctrl_register_and_init() which is not
    devm_ managed, it will leads memory leak if pinctrl_enable()
    fails. Replace it with devm_pinctrl_register_and_init().
    And add missing of_node_put() in the error path.
    
    Fixes: 5038a66dad01 ("pinctrl: core: delete incorrect free in pinctrl_enable()")
    Signed-off-by: Yang Yingliang <[email protected]>
    Reviewed-by: Dan Carpenter <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Linus Walleij <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
platform/chrome: cros_ec_debugfs: fix wrong EC message version [+ + +]
Author: Tzung-Bi Shih <[email protected]>
Date:   Tue Jun 11 11:31:10 2024 +0000

    platform/chrome: cros_ec_debugfs: fix wrong EC message version
    
    [ Upstream commit c2a28647bbb4e0894e8824362410f72b06ac57a4 ]
    
    ec_read_version_supported() uses ec_params_get_cmd_versions_v1 but it
    wrongly uses message version 0.
    
    Fix it.
    
    Fixes: e86264595225 ("mfd: cros_ec: add debugfs, console log file")
    Reviewed-by: Guenter Roeck <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Tzung-Bi Shih <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
platform: mips: cpu_hwmon: Disable driver on unsupported hardware [+ + +]
Author: Jiaxun Yang <[email protected]>
Date:   Fri Jun 14 16:40:15 2024 +0100

    platform: mips: cpu_hwmon: Disable driver on unsupported hardware
    
    commit f4d430db17b4ef4e9c3c352a04b2fe3c93011978 upstream.
    
    cpu_hwmon is unsupported on CPUs without loongson_chiptemp
    register and csr.
    
    Cc: [email protected]
    Signed-off-by: Jiaxun Yang <[email protected]>
    Signed-off-by: Thomas Bogendoerfer <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
power: supply: axp288_charger: Fix constant_charge_voltage writes [+ + +]
Author: Hans de Goede <[email protected]>
Date:   Wed Jul 17 22:03:32 2024 +0200

    power: supply: axp288_charger: Fix constant_charge_voltage writes
    
    commit b34ce4a59cfe9cd0d6f870e6408e8ec88a964585 upstream.
    
    info->max_cv is in millivolts, divide the microvolt value being written
    to constant_charge_voltage by 1000 *before* clamping it to info->max_cv.
    
    Before this fix the code always tried to set constant_charge_voltage
    to max_cv / 1000 = 4 millivolt, which ends up in setting it to 4.1V
    which is the lowest supported value.
    
    Fixes: 843735b788a4 ("power: axp288_charger: axp288 charger driver")
    Cc: [email protected]
    Signed-off-by: Hans de Goede <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sebastian Reichel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

power: supply: axp288_charger: Round constant_charge_voltage writes down [+ + +]
Author: Hans de Goede <[email protected]>
Date:   Wed Jul 17 22:03:33 2024 +0200

    power: supply: axp288_charger: Round constant_charge_voltage writes down
    
    commit 81af7f2342d162e24ac820c10e68684d9f927663 upstream.
    
    Round constant_charge_voltage writes down to the first supported lower
    value, rather then rounding them up to the first supported higher value.
    
    This fixes e.g. writing 4250000 resulting in a value of 4350000 which
    might be dangerous, instead writing 4250000 will now result in a safe
    4200000 value.
    
    Fixes: 843735b788a4 ("power: axp288_charger: axp288 charger driver")
    Cc: [email protected]
    Signed-off-by: Hans de Goede <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sebastian Reichel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
powerpc/xmon: Fix disassembly CPU feature checks [+ + +]
Author: Michael Ellerman <[email protected]>
Date:   Thu May 9 22:12:47 2024 +1000

    powerpc/xmon: Fix disassembly CPU feature checks
    
    [ Upstream commit 14196e47c5ffe32af7ed5a51c9e421c5ea5bccce ]
    
    In the xmon disassembly code there are several CPU feature checks to
    determine what dialects should be passed to the disassembler. The
    dialect controls which instructions the disassembler will recognise.
    
    Unfortunately the checks are incorrect, because instead of passing a
    single CPU feature they are passing a mask of feature bits.
    
    For example the code:
    
      if (cpu_has_feature(CPU_FTRS_POWER5))
          dialect |= PPC_OPCODE_POWER5;
    
    Is trying to check if the system is running on a Power5 CPU. But
    CPU_FTRS_POWER5 is a mask of *all* the feature bits that are enabled on
    a Power5.
    
    In practice the test will always return true for any 64-bit CPU, because
    at least one bit in the mask will be present in the CPU_FTRS_ALWAYS
    mask.
    
    Similarly for all the other checks against CPU_FTRS_xx masks.
    
    Rather than trying to match the disassembly behaviour exactly to the
    current CPU, just differentiate between 32-bit and 64-bit, and Altivec,
    VSX and HTM.
    
    That will cause some instructions to be shown in disassembly even
    on a CPU that doesn't support them, but that's OK, objdump -d output
    has the same behaviour, and if anything it's less confusing than some
    instructions not being disassembled.
    
    Fixes: 897f112bb42e ("[POWERPC] Import updated version of ppc disassembly code for xmon")
    Signed-off-by: Michael Ellerman <[email protected]>
    Link: https://msgid.link/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
powerpc: fix a file leak in kvm_vcpu_ioctl_enable_cap() [+ + +]
Author: Al Viro <[email protected]>
Date:   Thu May 30 23:54:55 2024 -0400

    powerpc: fix a file leak in kvm_vcpu_ioctl_enable_cap()
    
    [ Upstream commit b4cf5fc01ce83e5c0bcf3dbb9f929428646b9098 ]
    
    missing fdput() on one of the failure exits
    
    Fixes: eacc56bb9de3e # v5.2
    Signed-off-by: Al Viro <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
Linux: protect the fetch of ->fd[fd] in do_dup2() from mispredictions [+ + +]
Author: Al Viro <[email protected]>
Date:   Thu Aug 1 15:22:22 2024 -0400

    protect the fetch of ->fd[fd] in do_dup2() from mispredictions
    
    commit 8aa37bde1a7b645816cda8b80df4753ecf172bf1 upstream.
    
    both callers have verified that fd is not greater than ->max_fds;
    however, misprediction might end up with
            tofree = fdt->fd[fd];
    being speculatively executed.  That's wrong for the same reasons
    why it's wrong in close_fd()/file_close_fd_locked(); the same
    solution applies - array_index_nospec(fd, fdt->max_fds) could differ
    from fd only in case of speculative execution on mispredicted path.
    
    Cc: [email protected]
    Signed-off-by: Al Viro <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
pwm: stm32: Always do lazy disabling [+ + +]
Author: Uwe Kleine-König <[email protected]>
Date:   Wed Jul 3 13:00:06 2024 +0200

    pwm: stm32: Always do lazy disabling
    
    [ Upstream commit 7346e7a058a2c9aa9ff1cc699c7bf18a402d9f84 ]
    
    When the state changes from enabled to disabled, polarity, duty_cycle
    and period are not configured in hardware and TIM_CCER_CCxE is just
    cleared. However if the state changes from one disabled state to
    another, all parameters are written to hardware because the early exit
    from stm32_pwm_apply() is only taken if the pwm is currently enabled.
    
    This yields surprises like: Applying
    
            { .period = 1, .duty_cycle = 0, .enabled = false }
    
    succeeds if the pwm is initially on, but fails if it's already off
    because 1 is a too small period.
    
    Update the check for lazy disable to always exit early if the target
    state is disabled, no matter what is currently configured.
    
    Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm")
    Signed-off-by: Uwe Kleine-König <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Uwe Kleine-König <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
qed: Improve the stack space of filter_config() [+ + +]
Author: Shai Malin <[email protected]>
Date:   Mon Sep 13 10:50:24 2021 +0300

    qed: Improve the stack space of filter_config()
    
    [ Upstream commit f55e36d5ab76c3097ff36ecea60b91c6b0d80fc8 ]
    
    As it was reported and discussed in: https://lore.kernel.org/lkml/CAHk-=whF9F89vsfH8E9TGc0tZA-yhzi2Di8wOtquNB5vRkFX5w@mail.gmail.com/
    This patch improves the stack space of qede_config_rx_mode() by
    splitting filter_config() to 3 functions and removing the
    union qed_filter_type_params.
    
    Reported-by: Naresh Kamboju <[email protected]>
    Signed-off-by: Ariel Elior <[email protected]>
    Signed-off-by: Shai Malin <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Stable-dep-of: b5d14b0c6716 ("wifi: virt_wifi: avoid reporting connection success with wrong SSID")
    Signed-off-by: Sasha Levin <[email protected]>

 
rbd: don't assume rbd_is_lock_owner() for exclusive mappings [+ + +]
Author: Ilya Dryomov <[email protected]>
Date:   Tue Jul 23 18:08:08 2024 +0200

    rbd: don't assume rbd_is_lock_owner() for exclusive mappings
    
    commit 3ceccb14f5576e02b81cc8b105ab81f224bd87f6 upstream.
    
    Expanding on the previous commit, assuming that rbd_is_lock_owner()
    always returns true (i.e. that we are either in RBD_LOCK_STATE_LOCKED
    or RBD_LOCK_STATE_QUIESCING) if the mapping is exclusive is wrong too.
    In case ceph_cls_set_cookie() fails, the lock would be temporarily
    released even if the mapping is exclusive, meaning that we can end up
    even in RBD_LOCK_STATE_UNLOCKED.
    
    IOW, exclusive mappings are really "just" about disabling automatic
    lock transitions (as documented in the man page), not about grabbing
    the lock and holding on to it whatever it takes.
    
    Cc: [email protected]
    Fixes: 637cd060537d ("rbd: new exclusive lock wait/wake code")
    Signed-off-by: Ilya Dryomov <[email protected]>
    Reviewed-by: Dongsheng Yang <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

rbd: don't assume RBD_LOCK_STATE_LOCKED for exclusive mappings [+ + +]
Author: Ilya Dryomov <[email protected]>
Date:   Tue Jul 23 18:07:59 2024 +0200

    rbd: don't assume RBD_LOCK_STATE_LOCKED for exclusive mappings
    
    commit 2237ceb71f89837ac47c5dce2aaa2c2b3a337a3c upstream.
    
    Every time a watch is reestablished after getting lost, we need to
    update the cookie which involves quiescing exclusive lock.  For this,
    we transition from RBD_LOCK_STATE_LOCKED to RBD_LOCK_STATE_QUIESCING
    roughly for the duration of rbd_reacquire_lock() call.  If the mapping
    is exclusive and I/O happens to arrive in this time window, it's failed
    with EROFS (later translated to EIO) based on the wrong assumption in
    rbd_img_exclusive_lock() -- "lock got released?" check there stopped
    making sense with commit a2b1da09793d ("rbd: lock should be quiesced on
    reacquire").
    
    To make it worse, any such I/O is added to the acquiring list before
    EROFS is returned and this sets up for violating rbd_lock_del_request()
    precondition that the request is either on the running list or not on
    any list at all -- see commit ded080c86b3f ("rbd: don't move requests
    to the running list on errors").  rbd_lock_del_request() ends up
    processing these requests as if they were on the running list which
    screws up quiescing_wait completion counter and ultimately leads to
    
        rbd_assert(!completion_done(&rbd_dev->quiescing_wait));
    
    being triggered on the next watch error.
    
    Cc: [email protected] # 06ef84c4e9c4: rbd: rename RBD_LOCK_STATE_RELEASING and releasing_wait
    Cc: [email protected]
    Fixes: 637cd060537d ("rbd: new exclusive lock wait/wake code")
    Signed-off-by: Ilya Dryomov <[email protected]>
    Reviewed-by: Dongsheng Yang <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

rbd: rename RBD_LOCK_STATE_RELEASING and releasing_wait [+ + +]
Author: Ilya Dryomov <[email protected]>
Date:   Tue Jul 23 17:54:39 2024 +0200

    rbd: rename RBD_LOCK_STATE_RELEASING and releasing_wait
    
    commit f5c466a0fdb2d9f3650d2e3911b0735f17ba00cf upstream.
    
    ... to RBD_LOCK_STATE_QUIESCING and quiescing_wait to recognize that
    this state and the associated completion are backing rbd_quiesce_lock(),
    which isn't specific to releasing the lock.
    
    While exclusive lock does get quiesced before it's released, it also
    gets quiesced before an attempt to update the cookie is made and there
    the lock is not released as long as ceph_cls_set_cookie() succeeds.
    
    Signed-off-by: Ilya Dryomov <[email protected]>
    Reviewed-by: Dongsheng Yang <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
RDMA/device: Return error earlier if port in not valid [+ + +]
Author: Leon Romanovsky <[email protected]>
Date:   Mon Jun 24 16:24:32 2024 +0300

    RDMA/device: Return error earlier if port in not valid
    
    [ Upstream commit 917918f57a7b139c043e78c502876f2c286f4f0a ]
    
    There is no need to allocate port data if port provided is not valid.
    
    Fixes: c2261dd76b54 ("RDMA/device: Add ib_device_set_netdev() as an alternative to get_netdev")
    Link: https://lore.kernel.org/r/022047a8b16988fc88d4426da50bf60a4833311b.1719235449.git.leon@kernel.org
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
RDMA/iwcm: Fix a use-after-free related to destroying CM IDs [+ + +]
Author: Bart Van Assche <[email protected]>
Date:   Wed Jun 5 08:51:01 2024 -0600

    RDMA/iwcm: Fix a use-after-free related to destroying CM IDs
    
    commit aee2424246f9f1dadc33faa78990c1e2eb7826e4 upstream.
    
    iw_conn_req_handler() associates a new struct rdma_id_private (conn_id) with
    an existing struct iw_cm_id (cm_id) as follows:
    
            conn_id->cm_id.iw = cm_id;
            cm_id->context = conn_id;
            cm_id->cm_handler = cma_iw_handler;
    
    rdma_destroy_id() frees both the cm_id and the struct rdma_id_private. Make
    sure that cm_work_handler() does not trigger a use-after-free by only
    freeing of the struct rdma_id_private after all pending work has finished.
    
    Cc: [email protected]
    Fixes: 59c68ac31e15 ("iw_cm: free cm_id resources on the last deref")
    Reviewed-by: Zhu Yanjun <[email protected]>
    Tested-by: Shin'ichiro Kawasaki <[email protected]>
    Signed-off-by: Bart Van Assche <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
RDMA/mlx4: Fix truncated output warning in alias_GUID.c [+ + +]
Author: Leon Romanovsky <[email protected]>
Date:   Sun Jun 16 19:17:30 2024 +0300

    RDMA/mlx4: Fix truncated output warning in alias_GUID.c
    
    [ Upstream commit 5953e0647cec703ef436ead37fed48943507b433 ]
    
    drivers/infiniband/hw/mlx4/alias_GUID.c: In function ‘mlx4_ib_init_alias_guid_service’:
    drivers/infiniband/hw/mlx4/alias_GUID.c:878:74: error: ‘%d’ directive
    output may be truncated writing between 1 and 11 bytes into a region of
    size 5 [-Werror=format-truncation=]
      878 |                 snprintf(alias_wq_name, sizeof alias_wq_name, "alias_guid%d", i);
          |                                                                          ^~
    drivers/infiniband/hw/mlx4/alias_GUID.c:878:63: note: directive argument in the range [-2147483641, 2147483646]
      878 |                 snprintf(alias_wq_name, sizeof alias_wq_name, "alias_guid%d", i);
          |                                                               ^~~~~~~~~~~~~~
    drivers/infiniband/hw/mlx4/alias_GUID.c:878:17: note: ‘snprintf’ output
    between 12 and 22 bytes into a destination of size 15
      878 |                 snprintf(alias_wq_name, sizeof alias_wq_name, "alias_guid%d", i);
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    
    Fixes: a0c64a17aba8 ("mlx4: Add alias_guid mechanism")
    Link: https://lore.kernel.org/r/1951c9500109ca7e36dcd523f8a5f2d0d2a608d1.1718554641.git.leon@kernel.org
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

RDMA/mlx4: Fix truncated output warning in mad.c [+ + +]
Author: Leon Romanovsky <[email protected]>
Date:   Sun Jun 16 19:16:33 2024 +0300

    RDMA/mlx4: Fix truncated output warning in mad.c
    
    [ Upstream commit 0d2e6992fc956e3308cd5376c18567def4cb3967 ]
    
    Increase size of the name array to avoid truncated output warning.
    
    drivers/infiniband/hw/mlx4/mad.c: In function ‘mlx4_ib_alloc_demux_ctx’:
    drivers/infiniband/hw/mlx4/mad.c:2197:47: error: ‘%d’ directive output
    may be truncated writing between 1 and 11 bytes into a region of size 4
    [-Werror=format-truncation=]
     2197 |         snprintf(name, sizeof(name), "mlx4_ibt%d", port);
          |                                               ^~
    drivers/infiniband/hw/mlx4/mad.c:2197:38: note: directive argument in
    the range [-2147483645, 2147483647]
     2197 |         snprintf(name, sizeof(name), "mlx4_ibt%d", port);
          |                                      ^~~~~~~~~~~~
    drivers/infiniband/hw/mlx4/mad.c:2197:9: note: ‘snprintf’ output between
    10 and 20 bytes into a destination of size 12
     2197 |         snprintf(name, sizeof(name), "mlx4_ibt%d", port);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/infiniband/hw/mlx4/mad.c:2205:48: error: ‘%d’ directive output
    may be truncated writing between 1 and 11 bytes into a region of size 3
    [-Werror=format-truncation=]
     2205 |         snprintf(name, sizeof(name), "mlx4_ibwi%d", port);
          |                                                ^~
    drivers/infiniband/hw/mlx4/mad.c:2205:38: note: directive argument in
    the range [-2147483645, 2147483647]
     2205 |         snprintf(name, sizeof(name), "mlx4_ibwi%d", port);
          |                                      ^~~~~~~~~~~~~
    drivers/infiniband/hw/mlx4/mad.c:2205:9: note: ‘snprintf’ output between
    11 and 21 bytes into a destination of size 12
     2205 |         snprintf(name, sizeof(name), "mlx4_ibwi%d", port);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/infiniband/hw/mlx4/mad.c:2213:48: error: ‘%d’ directive output
    may be truncated writing between 1 and 11 bytes into a region of size 3
    [-Werror=format-truncation=]
     2213 |         snprintf(name, sizeof(name), "mlx4_ibud%d", port);
          |                                                ^~
    drivers/infiniband/hw/mlx4/mad.c:2213:38: note: directive argument in
    the range [-2147483645, 2147483647]
     2213 |         snprintf(name, sizeof(name), "mlx4_ibud%d", port);
          |                                      ^~~~~~~~~~~~~
    drivers/infiniband/hw/mlx4/mad.c:2213:9: note: ‘snprintf’ output between
    11 and 21 bytes into a destination of size 12
     2213 |         snprintf(name, sizeof(name), "mlx4_ibud%d", port);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    make[6]: *** [scripts/Makefile.build:244: drivers/infiniband/hw/mlx4/mad.o] Error 1
    
    Fixes: fc06573dfaf8 ("IB/mlx4: Initialize SR-IOV IB support for slaves in master context")
    Link: https://lore.kernel.org/r/f3798b3ce9a410257d7e1ec7c9e285f1352e256a.1718554569.git.leon@kernel.org
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs [+ + +]
Author: Honggang LI <[email protected]>
Date:   Mon Jun 24 10:03:48 2024 +0800

    RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs
    
    [ Upstream commit 4adcaf969d77d3d3aa3871bbadc196258a38aec6 ]
    
    BTH_ACK_MASK bit is used to indicate that an acknowledge
    (for this packet) should be scheduled by the responder.
    Both UC and UD QPs are unacknowledged, so don't set
    BTH_ACK_MASK for UC or UD QPs.
    
    Fixes: 8700e3e7c485 ("Soft RoCE driver")
    Signed-off-by: Honggang LI <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Zhu Yanjun <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
remoteproc: imx_rproc: Fix ignoring mapping vdev regions [+ + +]
Author: Dong Aisheng <[email protected]>
Date:   Fri Sep 10 17:06:19 2021 +0800

    remoteproc: imx_rproc: Fix ignoring mapping vdev regions
    
    [ Upstream commit afe670e23af91d8a74a8d7049f6e0984bbf6ea11 ]
    
    vdev regions are typically named vdev0buffer, vdev0ring0, vdev0ring1 and
    etc. Change to strncmp to cover them all.
    
    Fixes: 8f2d8961640f ("remoteproc: imx_rproc: ignore mapping vdev regions")
    Reviewed-and-tested-by: Peng Fan <[email protected]>
    Signed-off-by: Dong Aisheng <[email protected]>
    Signed-off-by: Peng Fan <[email protected]>
    Cc: stable <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Mathieu Poirier <[email protected]>
    Signed-off-by: Bjorn Andersson <[email protected]>
    Stable-dep-of: 2fa26ca8b786 ("remoteproc: imx_rproc: Skip over memory region when node value is NULL")
    Signed-off-by: Sasha Levin <[email protected]>

remoteproc: imx_rproc: ignore mapping vdev regions [+ + +]
Author: Peng Fan <[email protected]>
Date:   Sat Mar 6 19:24:24 2021 +0800

    remoteproc: imx_rproc: ignore mapping vdev regions
    
    [ Upstream commit 8f2d8961640f0346cbe892273c3260a0d30c1931 ]
    
    vdev regions are vdev0vring0, vdev0vring1, vdevbuffer and similar.
    They are handled by remoteproc common code, no need to map in imx
    rproc driver.
    
    Signed-off-by: Peng Fan <[email protected]>
    Reviewed-by: Mathieu Poirier <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Bjorn Andersson <[email protected]>
    Stable-dep-of: 2fa26ca8b786 ("remoteproc: imx_rproc: Skip over memory region when node value is NULL")
    Signed-off-by: Sasha Levin <[email protected]>

remoteproc: imx_rproc: Skip over memory region when node value is NULL [+ + +]
Author: Aleksandr Mishin <[email protected]>
Date:   Thu Jun 6 10:52:04 2024 +0300

    remoteproc: imx_rproc: Skip over memory region when node value is NULL
    
    [ Upstream commit 2fa26ca8b786888673689ccc9da6094150939982 ]
    
    In imx_rproc_addr_init() "nph = of_count_phandle_with_args()" just counts
    number of phandles. But phandles may be empty. So of_parse_phandle() in
    the parsing loop (0 < a < nph) may return NULL which is later dereferenced.
    Adjust this issue by adding NULL-return check.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: a0ff4aa6f010 ("remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driver")
    Signed-off-by: Aleksandr Mishin <[email protected]>
    Reviewed-by: Peng Fan <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/r/[email protected]
    [Fixed title to fit within the prescribed 70-75 charcters]
    Signed-off-by: Mathieu Poirier <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
rtc: cmos: Fix return value of nvmem callbacks [+ + +]
Author: Joy Chakraborty <[email protected]>
Date:   Wed Jun 12 08:36:35 2024 +0000

    rtc: cmos: Fix return value of nvmem callbacks
    
    commit 1c184baccf0d5e2ef4cc1562261d0e48508a1c2b upstream.
    
    Read/write callbacks registered with nvmem core expect 0 to be returned
    on success and a negative value to be returned on failure.
    
    cmos_nvram_read()/cmos_nvram_write() currently return the number of
    bytes read or written, fix to return 0 on success and -EIO incase number
    of bytes requested was not read or written.
    
    Fixes: 8b5b7958fd1c ("rtc: cmos: use generic nvmem")
    Cc: [email protected]
    Signed-off-by: Joy Chakraborty <[email protected]>
    Reviewed-by: Dan Carpenter <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

rtc: interface: Add RTC offset to alarm after fix-up [+ + +]
Author: Csókás, Bence <[email protected]>
Date:   Wed Jun 19 16:04:52 2024 +0200

    rtc: interface: Add RTC offset to alarm after fix-up
    
    [ Upstream commit 463927a8902a9f22c3633960119410f57d4c8920 ]
    
    `rtc_add_offset()` is called by `__rtc_read_time()`
    and `__rtc_read_alarm()` to add the RTC's offset to
    the raw read-outs from the device drivers. However,
    in the latter case, a fix-up algorithm is run if
    the RTC device does not report a full `struct rtc_time`
    alarm value. In that case, the offset was forgot to be
    added.
    
    Fixes: fd6792bb022e ("rtc: fix alarm read and set offset")
    
    Signed-off-by: Csókás, Bence <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

rtc: isl1208: Fix return value of nvmem callbacks [+ + +]
Author: Joy Chakraborty <[email protected]>
Date:   Wed Jun 12 08:08:31 2024 +0000

    rtc: isl1208: Fix return value of nvmem callbacks
    
    commit 70f1ae5f0e7f44edf842444044615da7b59838c1 upstream.
    
    Read/write callbacks registered with nvmem core expect 0 to be returned
    on success and a negative value to be returned on failure.
    
    isl1208_nvmem_read()/isl1208_nvmem_write() currently return the number of
    bytes read/written on success, fix to return 0 on success and negative on
    failure.
    
    Fixes: c3544f6f51ed ("rtc: isl1208: Add new style nvmem support to driver")
    Cc: [email protected]
    Signed-off-by: Joy Chakraborty <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
s390/sclp: Prevent release of buffer in I/O [+ + +]
Author: Peter Oberparleiter <[email protected]>
Date:   Thu Jun 20 14:20:27 2024 +0200

    s390/sclp: Prevent release of buffer in I/O
    
    [ Upstream commit bf365071ea92b9579d5a272679b74052a5643e35 ]
    
    When a task waiting for completion of a Store Data operation is
    interrupted, an attempt is made to halt this operation. If this attempt
    fails due to a hardware or firmware problem, there is a chance that the
    SCLP facility might store data into buffers referenced by the original
    operation at a later time.
    
    Handle this situation by not releasing the referenced data buffers if
    the halt attempt fails. For current use cases, this might result in a
    leak of few pages of memory in case of a rare hardware/firmware
    malfunction.
    
    Reviewed-by: Heiko Carstens <[email protected]>
    Signed-off-by: Peter Oberparleiter <[email protected]>
    Signed-off-by: Alexander Gordeev <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
saa7134: Unchecked i2c_transfer function result fixed [+ + +]
Author: Aleksandr Burakov <[email protected]>
Date:   Fri Feb 16 15:40:06 2024 +0300

    saa7134: Unchecked i2c_transfer function result fixed
    
    [ Upstream commit 9d8683b3fd93f0e378f24dc3d9604e5d7d3e0a17 ]
    
    Return value of function 'i2c_transfer' is not checked that
    may cause undefined behaviour.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 2cf36ac44730 ("[PATCH] v4l: 656: added support for the following cards")
    Signed-off-by: Aleksandr Burakov <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
scsi: mpt3sas: Avoid IOMMU page faults on REPORT ZONES [+ + +]
Author: Damien Le Moal <[email protected]>
Date:   Fri Jul 19 16:39:12 2024 +0900

    scsi: mpt3sas: Avoid IOMMU page faults on REPORT ZONES
    
    [ Upstream commit 82dbb57ac8d06dfe8227ba9ab11a49de2b475ae5 ]
    
    Some firmware versions of the 9600 series SAS HBA byte-swap the REPORT
    ZONES command reply buffer from ATA-ZAC devices by directly accessing the
    buffer in the host memory. This does not respect the default command DMA
    direction and causes IOMMU page faults on architectures with an IOMMU
    enforcing write-only mappings for DMA_FROM_DEVICE DMA driection (e.g. AMD
    hosts).
    
    scsi 18:0:0:0: Direct-Access-ZBC ATA      WDC  WSH722020AL W870 PQ: 0 ANSI: 6
    scsi 18:0:0:0: SATA: handle(0x0027), sas_addr(0x300062b2083e7c40), phy(0), device_name(0x5000cca29dc35e11)
    scsi 18:0:0:0: enclosure logical id (0x300062b208097c40), slot(0)
    scsi 18:0:0:0: enclosure level(0x0000), connector name( C0.0)
    scsi 18:0:0:0: atapi(n), ncq(y), asyn_notify(n), smart(y), fua(y), sw_preserve(y)
    scsi 18:0:0:0: qdepth(32), tagged(1), scsi_level(7), cmd_que(1)
    sd 18:0:0:0: Attached scsi generic sg2 type 20
    sd 18:0:0:0: [sdc] Host-managed zoned block device
    mpt3sas 0000:41:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0021 address=0xfff9b200 flags=0x0050]
    mpt3sas 0000:41:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0021 address=0xfff9b300 flags=0x0050]
    mpt3sas_cm0: mpt3sas_ctl_pre_reset_handler: Releasing the trace buffer due to adapter reset.
    mpt3sas_cm0 fault info from func: mpt3sas_base_make_ioc_ready
    mpt3sas_cm0: fault_state(0x2666)!
    mpt3sas_cm0: sending diag reset !!
    mpt3sas_cm0: diag reset: SUCCESS
    sd 18:0:0:0: [sdc] REPORT ZONES start lba 0 failed
    sd 18:0:0:0: [sdc] REPORT ZONES: Result: hostbyte=DID_RESET driverbyte=DRIVER_OK
    sd 18:0:0:0: [sdc] 0 4096-byte logical blocks: (0 B/0 B)
    
    Avoid such issue by always mapping the buffer of REPORT ZONES commands
    using DMA_BIDIRECTIONAL (read+write IOMMU mapping). This is done by
    introducing the helper function _base_scsi_dma_map() and using this helper
    in _base_build_sg_scmd() and _base_build_sg_scmd_ieee() instead of calling
    directly scsi_dma_map().
    
    Fixes: 471ef9d4e498 ("mpt3sas: Build MPI SGL LIST on GEN2 HBAs and IEEE SGL LIST on GEN3 HBAs")
    Cc: [email protected]
    Signed-off-by: Damien Le Moal <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Christoph Hellwig <[email protected]>
    Reviewed-by: Johannes Thumshirn <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

scsi: mpt3sas: Remove scsi_dma_map() error messages [+ + +]
Author: Sreekanth Reddy <[email protected]>
Date:   Thu Mar 3 19:32:03 2022 +0530

    scsi: mpt3sas: Remove scsi_dma_map() error messages
    
    [ Upstream commit 0c25422d34b4726b2707d5f38560943155a91b80 ]
    
    When scsi_dma_map() fails by returning a sges_left value less than zero,
    the amount of logging produced can be extremely high.  In a recent end-user
    environment, 1200 messages per second were being sent to the log buffer.
    This eventually overwhelmed the system and it stalled.
    
    These error messages are not needed. Remove them.
    
    Link: https://lore.kernel.org/r/[email protected]
    Suggested-by: Christoph Hellwig <[email protected]>
    Signed-off-by: Sreekanth Reddy <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Stable-dep-of: 82dbb57ac8d0 ("scsi: mpt3sas: Avoid IOMMU page faults on REPORT ZONES")
    Signed-off-by: Sasha Levin <[email protected]>

scsi: qla2xxx: Complete command early within lock [+ + +]
Author: Shreyas Deodhar <[email protected]>
Date:   Wed Jul 10 22:40:52 2024 +0530

    scsi: qla2xxx: Complete command early within lock
    
    commit 4475afa2646d3fec176fc4d011d3879b26cb26e3 upstream.
    
    A crash was observed while performing NPIV and FW reset,
    
     BUG: kernel NULL pointer dereference, address: 000000000000001c
     #PF: supervisor read access in kernel mode
     #PF: error_code(0x0000) - not-present page
     PGD 0 P4D 0
     Oops: 0000 1 PREEMPT_RT SMP NOPTI
     RIP: 0010:dma_direct_unmap_sg+0x51/0x1e0
     RSP: 0018:ffffc90026f47b88 EFLAGS: 00010246
     RAX: 0000000000000000 RBX: 0000000000000021 RCX: 0000000000000002
     RDX: 0000000000000021 RSI: 0000000000000000 RDI: ffff8881041130d0
     RBP: ffff8881041130d0 R08: 0000000000000000 R09: 0000000000000034
     R10: ffffc90026f47c48 R11: 0000000000000031 R12: 0000000000000000
     R13: 0000000000000000 R14: ffff8881565e4a20 R15: 0000000000000000
     FS: 00007f4c69ed3d00(0000) GS:ffff889faac80000(0000) knlGS:0000000000000000
     CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 000000000000001c CR3: 0000000288a50002 CR4: 00000000007706e0
     DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
     DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
     PKRU: 55555554
     Call Trace:
     <TASK>
     ? __die_body+0x1a/0x60
     ? page_fault_oops+0x16f/0x4a0
     ? do_user_addr_fault+0x174/0x7f0
     ? exc_page_fault+0x69/0x1a0
     ? asm_exc_page_fault+0x22/0x30
     ? dma_direct_unmap_sg+0x51/0x1e0
     ? preempt_count_sub+0x96/0xe0
     qla2xxx_qpair_sp_free_dma+0x29f/0x3b0 [qla2xxx]
     qla2xxx_qpair_sp_compl+0x60/0x80 [qla2xxx]
     __qla2x00_abort_all_cmds+0xa2/0x450 [qla2xxx]
    
    The command completion was done early while aborting the commands in driver
    unload path but outside lock to avoid the WARN_ON condition of performing
    dma_free_attr within the lock. However this caused race condition while
    command completion via multiple paths causing system crash.
    
    Hence complete the command early in unload path but within the lock to
    avoid race condition.
    
    Fixes: 0367076b0817 ("scsi: qla2xxx: Perform lockless command completion in abort path")
    Cc: [email protected]
    Signed-off-by: Shreyas Deodhar <[email protected]>
    Signed-off-by: Nilesh Javali <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Himanshu Madhani <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scsi: qla2xxx: During vport delete send async logout explicitly [+ + +]
Author: Manish Rangankar <[email protected]>
Date:   Wed Jul 10 22:40:53 2024 +0530

    scsi: qla2xxx: During vport delete send async logout explicitly
    
    commit 76f480d7c717368f29a3870f7d64471ce0ff8fb2 upstream.
    
    During vport delete, it is observed that during unload we hit a crash
    because of stale entries in outstanding command array.  For all these stale
    I/O entries, eh_abort was issued and aborted (fast_fail_io = 2009h) but
    I/Os could not complete while vport delete is in process of deleting.
    
      BUG: kernel NULL pointer dereference, address: 000000000000001c
      #PF: supervisor read access in kernel mode
      #PF: error_code(0x0000) - not-present page
      PGD 0 P4D 0
      Oops: 0000 [#1] PREEMPT SMP NOPTI
      Workqueue: qla2xxx_wq qla_do_work [qla2xxx]
      RIP: 0010:dma_direct_unmap_sg+0x51/0x1e0
      RSP: 0018:ffffa1e1e150fc68 EFLAGS: 00010046
      RAX: 0000000000000000 RBX: 0000000000000021 RCX: 0000000000000001
      RDX: 0000000000000021 RSI: 0000000000000000 RDI: ffff8ce208a7a0d0
      RBP: ffff8ce208a7a0d0 R08: 0000000000000000 R09: ffff8ce378aac9c8
      R10: ffff8ce378aac8a0 R11: ffffa1e1e150f9d8 R12: 0000000000000000
      R13: 0000000000000000 R14: ffff8ce378aac9c8 R15: 0000000000000000
      FS:  0000000000000000(0000) GS:ffff8d217f000000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 000000000000001c CR3: 0000002089acc000 CR4: 0000000000350ee0
      Call Trace:
      <TASK>
      qla2xxx_qpair_sp_free_dma+0x417/0x4e0
      ? qla2xxx_qpair_sp_compl+0x10d/0x1a0
      ? qla2x00_status_entry+0x768/0x2830
      ? newidle_balance+0x2f0/0x430
      ? dequeue_entity+0x100/0x3c0
      ? qla24xx_process_response_queue+0x6a1/0x19e0
      ? __schedule+0x2d5/0x1140
      ? qla_do_work+0x47/0x60
      ? process_one_work+0x267/0x440
      ? process_one_work+0x440/0x440
      ? worker_thread+0x2d/0x3d0
      ? process_one_work+0x440/0x440
      ? kthread+0x156/0x180
      ? set_kthread_struct+0x50/0x50
      ? ret_from_fork+0x22/0x30
      </TASK>
    
    Send out async logout explicitly for all the ports during vport delete.
    
    Cc: [email protected]
    Signed-off-by: Manish Rangankar <[email protected]>
    Signed-off-by: Nilesh Javali <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Himanshu Madhani <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scsi: qla2xxx: Fix for possible memory corruption [+ + +]
Author: Shreyas Deodhar <[email protected]>
Date:   Wed Jul 10 22:40:49 2024 +0530

    scsi: qla2xxx: Fix for possible memory corruption
    
    commit c03d740152f78e86945a75b2ad541bf972fab92a upstream.
    
    Init Control Block is dereferenced incorrectly.  Correctly dereference ICB
    
    Cc: [email protected]
    Signed-off-by: Shreyas Deodhar <[email protected]>
    Signed-off-by: Nilesh Javali <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Himanshu Madhani <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scsi: qla2xxx: Return ENOBUFS if sg_cnt is more than one for ELS cmds [+ + +]
Author: Saurav Kashyap <[email protected]>
Date:   Wed Jul 10 22:40:50 2024 +0530

    scsi: qla2xxx: Return ENOBUFS if sg_cnt is more than one for ELS cmds
    
    commit ce2065c4cc4f05635413f63f6dc038d7d4842e31 upstream.
    
    Firmware only supports single DSDs in ELS Pass-through IOCB (0x53h), sg cnt
    is decided by the SCSI ML. User is not aware of the cause of an acutal
    error.
    
    Return the appropriate return code that will be decoded by API and
    application and proper error message will be displayed to user.
    
    Fixes: 6e98016ca077 ("[SCSI] qla2xxx: Re-organized BSG interface specific code.")
    Cc: [email protected]
    Signed-off-by: Saurav Kashyap <[email protected]>
    Signed-off-by: Nilesh Javali <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Himanshu Madhani <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scsi: qla2xxx: validate nvme_local_port correctly [+ + +]
Author: Nilesh Javali <[email protected]>
Date:   Wed Jul 10 22:40:48 2024 +0530

    scsi: qla2xxx: validate nvme_local_port correctly
    
    commit eb1d4ce2609584eeb7694866f34d4b213caa3af9 upstream.
    
    The driver load failed with error message,
    
    qla2xxx [0000:04:00.0]-ffff:0: register_localport failed: ret=ffffffef
    
    and with a kernel crash,
    
            BUG: unable to handle kernel NULL pointer dereference at 0000000000000070
            Workqueue: events_unbound qla_register_fcport_fn [qla2xxx]
            RIP: 0010:nvme_fc_register_remoteport+0x16/0x430 [nvme_fc]
            RSP: 0018:ffffaaa040eb3d98 EFLAGS: 00010282
            RAX: 0000000000000000 RBX: ffff9dfb46b78c00 RCX: 0000000000000000
            RDX: ffff9dfb46b78da8 RSI: ffffaaa040eb3e08 RDI: 0000000000000000
            RBP: ffff9dfb612a0a58 R08: ffffffffaf1d6270 R09: 3a34303a30303030
            R10: 34303a303030305b R11: 2078787832616c71 R12: ffff9dfb46b78dd4
            R13: ffff9dfb46b78c24 R14: ffff9dfb41525300 R15: ffff9dfb46b78da8
            FS:  0000000000000000(0000) GS:ffff9dfc67c00000(0000) knlGS:0000000000000000
            CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
            CR2: 0000000000000070 CR3: 000000018da10004 CR4: 00000000000206f0
            Call Trace:
            qla_nvme_register_remote+0xeb/0x1f0 [qla2xxx]
            ? qla2x00_dfs_create_rport+0x231/0x270 [qla2xxx]
            qla2x00_update_fcport+0x2a1/0x3c0 [qla2xxx]
            qla_register_fcport_fn+0x54/0xc0 [qla2xxx]
    
    Exit the qla_nvme_register_remote() function when qla_nvme_register_hba()
    fails and correctly validate nvme_local_port.
    
    Cc: [email protected]
    Signed-off-by: Nilesh Javali <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Reviewed-by: Himanshu Madhani <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scsi: ufs: core: Fix hba->last_dme_cmd_tstamp timestamp updating logic [+ + +]
Author: Vamshi Gajjela <[email protected]>
Date:   Wed Jul 24 19:21:26 2024 +0530

    scsi: ufs: core: Fix hba->last_dme_cmd_tstamp timestamp updating logic
    
    commit ab9fd06cb8f0db0854291833fc40c789e43a361f upstream.
    
    The ufshcd_add_delay_before_dme_cmd() always introduces a delay of
    MIN_DELAY_BEFORE_DME_CMDS_US between DME commands even when it's not
    required. The delay is added when the UFS host controller supplies the
    quirk UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS.
    
    Fix the logic to update hba->last_dme_cmd_tstamp to ensure subsequent DME
    commands have the correct delay in the range of 0 to
    MIN_DELAY_BEFORE_DME_CMDS_US.
    
    Update the timestamp at the end of the function to ensure it captures the
    latest time after any necessary delay has been applied.
    
    Signed-off-by: Vamshi Gajjela <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Fixes: cad2e03d8607 ("ufs: add support to allow non standard behaviours (quirks)")
    Cc: [email protected]
    Reviewed-by: Bart Van Assche <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
sctp: Fix null-ptr-deref in reuseport_add_sock(). [+ + +]
Author: Kuniyuki Iwashima <[email protected]>
Date:   Wed Jul 31 16:46:24 2024 -0700

    sctp: Fix null-ptr-deref in reuseport_add_sock().
    
    [ Upstream commit 9ab0faa7f9ffe31296dbb9bbe6f76c72c14eea18 ]
    
    syzbot reported a null-ptr-deref while accessing sk2->sk_reuseport_cb in
    reuseport_add_sock(). [0]
    
    The repro first creates a listener with SO_REUSEPORT.  Then, it creates
    another listener on the same port and concurrently closes the first
    listener.
    
    The second listen() calls reuseport_add_sock() with the first listener as
    sk2, where sk2->sk_reuseport_cb is not expected to be cleared concurrently,
    but the close() does clear it by reuseport_detach_sock().
    
    The problem is SCTP does not properly synchronise reuseport_alloc(),
    reuseport_add_sock(), and reuseport_detach_sock().
    
    The caller of reuseport_alloc() and reuseport_{add,detach}_sock() must
    provide synchronisation for sockets that are classified into the same
    reuseport group.
    
    Otherwise, such sockets form multiple identical reuseport groups, and
    all groups except one would be silently dead.
    
      1. Two sockets call listen() concurrently
      2. No socket in the same group found in sctp_ep_hashtable[]
      3. Two sockets call reuseport_alloc() and form two reuseport groups
      4. Only one group hit first in __sctp_rcv_lookup_endpoint() receives
          incoming packets
    
    Also, the reported null-ptr-deref could occur.
    
    TCP/UDP guarantees that would not happen by holding the hash bucket lock.
    
    Let's apply the locking strategy to __sctp_hash_endpoint() and
    __sctp_unhash_endpoint().
    
    [0]:
    Oops: general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN PTI
    KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
    CPU: 1 UID: 0 PID: 10230 Comm: syz-executor119 Not tainted 6.10.0-syzkaller-12585-g301927d2d2eb #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
    RIP: 0010:reuseport_add_sock+0x27e/0x5e0 net/core/sock_reuseport.c:350
    Code: 00 0f b7 5d 00 bf 01 00 00 00 89 de e8 1b a4 ff f7 83 fb 01 0f 85 a3 01 00 00 e8 6d a0 ff f7 49 8d 7e 12 48 89 f8 48 c1 e8 03 <42> 0f b6 04 28 84 c0 0f 85 4b 02 00 00 41 0f b7 5e 12 49 8d 7e 14
    RSP: 0018:ffffc9000b947c98 EFLAGS: 00010202
    RAX: 0000000000000002 RBX: ffff8880252ddf98 RCX: ffff888079478000
    RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000012
    RBP: 0000000000000001 R08: ffffffff8993e18d R09: 1ffffffff1fef385
    R10: dffffc0000000000 R11: fffffbfff1fef386 R12: ffff8880252ddac0
    R13: dffffc0000000000 R14: 0000000000000000 R15: 0000000000000000
    FS:  00007f24e45b96c0(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007ffcced5f7b8 CR3: 00000000241be000 CR4: 00000000003506f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
     DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
     <TASK>
     __sctp_hash_endpoint net/sctp/input.c:762 [inline]
     sctp_hash_endpoint+0x52a/0x600 net/sctp/input.c:790
     sctp_listen_start net/sctp/socket.c:8570 [inline]
     sctp_inet_listen+0x767/0xa20 net/sctp/socket.c:8625
     __sys_listen_socket net/socket.c:1883 [inline]
     __sys_listen+0x1b7/0x230 net/socket.c:1894
     __do_sys_listen net/socket.c:1902 [inline]
     __se_sys_listen net/socket.c:1900 [inline]
     __x64_sys_listen+0x5a/0x70 net/socket.c:1900
     do_syscall_x64 arch/x86/entry/common.c:52 [inline]
     do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    RIP: 0033:0x7f24e46039b9
    Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 91 1a 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
    RSP: 002b:00007f24e45b9228 EFLAGS: 00000246 ORIG_RAX: 0000000000000032
    RAX: ffffffffffffffda RBX: 00007f24e468e428 RCX: 00007f24e46039b9
    RDX: 00007f24e46039b9 RSI: 0000000000000003 RDI: 0000000000000004
    RBP: 00007f24e468e420 R08: 00007f24e45b96c0 R09: 00007f24e45b96c0
    R10: 00007f24e45b96c0 R11: 0000000000000246 R12: 00007f24e468e42c
    R13: 00007f24e465a5dc R14: 0020000000000001 R15: 00007ffcced5f7d8
     </TASK>
    Modules linked in:
    
    Fixes: 6ba845740267 ("sctp: process sk_reuseport in sctp_get_port_local")
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=e6979a5d2f10ecb700e4
    Tested-by: [email protected]
    Signed-off-by: Kuniyuki Iwashima <[email protected]>
    Acked-by: Xin Long <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

sctp: move hlist_node and hashent out of sctp_ep_common [+ + +]
Author: Xin Long <[email protected]>
Date:   Tue Dec 21 16:40:30 2021 -0500

    sctp: move hlist_node and hashent out of sctp_ep_common
    
    [ Upstream commit 3d3b2f57d4447e6e9f4096ad01d0e4129f7bc7e9 ]
    
    Struct sctp_ep_common is included in both asoc and ep, but hlist_node
    and hashent are only needed by ep after asoc_hashtable was dropped by
    Commit b5eff7128366 ("sctp: drop the old assoc hashtable of sctp").
    
    So it is better to move hlist_node and hashent from sctp_ep_common to
    sctp_endpoint, and it saves some space for each asoc.
    
    Signed-off-by: Xin Long <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Stable-dep-of: 9ab0faa7f9ff ("sctp: Fix null-ptr-deref in reuseport_add_sock().")
    Signed-off-by: Sasha Levin <[email protected]>

 
selftests/bpf: Check length of recv in test_sockmap [+ + +]
Author: Geliang Tang <[email protected]>
Date:   Thu May 23 14:50:03 2024 +0800

    selftests/bpf: Check length of recv in test_sockmap
    
    [ Upstream commit de1b5ea789dc28066cc8dc634b6825bd6148f38b ]
    
    The value of recv in msg_loop may be negative, like EWOULDBLOCK, so it's
    necessary to check if it is positive before accumulating it to bytes_recvd.
    
    Fixes: 16962b2404ac ("bpf: sockmap, add selftests")
    Signed-off-by: Geliang Tang <[email protected]>
    Signed-off-by: Daniel Borkmann <[email protected]>
    Tested-by: Jakub Sitnicki <[email protected]>
    Acked-by: John Fastabend <[email protected]>
    Link: https://lore.kernel.org/bpf/5172563f7c7b2a2e953cef02e89fc34664a7b190.1716446893.git.tanggeliang@kylinos.cn
    Signed-off-by: Sasha Levin <[email protected]>

selftests/bpf: Fix send_signal test with nested CONFIG_PARAVIRT [+ + +]
Author: Yonghong Song <[email protected]>
Date:   Wed Jun 5 13:12:03 2024 -0700

    selftests/bpf: Fix send_signal test with nested CONFIG_PARAVIRT
    
    [ Upstream commit 7015843afcaf68c132784c89528dfddc0005e483 ]
    
    Alexei reported that send_signal test may fail with nested CONFIG_PARAVIRT
    configs. In this particular case, the base VM is AMD with 166 cpus, and I
    run selftests with regular qemu on top of that and indeed send_signal test
    failed. I also tried with an Intel box with 80 cpus and there is no issue.
    
    The main qemu command line includes:
    
      -enable-kvm -smp 16 -cpu host
    
    The failure log looks like:
    
      $ ./test_progs -t send_signal
      [   48.501588] watchdog: BUG: soft lockup - CPU#9 stuck for 26s! [test_progs:2225]
      [   48.503622] Modules linked in: bpf_testmod(O)
      [   48.503622] CPU: 9 PID: 2225 Comm: test_progs Tainted: G           O       6.9.0-08561-g2c1713a8f1c9-dirty #69
      [   48.507629] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
      [   48.511635] RIP: 0010:handle_softirqs+0x71/0x290
      [   48.511635] Code: [...] 10 0a 00 00 00 31 c0 65 66 89 05 d5 f4 fa 7e fb bb ff ff ff ff <49> c7 c2 cb
      [   48.518527] RSP: 0018:ffffc90000310fa0 EFLAGS: 00000246
      [   48.519579] RAX: 0000000000000000 RBX: 00000000ffffffff RCX: 00000000000006e0
      [   48.522526] RDX: 0000000000000006 RSI: ffff88810791ae80 RDI: 0000000000000000
      [   48.523587] RBP: ffffc90000fabc88 R08: 00000005a0af4f7f R09: 0000000000000000
      [   48.525525] R10: 0000000561d2f29c R11: 0000000000006534 R12: 0000000000000280
      [   48.528525] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
      [   48.528525] FS:  00007f2f2885cd00(0000) GS:ffff888237c40000(0000) knlGS:0000000000000000
      [   48.531600] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   48.535520] CR2: 00007f2f287059f0 CR3: 0000000106a28002 CR4: 00000000003706f0
      [   48.537538] Call Trace:
      [   48.537538]  <IRQ>
      [   48.537538]  ? watchdog_timer_fn+0x1cd/0x250
      [   48.539590]  ? lockup_detector_update_enable+0x50/0x50
      [   48.539590]  ? __hrtimer_run_queues+0xff/0x280
      [   48.542520]  ? hrtimer_interrupt+0x103/0x230
      [   48.544524]  ? __sysvec_apic_timer_interrupt+0x4f/0x140
      [   48.545522]  ? sysvec_apic_timer_interrupt+0x3a/0x90
      [   48.547612]  ? asm_sysvec_apic_timer_interrupt+0x1a/0x20
      [   48.547612]  ? handle_softirqs+0x71/0x290
      [   48.547612]  irq_exit_rcu+0x63/0x80
      [   48.551585]  sysvec_apic_timer_interrupt+0x75/0x90
      [   48.552521]  </IRQ>
      [   48.553529]  <TASK>
      [   48.553529]  asm_sysvec_apic_timer_interrupt+0x1a/0x20
      [   48.555609] RIP: 0010:finish_task_switch.isra.0+0x90/0x260
      [   48.556526] Code: [...] 9f 58 0a 00 00 48 85 db 0f 85 89 01 00 00 4c 89 ff e8 53 d9 bd 00 fb 66 90 <4d> 85 ed 74
      [   48.562524] RSP: 0018:ffffc90000fabd38 EFLAGS: 00000282
      [   48.563589] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff83385620
      [   48.563589] RDX: ffff888237c73ae4 RSI: 0000000000000000 RDI: ffff888237c6fd00
      [   48.568521] RBP: ffffc90000fabd68 R08: 0000000000000000 R09: 0000000000000000
      [   48.569528] R10: 0000000000000001 R11: 0000000000000000 R12: ffff8881009d0000
      [   48.573525] R13: ffff8881024e5400 R14: ffff88810791ae80 R15: ffff888237c6fd00
      [   48.575614]  ? finish_task_switch.isra.0+0x8d/0x260
      [   48.576523]  __schedule+0x364/0xac0
      [   48.577535]  schedule+0x2e/0x110
      [   48.578555]  pipe_read+0x301/0x400
      [   48.579589]  ? destroy_sched_domains_rcu+0x30/0x30
      [   48.579589]  vfs_read+0x2b3/0x2f0
      [   48.579589]  ksys_read+0x8b/0xc0
      [   48.583590]  do_syscall_64+0x3d/0xc0
      [   48.583590]  entry_SYSCALL_64_after_hwframe+0x4b/0x53
      [   48.586525] RIP: 0033:0x7f2f28703fa1
      [   48.587592] Code: [...] 00 00 00 0f 1f 44 00 00 f3 0f 1e fa 80 3d c5 23 14 00 00 74 13 31 c0 0f 05 <48> 3d 00 f0
      [   48.593534] RSP: 002b:00007ffd90f8cf88 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
      [   48.595589] RAX: ffffffffffffffda RBX: 00007ffd90f8d5e8 RCX: 00007f2f28703fa1
      [   48.595589] RDX: 0000000000000001 RSI: 00007ffd90f8cfb0 RDI: 0000000000000006
      [   48.599592] RBP: 00007ffd90f8d2f0 R08: 0000000000000064 R09: 0000000000000000
      [   48.602527] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
      [   48.603589] R13: 00007ffd90f8d608 R14: 00007f2f288d8000 R15: 0000000000f6bdb0
      [   48.605527]  </TASK>
    
    In the test, two processes are communicating through pipe. Further debugging
    with strace found that the above splat is triggered as read() syscall could
    not receive the data even if the corresponding write() syscall in another
    process successfully wrote data into the pipe.
    
    The failed subtest is "send_signal_perf". The corresponding perf event has
    sample_period 1 and config PERF_COUNT_SW_CPU_CLOCK. sample_period 1 means every
    overflow event will trigger a call to the BPF program. So I suspect this may
    overwhelm the system. So I increased the sample_period to 100,000 and the test
    passed. The sample_period 10,000 still has the test failed.
    
    In other parts of selftest, e.g., [1], sample_freq is used instead. So I
    decided to use sample_freq = 1,000 since the test can pass as well.
    
      [1] https://lore.kernel.org/bpf/[email protected]/
    
    Reported-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Yonghong Song <[email protected]>
    Signed-off-by: Daniel Borkmann <[email protected]>
    Link: https://lore.kernel.org/bpf/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
selftests/sigaltstack: Fix ppc64 GCC build [+ + +]
Author: Michael Ellerman <[email protected]>
Date:   Mon May 20 16:26:47 2024 +1000

    selftests/sigaltstack: Fix ppc64 GCC build
    
    commit 17c743b9da9e0d073ff19fd5313f521744514939 upstream.
    
    Building the sigaltstack test with GCC on 64-bit powerpc errors with:
    
      gcc -Wall     sas.c  -o /home/michael/linux/.build/kselftest/sigaltstack/sas
      In file included from sas.c:23:
      current_stack_pointer.h:22:2: error: #error "implement current_stack_pointer equivalent"
         22 | #error "implement current_stack_pointer equivalent"
            |  ^~~~~
      sas.c: In function ‘my_usr1’:
      sas.c:50:13: error: ‘sp’ undeclared (first use in this function); did you mean ‘p’?
         50 |         if (sp < (unsigned long)sstack ||
            |             ^~
    
    This happens because GCC doesn't define __ppc__ for 64-bit builds, only
    32-bit builds. Instead use __powerpc__ to detect powerpc builds, which
    is defined by clang and GCC for 64-bit and 32-bit builds.
    
    Fixes: 05107edc9101 ("selftests: sigaltstack: fix -Wuninitialized")
    Cc: [email protected] # v6.3+
    Signed-off-by: Michael Ellerman <[email protected]>
    Link: https://msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
selftests: forwarding: devlink_lib: Wait for udev events after reloading [+ + +]
Author: Amit Cohen <[email protected]>
Date:   Thu Jul 11 17:27:02 2024 +0200

    selftests: forwarding: devlink_lib: Wait for udev events after reloading
    
    [ Upstream commit f67a90a0c8f5b3d0acc18f10650d90fec44775f9 ]
    
    Lately, an additional locking was added by commit c0a40097f0bc
    ("drivers: core: synchronize really_probe() and dev_uevent()"). The
    locking protects dev_uevent() calling. This function is used to send
    messages from the kernel to user space. Uevent messages notify user space
    about changes in device states, such as when a device is added, removed,
    or changed. These messages are used by udev (or other similar user-space
    tools) to apply device-specific rules.
    
    After reloading devlink instance, udev events should be processed. This
    locking causes a short delay of udev events handling.
    
    One example for useful udev rule is renaming ports. 'forwading.config'
    can be configured to use names after udev rules are applied. Some tests run
    devlink_reload() and immediately use the updated names. This worked before
    the above mentioned commit was pushed, but now the delay of uevent messages
    causes that devlink_reload() returns before udev events are handled and
    tests fail.
    
    Adjust devlink_reload() to not assume that udev events are already
    processed when devlink reload is done, instead, wait for udev events to
    ensure they are processed before returning from the function.
    
    Without this patch:
    TESTS='rif_mac_profile' ./resource_scale.sh
    TEST: 'rif_mac_profile' 4                                           [ OK ]
    sysctl: cannot stat /proc/sys/net/ipv6/conf/swp1/disable_ipv6: No such file or directory
    sysctl: cannot stat /proc/sys/net/ipv6/conf/swp1/disable_ipv6: No such file or directory
    sysctl: cannot stat /proc/sys/net/ipv6/conf/swp2/disable_ipv6: No such file or directory
    sysctl: cannot stat /proc/sys/net/ipv6/conf/swp2/disable_ipv6: No such file or directory
    Cannot find device "swp1"
    Cannot find device "swp2"
    TEST: setup_wait_dev (: Interface swp1 does not come up.) [FAIL]
    
    With this patch:
    $ TESTS='rif_mac_profile' ./resource_scale.sh
    TEST: 'rif_mac_profile' 4                                           [ OK ]
    TEST: 'rif_mac_profile' overflow 5                                  [ OK ]
    
    This is relevant not only for this test.
    
    Fixes: bc7cbb1e9f4c ("selftests: forwarding: Add devlink_lib.sh")
    Signed-off-by: Amit Cohen <[email protected]>
    Reviewed-by: Ido Schimmel <[email protected]>
    Signed-off-by: Petr Machata <[email protected]>
    Link: https://patch.msgid.link/89367666e04b38a8993027f1526801ca327ab96a.1720709333.git.petrm@nvidia.com
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
serial: core: check uartclk for zero to avoid divide by zero [+ + +]
Author: George Kennedy <[email protected]>
Date:   Wed Jul 17 07:24:38 2024 -0500

    serial: core: check uartclk for zero to avoid divide by zero
    
    commit 6eabce6608d6f3440f4c03aa3d3ef50a47a3d193 upstream.
    
    Calling ioctl TIOCSSERIAL with an invalid baud_base can
    result in uartclk being zero, which will result in a
    divide by zero error in uart_get_divisor(). The check for
    uartclk being zero in uart_set_info() needs to be done
    before other settings are made as subsequent calls to
    ioctl TIOCSSERIAL for the same port would be impacted if
    the uartclk check was done where uartclk gets set.
    
    Oops: divide error: 0000  PREEMPT SMP KASAN PTI
    RIP: 0010:uart_get_divisor (drivers/tty/serial/serial_core.c:580)
    Call Trace:
     <TASK>
    serial8250_get_divisor (drivers/tty/serial/8250/8250_port.c:2576
        drivers/tty/serial/8250/8250_port.c:2589)
    serial8250_do_set_termios (drivers/tty/serial/8250/8250_port.c:502
        drivers/tty/serial/8250/8250_port.c:2741)
    serial8250_set_termios (drivers/tty/serial/8250/8250_port.c:2862)
    uart_change_line_settings (./include/linux/spinlock.h:376
        ./include/linux/serial_core.h:608 drivers/tty/serial/serial_core.c:222)
    uart_port_startup (drivers/tty/serial/serial_core.c:342)
    uart_startup (drivers/tty/serial/serial_core.c:368)
    uart_set_info (drivers/tty/serial/serial_core.c:1034)
    uart_set_info_user (drivers/tty/serial/serial_core.c:1059)
    tty_set_serial (drivers/tty/tty_io.c:2637)
    tty_ioctl (drivers/tty/tty_io.c:2647 drivers/tty/tty_io.c:2791)
    __x64_sys_ioctl (fs/ioctl.c:52 fs/ioctl.c:907
        fs/ioctl.c:893 fs/ioctl.c:893)
    do_syscall_64 (arch/x86/entry/common.c:52
        (discriminator 1) arch/x86/entry/common.c:83 (discriminator 1))
    entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)
    
    Reported-by: syzkaller <[email protected]>
    Cc: [email protected]
    Signed-off-by: George Kennedy <[email protected]>
    Rule: add
    Link: https://lore.kernel.org/stable/1721148848-9784-1-git-send-email-george.kennedy%40oracle.com
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
sparc64: Fix incorrect function signature and add prototype for prom_cif_init [+ + +]
Author: Andreas Larsson <[email protected]>
Date:   Wed Jul 10 11:41:53 2024 +0200

    sparc64: Fix incorrect function signature and add prototype for prom_cif_init
    
    [ Upstream commit a6c3ea1ec96307dbfbb2f16d96c674c5cc80f445 ]
    
    Remove the unused cif_stack argument and add a protype in oplib_64.h
    Commit ef3e035c3a9b ("sparc64: Fix register corruption in top-most
    kernel stack frame during boot.") removed the cif_stack argument to
    prom_cif init in the declaration at the caller site and the usage of it
    within prom_cif_init, but not in the function signature of the function
    itself.
    
    This also fixes the following warning:
    arch/sparc/prom/p1275.c:52:6: warning: no previous prototype for ‘prom_cif_init’
    
    Fixes: ef3e035c3a9b ("sparc64: Fix register corruption in top-most kernel stack frame during boot.")
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Andreas Larsson <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
spi: fsl-lpspi: remove unneeded array [+ + +]
Author: Oleksandr Suvorov <[email protected]>
Date:   Thu Feb 20 14:11:48 2020 +0000

    spi: fsl-lpspi: remove unneeded array
    
    [ Upstream commit 2fa98705a9289c758b6154a22174aa8d4041a285 ]
    
    - replace the array with the shift operation
    - remove the extra comparing operation.
    
    Signed-off-by: Oleksandr Suvorov <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Stable-dep-of: 730bbfaf7d48 ("spi: spi-fsl-lpspi: Fix scldiv calculation")
    Signed-off-by: Sasha Levin <[email protected]>

spi: spi-fsl-lpspi: Fix scldiv calculation [+ + +]
Author: Stefan Wahren <[email protected]>
Date:   Sun Aug 4 13:36:11 2024 +0200

    spi: spi-fsl-lpspi: Fix scldiv calculation
    
    [ Upstream commit 730bbfaf7d4890bd99e637db7767dc68cfeb24e7 ]
    
    The effective SPI clock frequency should never exceed speed_hz
    otherwise this might result in undefined behavior of the SPI device.
    
    Currently the scldiv calculation could violate this constraint.
    For the example parameters perclk_rate = 24 MHz and speed_hz = 7 MHz,
    the function fsl_lpspi_set_bitrate will determine perscale = 0 and
    scldiv = 1, which is a effective SPI clock of 8 MHz.
    
    So fix this by rounding up the quotient of perclk_rate and speed_hz.
    While this never change within the loop, we can pull this out.
    
    Fixes: 5314987de5e5 ("spi: imx: add lpspi bus driver")
    Signed-off-by: Stefan Wahren <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
SUNRPC: avoid soft lockup when transmitting UDP to reachable server. [+ + +]
Author: NeilBrown <[email protected]>
Date:   Wed Jun 19 11:05:13 2024 +1000

    SUNRPC: avoid soft lockup when transmitting UDP to reachable server.
    
    [ Upstream commit 6258cf25d5e3155c3219ab5a79b970eef7996356 ]
    
    Prior to the commit identified below, call_transmit_status() would
    handle -EPERM and other errors related to an unreachable server by
    falling through to call_status() which added a 3-second delay and
    handled the failure as a timeout.
    
    Since that commit, call_transmit_status() falls through to
    handle_bind().  For UDP this moves straight on to handle_connect() and
    handle_transmit() so we immediately retransmit - and likely get the same
    error.
    
    This results in an indefinite loop in __rpc_execute() which triggers a
    soft-lockup warning.
    
    For the errors that indicate an unreachable server,
    call_transmit_status() should fall back to call_status() as it did
    before.  This cannot cause the thundering herd that the previous patch
    was avoiding, as the call_status() will insert a delay.
    
    Fixes: ed7dc973bd91 ("SUNRPC: Prevent thundering herd when the socket is not connected")
    Signed-off-by: NeilBrown <[email protected]>
    Signed-off-by: Anna Schumaker <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

SUNRPC: Fix a race to wake a sync task [+ + +]
Author: Benjamin Coddington <[email protected]>
Date:   Wed Jul 17 10:49:33 2024 -0400

    SUNRPC: Fix a race to wake a sync task
    
    [ Upstream commit ed0172af5d6fc07d1b40ca82f5ca3979300369f7 ]
    
    We've observed NFS clients with sync tasks sleeping in __rpc_execute
    waiting on RPC_TASK_QUEUED that have not responded to a wake-up from
    rpc_make_runnable().  I suspect this problem usually goes unnoticed,
    because on a busy client the task will eventually be re-awoken by another
    task completion or xprt event.  However, if the state manager is draining
    the slot table, a sync task missing a wake-up can result in a hung client.
    
    We've been able to prove that the waker in rpc_make_runnable() successfully
    calls wake_up_bit() (ie- there's no race to tk_runstate), but the
    wake_up_bit() call fails to wake the waiter.  I suspect the waker is
    missing the load of the bit's wait_queue_head, so waitqueue_active() is
    false.  There are some very helpful comments about this problem above
    wake_up_bit(), prepare_to_wait(), and waitqueue_active().
    
    Fix this by inserting smp_mb__after_atomic() before the wake_up_bit(),
    which pairs with prepare_to_wait() calling set_current_state().
    
    Signed-off-by: Benjamin Coddington <[email protected]>
    Reviewed-by: Jeff Layton <[email protected]>
    Signed-off-by: Anna Schumaker <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

SUNRPC: Fixup gss_status tracepoint error output [+ + +]
Author: Benjamin Coddington <[email protected]>
Date:   Thu Jul 11 13:21:00 2024 -0400

    SUNRPC: Fixup gss_status tracepoint error output
    
    [ Upstream commit b9fae9f06d84ffab0f3f9118f3a96bbcdc528bf6 ]
    
    The GSS routine errors are values, not flags.
    
    Fixes: 0c77668ddb4e ("SUNRPC: Introduce trace points in rpc_auth_gss.ko")
    Signed-off-by: Benjamin Coddington <[email protected]>
    Reviewed-by: Chuck Lever <[email protected]>
    Signed-off-by: Anna Schumaker <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
tick/broadcast: Make takeover of broadcast hrtimer reliable [+ + +]
Author: Yu Liao <[email protected]>
Date:   Thu Jul 11 20:48:43 2024 +0800

    tick/broadcast: Make takeover of broadcast hrtimer reliable
    
    commit f7d43dd206e7e18c182f200e67a8db8c209907fa upstream.
    
    Running the LTP hotplug stress test on a aarch64 machine results in
    rcu_sched stall warnings when the broadcast hrtimer was owned by the
    un-plugged CPU. The issue is the following:
    
    CPU1 (owns the broadcast hrtimer)       CPU2
    
                                    tick_broadcast_enter()
                                      // shutdown local timer device
                                      broadcast_shutdown_local()
                                    ...
                                    tick_broadcast_exit()
                                      clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT)
                                      // timer device is not programmed
                                      cpumask_set_cpu(cpu, tick_broadcast_force_mask)
    
                                    initiates offlining of CPU1
    take_cpu_down()
    /*
     * CPU1 shuts down and does not
     * send broadcast IPI anymore
     */
                                    takedown_cpu()
                                      hotplug_cpu__broadcast_tick_pull()
                                        // move broadcast hrtimer to this CPU
                                        clockevents_program_event()
                                          bc_set_next()
                                            hrtimer_start()
                                            /*
                                             * timer device is not programmed
                                             * because only the first expiring
                                             * timer will trigger clockevent
                                             * device reprogramming
                                             */
    
    What happens is that CPU2 exits broadcast mode with force bit set, then the
    local timer device is not reprogrammed and CPU2 expects to receive the
    expired event by the broadcast IPI. But this does not happen because CPU1
    is offlined by CPU2. CPU switches the clockevent device to ONESHOT state,
    but does not reprogram the device.
    
    The subsequent reprogramming of the hrtimer broadcast device does not
    program the clockevent device of CPU2 either because the pending expiry
    time is already in the past and the CPU expects the event to be delivered.
    As a consequence all CPUs which wait for a broadcast event to be delivered
    are stuck forever.
    
    Fix this issue by reprogramming the local timer device if the broadcast
    force bit of the CPU is set so that the broadcast hrtimer is delivered.
    
    [ tglx: Massage comment and change log. Add Fixes tag ]
    
    Fixes: 989dcb645ca7 ("tick: Handle broadcast wakeup of multiple cpus")
    Signed-off-by: Yu Liao <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

tick/broadcast: Move per CPU pointer access into the atomic section [+ + +]
Author: Thomas Gleixner <[email protected]>
Date:   Wed Jul 31 12:23:51 2024 +0200

    tick/broadcast: Move per CPU pointer access into the atomic section
    
    commit 6881e75237a84093d0986f56223db3724619f26e upstream.
    
    The recent fix for making the take over of the broadcast timer more
    reliable retrieves a per CPU pointer in preemptible context.
    
    This went unnoticed as compilers hoist the access into the non-preemptible
    region where the pointer is actually used. But of course it's valid that
    the compiler keeps it at the place where the code puts it which rightfully
    triggers:
    
      BUG: using smp_processor_id() in preemptible [00000000] code:
           caller is hotplug_cpu__broadcast_tick_pull+0x1c/0xc0
    
    Move it to the actual usage site which is in a non-preemptible region.
    
    Fixes: f7d43dd206e7 ("tick/broadcast: Make takeover of broadcast hrtimer reliable")
    Reported-by: David Wang <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Tested-by: Yu Liao <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/all/87ttg56ers.ffs@tglx
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tipc: Return non-zero value from tipc_udp_addr2str() on error [+ + +]
Author: Shigeru Yoshida <[email protected]>
Date:   Tue Jul 16 11:09:05 2024 +0900

    tipc: Return non-zero value from tipc_udp_addr2str() on error
    
    [ Upstream commit fa96c6baef1b5385e2f0c0677b32b3839e716076 ]
    
    tipc_udp_addr2str() should return non-zero value if the UDP media
    address is invalid. Otherwise, a buffer overflow access can occur in
    tipc_media_addr_printf(). Fix this by returning 1 on an invalid UDP
    media address.
    
    Fixes: d0f91938bede ("tipc: add ip/udp media type")
    Signed-off-by: Shigeru Yoshida <[email protected]>
    Reviewed-by: Tung Nguyen <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
tools/memory-model: Fix bug in lock.cat [+ + +]
Author: Alan Stern <[email protected]>
Date:   Thu Jun 6 09:57:55 2024 -0400

    tools/memory-model: Fix bug in lock.cat
    
    commit 4c830eef806679dc243e191f962c488dd9d00708 upstream.
    
    Andrea reported that the following innocuous litmus test:
    
    C T
    
    {}
    
    P0(spinlock_t *x)
    {
            int r0;
    
            spin_lock(x);
            spin_unlock(x);
            r0 = spin_is_locked(x);
    }
    
    gives rise to a nonsensical empty result with no executions:
    
    $ herd7 -conf linux-kernel.cfg T.litmus
    Test T Required
    States 0
    Ok
    Witnesses
    Positive: 0 Negative: 0
    Condition forall (true)
    Observation T Never 0 0
    Time T 0.00
    Hash=6fa204e139ddddf2cb6fa963bad117c0
    
    The problem is caused by a bug in the lock.cat part of the LKMM.  Its
    computation of the rf relation for RU (read-unlocked) events is
    faulty; it implicitly assumes that every RU event must read from
    either a UL (unlock) event in another thread or from the lock's
    initial state.  Neither is true in the litmus test above, so the
    computation yields no possible executions.
    
    The lock.cat code tries to make up for this deficiency by allowing RU
    events outside of critical sections to read from the last po-previous
    UL event.  But it does this incorrectly, trying to keep these rfi links
    separate from the rfe links that might also be needed, and passing only
    the latter to herd7's cross() macro.
    
    The problem is fixed by merging the two sets of possible rf links for
    RU events and using them all in the call to cross().
    
    Signed-off-by: Alan Stern <[email protected]>
    Reported-by: Andrea Parri <[email protected]>
    Closes: https://lore.kernel.org/linux-arch/ZlC0IkzpQdeGj+a3@andrea/
    Tested-by: Andrea Parri <[email protected]>
    Acked-by: Andrea Parri <[email protected]>
    Fixes: 15553dcbca06 ("tools/memory-model: Add model support for spin_is_locked()")
    CC: <[email protected]>
    Signed-off-by: Paul E. McKenney <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tracing: Fix overflow in get_free_elt() [+ + +]
Author: Tze-nan Wu <[email protected]>
Date:   Mon Aug 5 13:59:22 2024 +0800

    tracing: Fix overflow in get_free_elt()
    
    commit bcf86c01ca4676316557dd482c8416ece8c2e143 upstream.
    
    "tracing_map->next_elt" in get_free_elt() is at risk of overflowing.
    
    Once it overflows, new elements can still be inserted into the tracing_map
    even though the maximum number of elements (`max_elts`) has been reached.
    Continuing to insert elements after the overflow could result in the
    tracing_map containing "tracing_map->max_size" elements, leaving no empty
    entries.
    If any attempt is made to insert an element into a full tracing_map using
    `__tracing_map_insert()`, it will cause an infinite loop with preemption
    disabled, leading to a CPU hang problem.
    
    Fix this by preventing any further increments to "tracing_map->next_elt"
    once it reaches "tracing_map->max_elt".
    
    Cc: [email protected]
    Cc: Masami Hiramatsu <[email protected]>
    Fixes: 08d43a5fa063e ("tracing: Add lock-free tracing_map")
    Co-developed-by: Cheng-Jui Wang <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Cheng-Jui Wang <[email protected]>
    Signed-off-by: Tze-nan Wu <[email protected]>
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ubi: eba: properly rollback inside self_check_eba [+ + +]
Author: Fedor Pchelkin <[email protected]>
Date:   Thu Feb 29 23:42:36 2024 +0300

    ubi: eba: properly rollback inside self_check_eba
    
    commit 745d9f4a31defec731119ee8aad8ba9f2536dd9a upstream.
    
    In case of a memory allocation failure in the volumes loop we can only
    process the already allocated scan_eba and fm_eba array elements on the
    error path - others are still uninitialized.
    
    Found by Linux Verification Center (linuxtesting.org).
    
    Fixes: 00abf3041590 ("UBI: Add self_check_eba()")
    Cc: [email protected]
    Signed-off-by: Fedor Pchelkin <[email protected]>
    Reviewed-by: Zhihao Cheng <[email protected]>
    Signed-off-by: Richard Weinberger <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
udf: Avoid using corrupted block bitmap buffer [+ + +]
Author: Jan Kara <[email protected]>
Date:   Mon Jun 17 17:41:52 2024 +0200

    udf: Avoid using corrupted block bitmap buffer
    
    commit a90d4471146de21745980cba51ce88e7926bcc4f upstream.
    
    When the filesystem block bitmap is corrupted, we detect the corruption
    while loading the bitmap and fail the allocation with error. However the
    next allocation from the same bitmap will notice the bitmap buffer is
    already loaded and tries to allocate from the bitmap with mixed results
    (depending on the exact nature of the bitmap corruption). Fix the
    problem by using BH_verified bit to indicate whether the bitmap is valid
    or not.
    
    Reported-by: [email protected]
    CC: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Fixes: 1e0d4adf17e7 ("udf: Check consistency of Space Bitmap Descriptor")
    Signed-off-by: Jan Kara <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

udf: prevent integer overflow in udf_bitmap_free_blocks() [+ + +]
Author: Roman Smirnov <[email protected]>
Date:   Thu Jun 20 10:24:13 2024 +0300

    udf: prevent integer overflow in udf_bitmap_free_blocks()
    
    [ Upstream commit 56e69e59751d20993f243fb7dd6991c4e522424c ]
    
    An overflow may occur if the function is called with the last
    block and an offset greater than zero. It is necessary to add
    a check to avoid this.
    
    Found by Linux Verification Center (linuxtesting.org) with Svace.
    
    [JK: Make test cover also unalloc table freeing]
    
    Link: https://patch.msgid.link/[email protected]
    Suggested-by: Jan Kara <[email protected]>
    Signed-off-by: Roman Smirnov <[email protected]>
    Signed-off-by: Jan Kara <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
um: time-travel: fix time-travel-start option [+ + +]
Author: Johannes Berg <[email protected]>
Date:   Wed Apr 17 10:27:45 2024 +0200

    um: time-travel: fix time-travel-start option
    
    [ Upstream commit 7d0a8a490aa3a2a82de8826aaf1dfa38575cb77a ]
    
    We need to have the = as part of the option so that the
    value can be parsed properly. Also document that it must
    be given in nanoseconds, not seconds.
    
    Fixes: 065038706f77 ("um: Support time travel mode")
    Link: https://patch.msgid.link/20240417102744.14b9a9d4eba0.Ib22e9136513126b2099d932650f55f193120cd97@changeid
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
usb: gadget: core: Check for unset descriptor [+ + +]
Author: Chris Wulff <[email protected]>
Date:   Wed Jul 24 21:04:20 2024 -0400

    usb: gadget: core: Check for unset descriptor
    
    commit 973a57891608a98e894db2887f278777f564de18 upstream.
    
    Make sure the descriptor has been set before looking at maxpacket.
    This fixes a null pointer panic in this case.
    
    This may happen if the gadget doesn't properly set up the endpoint
    for the current speed, or the gadget descriptors are malformed and
    the descriptor for the speed/endpoint are not found.
    
    No current gadget driver is known to have this problem, but this
    may cause a hard-to-find bug during development of new gadgets.
    
    Fixes: 54f83b8c8ea9 ("USB: gadget: Reject endpoints with 0 maxpacket value")
    Cc: [email protected]
    Signed-off-by: Chris Wulff <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
USB: move snd_usb_pipe_sanity_check into the USB core [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Mon Sep 14 17:37:46 2020 +0200

    USB: move snd_usb_pipe_sanity_check into the USB core
    
    [ Upstream commit fcc2cc1f35613c016e1de25bb001bfdd9eaa25f9 ]
    
    snd_usb_pipe_sanity_check() is a great function, so let's move it into
    the USB core so that other parts of the kernel, including the USB core,
    can call it.
    
    Name it usb_pipe_type_check() to match the existing
    usb_urb_ep_type_check() call, which now uses this function.
    
    Cc: Jaroslav Kysela <[email protected]>
    Cc: "Gustavo A. R. Silva" <[email protected]>
    Cc: Eli Billauer <[email protected]>
    Cc: Emiliano Ingrassia <[email protected]>
    Cc: Alan Stern <[email protected]>
    Cc: Alexander Tsoy <[email protected]>
    Cc: "Geoffrey D. Bennett" <[email protected]>
    Cc: Jussi Laako <[email protected]>
    Cc: Nick Kossifidis <[email protected]>
    Cc: Dmitry Panchenko <[email protected]>
    Cc: Chris Wulff <[email protected]>
    Cc: Jesus Ramos <[email protected]>
    Reviewed-by: Takashi Iwai <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Stable-dep-of: 2052138b7da5 ("media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()")
    Signed-off-by: Sasha Levin <[email protected]>

USB: serial: debug: do not echo input by default [+ + +]
Author: Marek Marczykowski-Górecki <[email protected]>
Date:   Mon Jul 15 12:44:53 2024 +0200

    USB: serial: debug: do not echo input by default
    
    commit 00af4f3dda1461ec90d892edc10bec6d3c50c554 upstream.
    
    This driver is intended as a "client" end of the console connection.
    When connected to a host it's supposed to receive debug logs, and
    possibly allow to interact with whatever debug console is available
    there. Feeding messages back, depending on a configuration may cause log
    messages be executed as shell commands (which can be really bad if one
    is unlucky, imagine a log message like "prevented running `rm -rf
    /home`"). In case of Xen, it exposes sysrq-like debug interface, and
    feeding it its own logs will pretty quickly hit 'R' for "instant
    reboot".
    
    Contrary to a classic serial console, the USB one cannot be configured
    ahead of time, as the device shows up only when target OS is up. And at
    the time device is opened to execute relevant ioctl, it's already too
    late, especially when logs start flowing shortly after device is
    initialized.
    Avoid the issue by changing default to no echo for this type of devices.
    
    Signed-off-by: Marek Marczykowski-Górecki <[email protected]>
    [ johan: amend summary; disable also ECHONL ]
    Cc: [email protected]
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
usb: vhci-hcd: Do not drop references before new references are gained [+ + +]
Author: Oliver Neukum <[email protected]>
Date:   Tue Jul 9 13:38:41 2024 +0200

    usb: vhci-hcd: Do not drop references before new references are gained
    
    commit afdcfd3d6fcdeca2735ca8d994c5f2d24a368f0a upstream.
    
    At a few places the driver carries stale pointers
    to references that can still be used. Make sure that does not happen.
    This strictly speaking closes ZDI-CAN-22273, though there may be
    similar races in the driver.
    
    Signed-off-by: Oliver Neukum <[email protected]>
    Cc: stable <[email protected]>
    Acked-by: Shuah Khan <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
watchdog/perf: properly initialize the turbo mode timestamp and rearm counter [+ + +]
Author: Thomas Gleixner <[email protected]>
Date:   Thu Jul 11 22:25:21 2024 +0200

    watchdog/perf: properly initialize the turbo mode timestamp and rearm counter
    
    commit f944ffcbc2e1c759764850261670586ddf3bdabb upstream.
    
    For systems on which the performance counter can expire early due to turbo
    modes the watchdog handler has a safety net in place which validates that
    since the last watchdog event there has at least 4/5th of the watchdog
    period elapsed.
    
    This works reliably only after the first watchdog event because the per
    CPU variable which holds the timestamp of the last event is never
    initialized.
    
    So a first spurious event will validate against a timestamp of 0 which
    results in a delta which is likely to be way over the 4/5 threshold of the
    period.  As this might happen before the first watchdog hrtimer event
    increments the watchdog counter, this can lead to false positives.
    
    Fix this by initializing the timestamp before enabling the hardware event.
    Reset the rearm counter as well, as that might be non zero after the
    watchdog was disabled and reenabled.
    
    Link: https://lkml.kernel.org/r/87frsfu15a.ffs@tglx
    Fixes: 7edaeb6841df ("kernel/watchdog: Prevent false positives with turbo modes")
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: Arjan van de Ven <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
wifi: brcmsmac: LCN PHY code is used for BCM4313 2G-only device [+ + +]
Author: Samasth Norway Ananda <[email protected]>
Date:   Thu May 9 16:10:37 2024 -0700

    wifi: brcmsmac: LCN PHY code is used for BCM4313 2G-only device
    
    [ Upstream commit c636fa85feb450ca414a10010ed05361a73c93a6 ]
    
    The band_idx variable in the function wlc_lcnphy_tx_iqlo_cal() will
    never be set to 1 as BCM4313 is the only device for which the LCN PHY
    code is used. This is a 2G-only device.
    
    Fixes: 5b435de0d786 ("net: wireless: add brcm80211 drivers")
    Signed-off-by: Samasth Norway Ananda <[email protected]>
    Acked-by: Arend van Spriel <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Link: https://msgid.link/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

wifi: cfg80211: fix typo in cfg80211_calculate_bitrate_he() [+ + +]
Author: Baochen Qiang <[email protected]>
Date:   Thu Jun 6 10:06:52 2024 +0800

    wifi: cfg80211: fix typo in cfg80211_calculate_bitrate_he()
    
    [ Upstream commit 9ee0d44f055276fe2802b2f65058e920853f4f99 ]
    
    rates_996 is mistakenly written as rates_969, fix it.
    
    Fixes: c4cbaf7973a7 ("cfg80211: Add support for HE")
    Signed-off-by: Baochen Qiang <[email protected]>
    Link: https://msgid.link/[email protected]
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

wifi: cfg80211: handle 2x996 RU allocation in cfg80211_calculate_bitrate_he() [+ + +]
Author: Baochen Qiang <[email protected]>
Date:   Thu Jun 6 10:06:53 2024 +0800

    wifi: cfg80211: handle 2x996 RU allocation in cfg80211_calculate_bitrate_he()
    
    [ Upstream commit bcbd771cd5d68c0c52567556097d75f9fc4e7cd6 ]
    
    Currently NL80211_RATE_INFO_HE_RU_ALLOC_2x996 is not handled in
    cfg80211_calculate_bitrate_he(), leading to below warning:
    
    kernel: invalid HE MCS: bw:6, ru:6
    kernel: WARNING: CPU: 0 PID: 2312 at net/wireless/util.c:1501 cfg80211_calculate_bitrate_he+0x22b/0x270 [cfg80211]
    
    Fix it by handling 2x996 RU allocation in the same way as 160 MHz bandwidth.
    
    Fixes: c4cbaf7973a7 ("cfg80211: Add support for HE")
    Signed-off-by: Baochen Qiang <[email protected]>
    Link: https://msgid.link/[email protected]
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

wifi: mwifiex: Fix interface type change [+ + +]
Author: Rafael Beims <[email protected]>
Date:   Fri May 10 13:04:58 2024 +0200

    wifi: mwifiex: Fix interface type change
    
    commit a17b9f590f6ec2b9f1b12b1db3bf1d181de6b272 upstream.
    
    When changing the interface type we also need to update the bss_num, the
    driver private data is searched based on a unique (bss_type, bss_num)
    tuple, therefore every time bss_type changes, bss_num must also change.
    
    This fixes for example an issue in which, after the mode changed, a
    wireless scan on the changed interface would not finish, leading to
    repeated -EBUSY messages to userspace when other scan requests were
    sent.
    
    Fixes: c606008b7062 ("mwifiex: Properly initialize private structure on interface type changes")
    Cc: [email protected]
    Signed-off-by: Rafael Beims <[email protected]>
    Signed-off-by: Francesco Dolcini <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Link: https://msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: nl80211: don't give key data to userspace [+ + +]
Author: Johannes Berg <[email protected]>
Date:   Thu Jun 27 10:44:11 2024 +0200

    wifi: nl80211: don't give key data to userspace
    
    [ Upstream commit a7e5793035792cc46a1a4b0a783655ffa897dfe9 ]
    
    When a key is requested by userspace, there's really no need
    to include the key data, the sequence counter is really what
    userspace needs in this case. The fact that it's included is
    just a historic quirk.
    
    Remove the key data.
    
    Reviewed-by: Miriam Rachel Korenblit <[email protected]>
    Link: https://patch.msgid.link/20240627104411.b6a4f097e4ea.I7e6cc976cb9e8a80ef25a3351330f313373b4578@changeid
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

wifi: virt_wifi: avoid reporting connection success with wrong SSID [+ + +]
Author: En-Wei Wu <[email protected]>
Date:   Fri Jul 5 10:37:56 2024 +0800

    wifi: virt_wifi: avoid reporting connection success with wrong SSID
    
    [ Upstream commit b5d14b0c6716fad7f0c94ac6e1d6f60a49f985c7 ]
    
    When user issues a connection with a different SSID than the one
    virt_wifi has advertised, the __cfg80211_connect_result() will
    trigger the warning: WARN_ON(bss_not_found).
    
    The issue is because the connection code in virt_wifi does not
    check the SSID from user space (it only checks the BSSID), and
    virt_wifi will call cfg80211_connect_result() with WLAN_STATUS_SUCCESS
    even if the SSID is different from the one virt_wifi has advertised.
    Eventually cfg80211 won't be able to find the cfg80211_bss and generate
    the warning.
    
    Fixed it by checking the SSID (from user space) in the connection code.
    
    Fixes: c7cdba31ed8b ("mac80211-next: rtnetlink wifi simulation device")
    Reported-by: [email protected]
    Signed-off-by: En-Wei Wu <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

wifi: virt_wifi: don't use strlen() in const context [+ + +]
Author: Johannes Berg <[email protected]>
Date:   Tue Jul 9 08:34:09 2024 +0200

    wifi: virt_wifi: don't use strlen() in const context
    
    [ Upstream commit 6e909f489191b365364e9d636dec33b5dfd4e5eb ]
    
    Looks like not all compilers allow strlen(constant) as
    a constant, so don't do that. Instead, revert back to
    defining the length as the first submission had it.
    
    Fixes: b5d14b0c6716 ("wifi: virt_wifi: avoid reporting connection success with wrong SSID")
    Reported-by: kernel test robot <[email protected]>
    Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
    Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
x86/mm: Fix pti_clone_pgtable() alignment assumption [+ + +]
Author: Peter Zijlstra <[email protected]>
Date:   Wed Jul 31 18:31:05 2024 +0200

    x86/mm: Fix pti_clone_pgtable() alignment assumption
    
    [ Upstream commit 41e71dbb0e0a0fe214545fe64af031303a08524c ]
    
    Guenter reported dodgy crashes on an i386-nosmp build using GCC-11
    that had the form of endless traps until entry stack exhaust and then
    #DF from the stack guard.
    
    It turned out that pti_clone_pgtable() had alignment assumptions on
    the start address, notably it hard assumes start is PMD aligned. This
    is true on x86_64, but very much not true on i386.
    
    These assumptions can cause the end condition to malfunction, leading
    to a 'short' clone. Guess what happens when the user mapping has a
    short copy of the entry text?
    
    Use the correct increment form for addr to avoid alignment
    assumptions.
    
    Fixes: 16a3fe634f6a ("x86/mm/pti: Clone kernel-image on PTE level for 32 bit")
    Reported-by: Guenter Roeck <[email protected]>
    Tested-by: Guenter Roeck <[email protected]>
    Suggested-by: Thomas Gleixner <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
x86/mtrr: Check if fixed MTRRs exist before saving them [+ + +]
Author: Andi Kleen <[email protected]>
Date:   Wed Aug 7 17:02:44 2024 -0700

    x86/mtrr: Check if fixed MTRRs exist before saving them
    
    commit 919f18f961c03d6694aa726c514184f2311a4614 upstream.
    
    MTRRs have an obsolete fixed variant for fine grained caching control
    of the 640K-1MB region that uses separate MSRs. This fixed variant has
    a separate capability bit in the MTRR capability MSR.
    
    So far all x86 CPUs which support MTRR have this separate bit set, so it
    went unnoticed that mtrr_save_state() does not check the capability bit
    before accessing the fixed MTRR MSRs.
    
    Though on a CPU that does not support the fixed MTRR capability this
    results in a #GP.  The #GP itself is harmless because the RDMSR fault is
    handled gracefully, but results in a WARN_ON().
    
    Add the missing capability check to prevent this.
    
    Fixes: 2b1f6278d77c ("[PATCH] x86: Save the MTRRs of the BSP before booting an AP")
    Signed-off-by: Andi Kleen <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/all/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
x86/of: Return consistent error type from x86_of_pci_irq_enable() [+ + +]
Author: Ilpo Järvinen <[email protected]>
Date:   Mon May 27 15:55:35 2024 +0300

    x86/of: Return consistent error type from x86_of_pci_irq_enable()
    
    [ Upstream commit ec0b4c4d45cf7cf9a6c9626a494a89cb1ae7c645 ]
    
    x86_of_pci_irq_enable() returns PCIBIOS_* code received from
    pci_read_config_byte() directly and also -EINVAL which are not
    compatible error types. x86_of_pci_irq_enable() is used as
    (*pcibios_enable_irq) function which should not return PCIBIOS_* codes.
    
    Convert the PCIBIOS_* return code from pci_read_config_byte() into
    normal errno using pcibios_err_to_errno().
    
    Fixes: 96e0a0797eba ("x86: dtb: Add support for PCI devices backed by dtb nodes")
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Borislav Petkov (AMD) <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
x86/pci/intel_mid_pci: Fix PCIBIOS_* return code handling [+ + +]
Author: Ilpo Järvinen <[email protected]>
Date:   Mon May 27 15:55:36 2024 +0300

    x86/pci/intel_mid_pci: Fix PCIBIOS_* return code handling
    
    [ Upstream commit 724852059e97c48557151b3aa4af424614819752 ]
    
    intel_mid_pci_irq_enable() uses pci_read_config_byte() that returns
    PCIBIOS_* codes. The error handling, however, assumes the codes are
    normal errnos because it checks for < 0.
    
    intel_mid_pci_irq_enable() also returns the PCIBIOS_* code back to the
    caller but the function is used as the (*pcibios_enable_irq) function
    which should return normal errnos.
    
    Convert the error check to plain non-zero check which works for
    PCIBIOS_* return codes and convert the PCIBIOS_* return code using
    pcibios_err_to_errno() into normal errno before returning it.
    
    Fixes: 5b395e2be6c4 ("x86/platform/intel-mid: Make IRQ allocation a bit more flexible")
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Borislav Petkov (AMD) <[email protected]>
    Reviewed-by: Andy Shevchenko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
x86/pci/xen: Fix PCIBIOS_* return code handling [+ + +]
Author: Ilpo Järvinen <[email protected]>
Date:   Mon May 27 15:55:37 2024 +0300

    x86/pci/xen: Fix PCIBIOS_* return code handling
    
    [ Upstream commit e9d7b435dfaec58432f4106aaa632bf39f52ce9f ]
    
    xen_pcifront_enable_irq() uses pci_read_config_byte() that returns
    PCIBIOS_* codes. The error handling, however, assumes the codes are
    normal errnos because it checks for < 0.
    
    xen_pcifront_enable_irq() also returns the PCIBIOS_* code back to the
    caller but the function is used as the (*pcibios_enable_irq) function
    which should return normal errnos.
    
    Convert the error check to plain non-zero check which works for
    PCIBIOS_* return codes and convert the PCIBIOS_* return code using
    pcibios_err_to_errno() into normal errno before returning it.
    
    Fixes: 3f2a230caf21 ("xen: handled remapped IRQs when enabling a pcifront PCI device.")
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Borislav Petkov (AMD) <[email protected]>
    Reviewed-by: Juergen Gross <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
x86/platform/iosf_mbi: Convert PCIBIOS_* return codes to errnos [+ + +]
Author: Ilpo Järvinen <[email protected]>
Date:   Mon May 27 15:55:38 2024 +0300

    x86/platform/iosf_mbi: Convert PCIBIOS_* return codes to errnos
    
    [ Upstream commit 7821fa101eab529521aa4b724bf708149d70820c ]
    
    iosf_mbi_pci_{read,write}_mdr() use pci_{read,write}_config_dword()
    that return PCIBIOS_* codes but functions also return -ENODEV which are
    not compatible error codes. As neither of the functions are related to
    PCI read/write functions, they should return normal errnos.
    
    Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal
    errno before returning it.
    
    Fixes: 46184415368a ("arch: x86: New MailBox support driver for Intel SOC's")
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Borislav Petkov (AMD) <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
x86/xen: Convert comma to semicolon [+ + +]
Author: Chen Ni <[email protected]>
Date:   Tue Jul 2 11:10:10 2024 +0800

    x86/xen: Convert comma to semicolon
    
    [ Upstream commit 349d271416c61f82b853336509b1d0dc04c1fcbb ]
    
    Replace a comma between expression statements by a semicolon.
    
    Fixes: 8310b77b48c5 ("Xen/gnttab: handle p2m update errors on a per-slot basis")
    Signed-off-by: Chen Ni <[email protected]>
    Reviewed-by: Juergen Gross <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Juergen Gross <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>