Changelog in Linux kernel 6.1.132

 
ACPI: resource: IRQ override for Eluktronics MECH-17 [+ + +]
Author: Gannon Kolding <gannon.kolding@gmail.com>
Date:   Mon Jan 27 02:39:02 2025 -0700

    ACPI: resource: IRQ override for Eluktronics MECH-17
    
    [ Upstream commit 607ab6f85f4194b644ea95ac5fe660ef575db3b4 ]
    
    The Eluktronics MECH-17 (GM7RG7N) needs IRQ overriding for the
    keyboard to work.
    
    Adding a DMI_MATCH entry for this laptop model makes the internal
    keyboard function normally.
    
    Signed-off-by: Gannon Kolding <gannon.kolding@gmail.com>
    Link: https://patch.msgid.link/20250127093902.328361-1-gannon.kolding@gmail.com
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support [+ + +]
Author: Eric W. Biederman <ebiederm@xmission.com>
Date:   Sun Jan 12 23:39:01 2025 -0600

    alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support
    
    [ Upstream commit b029628be267cba3c7684ec684749fe3e4372398 ]
    
    Richard Henderson <richard.henderson@linaro.org> writes[1]:
    
    > There was a Spec benchmark (I forget which) which was memory bound and ran
    > twice as fast with 32-bit pointers.
    >
    > I copied the idea from DEC to the ELF abi, but never did all the other work
    > to allow the toolchain to take advantage.
    >
    > Amusingly, a later Spec changed the benchmark data sets to not fit into a
    > 32-bit address space, specifically because of this.
    >
    > I expect one could delete the ELF bit and personality and no one would
    > notice. Not even the 10 remaining Alpha users.
    
    In [2] it was pointed out that parts of setarch weren't working
    properly on alpha because it has it's own SET_PERSONALITY
    implementation.  In the discussion that followed Richard Henderson
    pointed out that the 32bit pointer support for alpha was never
    completed.
    
    Fix this by removing alpha's 32bit pointer support.
    
    As a bit of paranoia refuse to execute any alpha binaries that have
    the EF_ALPHA_32BIT flag set.  Just in case someone somewhere has
    binaries that try to use alpha's 32bit pointer support.
    
    Link: https://lkml.kernel.org/r/CAFXwXrkgu=4Qn-v1PjnOR4SG0oUb9LSa0g6QXpBq4ttm52pJOQ@mail.gmail.com [1]
    Link: https://lkml.kernel.org/r/20250103140148.370368-1-glaubitz@physik.fu-berlin.de [2]
    Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Arnd Bergmann <arnd@arndb.de>
    Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    Link: https://lore.kernel.org/r/87y0zfs26i.fsf_-_@email.froward.int.ebiederm.org
    Signed-off-by: Kees Cook <kees@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ALSA: hda/realtek: Limit mic boost on Positivo ARN50 [+ + +]
Author: Edson Juliano Drosdeck <edson.drosdeck@gmail.com>
Date:   Sat Feb 1 11:39:30 2025 -0300

    ALSA: hda/realtek: Limit mic boost on Positivo ARN50
    
    [ Upstream commit 76b0a22d4cf7dc9091129560fdc04e73eb9db4cb ]
    
    The internal mic boost on the Positivo ARN50 is too high.
    Fix this by applying the ALC269_FIXUP_LIMIT_INT_MIC_BOOST fixup to the machine
    to limit the gain.
    
    Signed-off-by: Edson Juliano Drosdeck <edson.drosdeck@gmail.com>
    Link: https://patch.msgid.link/20250201143930.25089-1-edson.drosdeck@gmail.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
arm64: dts: freescale: imx8mm-verdin-dahlia: add Microphone Jack to sound card [+ + +]
Author: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Date:   Mon Feb 17 15:56:41 2025 +0100

    arm64: dts: freescale: imx8mm-verdin-dahlia: add Microphone Jack to sound card
    
    commit 2c1092823eb03f8508d6769e2f38eef7e1fe62a0 upstream.
    
    The simple-audio-card's microphone widget currently connects to the
    headphone jack. Routing the microphone input to the microphone jack
    allows for independent operation of the microphone and headphones.
    
    This resolves the following boot-time kernel log message, which
    indicated a conflict when the microphone and headphone functions were
    not separated:
      debugfs: File 'Headphone Jack' in directory 'dapm' already present!
    
    Fixes: 6a57f224f734 ("arm64: dts: freescale: add initial support for verdin imx8m mini")
    Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
    Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

arm64: dts: freescale: tqma8mpql: Fix vqmmc-supply [+ + +]
Author: Alexander Stein <alexander.stein@ew.tq-group.com>
Date:   Tue Jan 7 16:03:09 2025 +0100

    arm64: dts: freescale: tqma8mpql: Fix vqmmc-supply
    
    [ Upstream commit 38f59e0e8bd2b3e1319716e4aeaeb9a6223b006d ]
    
    eMMC is supplied by BUCK5 rail. Use the actual regulator instead of
    a virtual fixed regulator.
    
    Fixes: 418d1d840e421 ("arm64: dts: freescale: add initial device tree for TQMa8MPQL with i.MX8MP")
    Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

arm64: dts: rockchip: fix u2phy1_host status for NanoPi R4S [+ + +]
Author: Justin Klaassen <justin@tidylabs.net>
Date:   Tue Feb 25 17:03:58 2025 +0000

    arm64: dts: rockchip: fix u2phy1_host status for NanoPi R4S
    
    commit 38f4aa34a5f737ea8588dac320d884cc2e762c03 upstream.
    
    The u2phy1_host should always have the same status as usb_host1_ehci
    and usb_host1_ohci, otherwise the EHCI and OHCI drivers may be
    initialized for a disabled usb port.
    
    Per the NanoPi R4S schematic, the phy-supply for u2phy1_host is set to
    the vdd_5v regulator.
    
    Fixes: db792e9adbf8 ("rockchip: rk3399: Add support for FriendlyARM NanoPi R4S")
    Cc: stable@vger.kernel.org
    Signed-off-by: Justin Klaassen <justin@tidylabs.net>
    Reviewed-by: Dragan Simic <dsimic@manjaro.org>
    Link: https://lore.kernel.org/r/20250225170420.3898-1-justin@tidylabs.net
    Signed-off-by: Heiko Stuebner <heiko@sntech.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

arm64: mm: Populate vmemmap at the page level if not section aligned [+ + +]
Author: Zhenhua Huang <quic_zhenhuah@quicinc.com>
Date:   Tue Mar 4 15:27:00 2025 +0800

    arm64: mm: Populate vmemmap at the page level if not section aligned
    
    [ Upstream commit d4234d131b0a3f9e65973f1cdc71bb3560f5d14b ]
    
    On the arm64 platform with 4K base page config, SECTION_SIZE_BITS is set
    to 27, making one section 128M. The related page struct which vmemmap
    points to is 2M then.
    Commit c1cc1552616d ("arm64: MMU initialisation") optimizes the
    vmemmap to populate at the PMD section level which was suitable
    initially since hot plug granule is always one section(128M). However,
    commit ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug")
    introduced a 2M(SUBSECTION_SIZE) hot plug granule, which disrupted the
    existing arm64 assumptions.
    
    The first problem is that if start or end is not aligned to a section
    boundary, such as when a subsection is hot added, populating the entire
    section is wasteful.
    
    The next problem is if we hotplug something that spans part of 128 MiB
    section (subsections, let's call it memblock1), and then hotplug something
    that spans another part of a 128 MiB section(subsections, let's call it
    memblock2), and subsequently unplug memblock1, vmemmap_free() will clear
    the entire PMD entry which also supports memblock2 even though memblock2
    is still active.
    
    Assuming hotplug/unplug sizes are guaranteed to be symmetric. Do the
    fix similar to x86-64: populate to pages levels if start/end is not aligned
    with section boundary.
    
    Cc: stable@vger.kernel.org # v5.4+
    Fixes: ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug")
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Zhenhua Huang <quic_zhenhuah@quicinc.com>
    Reviewed-by: Oscar Salvador <osalvador@suse.de>
    Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
    Link: https://lore.kernel.org/r/20250304072700.3405036-1-quic_zhenhuah@quicinc.com
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ARM: dts: bcm2711: Don't mark timer regs unconfigured [+ + +]
Author: Phil Elwell <phil@raspberrypi.com>
Date:   Sat Feb 22 10:41:13 2025 +0100

    ARM: dts: bcm2711: Don't mark timer regs unconfigured
    
    [ Upstream commit c24f272ae751a9f54f8816430e7f2d56031892cc ]
    
    During upstream process of Raspberry Pi 4 back in 2019 the ARMv7 stubs
    didn't configured the ARM architectural timer. This firmware issue has
    been fixed in 2020, which gave users enough time to update their system.
    
    So drop this property to allow the use of the vDSO version of
    clock_gettime.
    
    Link: https://github.com/raspberrypi/tools/pull/113
    Fixes: 7dbe8c62ceeb ("ARM: dts: Add minimal Raspberry Pi 4 support")
    Signed-off-by: Phil Elwell <phil@raspberrypi.com>
    Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
    Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Link: https://lore.kernel.org/r/20250222094113.48198-1-wahrenst@gmx.net
    Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ARM: dts: bcm2711: PL011 UARTs are actually r1p5 [+ + +]
Author: Phil Elwell <phil@raspberrypi.com>
Date:   Sun Feb 23 13:56:13 2025 +0100

    ARM: dts: bcm2711: PL011 UARTs are actually r1p5
    
    [ Upstream commit 0de09025f161f67c07978c4742e221243d070d41 ]
    
    The ARM PL011 UART instances in BCM2711 are r1p5 spec, which means they
    have 32-entry FIFOs. The correct periphid value for this is 0x00341011.
    Thanks to N Buchwitz for pointing this out.
    
    Signed-off-by: Phil Elwell <phil@raspberrypi.com>
    Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
    Link: https://lore.kernel.org/r/20250223125614.3592-2-wahrenst@gmx.net
    Fixes: 7dbe8c62ceeb ("ARM: dts: Add minimal Raspberry Pi 4 support")
    Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ARM: OMAP1: select CONFIG_GENERIC_IRQ_CHIP [+ + +]
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Wed Feb 5 13:11:33 2025 +0100

    ARM: OMAP1: select CONFIG_GENERIC_IRQ_CHIP
    
    [ Upstream commit 98f3ab18a0a55aa1ff2cd6b74bd0c02c8f76f17e ]
    
    When GENERIC_IRQ_CHIP is disabled, OMAP1 kernels fail to link:
    
    arm-linux-gnueabi-ld: arch/arm/mach-omap1/irq.o: in function `omap1_init_irq':
    irq.c:(.init.text+0x1e8): undefined reference to `irq_alloc_generic_chip'
    arm-linux-gnueabi-ld: irq.c:(.init.text+0x228): undefined reference to `irq_setup_generic_chip'
    arm-linux-gnueabi-ld: irq.c:(.init.text+0x2a8): undefined reference to `irq_gc_set_wake'
    arm-linux-gnueabi-ld: irq.c:(.init.text+0x2b0): undefined reference to `irq_gc_mask_set_bit'
    arm-linux-gnueabi-ld: irq.c:(.init.text+0x2b4): undefined reference to `irq_gc_mask_clr_bit'
    
    This has apparently been the case for many years, but I never caught it
    in randconfig builds until now, as there are dozens of other drivers
    that also 'select GENERIC_IRQ_CHIP' and statistically there is almost
    always one of them enabled.
    
    Fixes: 55b447744389 ("ARM: OMAP1: Switch to use generic irqchip in preparation for sparse IRQ")
    Link: https://lore.kernel.org/r/20250205121151.289535-1-arnd@kernel.org
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ARM: shmobile: smp: Enforce shmobile_smp_* alignment [+ + +]
Author: Geert Uytterhoeven <geert+renesas@glider.be>
Date:   Mon Mar 10 14:12:20 2025 +0100

    ARM: shmobile: smp: Enforce shmobile_smp_* alignment
    
    commit 379c590113ce46f605439d4887996c60ab8820cc upstream.
    
    When the addresses of the shmobile_smp_mpidr, shmobile_smp_fn, and
    shmobile_smp_arg variables are not multiples of 4 bytes, secondary CPU
    bring-up fails:
    
        smp: Bringing up secondary CPUs ...
        CPU1: failed to come online
        CPU2: failed to come online
        CPU3: failed to come online
        smp: Brought up 1 node, 1 CPU
    
    Fix this by adding the missing alignment directive.
    
    Fixes: 4e960f52fce16a3b ("ARM: shmobile: Move shmobile_smp_{mpidr, fn, arg}[] from .text to .bss")
    Closes: https://lore.kernel.org/r/CAMuHMdU=QR-JLgEHKWpsr6SbaZRc-Hz9r91JfpP8c3n2G-OjqA@mail.gmail.com
    Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Link: https://lore.kernel.org/c499234d559a0d95ad9472883e46077311051cd8.1741612208.git.geert+renesas@glider.be
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ASoC: amd: yc: Support mic on another Lenovo ThinkPad E16 Gen 2 model [+ + +]
Author: Thomas Mizrahi <thomasmizra@gmail.com>
Date:   Sat Mar 8 01:06:28 2025 -0300

    ASoC: amd: yc: Support mic on another Lenovo ThinkPad E16 Gen 2 model
    
    commit 0704a15b930cf97073ce091a0cd7ad32f2304329 upstream.
    
    The internal microphone on the Lenovo ThinkPad E16 model requires a
    quirk entry to work properly. This was fixed in a previous patch (linked
    below), but depending on the specific variant of the model, the product
    name may be "21M5" or "21M6".
    
    The following patch fixed this issue for the 21M5 variant:
      https://lore.kernel.org/all/20240725065442.9293-1-tiwai@suse.de/
    
    This patch adds support for the microphone on the 21M6 variant.
    
    Link: https://github.com/ramaureirac/thinkpad-e14-linux/issues/31
    Cc: stable@vger.kernel.org
    Signed-off-by: Thomas Mizrahi <thomasmizra@gmail.com>
    Link: https://patch.msgid.link/20250308041303.198765-1-thomasmizra@gmail.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ASoC: arizona/madera: use fsleep() in up/down DAPM event delays. [+ + +]
Author: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Date:   Wed Feb 5 16:08:46 2025 +0000

    ASoC: arizona/madera: use fsleep() in up/down DAPM event delays.
    
    [ Upstream commit 679074942c2502a95842a80471d8fb718165ac77 ]
    
    Using `fsleep` instead of `msleep` resolves some customer complaints
    regarding the precision of up/down DAPM event timing. `fsleep()`
    automatically selects the appropriate sleep function, making the delay
    time more predictable.
    
    Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
    Link: https://patch.msgid.link/20250205160849.500306-1-vitalyr@opensource.cirrus.com
    Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe() [+ + +]
Author: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date:   Mon Mar 10 18:45:36 2025 +0100

    ASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe()
    
    [ Upstream commit ed92bc5264c4357d4fca292c769ea9967cd3d3b6 ]
    
    Free some resources in the error handling path of the probe, as already
    done in the remove function.
    
    Fixes: e3523e01869d ("ASoC: wm0010: Add initial wm0010 DSP driver")
    Fixes: fd8b96574456 ("ASoC: wm0010: Clear IRQ as wake source and include missing header")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
    Link: https://patch.msgid.link/5139ba1ab8c4c157ce04e56096a0f54a1683195c.1741549792.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: ops: Consistently treat platform_max as control value [+ + +]
Author: Charles Keepax <ckeepax@opensource.cirrus.com>
Date:   Fri Feb 28 15:14:56 2025 +0000

    ASoC: ops: Consistently treat platform_max as control value
    
    [ Upstream commit 0eba2a7e858907a746ba69cd002eb9eb4dbd7bf3 ]
    
    This reverts commit 9bdd10d57a88 ("ASoC: ops: Shift tested values in
    snd_soc_put_volsw() by +min"), and makes some additional related
    updates.
    
    There are two ways the platform_max could be interpreted; the maximum
    register value, or the maximum value the control can be set to. The
    patch moved from treating the value as a control value to a register
    one. When the patch was applied it was technically correct as
    snd_soc_limit_volume() also used the register interpretation. However,
    even then most of the other usages treated platform_max as a
    control value, and snd_soc_limit_volume() has since been updated to
    also do so in commit fb9ad24485087 ("ASoC: ops: add correct range
    check for limiting volume"). That patch however, missed updating
    snd_soc_put_volsw() back to the control interpretation, and fixing
    snd_soc_info_volsw_range(). The control interpretation makes more
    sense as limiting is typically done from the machine driver, so it is
    appropriate to use the customer facing representation rather than the
    internal codec representation. Update all the code to consistently use
    this interpretation of platform_max.
    
    Finally, also add some comments to the soc_mixer_control struct to
    hopefully avoid further patches switching between the two approaches.
    
    Fixes: fb9ad24485087 ("ASoC: ops: add correct range check for limiting volume")
    Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
    Link: https://patch.msgid.link/20250228151456.3703342-1-ckeepax@opensource.cirrus.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: rsnd: adjust convert rate limitation [+ + +]
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Wed Feb 5 00:20:48 2025 +0000

    ASoC: rsnd: adjust convert rate limitation
    
    [ Upstream commit 89f9cf185885d4358aa92b48e51d0f09b71775aa ]
    
    Current rsnd driver supports Synchronous SRC Mode, but HW allow to update
    rate only within 1% from current rate. Adjust to it.
    
    Becially, this feature is used to fine-tune subtle difference that occur
    during sampling rate conversion in SRC. So, it should be called within 1%
    margin of rate difference.
    
    If there was difference over 1%, it will apply with 1% increments by using
    loop without indicating error message.
    
    Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    Link: https://patch.msgid.link/871pwd2qe8.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: rsnd: don't indicate warning on rsnd_kctrl_accept_runtime() [+ + +]
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Wed Feb 5 00:20:42 2025 +0000

    ASoC: rsnd: don't indicate warning on rsnd_kctrl_accept_runtime()
    
    [ Upstream commit c3fc002b206c6c83d1e3702b979733002ba6fb2c ]
    
    rsnd_kctrl_accept_runtime() (1) is used for runtime convert rate
    (= Synchronous SRC Mode). Now, rsnd driver has 2 kctrls for it
    
    (A):    "SRC Out Rate Switch"
    (B):    "SRC Out Rate"          // it calls (1)
    
    (A): can be called anytime
    (B): can be called only runtime, and will indicate warning if it was used
       at non-runtime.
    
    To use runtime convert rate (= Synchronous SRC Mode), user might uses
    command in below order.
    
    (X):    > amixer set "SRC Out Rate" on
            > aplay xxx.wav &
    (Y):    > amixer set "SRC Out Rate" 48010 // convert rate to 48010Hz
    
    (Y): calls B
    (X): calls both A and B.
    
    In this case, when user calls (X), it calls both (A) and (B), but it is not
    yet start running. So, (B) will indicate warning.
    
    This warning was added by commit b5c088689847 ("ASoC: rsnd: add warning
    message to rsnd_kctrl_accept_runtime()"), but the message sounds like the
    operation was not correct. Let's update warning message.
    
    The message is very SRC specific, implement it in src.c
    
    Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    Link: https://patch.msgid.link/8734gt2qed.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: SOF: Intel: hda: add softdep pre to snd-hda-codec-hdmi module [+ + +]
Author: Terry Cheong <htcheong@chromium.org>
Date:   Thu Feb 6 11:47:23 2025 +0200

    ASoC: SOF: Intel: hda: add softdep pre to snd-hda-codec-hdmi module
    
    [ Upstream commit 33b7dc7843dbdc9b90c91d11ba30b107f9138ffd ]
    
    In enviornment without KMOD requesting module may fail to load
    snd-hda-codec-hdmi, resulting in HDMI audio not usable.
    Add softdep to loading HDMI codec module first to ensure we can load it
    correctly.
    
    Signed-off-by: Terry Cheong <htcheong@chromium.org>
    Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
    Reviewed-by: Johny Lin <lpg76627@gmail.com>
    Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
    Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
    Link: https://patch.msgid.link/20250206094723.18013-1-peter.ujfalusi@linux.intel.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: tas2764: Fix power control mask [+ + +]
Author: Hector Martin <marcan@marcan.st>
Date:   Tue Feb 18 18:35:35 2025 +1000

    ASoC: tas2764: Fix power control mask
    
    [ Upstream commit a3f172359e22b2c11b750d23560481a55bf86af1 ]
    
    Reviewed-by: Neal Gompa <neal@gompa.dev>
    Signed-off-by: Hector Martin <marcan@marcan.st>
    Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
    Link: https://patch.msgid.link/20250218-apple-codec-changes-v2-1-932760fd7e07@gmail.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: tas2764: Set the SDOUT polarity correctly [+ + +]
Author: Hector Martin <marcan@marcan.st>
Date:   Tue Feb 18 18:36:02 2025 +1000

    ASoC: tas2764: Set the SDOUT polarity correctly
    
    [ Upstream commit f5468beeab1b1adfc63c2717b1f29ef3f49a5fab ]
    
    TX launch polarity needs to be the opposite of RX capture polarity, to
    generate the right bit slot alignment.
    
    Reviewed-by: Neal Gompa <neal@gompa.dev>
    Signed-off-by: Hector Martin <marcan@marcan.st>
    Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
    Link: https://patch.msgid.link/20250218-apple-codec-changes-v2-28-932760fd7e07@gmail.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: tas2770: Fix volume scale [+ + +]
Author: Hector Martin <marcan@marcan.st>
Date:   Sat Feb 8 00:54:35 2025 +0000

    ASoC: tas2770: Fix volume scale
    
    [ Upstream commit 579cd64b9df8a60284ec3422be919c362de40e41 ]
    
    The scale starts at -100dB, not -128dB.
    
    Signed-off-by: Hector Martin <marcan@marcan.st>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Link: https://patch.msgid.link/20250208-asoc-tas2770-v1-1-cf50ff1d59a3@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
batman-adv: Ignore own maximum aggregation size during RX [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Sun Feb 2 17:04:13 2025 +0100

    batman-adv: Ignore own maximum aggregation size during RX
    
    commit 548b0c5de7619ef53bbde5590700693f2f6d2a56 upstream.
    
    An OGMv1 and OGMv2 packet receive processing were not only limited by the
    number of bytes in the received packet but also by the nodes maximum
    aggregation packet size limit. But this limit is relevant for TX and not
    for RX. It must not be enforced by batadv_(i)v_ogm_aggr_packet to avoid
    loss of information in case of a different limit for sender and receiver.
    
    This has a minor side effect for B.A.T.M.A.N. IV because the
    batadv_iv_ogm_aggr_packet is also used for the preprocessing for the TX.
    But since the aggregation code itself will not allow more than
    BATADV_MAX_AGGREGATION_BYTES bytes, this check was never triggering (in
    this context) prior of removing it.
    
    Cc: stable@vger.kernel.org
    Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol")
    Fixes: 9323158ef9f4 ("batman-adv: OGMv2 - implement originators logic")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
block, bfq: fix re-introduced UAF in bic_set_bfqq() [+ + +]
Author: Acs, Jakub <acsjakub@amazon.de>
Date:   Tue Mar 25 10:24:41 2025 +0000

    block, bfq: fix re-introduced UAF in bic_set_bfqq()
    
    Commit eca0025faa96ac ("block, bfq: split sync bfq_queues on a
    per-actuator basis"), which is a backport of 9778369a2d6c5e ("block,
    bfq: split sync bfq_queues on a per-actuator basis") re-introduces UAF
    bug originally fixed by b600de2d7d3a16 ("block, bfq: fix uaf for bfqq in
    bic_set_bfqq()") and backported to 6.1 in cb1876fc33af26 ("block, bfq:
    fix uaf for bfqq in bic_set_bfqq()").
    
    bfq_release_process_ref() may release the sync_bfqq variable, which
    points to the same bfqq as bic->bfqq member for call context from
    __bfq_bic_change_cgroup(). bic_set_bfqq() then accesses bic->bfqq member
    which leads to the UAF condition.
    
    Fix this by bringing the incriminated function calls back in correct
    order.
    
    Fixes: eca0025faa96ac ("block, bfq: split sync bfq_queues on a per-actuator basis")
    Signed-off-by: Jakub Acs <acsjakub@amazon.de>
    Cc: Hagar Hemdan <hagarhem@amazon.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
block: fix 'kmem_cache of name 'bio-108' already exists' [+ + +]
Author: Ming Lei <ming.lei@redhat.com>
Date:   Fri Feb 28 21:26:56 2025 +0800

    block: fix 'kmem_cache of name 'bio-108' already exists'
    
    [ Upstream commit b654f7a51ffb386131de42aa98ed831f8c126546 ]
    
    Device mapper bioset often has big bio_slab size, which can be more than
    1000, then 8byte can't hold the slab name any more, cause the kmem_cache
    allocation warning of 'kmem_cache of name 'bio-108' already exists'.
    
    Fix the warning by extending bio_slab->name to 12 bytes, but fix output
    of /proc/slabinfo
    
    Reported-by: Guangwu Zhang <guazhang@redhat.com>
    Signed-off-by: Ming Lei <ming.lei@redhat.com>
    Link: https://lore.kernel.org/r/20250228132656.2838008-1-ming.lei@redhat.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Bluetooth: Fix error code in chan_alloc_skb_cb() [+ + +]
Author: Dan Carpenter <dan.carpenter@linaro.org>
Date:   Mon Mar 10 22:46:56 2025 +0300

    Bluetooth: Fix error code in chan_alloc_skb_cb()
    
    [ Upstream commit 72d061ee630d0dbb45c2920d8d19b3861c413e54 ]
    
    The chan_alloc_skb_cb() function is supposed to return error pointers on
    error.  Returning NULL will lead to a NULL dereference.
    
    Fixes: 6b8d4a6a0314 ("Bluetooth: 6LoWPAN: Use connected oriented channel instead of fixed one")
    Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: hci_event: Fix enabling passive scanning [+ + +]
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date:   Fri Feb 28 13:12:54 2025 -0500

    Bluetooth: hci_event: Fix enabling passive scanning
    
    [ Upstream commit 0bdd88971519cfa8a76d1a4dde182e74cfbd5d5c ]
    
    Passive scanning shall only be enabled when disconnecting LE links,
    otherwise it may start result in triggering scanning when e.g. an ISO
    link disconnects:
    
    > HCI Event: LE Meta Event (0x3e) plen 29
          LE Connected Isochronous Stream Established (0x19)
            Status: Success (0x00)
            Connection Handle: 257
            CIG Synchronization Delay: 0 us (0x000000)
            CIS Synchronization Delay: 0 us (0x000000)
            Central to Peripheral Latency: 10000 us (0x002710)
            Peripheral to Central Latency: 10000 us (0x002710)
            Central to Peripheral PHY: LE 2M (0x02)
            Peripheral to Central PHY: LE 2M (0x02)
            Number of Subevents: 1
            Central to Peripheral Burst Number: 1
            Peripheral to Central Burst Number: 1
            Central to Peripheral Flush Timeout: 2
            Peripheral to Central Flush Timeout: 2
            Central to Peripheral MTU: 320
            Peripheral to Central MTU: 160
            ISO Interval: 10.00 msec (0x0008)
    ...
    > HCI Event: Disconnect Complete (0x05) plen 4
            Status: Success (0x00)
            Handle: 257
            Reason: Remote User Terminated Connection (0x13)
    < HCI Command: LE Set Extended Scan Enable (0x08|0x0042) plen 6
            Extended scan: Enabled (0x01)
            Filter duplicates: Enabled (0x01)
            Duration: 0 msec (0x0000)
            Period: 0.00 sec (0x0000)
    
    Fixes: 9fcb18ef3acb ("Bluetooth: Introduce LE auto connect options")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
bonding: fix incorrect MAC address setting to receive NS messages [+ + +]
Author: Hangbin Liu <liuhangbin@gmail.com>
Date:   Thu Mar 6 02:39:22 2025 +0000

    bonding: fix incorrect MAC address setting to receive NS messages
    
    [ Upstream commit 0c5e145a350de3b38cd5ae77a401b12c46fb7c1d ]
    
    When validation on the backup slave is enabled, we need to validate the
    Neighbor Solicitation (NS) messages received on the backup slave. To
    receive these messages, the correct destination MAC address must be added
    to the slave. However, the target in bonding is a unicast address, which
    we cannot use directly. Instead, we should first convert it to a
    Solicited-Node Multicast Address and then derive the corresponding MAC
    address.
    
    Fix the incorrect MAC address setting on both slave_set_ns_maddr() and
    slave_set_ns_maddrs(). Since the two function names are similar. Add
    some description for the functions. Also only use one mac_addr variable
    in slave_set_ns_maddr() to save some code and logic.
    
    Fixes: 8eb36164d1a6 ("bonding: add ns target multicast address to slave device")
    Acked-by: Jay Vosburgh <jv@jvosburgh.net>
    Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
    Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20250306023923.38777-2-liuhangbin@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
can: flexcan: disable transceiver during system PM [+ + +]
Author: Haibo Chen <haibo.chen@nxp.com>
Date:   Fri Mar 14 19:01:45 2025 +0800

    can: flexcan: disable transceiver during system PM
    
    commit 5a19143124be42900b3fbc9ada3c919632eb45eb upstream.
    
    During system PM, if no wakeup requirement, disable transceiver to
    save power.
    
    Fixes: 4de349e786a3 ("can: flexcan: fix resume function")
    Cc: stable@vger.kernel.org
    Reviewed-by: Frank Li <frank.li@nxp.com>
    Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
    Link: https://patch.msgid.link/20250314110145.899179-2-haibo.chen@nxp.com
    [mkl: add newlines]
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

can: flexcan: only change CAN state when link up in system PM [+ + +]
Author: Haibo Chen <haibo.chen@nxp.com>
Date:   Fri Mar 14 19:01:44 2025 +0800

    can: flexcan: only change CAN state when link up in system PM
    
    commit fd99d6ed20234b83d65b9c5417794343577cf3e5 upstream.
    
    After a suspend/resume cycle on a down interface, it will come up as
    ERROR-ACTIVE.
    
    $ ip -details -s -s a s dev flexcan0
    3: flexcan0: <NOARP,ECHO> mtu 16 qdisc pfifo_fast state DOWN group default qlen 10
        link/can  promiscuity 0 allmulti 0 minmtu 0 maxmtu 0
        can state STOPPED (berr-counter tx 0 rx 0) restart-ms 1000
    
    $ sudo systemctl suspend
    
    $ ip -details -s -s a s dev flexcan0
    3: flexcan0: <NOARP,ECHO> mtu 16 qdisc pfifo_fast state DOWN group default qlen 10
        link/can  promiscuity 0 allmulti 0 minmtu 0 maxmtu 0
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 1000
    
    And only set CAN state to CAN_STATE_ERROR_ACTIVE when resume process
    has no issue, otherwise keep in CAN_STATE_SLEEPING as suspend did.
    
    Fixes: 4de349e786a3 ("can: flexcan: fix resume function")
    Cc: stable@vger.kernel.org
    Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
    Link: https://patch.msgid.link/20250314110145.899179-1-haibo.chen@nxp.com
    Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Closes: https://lore.kernel.org/all/20250314-married-polar-elephant-b15594-mkl@pengutronix.de
    [mkl: add newlines]
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

can: rcar_canfd: Fix page entries in the AFL list [+ + +]
Author: Biju Das <biju.das.jz@bp.renesas.com>
Date:   Fri Mar 7 17:03:27 2025 +0000

    can: rcar_canfd: Fix page entries in the AFL list
    
    commit 1dba0a37644ed3022558165bbb5cb9bda540eaf7 upstream.
    
    There are a total of 96 AFL pages and each page has 16 entries with
    registers CFDGAFLIDr, CFDGAFLMr, CFDGAFLP0r, CFDGAFLP1r holding
    the rule entries (r = 0..15).
    
    Currently, RCANFD_GAFL* macros use a start variable to find AFL entries,
    which is incorrect as the testing on RZ/G3E shows ch1 and ch4
    gets a start value of 0 and the register contents are overwritten.
    
    Fix this issue by using rule_entry corresponding to the channel
    to find the page entries in the AFL list.
    
    Fixes: dd3bd23eb438 ("can: rcar_canfd: Add Renesas R-Car CAN FD driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
    Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Link: https://patch.msgid.link/20250307170330.173425-3-biju.das.jz@bp.renesas.com
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
cifs: Fix integer overflow while processing acdirmax mount option [+ + +]
Author: Murad Masimov <m.masimov@mt-integration.ru>
Date:   Tue Mar 11 17:22:04 2025 +0300

    cifs: Fix integer overflow while processing acdirmax mount option
    
    [ Upstream commit 5b29891f91dfb8758baf1e2217bef4b16b2b165b ]
    
    User-provided mount parameter acdirmax of type u32 is intended to have
    an upper limit, but before it is validated, the value is converted from
    seconds to jiffies which can lead to an integer overflow.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 4c9f948142a5 ("cifs: Add new mount parameter "acdirmax" to allow caching directory metadata")
    Signed-off-by: Murad Masimov <m.masimov@mt-integration.ru>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

cifs: Fix integer overflow while processing acregmax mount option [+ + +]
Author: Murad Masimov <m.masimov@mt-integration.ru>
Date:   Tue Mar 11 17:22:03 2025 +0300

    cifs: Fix integer overflow while processing acregmax mount option
    
    [ Upstream commit 7489161b1852390b4413d57f2457cd40b34da6cc ]
    
    User-provided mount parameter acregmax of type u32 is intended to have
    an upper limit, but before it is validated, the value is converted from
    seconds to jiffies which can lead to an integer overflow.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 5780464614f6 ("cifs: Add new parameter "acregmax" for distinct file and directory metadata timeout")
    Signed-off-by: Murad Masimov <m.masimov@mt-integration.ru>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

cifs: Fix integer overflow while processing actimeo mount option [+ + +]
Author: Murad Masimov <m.masimov@mt-integration.ru>
Date:   Tue Mar 11 17:22:05 2025 +0300

    cifs: Fix integer overflow while processing actimeo mount option
    
    [ Upstream commit 64f690ee22c99e16084e0e45181b2a1eed2fa149 ]
    
    User-provided mount parameter actimeo of type u32 is intended to have
    an upper limit, but before it is validated, the value is converted from
    seconds to jiffies which can lead to an integer overflow.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 6d20e8406f09 ("cifs: add attribute cache timeout (actimeo) tunable")
    Signed-off-by: Murad Masimov <m.masimov@mt-integration.ru>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

cifs: Fix integer overflow while processing closetimeo mount option [+ + +]
Author: Murad Masimov <m.masimov@mt-integration.ru>
Date:   Tue Mar 11 17:22:06 2025 +0300

    cifs: Fix integer overflow while processing closetimeo mount option
    
    [ Upstream commit d5a30fddfe2f2e540f6c43b59cf701809995faef ]
    
    User-provided mount parameter closetimeo of type u32 is intended to have
    an upper limit, but before it is validated, the value is converted from
    seconds to jiffies which can lead to an integer overflow.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 5efdd9122eff ("smb3: allow deferred close timeout to be configurable")
    Signed-off-by: Murad Masimov <m.masimov@mt-integration.ru>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
clk: samsung: update PLL locktime for PLL142XX used on FSD platform [+ + +]
Author: Varada Pavani <v.pavani@samsung.com>
Date:   Tue Feb 25 18:49:18 2025 +0530

    clk: samsung: update PLL locktime for PLL142XX used on FSD platform
    
    commit 53517a70873c7a91675f7244768aad5006cc45de upstream.
    
    Currently PLL142XX locktime is 270. As per spec, it should be 150. Hence
    update PLL142XX controller locktime to 150.
    
    Cc: stable@vger.kernel.org
    Fixes: 4f346005aaed ("clk: samsung: fsd: Add initial clock support")
    Signed-off-by: Varada Pavani <v.pavani@samsung.com>
    Link: https://lore.kernel.org/r/20250225131918.50925-3-v.pavani@samsung.com
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
clockevents/drivers/i8253: Fix stop sequence for timer 0 [+ + +]
Author: David Woodhouse <dwmw@amazon.co.uk>
Date:   Fri Aug 2 14:55:55 2024 +0100

    clockevents/drivers/i8253: Fix stop sequence for timer 0
    
    commit 531b2ca0a940ac9db03f246c8b77c4201de72b00 upstream.
    
    According to the data sheet, writing the MODE register should stop the
    counter (and thus the interrupts). This appears to work on real hardware,
    at least modern Intel and AMD systems. It should also work on Hyper-V.
    
    However, on some buggy virtual machines the mode change doesn't have any
    effect until the counter is subsequently loaded (or perhaps when the IRQ
    next fires).
    
    So, set MODE 0 and then load the counter, to ensure that those buggy VMs
    do the right thing and the interrupts stop. And then write MODE 0 *again*
    to stop the counter on compliant implementations too.
    
    Apparently, Hyper-V keeps firing the IRQ *repeatedly* even in mode zero
    when it should only happen once, but the second MODE write stops that too.
    
    Userspace test program (mostly written by tglx):
    =====
     #include <stdio.h>
     #include <unistd.h>
     #include <stdlib.h>
     #include <stdint.h>
     #include <sys/io.h>
    
    static __always_inline void __out##bwl(type value, uint16_t port)       \
    {                                                                       \
            asm volatile("out" #bwl " %" #bw "0, %w1"                       \
                         : : "a"(value), "Nd"(port));                       \
    }                                                                       \
                                                                            \
    static __always_inline type __in##bwl(uint16_t port)                    \
    {                                                                       \
            type value;                                                     \
            asm volatile("in" #bwl " %w1, %" #bw "0"                        \
                         : "=a"(value) : "Nd"(port));                       \
            return value;                                                   \
    }
    
    BUILDIO(b, b, uint8_t)
    
     #define inb __inb
     #define outb __outb
    
     #define PIT_MODE       0x43
     #define PIT_CH0        0x40
     #define PIT_CH2        0x42
    
    static int is8254;
    
    static void dump_pit(void)
    {
            if (is8254) {
                    // Latch and output counter and status
                    outb(0xC2, PIT_MODE);
                    printf("%02x %02x %02x\n", inb(PIT_CH0), inb(PIT_CH0), inb(PIT_CH0));
            } else {
                    // Latch and output counter
                    outb(0x0, PIT_MODE);
                    printf("%02x %02x\n", inb(PIT_CH0), inb(PIT_CH0));
            }
    }
    
    int main(int argc, char* argv[])
    {
            int nr_counts = 2;
    
            if (argc > 1)
                    nr_counts = atoi(argv[1]);
    
            if (argc > 2)
                    is8254 = 1;
    
            if (ioperm(0x40, 4, 1) != 0)
                    return 1;
    
            dump_pit();
    
            printf("Set oneshot\n");
            outb(0x38, PIT_MODE);
            outb(0x00, PIT_CH0);
            outb(0x0F, PIT_CH0);
    
            dump_pit();
            usleep(1000);
            dump_pit();
    
            printf("Set periodic\n");
            outb(0x34, PIT_MODE);
            outb(0x00, PIT_CH0);
            outb(0x0F, PIT_CH0);
    
            dump_pit();
            usleep(1000);
            dump_pit();
            dump_pit();
            usleep(100000);
            dump_pit();
            usleep(100000);
            dump_pit();
    
            printf("Set stop (%d counter writes)\n", nr_counts);
            outb(0x30, PIT_MODE);
            while (nr_counts--)
                    outb(0xFF, PIT_CH0);
    
            dump_pit();
            usleep(100000);
            dump_pit();
            usleep(100000);
            dump_pit();
    
            printf("Set MODE 0\n");
            outb(0x30, PIT_MODE);
    
            dump_pit();
            usleep(100000);
            dump_pit();
            usleep(100000);
            dump_pit();
    
            return 0;
    }
    =====
    
    Suggested-by: Sean Christopherson <seanjc@google.com>
    Co-developed-by: Li RongQing <lirongqing@baidu.com>
    Signed-off-by: Li RongQing <lirongqing@baidu.com>
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Tested-by: Michael Kelley <mhkelley@outlook.com>
    Link: https://lore.kernel.org/all/20240802135555.564941-2-dwmw2@infradead.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
Drivers: hv: vmbus: Don't release fb_mmio resource in vmbus_free_mmio() [+ + +]
Author: Michael Kelley <mhklinux@outlook.com>
Date:   Sun Mar 9 20:52:08 2025 -0700

    Drivers: hv: vmbus: Don't release fb_mmio resource in vmbus_free_mmio()
    
    [ Upstream commit 73fe9073c0cc28056cb9de0c8a516dac070f1d1f ]
    
    The VMBus driver manages the MMIO space it owns via the hyperv_mmio
    resource tree. Because the synthetic video framebuffer portion of the
    MMIO space is initially setup by the Hyper-V host for each guest, the
    VMBus driver does an early reserve of that portion of MMIO space in the
    hyperv_mmio resource tree. It saves a pointer to that resource in
    fb_mmio. When a VMBus driver requests MMIO space and passes "true"
    for the "fb_overlap_ok" argument, the reserved framebuffer space is
    used if possible. In that case it's not necessary to do another request
    against the "shadow" hyperv_mmio resource tree because that resource
    was already requested in the early reserve steps.
    
    However, the vmbus_free_mmio() function currently does no special
    handling for the fb_mmio resource. When a framebuffer device is
    removed, or the driver is unbound, the current code for
    vmbus_free_mmio() releases the reserved resource, leaving fb_mmio
    pointing to memory that has been freed. If the same or another
    driver is subsequently bound to the device, vmbus_allocate_mmio()
    checks against fb_mmio, and potentially gets garbage. Furthermore
    a second unbind operation produces this "nonexistent resource" error
    because of the unbalanced behavior between vmbus_allocate_mmio() and
    vmbus_free_mmio():
    
    [   55.499643] resource: Trying to free nonexistent
                            resource <0x00000000f0000000-0x00000000f07fffff>
    
    Fix this by adding logic to vmbus_free_mmio() to recognize when
    MMIO space in the fb_mmio reserved area would be released, and don't
    release it. This filtering ensures the fb_mmio resource always exists,
    and makes vmbus_free_mmio() more parallel with vmbus_allocate_mmio().
    
    Fixes: be000f93e5d7 ("drivers:hv: Track allocations of children of hv_vmbus in private resource tree")
    Signed-off-by: Michael Kelley <mhklinux@outlook.com>
    Tested-by: Saurabh Sengar <ssengar@linux.microsoft.com>
    Reviewed-by: Saurabh Sengar <ssengar@linux.microsoft.com>
    Link: https://lore.kernel.org/r/20250310035208.275764-1-mhklinux@outlook.com
    Signed-off-by: Wei Liu <wei.liu@kernel.org>
    Message-ID: <20250310035208.275764-1-mhklinux@outlook.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/amd/display: Assign normalized_pix_clk when color depth = 14 [+ + +]
Author: Alex Hung <alex.hung@amd.com>
Date:   Thu Feb 27 16:36:25 2025 -0700

    drm/amd/display: Assign normalized_pix_clk when color depth = 14
    
    commit 79e31396fdd7037c503e6add15af7cb00633ea92 upstream.
    
    [WHY & HOW]
    A warning message "WARNING: CPU: 4 PID: 459 at ... /dc_resource.c:3397
    calculate_phy_pix_clks+0xef/0x100 [amdgpu]" occurs because the
    display_color_depth == COLOR_DEPTH_141414 is not handled. This is
    observed in Radeon RX 6600 XT.
    
    It is fixed by assigning pix_clk * (14 * 3) / 24 - same as the rests.
    
    Also fixes the indentation in get_norm_pix_clk.
    
    Reviewed-by: Harry Wentland <harry.wentland@amd.com>
    Signed-off-by: Alex Hung <alex.hung@amd.com>
    Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
    Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 274a87eb389f58eddcbc5659ab0b180b37e92775)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amd/display: Fix slab-use-after-free on hdcp_work [+ + +]
Author: Mario Limonciello <mario.limonciello@amd.com>
Date:   Fri Feb 28 13:18:14 2025 -0600

    drm/amd/display: Fix slab-use-after-free on hdcp_work
    
    commit e65e7bea220c3ce8c4c793b4ba35557f4994ab2b upstream.
    
    [Why]
    A slab-use-after-free is reported when HDCP is destroyed but the
    property_validate_dwork queue is still running.
    
    [How]
    Cancel the delayed work when destroying workqueue.
    
    Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4006
    Fixes: da3fd7ac0bcf ("drm/amd/display: Update CP property based on HW query")
    Cc: Alex Deucher <alexander.deucher@amd.com>
    Reviewed-by: Alex Hung <alex.hung@amd.com>
    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
    Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 725a04ba5a95e89c89633d4322430cfbca7ce128)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amd/display: Restore correct backlight brightness after a GPU reset [+ + +]
Author: Mario Limonciello <mario.limonciello@amd.com>
Date:   Sun Feb 23 00:04:35 2025 -0600

    drm/amd/display: Restore correct backlight brightness after a GPU reset
    
    commit 5760388d9681ac743038b846b9082b9023969551 upstream.
    
    [Why]
    GPU reset will attempt to restore cached state, but brightness doesn't
    get restored. It will come back at 100% brightness, but userspace thinks
    it's the previous value.
    
    [How]
    When running resume sequence if GPU is in reset restore brightness
    to previous value.
    
    Acked-by: Wayne Lin <Wayne.Lin@amd.com>
    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
    Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 5e19e2b57b6bb640d68dfc7991e1e182922cf867)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amd/display: Use HW lock mgr for PSR1 when only one eDP [+ + +]
Author: Mario Limonciello <mario.limonciello@amd.com>
Date:   Fri Mar 7 15:55:20 2025 -0600

    drm/amd/display: Use HW lock mgr for PSR1 when only one eDP
    
    commit acbf16a6ae775b4db86f537448cc466288aa307e upstream.
    
    [WHY]
    DMUB locking is important to make sure that registers aren't accessed
    while in PSR.  Previously it was enabled but caused a deadlock in
    situations with multiple eDP panels.
    
    [HOW]
    Detect if multiple eDP panels are in use to decide whether to use
    lock. Refactor the function so that the first check is for PSR-SU
    and then replay is in use to prevent having to look up number
    of eDP panels for those configurations.
    
    Fixes: f245b400a223 ("Revert "drm/amd/display: Use HW lock mgr for PSR1"")
    Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3965
    Reviewed-by: ChiaHsuan Chung <chiahsuan.chung@amd.com>
    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Alex Hung <alex.hung@amd.com>
    Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit ed569e1279a3045d6b974226c814e071fa0193a6)
    Cc: stable@vger.kernel.org
    [superm1: Adjust for missing replay support bfeefe6ea5f1,
              Adjust for dc_get_edp_links not being renamed from get_edp_links()]
    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amdgpu: Fix JPEG video caps max size for navi1x and raven [+ + +]
Author: David Rosca <david.rosca@amd.com>
Date:   Fri Feb 28 13:34:49 2025 +0100

    drm/amdgpu: Fix JPEG video caps max size for navi1x and raven
    
    commit ec33964d9d88488fa954a03d476a8b811efc6e85 upstream.
    
    8192x8192 is the maximum supported resolution.
    
    Signed-off-by: David Rosca <david.rosca@amd.com>
    Acked-by: Alex Deucher <alexander.deucher@amd.com>
    Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 6e0d2fde3ae8fdb5b47e10389f23ed2cb4daec5d)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amdgpu: fix use-after-free bug [+ + +]
Author: Vitaly Prosyak <vitaly.prosyak@amd.com>
Date:   Wed Mar 6 14:57:48 2024 -0500

    drm/amdgpu: fix use-after-free bug
    
    commit 22207fd5c80177b860279653d017474b2812af5e upstream.
    
    The bug can be triggered by sending a single amdgpu_gem_userptr_ioctl
    to the AMDGPU DRM driver on any ASICs with an invalid address and size.
    The bug was reported by Joonkyo Jung <joonkyoj@yonsei.ac.kr>.
    For example the following code:
    
    static void Syzkaller1(int fd)
    {
            struct drm_amdgpu_gem_userptr arg;
            int ret;
    
            arg.addr = 0xffffffffffff0000;
            arg.size = 0x80000000; /*2 Gb*/
            arg.flags = 0x7;
            ret = drmIoctl(fd, 0xc1186451/*amdgpu_gem_userptr_ioctl*/, &arg);
    }
    
    Due to the address and size are not valid there is a failure in
    amdgpu_hmm_register->mmu_interval_notifier_insert->__mmu_interval_notifier_insert->
    check_shl_overflow, but we even the amdgpu_hmm_register failure we still call
    amdgpu_hmm_unregister into  amdgpu_gem_object_free which causes access to a bad address.
    The following stack is below when the issue is reproduced when Kazan is enabled:
    
    [  +0.000014] Hardware name: ASUS System Product Name/ROG STRIX B550-F GAMING (WI-FI), BIOS 1401 12/03/2020
    [  +0.000009] RIP: 0010:mmu_interval_notifier_remove+0x327/0x340
    [  +0.000017] Code: ff ff 49 89 44 24 08 48 b8 00 01 00 00 00 00 ad de 4c 89 f7 49 89 47 40 48 83 c0 22 49 89 47 48 e8 ce d1 2d 01 e9 32 ff ff ff <0f> 0b e9 16 ff ff ff 4c 89 ef e8 fa 14 b3 ff e9 36 ff ff ff e8 80
    [  +0.000014] RSP: 0018:ffffc90002657988 EFLAGS: 00010246
    [  +0.000013] RAX: 0000000000000000 RBX: 1ffff920004caf35 RCX: ffffffff8160565b
    [  +0.000011] RDX: dffffc0000000000 RSI: 0000000000000004 RDI: ffff8881a9f78260
    [  +0.000010] RBP: ffffc90002657a70 R08: 0000000000000001 R09: fffff520004caf25
    [  +0.000010] R10: 0000000000000003 R11: ffffffff8161d1d6 R12: ffff88810e988c00
    [  +0.000010] R13: ffff888126fb5a00 R14: ffff88810e988c0c R15: ffff8881a9f78260
    [  +0.000011] FS:  00007ff9ec848540(0000) GS:ffff8883cc880000(0000) knlGS:0000000000000000
    [  +0.000012] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  +0.000010] CR2: 000055b3f7e14328 CR3: 00000001b5770000 CR4: 0000000000350ef0
    [  +0.000010] Call Trace:
    [  +0.000006]  <TASK>
    [  +0.000007]  ? show_regs+0x6a/0x80
    [  +0.000018]  ? __warn+0xa5/0x1b0
    [  +0.000019]  ? mmu_interval_notifier_remove+0x327/0x340
    [  +0.000018]  ? report_bug+0x24a/0x290
    [  +0.000022]  ? handle_bug+0x46/0x90
    [  +0.000015]  ? exc_invalid_op+0x19/0x50
    [  +0.000016]  ? asm_exc_invalid_op+0x1b/0x20
    [  +0.000017]  ? kasan_save_stack+0x26/0x50
    [  +0.000017]  ? mmu_interval_notifier_remove+0x23b/0x340
    [  +0.000019]  ? mmu_interval_notifier_remove+0x327/0x340
    [  +0.000019]  ? mmu_interval_notifier_remove+0x23b/0x340
    [  +0.000020]  ? __pfx_mmu_interval_notifier_remove+0x10/0x10
    [  +0.000017]  ? kasan_save_alloc_info+0x1e/0x30
    [  +0.000018]  ? srso_return_thunk+0x5/0x5f
    [  +0.000014]  ? __kasan_kmalloc+0xb1/0xc0
    [  +0.000018]  ? srso_return_thunk+0x5/0x5f
    [  +0.000013]  ? __kasan_check_read+0x11/0x20
    [  +0.000020]  amdgpu_hmm_unregister+0x34/0x50 [amdgpu]
    [  +0.004695]  amdgpu_gem_object_free+0x66/0xa0 [amdgpu]
    [  +0.004534]  ? __pfx_amdgpu_gem_object_free+0x10/0x10 [amdgpu]
    [  +0.004291]  ? do_syscall_64+0x5f/0xe0
    [  +0.000023]  ? srso_return_thunk+0x5/0x5f
    [  +0.000017]  drm_gem_object_free+0x3b/0x50 [drm]
    [  +0.000489]  amdgpu_gem_userptr_ioctl+0x306/0x500 [amdgpu]
    [  +0.004295]  ? __pfx_amdgpu_gem_userptr_ioctl+0x10/0x10 [amdgpu]
    [  +0.004270]  ? srso_return_thunk+0x5/0x5f
    [  +0.000014]  ? __this_cpu_preempt_check+0x13/0x20
    [  +0.000015]  ? srso_return_thunk+0x5/0x5f
    [  +0.000013]  ? sysvec_apic_timer_interrupt+0x57/0xc0
    [  +0.000020]  ? srso_return_thunk+0x5/0x5f
    [  +0.000014]  ? asm_sysvec_apic_timer_interrupt+0x1b/0x20
    [  +0.000022]  ? drm_ioctl_kernel+0x17b/0x1f0 [drm]
    [  +0.000496]  ? __pfx_amdgpu_gem_userptr_ioctl+0x10/0x10 [amdgpu]
    [  +0.004272]  ? drm_ioctl_kernel+0x190/0x1f0 [drm]
    [  +0.000492]  drm_ioctl_kernel+0x140/0x1f0 [drm]
    [  +0.000497]  ? __pfx_amdgpu_gem_userptr_ioctl+0x10/0x10 [amdgpu]
    [  +0.004297]  ? __pfx_drm_ioctl_kernel+0x10/0x10 [drm]
    [  +0.000489]  ? srso_return_thunk+0x5/0x5f
    [  +0.000011]  ? __kasan_check_write+0x14/0x20
    [  +0.000016]  drm_ioctl+0x3da/0x730 [drm]
    [  +0.000475]  ? __pfx_amdgpu_gem_userptr_ioctl+0x10/0x10 [amdgpu]
    [  +0.004293]  ? __pfx_drm_ioctl+0x10/0x10 [drm]
    [  +0.000506]  ? __pfx_rpm_resume+0x10/0x10
    [  +0.000016]  ? srso_return_thunk+0x5/0x5f
    [  +0.000011]  ? __kasan_check_write+0x14/0x20
    [  +0.000010]  ? srso_return_thunk+0x5/0x5f
    [  +0.000011]  ? _raw_spin_lock_irqsave+0x99/0x100
    [  +0.000015]  ? __pfx__raw_spin_lock_irqsave+0x10/0x10
    [  +0.000014]  ? srso_return_thunk+0x5/0x5f
    [  +0.000013]  ? srso_return_thunk+0x5/0x5f
    [  +0.000011]  ? srso_return_thunk+0x5/0x5f
    [  +0.000011]  ? preempt_count_sub+0x18/0xc0
    [  +0.000013]  ? srso_return_thunk+0x5/0x5f
    [  +0.000010]  ? _raw_spin_unlock_irqrestore+0x27/0x50
    [  +0.000019]  amdgpu_drm_ioctl+0x7e/0xe0 [amdgpu]
    [  +0.004272]  __x64_sys_ioctl+0xcd/0x110
    [  +0.000020]  do_syscall_64+0x5f/0xe0
    [  +0.000021]  entry_SYSCALL_64_after_hwframe+0x6e/0x76
    [  +0.000015] RIP: 0033:0x7ff9ed31a94f
    [  +0.000012] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 ff ff 77 1f 48 8b 44 24 18 64 48 2b 04 25 28 00
    [  +0.000013] RSP: 002b:00007fff25f66790 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
    [  +0.000016] RAX: ffffffffffffffda RBX: 000055b3f7e133e0 RCX: 00007ff9ed31a94f
    [  +0.000012] RDX: 000055b3f7e133e0 RSI: 00000000c1186451 RDI: 0000000000000003
    [  +0.000010] RBP: 00000000c1186451 R08: 0000000000000000 R09: 0000000000000000
    [  +0.000009] R10: 0000000000000008 R11: 0000000000000246 R12: 00007fff25f66ca8
    [  +0.000009] R13: 0000000000000003 R14: 000055b3f7021ba8 R15: 00007ff9ed7af040
    [  +0.000024]  </TASK>
    [  +0.000007] ---[ end trace 0000000000000000 ]---
    
    v2: Consolidate any error handling into amdgpu_hmm_register
        which applied to kfd_bo also. (Christian)
    v3: Improve syntax and comment (Christian)
    
    Cc: Christian Koenig <christian.koenig@amd.com>
    Cc: Alex Deucher <alexander.deucher@amd.com>
    Cc: Felix Kuehling <felix.kuehling@amd.com>
    Cc: Joonkyo Jung <joonkyoj@yonsei.ac.kr>
    Cc: Dokyung Song <dokyungs@yonsei.ac.kr>
    Cc: <jisoo.jang@yonsei.ac.kr>
    Cc: <yw9865@yonsei.ac.kr>
    Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    [ drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c is renamed from
      drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c since
      d9483ecd327b ("drm/amdgpu: rename the files for HMM handling").
      The path is changed accordingly to apply the patch on 6.1.y. ]
    Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
    Signed-off-by: He Zhe <zhe.he@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/atomic: Filter out redundant DPMS calls [+ + +]
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Wed Feb 19 18:02:39 2025 +0200

    drm/atomic: Filter out redundant DPMS calls
    
    commit de93ddf88088f7624b589d0ff3af9effb87e8f3b upstream.
    
    Video players (eg. mpv) do periodic XResetScreenSaver() calls to
    keep the screen on while the video playing. The modesetting ddx
    plumbs these straight through into the kernel as DPMS setproperty
    ioctls, without any filtering whatsoever. When implemented via
    atomic these end up as empty commits on the crtc (which will
    nonetheless take one full frame), which leads to a dropped
    frame every time XResetScreenSaver() is called.
    
    Let's just filter out redundant DPMS property changes in the
    kernel to avoid this issue.
    
    v2: Explain the resulting commits a bit better (Sima)
        Document the behaviour in uapi docs (Sima)
    
    Cc: stable@vger.kernel.org
    Testcase: igt/kms_flip/flip-vs-dpms-on-nop
    Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch>
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20250219160239.17502-1-ville.syrjala@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/dp_mst: Fix locking when skipping CSN before topology probing [+ + +]
Author: Imre Deak <imre.deak@intel.com>
Date:   Fri Mar 7 20:31:52 2025 +0200

    drm/dp_mst: Fix locking when skipping CSN before topology probing
    
    commit 12d8f318347b1d4feac48e8ac351d3786af39599 upstream.
    
    The handling of the MST Connection Status Notify message is skipped if
    the probing of the topology is still pending. Acquiring the
    drm_dp_mst_topology_mgr::probe_lock for this in
    drm_dp_mst_handle_up_req() is problematic: the task/work this function
    is called from is also responsible for handling MST down-request replies
    (in drm_dp_mst_handle_down_rep()). Thus drm_dp_mst_link_probe_work() -
    holding already probe_lock - could be blocked waiting for an MST
    down-request reply while drm_dp_mst_handle_up_req() is waiting for
    probe_lock while processing a CSN message. This leads to the probe
    work's down-request message timing out.
    
    A scenario similar to the above leading to a down-request timeout is
    handling a CSN message in drm_dp_mst_handle_conn_stat(), holding the
    probe_lock and sending down-request messages while a second CSN message
    sent by the sink subsequently is handled by drm_dp_mst_handle_up_req().
    
    Fix the above by moving the logic to skip the CSN handling to
    drm_dp_mst_process_up_req(). This function is called from a work
    (separate from the task/work handling new up/down messages), already
    holding probe_lock. This solves the above timeout issue, since handling
    of down-request replies won't be blocked by probe_lock.
    
    Fixes: ddf983488c3e ("drm/dp_mst: Skip CSN if topology probing is not done yet")
    Cc: Wayne Lin <Wayne.Lin@amd.com>
    Cc: Lyude Paul <lyude@redhat.com>
    Cc: stable@vger.kernel.org # v6.6+
    Reviewed-by: Wayne Lin <Wayne.Lin@amd.com>
    Reviewed-by: Lyude Paul <lyude@redhat.com>
    Signed-off-by: Imre Deak <imre.deak@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20250307183152.3822170-1-imre.deak@intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/gma500: Add NULL check for pci_gfx_root in mid_get_vbt_data() [+ + +]
Author: Ivan Abramov <i.abramov@mt-integration.ru>
Date:   Thu Mar 6 14:20:45 2025 +0300

    drm/gma500: Add NULL check for pci_gfx_root in mid_get_vbt_data()
    
    [ Upstream commit 9af152dcf1a06f589f44a74da4ad67e365d4db9a ]
    
    Since pci_get_domain_bus_and_slot() can return NULL, add NULL check for
    pci_gfx_root in the mid_get_vbt_data().
    
    This change is similar to the checks implemented in mid_get_fuse_settings()
    and mid_get_pci_revID(), which were introduced by commit 0cecdd818cd7
    ("gma500: Final enables for Oaktrail") as "additional minor
    bulletproofing".
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: f910b411053f ("gma500: Add the glue to the various BIOS and firmware interfaces")
    Signed-off-by: Ivan Abramov <i.abramov@mt-integration.ru>
    Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20250306112046.17144-1-i.abramov@mt-integration.ru
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/hyperv: Fix address space leak when Hyper-V DRM device is removed [+ + +]
Author: Michael Kelley <mhklinux@outlook.com>
Date:   Mon Feb 10 11:34:41 2025 -0800

    drm/hyperv: Fix address space leak when Hyper-V DRM device is removed
    
    [ Upstream commit aed709355fd05ef747e1af24a1d5d78cd7feb81e ]
    
    When a Hyper-V DRM device is probed, the driver allocates MMIO space for
    the vram, and maps it cacheable. If the device removed, or in the error
    path for device probing, the MMIO space is released but no unmap is done.
    Consequently the kernel address space for the mapping is leaked.
    
    Fix this by adding iounmap() calls in the device removal path, and in the
    error path during device probing.
    
    Fixes: f1f63cbb705d ("drm/hyperv: Fix an error handling path in hyperv_vmbus_probe()")
    Fixes: a0ab5abced55 ("drm/hyperv : Removing the restruction of VRAM allocation with PCI bar size")
    Signed-off-by: Michael Kelley <mhklinux@outlook.com>
    Reviewed-by: Saurabh Sengar <ssengar@linux.microsoft.com>
    Tested-by: Saurabh Sengar <ssengar@linux.microsoft.com>
    Link: https://lore.kernel.org/r/20250210193441.2414-1-mhklinux@outlook.com
    Signed-off-by: Wei Liu <wei.liu@kernel.org>
    Message-ID: <20250210193441.2414-1-mhklinux@outlook.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/mediatek: Fix coverity issue with unintentional integer overflow [+ + +]
Author: Jason-JH.Lin <jason-jh.lin@mediatek.com>
Date:   Thu Sep 7 17:14:25 2023 +0800

    drm/mediatek: Fix coverity issue with unintentional integer overflow
    
    commit b0b0d811eac6b4c52cb9ad632fa6384cf48869e7 upstream.
    
    1. Instead of multiplying 2 variable of different types. Change to
    assign a value of one variable and then multiply the other variable.
    
    2. Add a int variable for multiplier calculation instead of calculating
    different types multiplier with dma_addr_t variable directly.
    
    Fixes: 1a64a7aff8da ("drm/mediatek: Fix cursor plane no update")
    Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
    Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    Link: https://patchwork.kernel.org/project/dri-devel/patch/20230907091425.9526-1-jason-jh.lin@mediatek.com/
    Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
    [ For certain code segments with coverity issue do not exist in
      function mtk_plane_update_new_state(), those not present in v6.1 are
      not back ported. ]
    Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
    Signed-off-by: He Zhe <zhe.he@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/nouveau: Do not override forced connector status [+ + +]
Author: Thomas Zimmermann <tzimmermann@suse.de>
Date:   Tue Jan 14 10:57:25 2025 +0100

    drm/nouveau: Do not override forced connector status
    
    [ Upstream commit 01f1d77a2630e774ce33233c4e6723bca3ae9daa ]
    
    Keep user-forced connector status even if it cannot be programmed. Same
    behavior as for the rest of the drivers.
    
    Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
    Signed-off-by: Lyude Paul <lyude@redhat.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20250114100214.195386-1-tzimmermann@suse.de
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/radeon: fix uninitialized size issue in radeon_vce_cs_parse() [+ + +]
Author: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Date:   Tue Mar 11 14:14:59 2025 +0300

    drm/radeon: fix uninitialized size issue in radeon_vce_cs_parse()
    
    commit dd8689b52a24807c2d5ce0a17cb26dc87f75235c upstream.
    
    On the off chance that command stream passed from userspace via
    ioctl() call to radeon_vce_cs_parse() is weirdly crafted and
    first command to execute is to encode (case 0x03000001), the function
    in question will attempt to call radeon_vce_cs_reloc() with size
    argument that has not been properly initialized. Specifically, 'size'
    will point to 'tmp' variable before the latter had a chance to be
    assigned any value.
    
    Play it safe and init 'tmp' with 0, thus ensuring that
    radeon_vce_cs_reloc() will catch an early error in cases like these.
    
    Found by Linux Verification Center (linuxtesting.org) with static
    analysis tool SVACE.
    
    Fixes: 2fc5703abda2 ("drm/radeon: check VCE relocation buffer range v3")
    Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 2d52de55f9ee7aaee0e09ac443f77855989c6b68)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/v3d: Don't run jobs that have errors flagged in its fence [+ + +]
Author: Maíra Canal <mcanal@igalia.com>
Date:   Thu Mar 13 11:43:26 2025 -0300

    drm/v3d: Don't run jobs that have errors flagged in its fence
    
    commit 80cbee810e4e13cdbd3ae9654e9ecddf17f3e828 upstream.
    
    The V3D driver still relies on `drm_sched_increase_karma()` and
    `drm_sched_resubmit_jobs()` for resubmissions when a timeout occurs.
    The function `drm_sched_increase_karma()` marks the job as guilty, while
    `drm_sched_resubmit_jobs()` sets an error (-ECANCELED) in the DMA fence of
    that guilty job.
    
    Because of this, we must check whether the job’s DMA fence has been
    flagged with an error before executing the job. Otherwise, the same guilty
    job may be resubmitted indefinitely, causing repeated GPU resets.
    
    This patch adds a check for an error on the job's fence to prevent running
    a guilty job that was previously flagged when the GPU timed out.
    
    Note that the CPU and CACHE_CLEAN queues do not require this check, as
    their jobs are executed synchronously once the DRM scheduler starts them.
    
    Cc: stable@vger.kernel.org
    Fixes: d223f98f0209 ("drm/v3d: Add support for compute shader dispatch.")
    Fixes: 1584f16ca96e ("drm/v3d: Add support for submitting jobs to the TFU.")
    Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
    Signed-off-by: Maíra Canal <mcanal@igalia.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20250313-v3d-gpu-reset-fixes-v4-1-c1e780d8e096@igalia.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
efi/libstub: Avoid physical address 0x0 when doing random allocation [+ + +]
Author: Ard Biesheuvel <ardb@kernel.org>
Date:   Fri Mar 14 12:03:33 2025 +0100

    efi/libstub: Avoid physical address 0x0 when doing random allocation
    
    commit cb16dfed0093217a68c0faa9394fa5823927e04c upstream.
    
    Ben reports spurious EFI zboot failures on a system where physical RAM
    starts at 0x0. When doing random memory allocation from the EFI stub on
    such a platform, a random seed of 0x0 (which means no entropy source is
    available) will result in the allocation to be placed at address 0x0 if
    sufficient space is available.
    
    When this allocation is subsequently passed on to the decompression
    code, the 0x0 address is mistaken for NULL and the code complains and
    gives up.
    
    So avoid address 0x0 when doing random allocation, and set the minimum
    address to the minimum alignment.
    
    Cc: <stable@vger.kernel.org>
    Reported-by: Ben Schneider <ben@bens.haus>
    Tested-by: Ben Schneider <ben@bens.haus>
    Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
    Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
eth: bnxt: do not update checksum in bnxt_xdp_build_skb() [+ + +]
Author: Taehee Yoo <ap420073@gmail.com>
Date:   Sun Mar 9 13:42:15 2025 +0000

    eth: bnxt: do not update checksum in bnxt_xdp_build_skb()
    
    [ Upstream commit c03e7d05aa0e2f7e9a9ce5ad8a12471a53f941dc ]
    
    The bnxt_rx_pkt() updates ip_summed value at the end if checksum offload
    is enabled.
    When the XDP-MB program is attached and it returns XDP_PASS, the
    bnxt_xdp_build_skb() is called to update skb_shared_info.
    The main purpose of bnxt_xdp_build_skb() is to update skb_shared_info,
    but it updates ip_summed value too if checksum offload is enabled.
    This is actually duplicate work.
    
    When the bnxt_rx_pkt() updates ip_summed value, it checks if ip_summed
    is CHECKSUM_NONE or not.
    It means that ip_summed should be CHECKSUM_NONE at this moment.
    But ip_summed may already be updated to CHECKSUM_UNNECESSARY in the
    XDP-MB-PASS path.
    So the by skb_checksum_none_assert() WARNS about it.
    
    This is duplicate work and updating ip_summed in the
    bnxt_xdp_build_skb() is not needed.
    
    Splat looks like:
    WARNING: CPU: 3 PID: 5782 at ./include/linux/skbuff.h:5155 bnxt_rx_pkt+0x479b/0x7610 [bnxt_en]
    Modules linked in: bnxt_re bnxt_en rdma_ucm rdma_cm iw_cm ib_cm ib_uverbs veth xt_nat xt_tcpudp xt_conntrack nft_chain_nat xt_MASQUERADE nf_]
    CPU: 3 UID: 0 PID: 5782 Comm: socat Tainted: G        W          6.14.0-rc4+ #27
    Tainted: [W]=WARN
    Hardware name: ASUS System Product Name/PRIME Z690-P D4, BIOS 0603 11/01/2021
    RIP: 0010:bnxt_rx_pkt+0x479b/0x7610 [bnxt_en]
    Code: 54 24 0c 4c 89 f1 4c 89 ff c1 ea 1f ff d3 0f 1f 00 49 89 c6 48 85 c0 0f 84 4c e5 ff ff 48 89 c7 e8 ca 3d a0 c8 e9 8f f4 ff ff <0f> 0b f
    RSP: 0018:ffff88881ba09928 EFLAGS: 00010202
    RAX: 0000000000000000 RBX: 00000000c7590303 RCX: 0000000000000000
    RDX: 1ffff1104e7d1610 RSI: 0000000000000001 RDI: ffff8881c91300b8
    RBP: ffff88881ba09b28 R08: ffff888273e8b0d0 R09: ffff888273e8b070
    R10: ffff888273e8b010 R11: ffff888278b0f000 R12: ffff888273e8b080
    R13: ffff8881c9130e00 R14: ffff8881505d3800 R15: ffff888273e8b000
    FS:  00007f5a2e7be080(0000) GS:ffff88881ba00000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007fff2e708ff8 CR3: 000000013e3b0000 CR4: 00000000007506f0
    PKRU: 55555554
    Call Trace:
     <IRQ>
     ? __warn+0xcd/0x2f0
     ? bnxt_rx_pkt+0x479b/0x7610
     ? report_bug+0x326/0x3c0
     ? handle_bug+0x53/0xa0
     ? exc_invalid_op+0x14/0x50
     ? asm_exc_invalid_op+0x16/0x20
     ? bnxt_rx_pkt+0x479b/0x7610
     ? bnxt_rx_pkt+0x3e41/0x7610
     ? __pfx_bnxt_rx_pkt+0x10/0x10
     ? napi_complete_done+0x2cf/0x7d0
     __bnxt_poll_work+0x4e8/0x1220
     ? __pfx___bnxt_poll_work+0x10/0x10
     ? __pfx_mark_lock.part.0+0x10/0x10
     bnxt_poll_p5+0x36a/0xfa0
     ? __pfx_bnxt_poll_p5+0x10/0x10
     __napi_poll.constprop.0+0xa0/0x440
     net_rx_action+0x899/0xd00
    ...
    
    Following ping.py patch adds xdp-mb-pass case. so ping.py is going
    to be able to reproduce this issue.
    
    Fixes: 1dc4c557bfed ("bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff")
    Signed-off-by: Taehee Yoo <ap420073@gmail.com>
    Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
    Link: https://patch.msgid.link/20250309134219.91670-5-ap420073@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
fbdev: hyperv_fb: iounmap() the correct memory when removing a device [+ + +]
Author: Michael Kelley <mhklinux@outlook.com>
Date:   Sun Feb 9 15:52:52 2025 -0800

    fbdev: hyperv_fb: iounmap() the correct memory when removing a device
    
    [ Upstream commit 7241c886a71797cc51efc6fadec7076fcf6435c2 ]
    
    When a Hyper-V framebuffer device is removed, or the driver is unbound
    from a device, any allocated and/or mapped memory must be released. In
    particular, MMIO address space that was mapped to the framebuffer must
    be unmapped. Current code unmaps the wrong address, resulting in an
    error like:
    
    [ 4093.980597] iounmap: bad address 00000000c936c05c
    
    followed by a stack dump.
    
    Commit d21987d709e8 ("video: hyperv: hyperv_fb: Support deferred IO for
    Hyper-V frame buffer driver") changed the kind of address stored in
    info->screen_base, and the iounmap() call in hvfb_putmem() was not
    updated accordingly.
    
    Fix this by updating hvfb_putmem() to unmap the correct address.
    
    Fixes: d21987d709e8 ("video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver")
    Signed-off-by: Michael Kelley <mhklinux@outlook.com>
    Reviewed-by: Saurabh Sengar <ssengar@linux.microsoft.com>
    Link: https://lore.kernel.org/r/20250209235252.2987-1-mhklinux@outlook.com
    Signed-off-by: Wei Liu <wei.liu@kernel.org>
    Message-ID: <20250209235252.2987-1-mhklinux@outlook.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
firmware: imx-scu: fix OF node leak in .probe() [+ + +]
Author: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Date:   Tue Dec 24 12:34:56 2024 +0900

    firmware: imx-scu: fix OF node leak in .probe()
    
    [ Upstream commit fbf10b86f6057cf79300720da4ea4b77e6708b0d ]
    
    imx_scu_probe() calls of_parse_phandle_with_args(), but does not
    release the OF node reference obtained by it. Add a of_node_put() call
    after done with the node.
    
    Fixes: f25a066d1a07 ("firmware: imx-scu: Support one TX and one RX")
    Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
fs/ntfs3: Change new sparse cluster processing [+ + +]
Author: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Date:   Fri Oct 7 14:02:36 2022 +0300

    fs/ntfs3: Change new sparse cluster processing
    
    commit c380b52f6c5702cc4bdda5e6d456d6c19a201a0b upstream.
    
    Remove ntfs_sparse_cluster.
    Zero clusters in attr_allocate_clusters.
    Fixes xfstest generic/263
    
    Bug: https://syzkaller.appspot.com/bug?extid=f3e5d0948a1837ed1bb0
    Reported-by: syzbot+f3e5d0948a1837ed1bb0@syzkaller.appspotmail.com
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
    Signed-off-by: Miguel Garcia Roman <miguelgarciaroman8@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

fs/ntfs3: Fix shift-out-of-bounds in ntfs_fill_super [+ + +]
Author: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Date:   Fri Jun 30 16:25:25 2023 +0400

    fs/ntfs3: Fix shift-out-of-bounds in ntfs_fill_super
    
    commit 91a4b1ee78cb100b19b70f077c247f211110348f upstream.
    
    Reported-by: syzbot+478c1bf0e6bf4a8f3a04@syzkaller.appspotmail.com
    Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
    Signed-off-by: Miguel Garcia Roman <miguelgarciaroman8@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
fuse: don't truncate cached, mutated symlink [+ + +]
Author: Miklos Szeredi <mszeredi@redhat.com>
Date:   Thu Feb 20 11:02:58 2025 +0100

    fuse: don't truncate cached, mutated symlink
    
    [ Upstream commit b4c173dfbb6c78568578ff18f9e8822d7bd0e31b ]
    
    Fuse allows the value of a symlink to change and this property is exploited
    by some filesystems (e.g. CVMFS).
    
    It has been observed, that sometimes after changing the symlink contents,
    the value is truncated to the old size.
    
    This is caused by fuse_getattr() racing with fuse_reverse_inval_inode().
    fuse_reverse_inval_inode() updates the fuse_inode's attr_version, which
    results in fuse_change_attributes() exiting before updating the cached
    attributes
    
    This is okay, as the cached attributes remain invalid and the next call to
    fuse_change_attributes() will likely update the inode with the correct
    values.
    
    The reason this causes problems is that cached symlinks will be
    returned through page_get_link(), which truncates the symlink to
    inode->i_size.  This is correct for filesystems that don't mutate
    symlinks, but in this case it causes bad behavior.
    
    The solution is to just remove this truncation.  This can cause a
    regression in a filesystem that relies on supplying a symlink larger than
    the file size, but this is unlikely.  If that happens we'd need to make
    this behavior conditional.
    
    Reported-by: Laura Promberger <laura.promberger@cern.ch>
    Tested-by: Sam Lewis <samclewis@google.com>
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Link: https://lore.kernel.org/r/20250220100258.793363-1-mszeredi@redhat.com
    Reviewed-by: Bernd Schubert <bschubert@ddn.com>
    Signed-off-by: Christian Brauner <brauner@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
gre: Fix IPv6 link-local address generation. [+ + +]
Author: Guillaume Nault <gnault@redhat.com>
Date:   Fri Mar 7 20:28:53 2025 +0100

    gre: Fix IPv6 link-local address generation.
    
    [ Upstream commit 183185a18ff96751db52a46ccf93fff3a1f42815 ]
    
    Use addrconf_addr_gen() to generate IPv6 link-local addresses on GRE
    devices in most cases and fall back to using add_v4_addrs() only in
    case the GRE configuration is incompatible with addrconf_addr_gen().
    
    GRE used to use addrconf_addr_gen() until commit e5dd729460ca
    ("ip/ip6_gre: use the same logic as SIT interfaces when computing v6LL
    address") restricted this use to gretap and ip6gretap devices, and
    created add_v4_addrs() (borrowed from SIT) for non-Ethernet GRE ones.
    
    The original problem came when commit 9af28511be10 ("addrconf: refuse
    isatap eui64 for INADDR_ANY") made __ipv6_isatap_ifid() fail when its
    addr parameter was 0. The commit says that this would create an invalid
    address, however, I couldn't find any RFC saying that the generated
    interface identifier would be wrong. Anyway, since gre over IPv4
    devices pass their local tunnel address to __ipv6_isatap_ifid(), that
    commit broke their IPv6 link-local address generation when the local
    address was unspecified.
    
    Then commit e5dd729460ca ("ip/ip6_gre: use the same logic as SIT
    interfaces when computing v6LL address") tried to fix that case by
    defining add_v4_addrs() and calling it to generate the IPv6 link-local
    address instead of using addrconf_addr_gen() (apart for gretap and
    ip6gretap devices, which would still use the regular
    addrconf_addr_gen(), since they have a MAC address).
    
    That broke several use cases because add_v4_addrs() isn't properly
    integrated into the rest of IPv6 Neighbor Discovery code. Several of
    these shortcomings have been fixed over time, but add_v4_addrs()
    remains broken on several aspects. In particular, it doesn't send any
    Router Sollicitations, so the SLAAC process doesn't start until the
    interface receives a Router Advertisement. Also, add_v4_addrs() mostly
    ignores the address generation mode of the interface
    (/proc/sys/net/ipv6/conf/*/addr_gen_mode), thus breaking the
    IN6_ADDR_GEN_MODE_RANDOM and IN6_ADDR_GEN_MODE_STABLE_PRIVACY cases.
    
    Fix the situation by using add_v4_addrs() only in the specific scenario
    where the normal method would fail. That is, for interfaces that have
    all of the following characteristics:
    
      * run over IPv4,
      * transport IP packets directly, not Ethernet (that is, not gretap
        interfaces),
      * tunnel endpoint is INADDR_ANY (that is, 0),
      * device address generation mode is EUI64.
    
    In all other cases, revert back to the regular addrconf_addr_gen().
    
    Also, remove the special case for ip6gre interfaces in add_v4_addrs(),
    since ip6gre devices now always use addrconf_addr_gen() instead.
    
    Fixes: e5dd729460ca ("ip/ip6_gre: use the same logic as SIT interfaces when computing v6LL address")
    Signed-off-by: Guillaume Nault <gnault@redhat.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/559c32ce5c9976b269e6337ac9abb6a96abe5096.1741375285.git.gnault@redhat.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
HID: apple: disable Fn key handling on the Omoton KB066 [+ + +]
Author: Alex Henrie <alexhenrie24@gmail.com>
Date:   Sun Feb 23 22:36:30 2025 -0700

    HID: apple: disable Fn key handling on the Omoton KB066
    
    commit 221cea1003d8a412e5ec64a58df7ab19b654f490 upstream.
    
    Remove the fixup to make the Omoton KB066's F6 key F6 when not holding
    Fn. That was really just a hack to allow typing F6 in fnmode>0, and it
    didn't fix any of the other F keys that were likewise untypable in
    fnmode>0. Instead, because the Omoton's Fn key is entirely internal to
    the keyboard, completely disable Fn key translation when an Omoton is
    detected, which will prevent the hid-apple driver from interfering with
    the keyboard's built-in Fn key handling. All of the F keys, including
    F6, are then typable when Fn is held.
    
    The Omoton KB066 and the Apple A1255 both have HID product code
    05ac:022c. The self-reported name of every original A1255 when they left
    the factory was "Apple Wireless Keyboard". By default, Mac OS changes
    the name to "<username>'s keyboard" when pairing with the keyboard, but
    Mac OS allows the user to set the internal name of Apple keyboards to
    anything they like. The Omoton KB066's name, on the other hand, is not
    configurable: It is always "Bluetooth Keyboard". Because that name is so
    generic that a user might conceivably use the same name for a real Apple
    keyboard, detect Omoton keyboards based on both having that exact name
    and having HID product code 022c.
    
    Fixes: 819083cb6eed ("HID: apple: fix up the F6 key on the Omoton KB066 keyboard")
    Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
    Reviewed-by: Aditya Garg <gargaditya08@live.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

HID: apple: fix up the F6 key on the Omoton KB066 keyboard [+ + +]
Author: Alex Henrie <alexhenrie24@gmail.com>
Date:   Thu Jan 16 23:12:17 2025 -0700

    HID: apple: fix up the F6 key on the Omoton KB066 keyboard
    
    [ Upstream commit 819083cb6eedcc8495cbf84845877bcc741b93b3 ]
    
    The Omoton KB066 is an Apple A1255 keyboard clone (HID product code
    05ac:022c). On both keyboards, the F6 key becomes Num Lock when the Fn
    key is held. But unlike its Apple exemplar, when the Omoton's F6 key is
    pressed without Fn, it sends the usage code 0xC0301 from the reserved
    section of the consumer page instead of the standard F6 usage code
    0x7003F from the keyboard page. The nonstandard code is translated to
    KEY_UNKNOWN and becomes useless on Linux. The Omoton KB066 is a pretty
    popular keyboard, judging from its 29,058 reviews on Amazon at time of
    writing, so let's account for its quirk to make it more usable.
    
    By the way, it would be nice if we could automatically set fnmode to 0
    for Omoton keyboards because they handle the Fn key internally and the
    kernel's Fn key handling creates undesirable side effects such as making
    F1 and F2 always Brightness Up and Brightness Down in fnmode=1 (the
    default) or always F1 and F2 in fnmode=2. Unfortunately I don't think
    there's a way to identify Bluetooth keyboards more specifically than the
    HID product code which is obviously inaccurate. Users of Omoton
    keyboards will just have to set fnmode to 0 manually to get full Fn key
    functionality.
    
    Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

HID: hid-apple: Apple Magic Keyboard a3203 USB-C support [+ + +]
Author: Ievgen Vovk <YevgenVovk@ukr.net>
Date:   Sun Jan 12 13:13:14 2025 +0900

    HID: hid-apple: Apple Magic Keyboard a3203 USB-C support
    
    [ Upstream commit 2813e00dcd748cef47d2bffaa04071de93fddf00 ]
    
    Add Apple Magic Keyboard 2024 model (with USB-C port) device ID (0320)
    to those recognized by the hid-apple driver. Keyboard is otherwise
    compatible with the existing implementation for its earlier 2021 model.
    
    Signed-off-by: Ievgen Vovk <YevgenVovk@ukr.net>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

HID: ignore non-functional sensor in HP 5MP Camera [+ + +]
Author: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Date:   Wed Jan 15 15:00:20 2025 +0800

    HID: ignore non-functional sensor in HP 5MP Camera
    
    [ Upstream commit 363236d709e75610b628c2a4337ccbe42e454b6d ]
    
    The HP 5MP Camera (USB ID 0408:5473) reports a HID sensor interface that
    is not actually implemented. Attempting to access this non-functional
    sensor via iio_info causes system hangs as runtime PM tries to wake up
    an unresponsive sensor.
    
      [453] hid-sensor-hub 0003:0408:5473.0003: Report latency attributes: ffffffff:ffffffff
      [453] hid-sensor-hub 0003:0408:5473.0003: common attributes: 5:1, 2:1, 3:1 ffffffff:ffffffff
    
    Add this device to the HID ignore list since the sensor interface is
    non-functional by design and should not be exposed to userspace.
    
    Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
    Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

HID: intel-ish-hid: fix the length of MNG_SYNC_FW_CLOCK in doorbell [+ + +]
Author: Zhang Lixu <lixu.zhang@intel.com>
Date:   Wed Jan 22 09:29:00 2025 +0800

    HID: intel-ish-hid: fix the length of MNG_SYNC_FW_CLOCK in doorbell
    
    [ Upstream commit 4b54ae69197b9f416baa0fceadff7e89075f8454 ]
    
    The timestamps in the Firmware log and HID sensor samples are incorrect.
    They show 1970-01-01 because the current IPC driver only uses the first
    8 bytes of bootup time when synchronizing time with the firmware. The
    firmware converts the bootup time to UTC time, which results in the
    display of 1970-01-01.
    
    In write_ipc_from_queue(), when sending the MNG_SYNC_FW_CLOCK message,
    the clock is updated according to the definition of ipc_time_update_msg.
    However, in _ish_sync_fw_clock(), the message length is specified as the
    size of uint64_t when building the doorbell. As a result, the firmware
    only receives the first 8 bytes of struct ipc_time_update_msg.
    This patch corrects the length in the doorbell to ensure the entire
    ipc_time_update_msg is sent, fixing the timestamp issue.
    
    Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
    Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

HID: intel-ish-hid: Send clock sync message immediately after reset [+ + +]
Author: Zhang Lixu <lixu.zhang@intel.com>
Date:   Wed Jan 22 09:29:01 2025 +0800

    HID: intel-ish-hid: Send clock sync message immediately after reset
    
    [ Upstream commit 7e0d1cff12b895f44f4ddc8cf50311bc1f775201 ]
    
    The ISH driver performs a clock sync with the firmware once at system
    startup and then every 20 seconds. If a firmware reset occurs right
    after a clock sync, the driver would wait 20 seconds before performing
    another clock sync with the firmware. This is particularly problematic
    with the introduction of the "load firmware from host" feature, where
    the driver performs a clock sync with the bootloader and then has to
    wait 20 seconds before syncing with the main firmware.
    
    This patch clears prev_sync immediately upon receiving an IPC reset,
    so that the main firmware and driver will perform a clock sync
    immediately after completing the IPC handshake.
    
    Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
    Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
hrtimer: Use and report correct timerslack values for realtime tasks [+ + +]
Author: Felix Moessbauer <felix.moessbauer@siemens.com>
Date:   Wed Aug 14 14:10:32 2024 +0200

    hrtimer: Use and report correct timerslack values for realtime tasks
    
    commit ed4fb6d7ef68111bb539283561953e5c6e9a6e38 upstream.
    
    The timerslack_ns setting is used to specify how much the hardware
    timers should be delayed, to potentially dispatch multiple timers in a
    single interrupt. This is a performance optimization. Timers of
    realtime tasks (having a realtime scheduling policy) should not be
    delayed.
    
    This logic was inconsitently applied to the hrtimers, leading to delays
    of realtime tasks which used timed waits for events (e.g. condition
    variables). Due to the downstream override of the slack for rt tasks,
    the procfs reported incorrect (non-zero) timerslack_ns values.
    
    This is changed by setting the timer_slack_ns task attribute to 0 for
    all tasks with a rt policy. By that, downstream users do not need to
    specially handle rt tasks (w.r.t. the slack), and the procfs entry
    shows the correct value of "0". Setting non-zero slack values (either
    via procfs or PR_SET_TIMERSLACK) on tasks with a rt policy is ignored,
    as stated in "man 2 PR_SET_TIMERSLACK":
    
      Timer slack is not applied to threads that are scheduled under a
      real-time scheduling policy (see sched_setscheduler(2)).
    
    The special handling of timerslack on rt tasks in downstream users
    is removed as well.
    
    Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Link: https://lore.kernel.org/all/20240814121032.368444-2-felix.moessbauer@siemens.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
hrtimers: Mark is_migration_base() with __always_inline [+ + +]
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date:   Thu Jan 16 18:07:45 2025 +0200

    hrtimers: Mark is_migration_base() with __always_inline
    
    [ Upstream commit 27af31e44949fa85550176520ef7086a0d00fd7b ]
    
    When is_migration_base() is unused, it prevents kernel builds
    with clang, `make W=1` and CONFIG_WERROR=y:
    
    kernel/time/hrtimer.c:156:20: error: unused function 'is_migration_base' [-Werror,-Wunused-function]
      156 | static inline bool is_migration_base(struct hrtimer_clock_base *base)
          |                    ^~~~~~~~~~~~~~~~~
    
    Fix this by marking it with __always_inline.
    
    [ tglx: Use __always_inline instead of __maybe_unused and move it into the
            usage sites conditional ]
    
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Link: https://lore.kernel.org/all/20250116160745.243358-1-andriy.shevchenko@linux.intel.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
i2c: ali1535: Fix an error handling path in ali1535_probe() [+ + +]
Author: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date:   Mon Mar 3 20:53:08 2025 +0100

    i2c: ali1535: Fix an error handling path in ali1535_probe()
    
    [ Upstream commit 9b5463f349d019a261f1e80803447efca3126151 ]
    
    If i2c_add_adapter() fails, the request_region() call in ali1535_setup()
    must be undone by a corresponding release_region() call, as done in the
    remove function.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/0daf63d7a2ce74c02e2664ba805bbfadab7d25e5.1741031571.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Sasha Levin <sashal@kernel.org>

i2c: ali15x3: Fix an error handling path in ali15x3_probe() [+ + +]
Author: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date:   Mon Mar 3 20:58:06 2025 +0100

    i2c: ali15x3: Fix an error handling path in ali15x3_probe()
    
    [ Upstream commit 6e55caaf30c88209d097e575a169b1dface1ab69 ]
    
    If i2c_add_adapter() fails, the request_region() call in ali15x3_setup()
    must be undone by a corresponding release_region() call, as done in the
    remove function.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/9b2090cbcc02659f425188ea05f2e02745c4e67b.1741031878.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Sasha Levin <sashal@kernel.org>

i2c: omap: fix IRQ storms [+ + +]
Author: Andreas Kemnade <andreas@kemnade.info>
Date:   Fri Feb 28 15:04:20 2025 +0100

    i2c: omap: fix IRQ storms
    
    commit 285df995f90e3d61d97f327d34b9659d92313314 upstream.
    
    On the GTA04A5 writing a reset command to the gyroscope causes IRQ
    storms because NACK IRQs are enabled and therefore triggered but not
    acked.
    
    Sending a reset command to the gyroscope by
    i2cset 1 0x69 0x14 0xb6
    with an additional debug print in the ISR (not the thread) itself
    causes
    
    [ 363.353515] i2c i2c-1: ioctl, cmd=0x720, arg=0xbe801b00
    [ 363.359039] omap_i2c 48072000.i2c: addr: 0x0069, len: 2, flags: 0x0, stop: 1
    [ 363.366180] omap_i2c 48072000.i2c: IRQ LL (ISR = 0x1110)
    [ 363.371673] omap_i2c 48072000.i2c: IRQ (ISR = 0x0010)
    [ 363.376892] omap_i2c 48072000.i2c: IRQ LL (ISR = 0x0102)
    [ 363.382263] omap_i2c 48072000.i2c: IRQ LL (ISR = 0x0102)
    [ 363.387664] omap_i2c 48072000.i2c: IRQ LL (ISR = 0x0102)
    repeating till infinity
    [...]
    (0x2 = NACK, 0x100 = Bus free, which is not enabled)
    Apparently no other IRQ bit gets set, so this stalls.
    
    Do not ignore enabled interrupts and make sure they are acked.
    If the NACK IRQ is not needed, it should simply not enabled, but
    according to the above log, caring about it is necessary unless
    the Bus free IRQ is enabled and handled. The assumption that is
    will always come with a ARDY IRQ, which was the idea behind
    ignoring it, proves wrong.
    It is true for simple reads from an unused address.
    
    To still avoid the i2cdetect trouble which is the reason for
    commit c770657bd261 ("i2c: omap: Fix standard mode false ACK readings"),
    avoid doing much about NACK in omap_i2c_xfer_data() which is used
    by both IRQ mode and polling mode, so also the false detection fix
    is extended to polling usage and IRQ storms are avoided.
    
    By changing this, the hardirq handler is not needed anymore to filter
    stuff.
    
    The mentioned gyro reset now just causes a -ETIMEDOUT instead of
    hanging the system.
    
    Fixes: c770657bd261 ("i2c: omap: Fix standard mode false ACK readings").
    CC: stable@kernel.org
    Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
    Tested-by: Nishanth Menon <nm@ti.com>
    Reviewed-by: Aniket Limaye <a-limaye@ti.com>
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/20250228140420.379498-1-andreas@kemnade.info
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

i2c: sis630: Fix an error handling path in sis630_probe() [+ + +]
Author: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date:   Mon Mar 3 21:26:54 2025 +0100

    i2c: sis630: Fix an error handling path in sis630_probe()
    
    [ Upstream commit 2b22459792fcb4def9f0936d64575ac11a95a58d ]
    
    If i2c_add_adapter() fails, the request_region() call in sis630_setup()
    must be undone by a corresponding release_region() call, as done in the
    remove function.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Link: https://lore.kernel.org/r/3d607601f2c38e896b10207963c6ab499ca5c307.1741033587.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ice: fix memory leak in aRFS after reset [+ + +]
Author: Grzegorz Nitka <grzegorz.nitka@intel.com>
Date:   Thu Jan 23 09:15:39 2025 +0100

    ice: fix memory leak in aRFS after reset
    
    [ Upstream commit 23d97f18901ef5e4e264e3b1777fe65c760186b5 ]
    
    Fix aRFS (accelerated Receive Flow Steering) structures memory leak by
    adding a checker to verify if aRFS memory is already allocated while
    configuring VSI. aRFS objects are allocated in two cases:
    - as part of VSI initialization (at probe), and
    - as part of reset handling
    
    However, VSI reconfiguration executed during reset involves memory
    allocation one more time, without prior releasing already allocated
    resources. This led to the memory leak with the following signature:
    
    [root@os-delivery ~]# cat /sys/kernel/debug/kmemleak
    unreferenced object 0xff3c1ca7252e6000 (size 8192):
      comm "kworker/0:0", pid 8, jiffies 4296833052
      hex dump (first 32 bytes):
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      backtrace (crc 0):
        [<ffffffff991ec485>] __kmalloc_cache_noprof+0x275/0x340
        [<ffffffffc0a6e06a>] ice_init_arfs+0x3a/0xe0 [ice]
        [<ffffffffc09f1027>] ice_vsi_cfg_def+0x607/0x850 [ice]
        [<ffffffffc09f244b>] ice_vsi_setup+0x5b/0x130 [ice]
        [<ffffffffc09c2131>] ice_init+0x1c1/0x460 [ice]
        [<ffffffffc09c64af>] ice_probe+0x2af/0x520 [ice]
        [<ffffffff994fbcd3>] local_pci_probe+0x43/0xa0
        [<ffffffff98f07103>] work_for_cpu_fn+0x13/0x20
        [<ffffffff98f0b6d9>] process_one_work+0x179/0x390
        [<ffffffff98f0c1e9>] worker_thread+0x239/0x340
        [<ffffffff98f14abc>] kthread+0xcc/0x100
        [<ffffffff98e45a6d>] ret_from_fork+0x2d/0x50
        [<ffffffff98e083ba>] ret_from_fork_asm+0x1a/0x30
        ...
    
    Fixes: 28bf26724fdb ("ice: Implement aRFS")
    Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
    Signed-off-by: Grzegorz Nitka <grzegorz.nitka@intel.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Input: i8042 - add required quirks for missing old boardnames [+ + +]
Author: Werner Sembach <wse@tuxedocomputers.com>
Date:   Sat Feb 22 00:01:23 2025 +0100

    Input: i8042 - add required quirks for missing old boardnames
    
    commit 9ed468e17d5b80e7116fd35842df3648e808ae47 upstream.
    
    Some older Clevo barebones have problems like no or laggy keyboard after
    resume or boot which can be fixed with the SERIO_QUIRK_FORCENORESTORE
    quirk.
    
    The PB71RD keyboard is sometimes laggy after resume and the PC70DR, PB51RF,
    P640RE, and PCX0DX_GN20 keyboard is sometimes unresponsive after resume.
    This quirk fixes that.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
    Link: https://lore.kernel.org/r/20250221230137.70292-2-wse@tuxedocomputers.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: i8042 - swap old quirk combination with new quirk for more devices [+ + +]
Author: Werner Sembach <wse@tuxedocomputers.com>
Date:   Sat Feb 22 00:01:25 2025 +0100

    Input: i8042 - swap old quirk combination with new quirk for more devices
    
    commit d85862ccca452eeb19329e9f4f9a6ce1d1e53561 upstream.
    
    Some older Clevo barebones have problems like no or laggy keyboard after
    resume or boot which can be fixed with the SERIO_QUIRK_FORCENORESTORE
    quirk.
    
    We could not activly retest these devices because we no longer have them in
    our archive, but based on the other old Clevo barebones we tested where the
    new quirk had the same or a better behaviour I think it would be good to
    apply it on these too.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
    Link: https://lore.kernel.org/r/20250221230137.70292-4-wse@tuxedocomputers.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: i8042 - swap old quirk combination with new quirk for NHxxRZQ [+ + +]
Author: Werner Sembach <wse@tuxedocomputers.com>
Date:   Sat Feb 22 00:01:22 2025 +0100

    Input: i8042 - swap old quirk combination with new quirk for NHxxRZQ
    
    commit 729d163232971672d0f41b93c02092fb91f0e758 upstream.
    
    Some older Clevo barebones have problems like no or laggy keyboard after
    resume or boot which can be fixed with the SERIO_QUIRK_FORCENORESTORE
    quirk.
    
    With the old i8042 quirks this devices keyboard is sometimes laggy after
    resume. With the new quirk this issue doesn't happen.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
    Link: https://lore.kernel.org/r/20250221230137.70292-1-wse@tuxedocomputers.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: i8042 - swap old quirk combination with new quirk for several devices [+ + +]
Author: Werner Sembach <wse@tuxedocomputers.com>
Date:   Sat Feb 22 00:01:24 2025 +0100

    Input: i8042 - swap old quirk combination with new quirk for several devices
    
    commit 75ee4ebebbbe8dc4b55ba37f388924fa96bf1564 upstream.
    
    Some older Clevo barebones have problems like no or laggy keyboard after
    resume or boot which can be fixed with the SERIO_QUIRK_FORCENORESTORE
    quirk.
    
    While the old quirk combination did not show negative effects on these
    devices specifically, the new quirk works just as well and seems more
    stable in general.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
    Link: https://lore.kernel.org/r/20250221230137.70292-3-wse@tuxedocomputers.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
io_uring: add ring freeing helper [+ + +]
Author: Jens Axboe <axboe@kernel.dk>
Date:   Fri Nov 5 17:15:46 2021 -0600

    io_uring: add ring freeing helper
    
    Commit 9c189eee73af1825ea9c895fafad469de5f82641 upstream.
    
    We do rings and sqes separately, move them into a helper that does both
    the freeing and clearing of the memory.
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

io_uring: don't attempt to mmap larger than what the user asks for [+ + +]
Author: Jens Axboe <axboe@kernel.dk>
Date:   Wed May 29 09:38:38 2024 -0600

    io_uring: don't attempt to mmap larger than what the user asks for
    
    Commit 06fe9b1df1086b42718d632aa57e8f7cd1a66a21 upstream.
    
    If IORING_FEAT_SINGLE_MMAP is ignored, as can happen if an application
    uses an ancient liburing or does setup manually, then 3 mmap's are
    required to map the ring into userspace. The kernel will still have
    collapsed the mappings, however userspace may ask for mapping them
    individually. If so, then we should not use the full number of ring
    pages, as it may exceed the partial mapping. Doing so will yield an
    -EFAULT from vm_insert_pages(), as we pass in more pages than what the
    application asked for.
    
    Cap the number of pages to match what the application asked for, for
    the particular mapping operation.
    
    Reported-by: Lucas Mülling <lmulling@proton.me>
    Link: https://github.com/axboe/liburing/issues/1157
    Fixes: 3ab1db3c6039 ("io_uring: get rid of remap_pfn_range() for mapping rings/sqes")
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

io_uring: fix corner case forgetting to vunmap [+ + +]
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Mon Nov 25 23:10:31 2024 +0000

    io_uring: fix corner case forgetting to vunmap
    
    Commit 43eef70e7e2ac74e7767731dd806720c7fb5e010 upstream.
    
    io_pages_unmap() is a bit tricky in trying to figure whether the pages
    were previously vmap'ed or not. In particular If there is juts one page
    it belives there is no need to vunmap. Paired io_pages_map(), however,
    could've failed io_mem_alloc_compound() and attempted to
    io_mem_alloc_single(), which does vmap, and that leads to unpaired vmap.
    
    The solution is to fail if io_mem_alloc_compound() can't allocate a
    single page. That's the easiest way to deal with it, and those two
    functions are getting removed soon, so no need to overcomplicate it.
    
    Cc: stable@vger.kernel.org
    Fixes: 3ab1db3c6039e ("io_uring: get rid of remap_pfn_range() for mapping rings/sqes")
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/477e75a3907a2fe83249e49c0a92cd480b2c60e0.1732569842.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

io_uring: get rid of remap_pfn_range() for mapping rings/sqes [+ + +]
Author: Jens Axboe <axboe@kernel.dk>
Date:   Wed Mar 13 09:56:14 2024 -0600

    io_uring: get rid of remap_pfn_range() for mapping rings/sqes
    
    Commit 3ab1db3c6039e02a9deb9d5091d28d559917a645 upstream.
    
    Rather than use remap_pfn_range() for this and manually free later,
    switch to using vm_insert_pages() and have it Just Work.
    
    If possible, allocate a single compound page that covers the range that
    is needed. If that works, then we can just use page_address() on that
    page. If we fail to get a compound page, allocate single pages and use
    vmap() to map them into the kernel virtual address space.
    
    This just covers the rings/sqes, the other remaining user of the mmap
    remap_pfn_range() user will be converted separately. Once that is done,
    we can kill the old alloc/free code.
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

io_uring: return error pointer from io_mem_alloc() [+ + +]
Author: Jens Axboe <axboe@kernel.dk>
Date:   Fri Nov 5 17:13:52 2021 -0600

    io_uring: return error pointer from io_mem_alloc()
    
    Commit e27cef86a0edd4ef7f8b4670f508a03b509cbbb2 upstream.
    
    In preparation for having more than one time of ring allocator, make the
    existing one return valid/error-pointer rather than just NULL.
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ipv6: Fix memleak of nhc_pcpu_rth_output in fib_check_nh_v6_gw(). [+ + +]
Author: Kuniyuki Iwashima <kuniyu@amazon.com>
Date:   Tue Mar 11 18:03:25 2025 -0700

    ipv6: Fix memleak of nhc_pcpu_rth_output in fib_check_nh_v6_gw().
    
    [ Upstream commit 9740890ee20e01f99ff1dde84c63dcf089fabb98 ]
    
    fib_check_nh_v6_gw() expects that fib6_nh_init() cleans up everything
    when it fails.
    
    Commit 7dd73168e273 ("ipv6: Always allocate pcpu memory in a fib6_nh")
    moved fib_nh_common_init() before alloc_percpu_gfp() within fib6_nh_init()
    but forgot to add cleanup for fib6_nh->nh_common.nhc_pcpu_rth_output in
    case it fails to allocate fib6_nh->rt6i_pcpu, resulting in memleak.
    
    Let's call fib_nh_common_release() and clear nhc_pcpu_rth_output in the
    error path.
    
    Note that we can remove the fib6_nh_release() call in nh_create_ipv6()
    later in net-next.git.
    
    Fixes: 7dd73168e273 ("ipv6: Always allocate pcpu memory in a fib6_nh")
    Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
    Link: https://patch.msgid.link/20250312010333.56001-1-kuniyu@amazon.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ipv6: Set errno after ip_fib_metrics_init() in ip6_route_info_create(). [+ + +]
Author: Kuniyuki Iwashima <kuniyu@amazon.com>
Date:   Tue Mar 11 18:38:48 2025 -0700

    ipv6: Set errno after ip_fib_metrics_init() in ip6_route_info_create().
    
    [ Upstream commit 9a81fc3480bf5dbe2bf80e278c440770f6ba2692 ]
    
    While creating a new IPv6, we could get a weird -ENOMEM when
    RTA_NH_ID is set and either of the conditions below is true:
    
      1) CONFIG_IPV6_SUBTREES is enabled and rtm_src_len is specified
      2) nexthop_get() fails
    
    e.g.)
    
      # strace ip -6 route add fe80::dead:beef:dead:beef nhid 1 from ::
      recvmsg(3, {msg_iov=[{iov_base=[...[
        {error=-ENOMEM, msg=[... [...]]},
        [{nla_len=49, nla_type=NLMSGERR_ATTR_MSG}, "Nexthops can not be used with so"...]
      ]], iov_len=32768}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 148
    
    Let's set err explicitly after ip_fib_metrics_init() in
    ip6_route_info_create().
    
    Fixes: f88d8ea67fbd ("ipv6: Plumb support for nexthop object in a fib6_info")
    Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
    Reviewed-by: David Ahern <dsahern@kernel.org>
    Link: https://patch.msgid.link/20250312013854.61125-1-kuniyu@amazon.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ipvs: prevent integer overflow in do_ip_vs_get_ctl() [+ + +]
Author: Dan Carpenter <dan.carpenter@linaro.org>
Date:   Mon Mar 10 10:45:53 2025 +0300

    ipvs: prevent integer overflow in do_ip_vs_get_ctl()
    
    [ Upstream commit 80b78c39eb86e6b55f56363b709eb817527da5aa ]
    
    The get->num_services variable is an unsigned int which is controlled by
    the user.  The struct_size() function ensures that the size calculation
    does not overflow an unsigned long, however, we are saving the result to
    an int so the calculation can overflow.
    
    Both "len" and "get->num_services" come from the user.  This check is
    just a sanity check to help the user and ensure they are using the API
    correctly.  An integer overflow here is not a big deal.  This has no
    security impact.
    
    Save the result from struct_size() type size_t to fix this integer
    overflow bug.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
    Acked-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic() [+ + +]
Author: Chengen Du <chengen.du@canonical.com>
Date:   Tue Jan 14 12:12:34 2025 +0800

    iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic()
    
    [ Upstream commit 07e0d99a2f701123ad3104c0f1a1e66bce74d6e5 ]
    
    When performing an iSCSI boot using IPv6, iscsistart still reads the
    /sys/firmware/ibft/ethernetX/subnet-mask entry. Since the IPv6 prefix
    length is 64, this causes the shift exponent to become negative,
    triggering a UBSAN warning. As the concept of a subnet mask does not
    apply to IPv6, the value is set to ~0 to suppress the warning message.
    
    Signed-off-by: Chengen Du <chengen.du@canonical.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ksmbd: fix incorrect validation for num_aces field of smb_acl [+ + +]
Author: Namjae Jeon <linkinjeon@kernel.org>
Date:   Wed Feb 12 09:32:11 2025 +0900

    ksmbd: fix incorrect validation for num_aces field of smb_acl
    
    commit 1b8b67f3c5e5169535e26efedd3e422172e2db64 upstream.
    
    parse_dcal() validate num_aces to allocate posix_ace_state_array.
    
    if (num_aces > ULONG_MAX / sizeof(struct smb_ace *))
    
    It is an incorrect validation that we can create an array of size ULONG_MAX.
    smb_acl has ->size field to calculate actual number of aces in request buffer
    size. Use this to check invalid num_aces.
    
    Reported-by: Igor Leite Ladessa <igor-ladessa@hotmail.com>
    Tested-by: Igor Leite Ladessa <igor-ladessa@hotmail.com>
    Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
leds: mlxreg: Use devm_mutex_init() for mutex initialization [+ + +]
Author: George Stark <gnstark@salutedevices.com>
Date:   Thu Apr 11 19:10:31 2024 +0300

    leds: mlxreg: Use devm_mutex_init() for mutex initialization
    
    commit efc347b9efee1c2b081f5281d33be4559fa50a16 upstream.
    
    In this driver LEDs are registered using devm_led_classdev_register()
    so they are automatically unregistered after module's remove() is done.
    led_classdev_unregister() calls module's led_set_brightness() to turn off
    the LEDs and that callback uses mutex which was destroyed already
    in module's remove() so use devm API instead.
    
    Signed-off-by: George Stark <gnstark@salutedevices.com>
    Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
    Link: https://lore.kernel.org/r/20240411161032.609544-8-gnstark@salutedevices.com
    Signed-off-by: Lee Jones <lee@kernel.org>
    Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
    Signed-off-by: He Zhe <zhe.he@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
lib/buildid: Handle memfd_secret() files in build_id_parse() [+ + +]
Author: Andrii Nakryiko <andrii@kernel.org>
Date:   Thu Oct 17 10:47:13 2024 -0700

    lib/buildid: Handle memfd_secret() files in build_id_parse()
    
    commit 5ac9b4e935dfc6af41eee2ddc21deb5c36507a9f upstream.
    
    >From memfd_secret(2) manpage:
    
      The memory areas backing the file created with memfd_secret(2) are
      visible only to the processes that have access to the file descriptor.
      The memory region is removed from the kernel page tables and only the
      page tables of the processes holding the file descriptor map the
      corresponding physical memory. (Thus, the pages in the region can't be
      accessed by the kernel itself, so that, for example, pointers to the
      region can't be passed to system calls.)
    
    We need to handle this special case gracefully in build ID fetching
    code. Return -EFAULT whenever secretmem file is passed to build_id_parse()
    family of APIs. Original report and repro can be found in [0].
    
      [0] https://lore.kernel.org/bpf/ZwyG8Uro%2FSyTXAni@ly-workstation/
    
    Fixes: de3ec364c3c3 ("lib/buildid: add single folio-based file reader abstraction")
    Reported-by: Yi Lai <yi1.lai@intel.com>
    Suggested-by: Shakeel Butt <shakeel.butt@linux.dev>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
    Link: https://lore.kernel.org/bpf/20241017175431.6183-A-hca@linux.ibm.com
    Link: https://lore.kernel.org/bpf/20241017174713.2157873-1-andrii@kernel.org
    [ Chen Linxuan: backport same logic without folio-based changes ]
    Fixes: 88a16a130933 ("perf: Add build id data in mmap2 event")
    Signed-off-by: Chen Linxuan <chenlinxuan@deepin.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Linux: Linux 6.1.132 [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Fri Mar 28 21:59:02 2025 +0100

    Linux 6.1.132
    
    Link: https://lore.kernel.org/r/20250325122156.633329074@linuxfoundation.org
    Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Tested-by: Miguel Ojeda <ojeda@kernel.org>
    Link: https://lore.kernel.org/r/20250326154349.272647840@linuxfoundation.org
    Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Link: https://lore.kernel.org/r/20250328074420.301061796@linuxfoundation.org
    Tested-by: Pavel Machek (CIP) <pavel@denx.de>
    Tested-by: Ron Economos <re@w6rz.net>
    Tested-by: Peter Schneider <pschneider1968@googlemail.com>
    Tested-by: Jon Hunter <jonathanh@nvidia.com>
    Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Tested-by: Frank Scheiner <frank.scheiner@web.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
media: mediatek: vcodec: Fix VP8 stateless decoder smatch warning [+ + +]
Author: Yunfei Dong <yunfei.dong@mediatek.com>
Date:   Thu Jun 13 17:33:56 2024 +0800

    media: mediatek: vcodec: Fix VP8 stateless decoder smatch warning
    
    commit b113bc7c0e83b32f4dd2d291a2b6c4803e0a2c44 upstream.
    
    Fix a smatch static checker warning on vdec_vp8_req_if.c.
    Which leads to a kernel crash when fb is NULL.
    
    Fixes: 7a7ae26fd458 ("media: mediatek: vcodec: support stateless VP8 decoding")
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
    Signed-off-by: He Zhe <zhe.he@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/migrate: fix shmem xarray update during migration [+ + +]
Author: Zi Yan <ziy@nvidia.com>
Date:   Wed Mar 5 15:04:03 2025 -0500

    mm/migrate: fix shmem xarray update during migration
    
    commit 60cf233b585cdf1f3c5e52d1225606b86acd08b0 upstream.
    
    A shmem folio can be either in page cache or in swap cache, but not at the
    same time.  Namely, once it is in swap cache, folio->mapping should be
    NULL, and the folio is no longer in a shmem mapping.
    
    In __folio_migrate_mapping(), to determine the number of xarray entries to
    update, folio_test_swapbacked() is used, but that conflates shmem in page
    cache case and shmem in swap cache case.  It leads to xarray multi-index
    entry corruption, since it turns a sibling entry to a normal entry during
    xas_store() (see [1] for a userspace reproduction).  Fix it by only using
    folio_test_swapcache() to determine whether xarray is storing swap cache
    entries or not to choose the right number of xarray entries to update.
    
    [1] https://lore.kernel.org/linux-mm/Z8idPCkaJW1IChjT@casper.infradead.org/
    
    Note:
    In __split_huge_page(), folio_test_anon() && folio_test_swapcache() is
    used to get swap_cache address space, but that ignores the shmem folio in
    swap cache case.  It could lead to NULL pointer dereferencing when a
    in-swap-cache shmem folio is split at __xa_store(), since
    !folio_test_anon() is true and folio->mapping is NULL.  But fortunately,
    its caller split_huge_page_to_list_to_order() bails out early with EBUSY
    when folio->mapping is NULL.  So no need to take care of it here.
    
    Link: https://lkml.kernel.org/r/20250305200403.2822855-1-ziy@nvidia.com
    Fixes: fc346d0a70a1 ("mm: migrate high-order folios in swap cache correctly")
    Signed-off-by: Zi Yan <ziy@nvidia.com>
    Reported-by: Liu Shixin <liushixin2@huawei.com>
    Closes: https://lore.kernel.org/all/28546fb4-5210-bf75-16d6-43e1f8646080@huawei.com/
    Suggested-by: Hugh Dickins <hughd@google.com>
    Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
    Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
    Cc: Barry Song <baohua@kernel.org>
    Cc: Charan Teja Kalla <quic_charante@quicinc.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
    Cc: Lance Yang <ioworker0@gmail.com>
    Cc: Ryan Roberts <ryan.roberts@arm.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm: add nommu variant of vm_insert_pages() [+ + +]
Author: Jens Axboe <axboe@kernel.dk>
Date:   Sat Mar 16 07:21:43 2024 -0600

    mm: add nommu variant of vm_insert_pages()
    
    Commit 62346c6cb28b043f2a6e95337d9081ec0b37b5f5 upstream.
    
    An identical one exists for vm_insert_page(), add one for
    vm_insert_pages() to avoid needing to check for CONFIG_MMU in code using
    it.
    
    Acked-by: Johannes Weiner <hannes@cmpxchg.org>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mmc: atmel-mci: Add missing clk_disable_unprepare() [+ + +]
Author: Gu Bowen <gubowen5@huawei.com>
Date:   Tue Feb 25 10:28:56 2025 +0800

    mmc: atmel-mci: Add missing clk_disable_unprepare()
    
    commit e51a349d2dcf1df8422dabb90b2f691dc7df6f92 upstream.
    
    The error path when atmci_configure_dma() set dma fails in atmci driver
    does not correctly disable the clock.
    Add the missing clk_disable_unprepare() to the error path for pair with
    clk_prepare_enable().
    
    Fixes: 467e081d23e6 ("mmc: atmel-mci: use probe deferring if dma controller is not ready yet")
    Signed-off-by: Gu Bowen <gubowen5@huawei.com>
    Acked-by: Aubin Constans <aubin.constans@microchip.com>
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20250225022856.3452240-1-gubowen5@huawei.com
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mmc: sdhci-brcmstb: add cqhci suspend/resume to PM ops [+ + +]
Author: Kamal Dasu <kamal.dasu@broadcom.com>
Date:   Tue Mar 11 12:59:35 2025 -0400

    mmc: sdhci-brcmstb: add cqhci suspend/resume to PM ops
    
    commit 723ef0e20dbb2aa1b5406d2bb75374fc48187daa upstream.
    
    cqhci timeouts observed on brcmstb platforms during suspend:
      ...
      [  164.832853] mmc0: cqhci: timeout for tag 18
      ...
    
    Adding cqhci_suspend()/resume() calls to disable cqe
    in sdhci_brcmstb_suspend()/resume() respectively to fix
    CQE timeouts seen on PM suspend.
    
    Fixes: d46ba2d17f90 ("mmc: sdhci-brcmstb: Add support for Command Queuing (CQE)")
    Cc: stable@vger.kernel.org
    Signed-off-by: Kamal Dasu <kamal.dasu@broadcom.com>
    Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Link: https://lore.kernel.org/r/20250311165946.28190-1-kamal.dasu@broadcom.com
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mptcp: Fix data stream corruption in the address announcement [+ + +]
Author: Arthur Mongodin <amongodin@randorisec.fr>
Date:   Fri Mar 14 21:11:31 2025 +0100

    mptcp: Fix data stream corruption in the address announcement
    
    commit 2c1f97a52cb827a5f2768e67a9dddffae1ed47ab upstream.
    
    Because of the size restriction in the TCP options space, the MPTCP
    ADD_ADDR option is exclusive and cannot be sent with other MPTCP ones.
    For this reason, in the linked mptcp_out_options structure, group of
    fields linked to different options are part of the same union.
    
    There is a case where the mptcp_pm_add_addr_signal() function can modify
    opts->addr, but not ended up sending an ADD_ADDR. Later on, back in
    mptcp_established_options, other options will be sent, but with
    unexpected data written in other fields due to the union, e.g. in
    opts->ext_copy. This could lead to a data stream corruption in the next
    packet.
    
    Using an intermediate variable, prevents from corrupting previously
    established DSS option. The assignment of the ADD_ADDR option
    parameters is now done once we are sure this ADD_ADDR option can be set
    in the packet, e.g. after having dropped other suboptions.
    
    Fixes: 1bff1e43a30e ("mptcp: optimize out option generation")
    Cc: stable@vger.kernel.org
    Suggested-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Arthur Mongodin <amongodin@randorisec.fr>
    Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    [ Matt: the commit message has been updated: long lines splits and some
      clarifications. ]
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20250314-net-mptcp-fix-data-stream-corr-sockopt-v1-1-122dbb249db3@kernel.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mptcp: safety check before fallback [+ + +]
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Date:   Mon Feb 24 19:11:52 2025 +0100

    mptcp: safety check before fallback
    
    [ Upstream commit db75a16813aabae3b78c06b1b99f5e314c1f55d3 ]
    
    Recently, some fallback have been initiated, while the connection was
    not supposed to fallback.
    
    Add a safety check with a warning to detect when an wrong attempt to
    fallback is being done. This should help detecting any future issues
    quicker.
    
    Acked-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20250224-net-mptcp-misc-fixes-v1-3-f550f636b435@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/mlx5: Bridge, fix the crash caused by LAG state check [+ + +]
Author: Jianbo Liu <jianbol@nvidia.com>
Date:   Tue Mar 11 00:01:43 2025 +0200

    net/mlx5: Bridge, fix the crash caused by LAG state check
    
    [ Upstream commit 4b8eeed4fb105770ce6dc84a2c6ef953c7b71cbb ]
    
    When removing LAG device from bridge, NETDEV_CHANGEUPPER event is
    triggered. Driver finds the lower devices (PFs) to flush all the
    offloaded entries. And mlx5_lag_is_shared_fdb is checked, it returns
    false if one of PF is unloaded. In such case,
    mlx5_esw_bridge_lag_rep_get() and its caller return NULL, instead of
    the alive PF, and the flush is skipped.
    
    Besides, the bridge fdb entry's lastuse is updated in mlx5 bridge
    event handler. But this SWITCHDEV_FDB_ADD_TO_BRIDGE event can be
    ignored in this case because the upper interface for bond is deleted,
    and the entry will never be aged because lastuse is never updated.
    
    To make things worse, as the entry is alive, mlx5 bridge workqueue
    keeps sending that event, which is then handled by kernel bridge
    notifier. It causes the following crash when accessing the passed bond
    netdev which is already destroyed.
    
    To fix this issue, remove such checks. LAG state is already checked in
    commit 15f8f168952f ("net/mlx5: Bridge, verify LAG state when adding
    bond to bridge"), driver still need to skip offload if LAG becomes
    invalid state after initialization.
    
     Oops: stack segment: 0000 [#1] SMP
     CPU: 3 UID: 0 PID: 23695 Comm: kworker/u40:3 Tainted: G           OE      6.11.0_mlnx #1
     Tainted: [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
     Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
     Workqueue: mlx5_bridge_wq mlx5_esw_bridge_update_work [mlx5_core]
     RIP: 0010:br_switchdev_event+0x2c/0x110 [bridge]
     Code: 44 00 00 48 8b 02 48 f7 00 00 02 00 00 74 69 41 54 55 53 48 83 ec 08 48 8b a8 08 01 00 00 48 85 ed 74 4a 48 83 fe 02 48 89 d3 <4c> 8b 65 00 74 23 76 49 48 83 fe 05 74 7e 48 83 fe 06 75 2f 0f b7
     RSP: 0018:ffffc900092cfda0 EFLAGS: 00010297
     RAX: ffff888123bfe000 RBX: ffffc900092cfe08 RCX: 00000000ffffffff
     RDX: ffffc900092cfe08 RSI: 0000000000000001 RDI: ffffffffa0c585f0
     RBP: 6669746f6e690a30 R08: 0000000000000000 R09: ffff888123ae92c8
     R10: 0000000000000000 R11: fefefefefefefeff R12: ffff888123ae9c60
     R13: 0000000000000001 R14: ffffc900092cfe08 R15: 0000000000000000
     FS:  0000000000000000(0000) GS:ffff88852c980000(0000) knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 00007f15914c8734 CR3: 0000000002830005 CR4: 0000000000770ef0
     DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
     DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
     PKRU: 55555554
     Call Trace:
      <TASK>
      ? __die_body+0x1a/0x60
      ? die+0x38/0x60
      ? do_trap+0x10b/0x120
      ? do_error_trap+0x64/0xa0
      ? exc_stack_segment+0x33/0x50
      ? asm_exc_stack_segment+0x22/0x30
      ? br_switchdev_event+0x2c/0x110 [bridge]
      ? sched_balance_newidle.isra.149+0x248/0x390
      notifier_call_chain+0x4b/0xa0
      atomic_notifier_call_chain+0x16/0x20
      mlx5_esw_bridge_update+0xec/0x170 [mlx5_core]
      mlx5_esw_bridge_update_work+0x19/0x40 [mlx5_core]
      process_scheduled_works+0x81/0x390
      worker_thread+0x106/0x250
      ? bh_worker+0x110/0x110
      kthread+0xb7/0xe0
      ? kthread_park+0x80/0x80
      ret_from_fork+0x2d/0x50
      ? kthread_park+0x80/0x80
      ret_from_fork_asm+0x11/0x20
      </TASK>
    
    Fixes: ff9b7521468b ("net/mlx5: Bridge, support LAG")
    Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
    Reviewed-by: Vlad Buslov <vladbu@nvidia.com>
    Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
    Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
    Link: https://patch.msgid.link/1741644104-97767-6-git-send-email-tariqt@nvidia.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/mlx5: handle errors in mlx5_chains_create_table() [+ + +]
Author: Wentao Liang <vulab@iscas.ac.cn>
Date:   Fri Mar 7 10:18:20 2025 +0800

    net/mlx5: handle errors in mlx5_chains_create_table()
    
    [ Upstream commit eab0396353be1c778eba1c0b5180176f04dd21ce ]
    
    In mlx5_chains_create_table(), the return value of mlx5_get_fdb_sub_ns()
    and mlx5_get_flow_namespace() must be checked to prevent NULL pointer
    dereferences. If either function fails, the function should log error
    message with mlx5_core_warn() and return error pointer.
    
    Fixes: 39ac237ce009 ("net/mlx5: E-Switch, Refactor chains and priorities")
    Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
    Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
    Link: https://patch.msgid.link/20250307021820.2646-1-vulab@iscas.ac.cn
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/mlx5e: Prevent bridge link show failure for non-eswitch-allowed devices [+ + +]
Author: Carolina Jubran <cjubran@nvidia.com>
Date:   Tue Mar 11 00:01:44 2025 +0200

    net/mlx5e: Prevent bridge link show failure for non-eswitch-allowed devices
    
    [ Upstream commit e92df790d07a8eea873efcb84776e7b71f81c7d5 ]
    
    mlx5_eswitch_get_vepa returns -EPERM if the device lacks
    eswitch_manager capability, blocking mlx5e_bridge_getlink from
    retrieving VEPA mode. Since mlx5e_bridge_getlink implements
    ndo_bridge_getlink, returning -EPERM causes bridge link show to fail
    instead of skipping devices without this capability.
    
    To avoid this, return -EOPNOTSUPP from mlx5e_bridge_getlink when
    mlx5_eswitch_get_vepa fails, ensuring the command continues processing
    other devices while ignoring those without the necessary capability.
    
    Fixes: 4b89251de024 ("net/mlx5: Support ndo bridge_setlink and getlink")
    Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
    Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
    Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
    Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
    Link: https://patch.msgid.link/1741644104-97767-7-git-send-email-tariqt@nvidia.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/neighbor: add missing policy for NDTPA_QUEUE_LENBYTES [+ + +]
Author: Lin Ma <linma@zju.edu.cn>
Date:   Sun Mar 16 00:51:13 2025 +0800

    net/neighbor: add missing policy for NDTPA_QUEUE_LENBYTES
    
    [ Upstream commit 90a7138619a0c55e2aefaad27b12ffc2ddbeed78 ]
    
    Previous commit 8b5c171bb3dc ("neigh: new unresolved queue limits")
    introduces new netlink attribute NDTPA_QUEUE_LENBYTES to represent
    approximative value for deprecated QUEUE_LEN. However, it forgot to add
    the associated nla_policy in nl_ntbl_parm_policy array. Fix it with one
    simple NLA_U32 type policy.
    
    Fixes: 8b5c171bb3dc ("neigh: new unresolved queue limits")
    Signed-off-by: Lin Ma <linma@zju.edu.cn>
    Link: https://patch.msgid.link/20250315165113.37600-1-linma@zju.edu.cn
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net: atm: fix use after free in lec_send() [+ + +]
Author: Dan Carpenter <dan.carpenter@linaro.org>
Date:   Fri Mar 14 13:10:57 2025 +0300

    net: atm: fix use after free in lec_send()
    
    [ Upstream commit f3009d0d6ab78053117f8857b921a8237f4d17b3 ]
    
    The ->send() operation frees skb so save the length before calling
    ->send() to avoid a use after free.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/c751531d-4af4-42fe-affe-6104b34b791d@stanley.mountain
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: dsa: mv88e6xxx: Verify after ATU Load ops [+ + +]
Author: Joseph Huang <Joseph.Huang@garmin.com>
Date:   Thu Mar 6 12:23:05 2025 -0500

    net: dsa: mv88e6xxx: Verify after ATU Load ops
    
    [ Upstream commit dc5340c3133a3ebe54853fd299116149e528cfaa ]
    
    ATU Load operations could fail silently if there's not enough space
    on the device to hold the new entry. When this happens, the symptom
    depends on the unknown flood settings. If unknown multicast flood is
    disabled, the multicast packets are dropped when the ATU table is
    full. If unknown multicast flood is enabled, the multicast packets
    will be flooded to all ports. Either way, IGMP snooping is broken
    when the ATU Load operation fails silently.
    
    Do a Read-After-Write verification after each fdb/mdb add operation
    to make sure that the operation was really successful, and return
    -ENOSPC otherwise.
    
    Fixes: defb05b9b9b4 ("net: dsa: mv88e6xxx: Add support for fdb_add, fdb_del, and fdb_getnext")
    Signed-off-by: Joseph Huang <Joseph.Huang@garmin.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Link: https://patch.msgid.link/20250306172306.3859214-1-Joseph.Huang@garmin.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: lwtunnel: fix recursion loops [+ + +]
Author: Justin Iurman <justin.iurman@uliege.be>
Date:   Fri Mar 14 13:00:46 2025 +0100

    net: lwtunnel: fix recursion loops
    
    [ Upstream commit 986ffb3a57c5650fb8bf6d59a8f0f07046abfeb6 ]
    
    This patch acts as a parachute, catch all solution, by detecting
    recursion loops in lwtunnel users and taking care of them (e.g., a loop
    between routes, a loop within the same route, etc). In general, such
    loops are the consequence of pathological configurations. Each lwtunnel
    user is still free to catch such loops early and do whatever they want
    with them. It will be the case in a separate patch for, e.g., seg6 and
    seg6_local, in order to provide drop reasons and update statistics.
    Another example of a lwtunnel user taking care of loops is ioam6, which
    has valid use cases that include loops (e.g., inline mode), and which is
    addressed by the next patch in this series. Overall, this patch acts as
    a last resort to catch loops and drop packets, since we don't want to
    leak something unintentionally because of a pathological configuration
    in lwtunnels.
    
    The solution in this patch reuses dev_xmit_recursion(),
    dev_xmit_recursion_inc(), and dev_xmit_recursion_dec(), which seems fine
    considering the context.
    
    Closes: https://lore.kernel.org/netdev/2bc9e2079e864a9290561894d2a602d6@akamai.com/
    Closes: https://lore.kernel.org/netdev/Z7NKYMY7fJT5cYWu@shredder/
    Fixes: ffce41962ef6 ("lwtunnel: support dst output redirect function")
    Fixes: 2536862311d2 ("lwt: Add support to redirect dst.input")
    Fixes: 14972cbd34ff ("net: lwtunnel: Handle fragmentation")
    Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
    Link: https://patch.msgid.link/20250314120048.12569-2-justin.iurman@uliege.be
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: mctp i2c: Copy headers if cloned [+ + +]
Author: Matt Johnston <matt@codeconstruct.com.au>
Date:   Thu Mar 6 10:33:20 2025 +0800

    net: mctp i2c: Copy headers if cloned
    
    [ Upstream commit df8ce77ba8b7c012a3edd1ca7368b46831341466 ]
    
    Use skb_cow_head() prior to modifying the TX SKB. This is necessary
    when the SKB has been cloned, to avoid modifying other shared clones.
    
    Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
    Fixes: f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver")
    Link: https://patch.msgid.link/20250306-matt-mctp-i2c-cow-v1-1-293827212681@codeconstruct.com.au
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: openvswitch: remove misbehaving actions length check [+ + +]
Author: Ilya Maximets <i.maximets@ovn.org>
Date:   Sat Mar 8 01:45:59 2025 +0100

    net: openvswitch: remove misbehaving actions length check
    
    [ Upstream commit a1e64addf3ff9257b45b78bc7d743781c3f41340 ]
    
    The actions length check is unreliable and produces different results
    depending on the initial length of the provided netlink attribute and
    the composition of the actual actions inside of it.  For example, a
    user can add 4088 empty clone() actions without triggering -EMSGSIZE,
    on attempt to add 4089 such actions the operation will fail with the
    -EMSGSIZE verdict.  However, if another 16 KB of other actions will
    be *appended* to the previous 4089 clone() actions, the check passes
    and the flow is successfully installed into the openvswitch datapath.
    
    The reason for a such a weird behavior is the way memory is allocated.
    When ovs_flow_cmd_new() is invoked, it calls ovs_nla_copy_actions(),
    that in turn calls nla_alloc_flow_actions() with either the actual
    length of the user-provided actions or the MAX_ACTIONS_BUFSIZE.  The
    function adds the size of the sw_flow_actions structure and then the
    actually allocated memory is rounded up to the closest power of two.
    
    So, if the user-provided actions are larger than MAX_ACTIONS_BUFSIZE,
    then MAX_ACTIONS_BUFSIZE + sizeof(*sfa) rounded up is 32K + 24 -> 64K.
    Later, while copying individual actions, we look at ksize(), which is
    64K, so this way the MAX_ACTIONS_BUFSIZE check is not actually
    triggered and the user can easily allocate almost 64 KB of actions.
    
    However, when the initial size is less than MAX_ACTIONS_BUFSIZE, but
    the actions contain ones that require size increase while copying
    (such as clone() or sample()), then the limit check will be performed
    during the reserve_sfa_size() and the user will not be allowed to
    create actions that yield more than 32 KB internally.
    
    This is one part of the problem.  The other part is that it's not
    actually possible for the userspace application to know beforehand
    if the particular set of actions will be rejected or not.
    
    Certain actions require more space in the internal representation,
    e.g. an empty clone() takes 4 bytes in the action list passed in by
    the user, but it takes 12 bytes in the internal representation due
    to an extra nested attribute, and some actions require less space in
    the internal representations, e.g. set(tunnel(..)) normally takes
    64+ bytes in the action list provided by the user, but only needs to
    store a single pointer in the internal implementation, since all the
    data is stored in the tunnel_info structure instead.
    
    And the action size limit is applied to the internal representation,
    not to the action list passed by the user.  So, it's not possible for
    the userpsace application to predict if the certain combination of
    actions will be rejected or not, because it is not possible for it to
    calculate how much space these actions will take in the internal
    representation without knowing kernel internals.
    
    All that is causing random failures in ovs-vswitchd in userspace and
    inability to handle certain traffic patterns as a result.  For example,
    it is reported that adding a bit more than a 1100 VMs in an OpenStack
    setup breaks the network due to OVS not being able to handle ARP
    traffic anymore in some cases (it tries to install a proper datapath
    flow, but the kernel rejects it with -EMSGSIZE, even though the action
    list isn't actually that large.)
    
    Kernel behavior must be consistent and predictable in order for the
    userspace application to use it in a reasonable way.  ovs-vswitchd has
    a mechanism to re-direct parts of the traffic and partially handle it
    in userspace if the required action list is oversized, but that doesn't
    work properly if we can't actually tell if the action list is oversized
    or not.
    
    Solution for this is to check the size of the user-provided actions
    instead of the internal representation.  This commit just removes the
    check from the internal part because there is already an implicit size
    check imposed by the netlink protocol.  The attribute can't be larger
    than 64 KB.  Realistically, we could reduce the limit to 32 KB, but
    we'll be risking to break some existing setups that rely on the fact
    that it's possible to create nearly 64 KB action lists today.
    
    Vast majority of flows in real setups are below 100-ish bytes.  So
    removal of the limit will not change real memory consumption on the
    system.  The absolutely worst case scenario is if someone adds a flow
    with 64 KB of empty clone() actions.  That will yield a 192 KB in the
    internal representation consuming 256 KB block of memory.  However,
    that list of actions is not meaningful and also a no-op.  Real world
    very large action lists (that can occur for a rare cases of BUM
    traffic handling) are unlikely to contain a large number of clones and
    will likely have a lot of tunnel attributes making the internal
    representation comparable in size to the original action list.
    So, it should be fine to just remove the limit.
    
    Commit in the 'Fixes' tag is the first one that introduced the
    difference between internal representation and the user-provided action
    lists, but there were many more afterwards that lead to the situation
    we have today.
    
    Fixes: 7d5437c709de ("openvswitch: Add tunneling interface.")
    Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
    Reviewed-by: Aaron Conole <aconole@redhat.com>
    Link: https://patch.msgid.link/20250308004609.2881861-1-i.maximets@ovn.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: switchdev: Convert blocking notification chain to a raw one [+ + +]
Author: Amit Cohen <amcohen@nvidia.com>
Date:   Wed Mar 5 14:15:09 2025 +0200

    net: switchdev: Convert blocking notification chain to a raw one
    
    [ Upstream commit 62531a1effa87bdab12d5104015af72e60d926ff ]
    
    A blocking notification chain uses a read-write semaphore to protect the
    integrity of the chain. The semaphore is acquired for writing when
    adding / removing notifiers to / from the chain and acquired for reading
    when traversing the chain and informing notifiers about an event.
    
    In case of the blocking switchdev notification chain, recursive
    notifications are possible which leads to the semaphore being acquired
    twice for reading and to lockdep warnings being generated [1].
    
    Specifically, this can happen when the bridge driver processes a
    SWITCHDEV_BRPORT_UNOFFLOADED event which causes it to emit notifications
    about deferred events when calling switchdev_deferred_process().
    
    Fix this by converting the notification chain to a raw notification
    chain in a similar fashion to the netdev notification chain. Protect
    the chain using the RTNL mutex by acquiring it when modifying the chain.
    Events are always informed under the RTNL mutex, but add an assertion in
    call_switchdev_blocking_notifiers() to make sure this is not violated in
    the future.
    
    Maintain the "blocking" prefix as events are always emitted from process
    context and listeners are allowed to block.
    
    [1]:
    WARNING: possible recursive locking detected
    6.14.0-rc4-custom-g079270089484 #1 Not tainted
    --------------------------------------------
    ip/52731 is trying to acquire lock:
    ffffffff850918d8 ((switchdev_blocking_notif_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x58/0xa0
    
    but task is already holding lock:
    ffffffff850918d8 ((switchdev_blocking_notif_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x58/0xa0
    
    other info that might help us debug this:
    Possible unsafe locking scenario:
    CPU0
    ----
    lock((switchdev_blocking_notif_chain).rwsem);
    lock((switchdev_blocking_notif_chain).rwsem);
    
    *** DEADLOCK ***
    May be due to missing lock nesting notation
    3 locks held by ip/52731:
     #0: ffffffff84f795b0 (rtnl_mutex){+.+.}-{4:4}, at: rtnl_newlink+0x727/0x1dc0
     #1: ffffffff8731f628 (&net->rtnl_mutex){+.+.}-{4:4}, at: rtnl_newlink+0x790/0x1dc0
     #2: ffffffff850918d8 ((switchdev_blocking_notif_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x58/0xa0
    
    stack backtrace:
    ...
    ? __pfx_down_read+0x10/0x10
    ? __pfx_mark_lock+0x10/0x10
    ? __pfx_switchdev_port_attr_set_deferred+0x10/0x10
    blocking_notifier_call_chain+0x58/0xa0
    switchdev_port_attr_notify.constprop.0+0xb3/0x1b0
    ? __pfx_switchdev_port_attr_notify.constprop.0+0x10/0x10
    ? mark_held_locks+0x94/0xe0
    ? switchdev_deferred_process+0x11a/0x340
    switchdev_port_attr_set_deferred+0x27/0xd0
    switchdev_deferred_process+0x164/0x340
    br_switchdev_port_unoffload+0xc8/0x100 [bridge]
    br_switchdev_blocking_event+0x29f/0x580 [bridge]
    notifier_call_chain+0xa2/0x440
    blocking_notifier_call_chain+0x6e/0xa0
    switchdev_bridge_port_unoffload+0xde/0x1a0
    ...
    
    Fixes: f7a70d650b0b6 ("net: bridge: switchdev: Ensure deferred event delivery on unoffload")
    Signed-off-by: Amit Cohen <amcohen@nvidia.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Tested-by: Vladimir Oltean <olteanv@gmail.com>
    Link: https://patch.msgid.link/20250305121509.631207-1-amcohen@nvidia.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: wwan: mhi_wwan_mbim: Silence sequence number glitch errors [+ + +]
Author: Stephan Gerhold <stephan.gerhold@linaro.org>
Date:   Wed Feb 12 12:15:35 2025 +0100

    net: wwan: mhi_wwan_mbim: Silence sequence number glitch errors
    
    [ Upstream commit 0d1fac6d26aff5df21bb4ec980d9b7a11c410b96 ]
    
    When using the Qualcomm X55 modem on the ThinkPad X13s, the kernel log is
    constantly being filled with errors related to a "sequence number glitch",
    e.g.:
    
            [ 1903.284538] sequence number glitch prev=16 curr=0
            [ 1913.812205] sequence number glitch prev=50 curr=0
            [ 1923.698219] sequence number glitch prev=142 curr=0
            [ 2029.248276] sequence number glitch prev=1555 curr=0
            [ 2046.333059] sequence number glitch prev=70 curr=0
            [ 2076.520067] sequence number glitch prev=272 curr=0
            [ 2158.704202] sequence number glitch prev=2655 curr=0
            [ 2218.530776] sequence number glitch prev=2349 curr=0
            [ 2225.579092] sequence number glitch prev=6 curr=0
    
    Internet connectivity is working fine, so this error seems harmless. It
    looks like modem does not preserve the sequence number when entering low
    power state; the amount of errors depends on how actively the modem is
    being used.
    
    A similar issue has also been seen on USB-based MBIM modems [1]. However,
    in cdc_ncm.c the "sequence number glitch" message is a debug message
    instead of an error. Apply the same to the mhi_wwan_mbim.c driver to
    silence these errors when using the modem.
    
    [1]: https://lists.freedesktop.org/archives/libmbim-devel/2016-November/000781.html
    
    Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
    Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
    Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Link: https://patch.msgid.link/20250212-mhi-wwan-mbim-sequence-glitch-v1-1-503735977cbd@linaro.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net_sched: Prevent creation of classes with TC_H_ROOT [+ + +]
Author: Cong Wang <xiyou.wangcong@gmail.com>
Date:   Thu Mar 6 15:23:54 2025 -0800

    net_sched: Prevent creation of classes with TC_H_ROOT
    
    [ Upstream commit 0c3057a5a04d07120b3d0ec9c79568fceb9c921e ]
    
    The function qdisc_tree_reduce_backlog() uses TC_H_ROOT as a termination
    condition when traversing up the qdisc tree to update parent backlog
    counters. However, if a class is created with classid TC_H_ROOT, the
    traversal terminates prematurely at this class instead of reaching the
    actual root qdisc, causing parent statistics to be incorrectly maintained.
    In case of DRR, this could lead to a crash as reported by Mingi Cho.
    
    Prevent the creation of any Qdisc class with classid TC_H_ROOT
    (0xFFFFFFFF) across all qdisc types, as suggested by Jamal.
    
    Reported-by: Mingi Cho <mincho@theori.io>
    Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Fixes: 066a3b5b2346 ("[NET_SCHED] sch_api: fix qdisc_tree_decrease_qlen() loop")
    Link: https://patch.msgid.link/20250306232355.93864-2-xiyou.wangcong@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
netfilter: nf_conncount: Fully initialize struct nf_conncount_tuple in insert_tree() [+ + +]
Author: Kohei Enju <enjuk@amazon.com>
Date:   Sun Mar 9 17:07:38 2025 +0900

    netfilter: nf_conncount: Fully initialize struct nf_conncount_tuple in insert_tree()
    
    [ Upstream commit d653bfeb07ebb3499c403404c21ac58a16531607 ]
    
    Since commit b36e4523d4d5 ("netfilter: nf_conncount: fix garbage
    collection confirm race"), `cpu` and `jiffies32` were introduced to
    the struct nf_conncount_tuple.
    
    The commit made nf_conncount_add() initialize `conn->cpu` and
    `conn->jiffies32` when allocating the struct.
    In contrast, count_tree() was not changed to initialize them.
    
    By commit 34848d5c896e ("netfilter: nf_conncount: Split insert and
    traversal"), count_tree() was split and the relevant allocation
    code now resides in insert_tree().
    Initialize `conn->cpu` and `conn->jiffies32` in insert_tree().
    
    BUG: KMSAN: uninit-value in find_or_evict net/netfilter/nf_conncount.c:117 [inline]
    BUG: KMSAN: uninit-value in __nf_conncount_add+0xd9c/0x2850 net/netfilter/nf_conncount.c:143
     find_or_evict net/netfilter/nf_conncount.c:117 [inline]
     __nf_conncount_add+0xd9c/0x2850 net/netfilter/nf_conncount.c:143
     count_tree net/netfilter/nf_conncount.c:438 [inline]
     nf_conncount_count+0x82f/0x1e80 net/netfilter/nf_conncount.c:521
     connlimit_mt+0x7f6/0xbd0 net/netfilter/xt_connlimit.c:72
     __nft_match_eval net/netfilter/nft_compat.c:403 [inline]
     nft_match_eval+0x1a5/0x300 net/netfilter/nft_compat.c:433
     expr_call_ops_eval net/netfilter/nf_tables_core.c:240 [inline]
     nft_do_chain+0x426/0x2290 net/netfilter/nf_tables_core.c:288
     nft_do_chain_ipv4+0x1a5/0x230 net/netfilter/nft_chain_filter.c:23
     nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline]
     nf_hook_slow+0xf4/0x400 net/netfilter/core.c:626
     nf_hook_slow_list+0x24d/0x860 net/netfilter/core.c:663
     NF_HOOK_LIST include/linux/netfilter.h:350 [inline]
     ip_sublist_rcv+0x17b7/0x17f0 net/ipv4/ip_input.c:633
     ip_list_rcv+0x9ef/0xa40 net/ipv4/ip_input.c:669
     __netif_receive_skb_list_ptype net/core/dev.c:5936 [inline]
     __netif_receive_skb_list_core+0x15c5/0x1670 net/core/dev.c:5983
     __netif_receive_skb_list net/core/dev.c:6035 [inline]
     netif_receive_skb_list_internal+0x1085/0x1700 net/core/dev.c:6126
     netif_receive_skb_list+0x5a/0x460 net/core/dev.c:6178
     xdp_recv_frames net/bpf/test_run.c:280 [inline]
     xdp_test_run_batch net/bpf/test_run.c:361 [inline]
     bpf_test_run_xdp_live+0x2e86/0x3480 net/bpf/test_run.c:390
     bpf_prog_test_run_xdp+0xf1d/0x1ae0 net/bpf/test_run.c:1316
     bpf_prog_test_run+0x5e5/0xa30 kernel/bpf/syscall.c:4407
     __sys_bpf+0x6aa/0xd90 kernel/bpf/syscall.c:5813
     __do_sys_bpf kernel/bpf/syscall.c:5902 [inline]
     __se_sys_bpf kernel/bpf/syscall.c:5900 [inline]
     __ia32_sys_bpf+0xa0/0xe0 kernel/bpf/syscall.c:5900
     ia32_sys_call+0x394d/0x4180 arch/x86/include/generated/asm/syscalls_32.h:358
     do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
     __do_fast_syscall_32+0xb0/0x110 arch/x86/entry/common.c:387
     do_fast_syscall_32+0x38/0x80 arch/x86/entry/common.c:412
     do_SYSENTER_32+0x1f/0x30 arch/x86/entry/common.c:450
     entry_SYSENTER_compat_after_hwframe+0x84/0x8e
    
    Uninit was created at:
     slab_post_alloc_hook mm/slub.c:4121 [inline]
     slab_alloc_node mm/slub.c:4164 [inline]
     kmem_cache_alloc_noprof+0x915/0xe10 mm/slub.c:4171
     insert_tree net/netfilter/nf_conncount.c:372 [inline]
     count_tree net/netfilter/nf_conncount.c:450 [inline]
     nf_conncount_count+0x1415/0x1e80 net/netfilter/nf_conncount.c:521
     connlimit_mt+0x7f6/0xbd0 net/netfilter/xt_connlimit.c:72
     __nft_match_eval net/netfilter/nft_compat.c:403 [inline]
     nft_match_eval+0x1a5/0x300 net/netfilter/nft_compat.c:433
     expr_call_ops_eval net/netfilter/nf_tables_core.c:240 [inline]
     nft_do_chain+0x426/0x2290 net/netfilter/nf_tables_core.c:288
     nft_do_chain_ipv4+0x1a5/0x230 net/netfilter/nft_chain_filter.c:23
     nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline]
     nf_hook_slow+0xf4/0x400 net/netfilter/core.c:626
     nf_hook_slow_list+0x24d/0x860 net/netfilter/core.c:663
     NF_HOOK_LIST include/linux/netfilter.h:350 [inline]
     ip_sublist_rcv+0x17b7/0x17f0 net/ipv4/ip_input.c:633
     ip_list_rcv+0x9ef/0xa40 net/ipv4/ip_input.c:669
     __netif_receive_skb_list_ptype net/core/dev.c:5936 [inline]
     __netif_receive_skb_list_core+0x15c5/0x1670 net/core/dev.c:5983
     __netif_receive_skb_list net/core/dev.c:6035 [inline]
     netif_receive_skb_list_internal+0x1085/0x1700 net/core/dev.c:6126
     netif_receive_skb_list+0x5a/0x460 net/core/dev.c:6178
     xdp_recv_frames net/bpf/test_run.c:280 [inline]
     xdp_test_run_batch net/bpf/test_run.c:361 [inline]
     bpf_test_run_xdp_live+0x2e86/0x3480 net/bpf/test_run.c:390
     bpf_prog_test_run_xdp+0xf1d/0x1ae0 net/bpf/test_run.c:1316
     bpf_prog_test_run+0x5e5/0xa30 kernel/bpf/syscall.c:4407
     __sys_bpf+0x6aa/0xd90 kernel/bpf/syscall.c:5813
     __do_sys_bpf kernel/bpf/syscall.c:5902 [inline]
     __se_sys_bpf kernel/bpf/syscall.c:5900 [inline]
     __ia32_sys_bpf+0xa0/0xe0 kernel/bpf/syscall.c:5900
     ia32_sys_call+0x394d/0x4180 arch/x86/include/generated/asm/syscalls_32.h:358
     do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
     __do_fast_syscall_32+0xb0/0x110 arch/x86/entry/common.c:387
     do_fast_syscall_32+0x38/0x80 arch/x86/entry/common.c:412
     do_SYSENTER_32+0x1f/0x30 arch/x86/entry/common.c:450
     entry_SYSENTER_compat_after_hwframe+0x84/0x8e
    
    Reported-by: syzbot+83fed965338b573115f7@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=83fed965338b573115f7
    Fixes: b36e4523d4d5 ("netfilter: nf_conncount: fix garbage collection confirm race")
    Signed-off-by: Kohei Enju <enjuk@amazon.com>
    Reviewed-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nf_conncount: garbage collection is not skipped when jiffies wrap around [+ + +]
Author: Nicklas Bo Jensen <njensen@akamai.com>
Date:   Thu Feb 27 13:32:34 2025 +0000

    netfilter: nf_conncount: garbage collection is not skipped when jiffies wrap around
    
    [ Upstream commit df08c94baafb001de6cf44bb7098bb557f36c335 ]
    
    nf_conncount is supposed to skip garbage collection if it has already
    run garbage collection in the same jiffy. Unfortunately, this is broken
    when jiffies wrap around which this patch fixes.
    
    The problem is that last_gc in the nf_conncount_list struct is an u32,
    but jiffies is an unsigned long which is 8 bytes on my systems. When
    those two are compared it only works until last_gc wraps around.
    
    See bug report: https://bugzilla.netfilter.org/show_bug.cgi?id=1778
    for more details.
    
    Fixes: d265929930e2 ("netfilter: nf_conncount: reduce unnecessary GC")
    Signed-off-by: Nicklas Bo Jensen <njensen@akamai.com>
    Reviewed-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nft_counter: Use u64_stats_t for statistic. [+ + +]
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Tue Aug 20 09:54:32 2024 +0200

    netfilter: nft_counter: Use u64_stats_t for statistic.
    
    commit 4a1d3acd6ea86075e77fcc1188c3fc372833ba73 upstream.
    
    The nft_counter uses two s64 counters for statistics. Those two are
    protected by a seqcount to ensure that the 64bit variable is always
    properly seen during updates even on 32bit architectures where the store
    is performed by two writes. A side effect is that the two counter (bytes
    and packet) are written and read together in the same window.
    
    This can be replaced with u64_stats_t. write_seqcount_begin()/ end() is
    replaced with u64_stats_update_begin()/ end() and behaves the same way
    as with seqcount_t on 32bit architectures. Additionally there is a
    preempt_disable on PREEMPT_RT to ensure that a reader does not preempt a
    writer.
    On 64bit architectures the macros are removed and the reads happen
    without any retries. This also means that the reader can observe one
    counter (bytes) from before the update and the other counter (packets)
    but that is okay since there is no requirement to have both counter from
    the same update window.
    
    Convert the statistic to u64_stats_t. There is one optimisation:
    nft_counter_do_init() and nft_counter_clone() allocate a new per-CPU
    counter and assign a value to it. During this assignment preemption is
    disabled which is not needed because the counter is not yet exposed to
    the system so there can not be another writer or reader. Therefore
    disabling preemption is omitted and raw_cpu_ptr() is used to obtain a
    pointer to a counter for the assignment.
    
    Cc: Eric Dumazet <edumazet@google.com>
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

netfilter: nft_ct: Use __refcount_inc() for per-CPU nft_ct_pcpu_template. [+ + +]
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:   Mon Feb 17 17:02:42 2025 +0100

    netfilter: nft_ct: Use __refcount_inc() for per-CPU nft_ct_pcpu_template.
    
    [ Upstream commit 5cfe5612ca9590db69b9be29dc83041dbf001108 ]
    
    nft_ct_pcpu_template is a per-CPU variable and relies on disabled BH for its
    locking. The refcounter is read and if its value is set to one then the
    refcounter is incremented and variable is used - otherwise it is already
    in use and left untouched.
    
    Without per-CPU locking in local_bh_disable() on PREEMPT_RT the
    read-then-increment operation is not atomic and therefore racy.
    
    This can be avoided by using unconditionally __refcount_inc() which will
    increment counter and return the old value as an atomic operation.
    In case the returned counter is not one, the variable is in use and we
    need to decrement counter. Otherwise we can use it.
    
    Use __refcount_inc() instead of read and a conditional increment.
    
    Fixes: edee4f1e9245 ("netfilter: nft_ct: add zone id set support")
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Reviewed-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nft_exthdr: fix offset with ipv4_find_option() [+ + +]
Author: Alexey Kashavkin <akashavkin@gmail.com>
Date:   Sun Mar 2 00:14:36 2025 +0300

    netfilter: nft_exthdr: fix offset with ipv4_find_option()
    
    [ Upstream commit 6edd78af9506bb182518da7f6feebd75655d9a0e ]
    
    There is an incorrect calculation in the offset variable which causes
    the nft_skb_copy_to_reg() function to always return -EFAULT. Adding the
    start variable is redundant. In the __ip_options_compile() function the
    correct offset is specified when finding the function. There is no need
    to add the size of the iphdr structure to the offset.
    
    Fixes: dbb5281a1f84 ("netfilter: nf_tables: add support for matching IPv4 options")
    Signed-off-by: Alexey Kashavkin <akashavkin@gmail.com>
    Reviewed-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
netpoll: hold rcu read lock in __netpoll_send_skb() [+ + +]
Author: Breno Leitao <leitao@debian.org>
Date:   Thu Mar 6 05:16:18 2025 -0800

    netpoll: hold rcu read lock in __netpoll_send_skb()
    
    [ Upstream commit 505ead7ab77f289f12d8a68ac83da068e4d4408b ]
    
    The function __netpoll_send_skb() is being invoked without holding the
    RCU read lock. This oversight triggers a warning message when
    CONFIG_PROVE_RCU_LIST is enabled:
    
            net/core/netpoll.c:330 suspicious rcu_dereference_check() usage!
    
             netpoll_send_skb
             netpoll_send_udp
             write_ext_msg
             console_flush_all
             console_unlock
             vprintk_emit
    
    To prevent npinfo from disappearing unexpectedly, ensure that
    __netpoll_send_skb() is protected with the RCU read lock.
    
    Fixes: 2899656b494dcd1 ("netpoll: take rcu_read_lock_bh() in netpoll_send_skb_on_dev()")
    Signed-off-by: Breno Leitao <leitao@debian.org>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20250306-netpoll_rcu_v2-v2-1-bc4f5c51742a@debian.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
nvme-fc: go straight to connecting state when initializing [+ + +]
Author: Daniel Wagner <wagi@kernel.org>
Date:   Thu Jan 9 14:30:47 2025 +0100

    nvme-fc: go straight to connecting state when initializing
    
    [ Upstream commit d3d380eded7ee5fc2fc53b3b0e72365ded025c4a ]
    
    The initial controller initialization mimiks the reconnect loop
    behavior by switching from NEW to RESETTING and then to CONNECTING.
    
    The transition from NEW to CONNECTING is a valid transition, so there is
    no point entering the RESETTING state. TCP and RDMA also transition
    directly to CONNECTING state.
    
    Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
    Reviewed-by: Hannes Reinecke <hare@suse.de>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Daniel Wagner <wagi@kernel.org>
    Signed-off-by: Keith Busch <kbusch@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
nvme-pci: quirk Acer FA100 for non-uniqueue identifiers [+ + +]
Author: Christopher Lentocha <christopherericlentocha@gmail.com>
Date:   Tue Feb 18 08:59:29 2025 -0500

    nvme-pci: quirk Acer FA100 for non-uniqueue identifiers
    
    [ Upstream commit fcd875445866a5219cf2be3101e276b21fc843f3 ]
    
    In order for two Acer FA100 SSDs to work in one PC (in the case of
    myself, a Lenovo Legion T5 28IMB05), and not show one drive and not
    the other, and sometimes mix up what drive shows up (randomly), these
    two lines of code need to be added, and then both of the SSDs will
    show up and not conflict when booting off of one of them. If you boot
    up your computer with both SSDs installed without this patch, you may
    also randomly get into a kernel panic (if the initrd is not set up) or
    stuck in the initrd "/init" process, it is set up, however, if you do
    apply this patch, there should not be problems with booting or seeing
    both contents of the drive. Tested with the btrfs filesystem with a
    RAID configuration of having the root drive '/' combined to make two
    256GB Acer FA100 SSDs become 512GB in total storage.
    
    Kernel Logs with patch applied (`dmesg -t | grep -i nvm`):
    
    ```
    ...
    nvme 0000:04:00.0: platform quirk: setting simple suspend
    nvme nvme0: pci function 0000:04:00.0
    nvme 0000:05:00.0: platform quirk: setting simple suspend
    nvme nvme1: pci function 0000:05:00.0
    nvme nvme1: missing or invalid SUBNQN field.
    nvme nvme1: allocated 64 MiB host memory buffer.
    nvme nvme0: missing or invalid SUBNQN field.
    nvme nvme0: allocated 64 MiB host memory buffer.
    nvme nvme1: 8/0/0 default/read/poll queues
    nvme nvme1: Ignoring bogus Namespace Identifiers
    nvme nvme0: 8/0/0 default/read/poll queues
    nvme nvme0: Ignoring bogus Namespace Identifiers
    nvme0n1: p1 p2
    ...
    ```
    
    Kernel Logs with patch not applied (`dmesg -t | grep -i nvm`):
    
    ```
    ...
    nvme 0000:04:00.0: platform quirk: setting simple suspend
    nvme nvme0: pci function 0000:04:00.0
    nvme 0000:05:00.0: platform quirk: setting simple suspend
    nvme nvme1: pci function 0000:05:00.0
    nvme nvme0: missing or invalid SUBNQN field.
    nvme nvme1: missing or invalid SUBNQN field.
    nvme nvme0: allocated 64 MiB host memory buffer.
    nvme nvme1: allocated 64 MiB host memory buffer.
    nvme nvme0: 8/0/0 default/read/poll queues
    nvme nvme1: 8/0/0 default/read/poll queues
    nvme nvme1: globally duplicate IDs for nsid 1
    nvme nvme1: VID:DID 1dbe:5216 model:Acer SSD FA100 256GB firmware:1.Z.J.2X
    nvme0n1: p1 p2
    ...
    ```
    
    Signed-off-by: Christopher Lentocha <christopherericlentocha@gmail.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Keith Busch <kbusch@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
nvme-tcp: add basic support for the C2HTermReq PDU [+ + +]
Author: Maurizio Lombardi <mlombard@redhat.com>
Date:   Mon Feb 17 17:08:27 2025 +0100

    nvme-tcp: add basic support for the C2HTermReq PDU
    
    [ Upstream commit 84e009042d0f3dfe91bec60bcd208ee3f866cbcd ]
    
    Previously, the NVMe/TCP host driver did not handle the C2HTermReq PDU,
    instead printing "unsupported pdu type (3)" when received. This patch adds
    support for processing the C2HTermReq PDU, allowing the driver
    to print the Fatal Error Status field.
    
    Example of output:
    nvme nvme4: Received C2HTermReq (FES = Invalid PDU Header Field)
    
    Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
    Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
    Signed-off-by: Keith Busch <kbusch@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

nvme-tcp: Fix a C2HTermReq error message [+ + +]
Author: Maurizio Lombardi <mlombard@redhat.com>
Date:   Mon Feb 24 15:40:58 2025 +0100

    nvme-tcp: Fix a C2HTermReq error message
    
    commit afb41b08c44e5386f2f52fa859010ac4afd2b66f upstream.
    
    In H2CTermReq, a FES with value 0x05 means "R2T Limit Exceeded"; but
    in C2HTermReq the same value has a different meaning (Data Transfer Limit
    Exceeded).
    
    Fixes: 84e009042d0f ("nvme-tcp: add basic support for the C2HTermReq PDU")
    Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
    Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
    Signed-off-by: Keith Busch <kbusch@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
nvme: only allow entering LIVE from CONNECTING state [+ + +]
Author: Daniel Wagner <wagi@kernel.org>
Date:   Fri Feb 14 09:02:03 2025 +0100

    nvme: only allow entering LIVE from CONNECTING state
    
    [ Upstream commit d2fe192348f93fe3a0cb1e33e4aba58e646397f4 ]
    
    The fabric transports and also the PCI transport are not entering the
    LIVE state from NEW or RESETTING. This makes the state machine more
    restrictive and allows to catch not supported state transitions, e.g.
    directly switching from RESETTING to LIVE.
    
    Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
    Signed-off-by: Daniel Wagner <wagi@kernel.org>
    Signed-off-by: Keith Busch <kbusch@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
nvmet-rdma: recheck queue state is LIVE in state lock in recv done [+ + +]
Author: Ruozhu Li <david.li@jaguarmicro.com>
Date:   Sun Feb 16 20:49:56 2025 +0800

    nvmet-rdma: recheck queue state is LIVE in state lock in recv done
    
    [ Upstream commit 3988ac1c67e6e84d2feb987d7b36d5791174b3da ]
    
    The queue state checking in nvmet_rdma_recv_done is not in queue state
    lock.Queue state can transfer to LIVE in cm establish handler between
    state checking and state lock here, cause a silent drop of nvme connect
    cmd.
    Recheck queue state whether in LIVE state in state lock to prevent this
    issue.
    
    Signed-off-by: Ruozhu Li <david.li@jaguarmicro.com>
    Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
    Signed-off-by: Keith Busch <kbusch@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
perf/x86/intel: Use better start period for frequency mode [+ + +]
Author: Kan Liang <kan.liang@linux.intel.com>
Date:   Fri Jan 17 07:19:13 2025 -0800

    perf/x86/intel: Use better start period for frequency mode
    
    [ Upstream commit a26b24b2e21f6222635a95426b9ef9eec63d69b1 ]
    
    Freqency mode is the current default mode of Linux perf. A period of 1 is
    used as a starting period. The period is auto-adjusted on each tick or an
    overflow, to meet the frequency target.
    
    The start period of 1 is too low and may trigger some issues:
    
    - Many HWs do not support period 1 well.
      https://lore.kernel.org/lkml/875xs2oh69.ffs@tglx/
    
    - For an event that occurs frequently, period 1 is too far away from the
      real period. Lots of samples are generated at the beginning.
      The distribution of samples may not be even.
    
    - A low starting period for frequently occurring events also challenges
      virtualization, which has a longer path to handle a PMI.
    
    The limit_period value only checks the minimum acceptable value for HW.
    It cannot be used to set the start period, because some events may
    need a very low period. The limit_period cannot be set too high. It
    doesn't help with the events that occur frequently.
    
    It's hard to find a universal starting period for all events. The idea
    implemented by this patch is to only give an estimate for the popular
    HW and HW cache events. For the rest of the events, start from the lowest
    possible recommended value.
    
    Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: https://lore.kernel.org/r/20250117151913.3043942-3-kan.liang@linux.intel.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
pinctrl: bcm281xx: Fix incorrect regmap max_registers value [+ + +]
Author: Artur Weber <aweber.kernel@gmail.com>
Date:   Fri Feb 7 21:02:41 2025 +0100

    pinctrl: bcm281xx: Fix incorrect regmap max_registers value
    
    [ Upstream commit 68283c1cb573143c0b7515e93206f3503616bc10 ]
    
    The max_registers value does not take into consideration the stride;
    currently, it's set to the number of the last pin, but this does not
    accurately represent the final register.
    
    Fix this by multiplying the current value by 4.
    
    Fixes: 54b1aa5a5b16 ("ARM: pinctrl: Add Broadcom Capri pinctrl driver")
    Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
    Link: https://lore.kernel.org/20250207-bcm21664-pinctrl-v1-2-e7cfac9b2d3b@gmail.com
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
platform/x86: thinkpad_acpi: Fix invalid fan speed on ThinkPad X120e [+ + +]
Author: Sybil Isabel Dorsett <sybdorsett@proton.me>
Date:   Mon Feb 3 16:33:15 2025 +0000

    platform/x86: thinkpad_acpi: Fix invalid fan speed on ThinkPad X120e
    
    [ Upstream commit 1046cac109225eda0973b898e053aeb3d6c10e1d ]
    
    On ThinkPad X120e, fan speed is reported in ticks per revolution
    rather than RPM.
    
    Recalculate the fan speed value reported for ThinkPad X120e
    to RPM based on a 22.5 kHz clock.
    
    Based on the information on
    https://www.thinkwiki.org/wiki/How_to_control_fan_speed,
    the same problem is highly likely to be relevant to at least Edge11,
    but Edge11 is not addressed in this patch.
    
    Signed-off-by: Sybil Isabel Dorsett <sybdorsett@proton.me>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://lore.kernel.org/r/20250203163255.5525-1-sybdorsett@proton.me
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

platform/x86: thinkpad_acpi: Support for V9 DYTC platform profiles [+ + +]
Author: Mark Pearson <mpearson-lenovo@squebb.ca>
Date:   Thu Feb 6 14:39:41 2025 -0500

    platform/x86: thinkpad_acpi: Support for V9 DYTC platform profiles
    
    [ Upstream commit 9cff907cbf8c7fb5345918dbcc7b74a01656f34f ]
    
    Newer Thinkpad AMD platforms are using V9 DYTC and this changes the
    profiles used for PSC mode. Add support for this update.
    Tested on P14s G5 AMD
    
    Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
    Link: https://lore.kernel.org/r/20250206193953.58365-1-mpearson-lenovo@squebb.ca
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
powercap: call put_device() on an error path in powercap_register_control_type() [+ + +]
Author: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Date:   Fri Jan 10 10:05:54 2025 +0900

    powercap: call put_device() on an error path in powercap_register_control_type()
    
    [ Upstream commit 93c66fbc280747ea700bd6199633d661e3c819b3 ]
    
    powercap_register_control_type() calls device_register(), but does not
    release the refcount of the device when it fails.
    
    Call put_device() before returning an error to balance the refcount.
    
    Since the kfree(control_type) will be done by powercap_release(), remove
    the lines in powercap_register_control_type() before returning the error.
    
    This bug was found by an experimental verifier that I am developing.
    
    Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
    Link: https://patch.msgid.link/20250110010554.1583411-1-joe@pf.is.s.u-tokyo.ac.jp
    [ rjw: Changelog edits ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
proc: fix UAF in proc_get_inode() [+ + +]
Author: Ye Bin <yebin10@huawei.com>
Date:   Sat Mar 1 15:06:24 2025 +0300

    proc: fix UAF in proc_get_inode()
    
    commit 654b33ada4ab5e926cd9c570196fefa7bec7c1df upstream.
    
    Fix race between rmmod and /proc/XXX's inode instantiation.
    
    The bug is that pde->proc_ops don't belong to /proc, it belongs to a
    module, therefore dereferencing it after /proc entry has been registered
    is a bug unless use_pde/unuse_pde() pair has been used.
    
    use_pde/unuse_pde can be avoided (2 atomic ops!) because pde->proc_ops
    never changes so information necessary for inode instantiation can be
    saved _before_ proc_register() in PDE itself and used later, avoiding
    pde->proc_ops->...  dereference.
    
          rmmod                         lookup
    sys_delete_module
                             proc_lookup_de
                               pde_get(de);
                               proc_get_inode(dir->i_sb, de);
      mod->exit()
        proc_remove
          remove_proc_subtree
           proc_entry_rundown(de);
      free_module(mod);
    
                                   if (S_ISREG(inode->i_mode))
                                     if (de->proc_ops->proc_read_iter)
                               --> As module is already freed, will trigger UAF
    
    BUG: unable to handle page fault for address: fffffbfff80a702b
    PGD 817fc4067 P4D 817fc4067 PUD 817fc0067 PMD 102ef4067 PTE 0
    Oops: Oops: 0000 [#1] PREEMPT SMP KASAN PTI
    CPU: 26 UID: 0 PID: 2667 Comm: ls Tainted: G
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
    RIP: 0010:proc_get_inode+0x302/0x6e0
    RSP: 0018:ffff88811c837998 EFLAGS: 00010a06
    RAX: dffffc0000000000 RBX: ffffffffc0538140 RCX: 0000000000000007
    RDX: 1ffffffff80a702b RSI: 0000000000000001 RDI: ffffffffc0538158
    RBP: ffff8881299a6000 R08: 0000000067bbe1e5 R09: 1ffff11023906f20
    R10: ffffffffb560ca07 R11: ffffffffb2b43a58 R12: ffff888105bb78f0
    R13: ffff888100518048 R14: ffff8881299a6004 R15: 0000000000000001
    FS:  00007f95b9686840(0000) GS:ffff8883af100000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: fffffbfff80a702b CR3: 0000000117dd2000 CR4: 00000000000006f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
     <TASK>
     proc_lookup_de+0x11f/0x2e0
     __lookup_slow+0x188/0x350
     walk_component+0x2ab/0x4f0
     path_lookupat+0x120/0x660
     filename_lookup+0x1ce/0x560
     vfs_statx+0xac/0x150
     __do_sys_newstat+0x96/0x110
     do_syscall_64+0x5f/0x170
     entry_SYSCALL_64_after_hwframe+0x76/0x7e
    
    [adobriyan@gmail.com: don't do 2 atomic ops on the common path]
    Link: https://lkml.kernel.org/r/3d25ded0-1739-447e-812b-e34da7990dcf@p183
    Fixes: 778f3dd5a13c ("Fix procfs compat_ioctl regression")
    Signed-off-by: Ye Bin <yebin10@huawei.com>
    Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: David S. Miller <davem@davemloft.net>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
qlcnic: fix memory leak issues in qlcnic_sriov_common.c [+ + +]
Author: Haoxiang Li <haoxiang_li2024@163.com>
Date:   Fri Mar 7 17:49:52 2025 +0800

    qlcnic: fix memory leak issues in qlcnic_sriov_common.c
    
    commit d2b9d97e89c79c95f8b517e4fa43fd100f936acc upstream.
    
    Add qlcnic_sriov_free_vlans() in qlcnic_sriov_alloc_vlans() if
    any sriov_vlans fails to be allocated.
    Add qlcnic_sriov_free_vlans() to free the memory allocated by
    qlcnic_sriov_alloc_vlans() if "sriov->allowed_vlans" fails to
    be allocated.
    
    Fixes: 91b7282b613d ("qlcnic: Support VLAN id config.")
    Cc: stable@vger.kernel.org
    Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
    Link: https://patch.msgid.link/20250307094952.14874-1-haoxiang_li2024@163.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
RDMA/bnxt_re: Add missing paranthesis in map_qp_id_to_tbl_indx [+ + +]
Author: Kashyap Desai <kashyap.desai@broadcom.com>
Date:   Mon Mar 3 08:59:37 2025 -0800

    RDMA/bnxt_re: Add missing paranthesis in map_qp_id_to_tbl_indx
    
    [ Upstream commit 67ee8d496511ad8e1cb88f72944847e7b3e4e47c ]
    
    The modulo operation returns wrong result without the
    paranthesis and that resulted in wrong QP table indexing.
    
    Fixes: 84cf229f4001 ("RDMA/bnxt_re: Fix the qp table indexing")
    Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
    Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
    Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
    Link: https://patch.msgid.link/1741021178-2569-3-git-send-email-selvin.xavier@broadcom.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

RDMA/bnxt_re: Avoid clearing VLAN_ID mask in modify qp path [+ + +]
Author: Saravanan Vajravel <saravanan.vajravel@broadcom.com>
Date:   Mon Mar 10 22:16:36 2025 -0700

    RDMA/bnxt_re: Avoid clearing VLAN_ID mask in modify qp path
    
    [ Upstream commit 81c0db302a674f8004ed805393d17fd76f552e83 ]
    
    Driver is always clearing the mask that sets the VLAN ID/Service Level
    in the adapter. Recent change for supporting multiple traffic class
    exposed this issue.
    
    Allow setting SL and VLAN_ID while QP is moved from INIT to RTR state.
    
    Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
    Fixes: c64b16a37b6d ("RDMA/bnxt_re: Support different traffic class")
    Signed-off-by: Saravanan Vajravel <saravanan.vajravel@broadcom.com>
    Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
    Link: https://patch.msgid.link/1741670196-2919-1-git-send-email-selvin.xavier@broadcom.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
RDMA/hns: Fix a missing rollback in error path of hns_roce_create_qp_common() [+ + +]
Author: Junxian Huang <huangjunxian6@hisilicon.com>
Date:   Tue Mar 11 16:48:55 2025 +0800

    RDMA/hns: Fix a missing rollback in error path of hns_roce_create_qp_common()
    
    [ Upstream commit 444907dd45cbe62fd69398805b6e2c626fab5b3a ]
    
    When ib_copy_to_udata() fails in hns_roce_create_qp_common(),
    hns_roce_qp_remove() should be called in the error path to
    clean up resources in hns_roce_qp_store().
    
    Fixes: 0f00571f9433 ("RDMA/hns: Use new SQ doorbell register for HIP09")
    Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
    Link: https://patch.msgid.link/20250311084857.3803665-6-huangjunxian6@hisilicon.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

RDMA/hns: Fix soft lockup during bt pages loop [+ + +]
Author: Junxian Huang <huangjunxian6@hisilicon.com>
Date:   Tue Mar 11 16:48:52 2025 +0800

    RDMA/hns: Fix soft lockup during bt pages loop
    
    [ Upstream commit 25655580136de59ec89f09089dd28008ea440fc9 ]
    
    Driver runs a for-loop when allocating bt pages and mapping them with
    buffer pages. When a large buffer (e.g. MR over 100GB) is being allocated,
    it may require a considerable loop count. This will lead to soft lockup:
    
            watchdog: BUG: soft lockup - CPU#27 stuck for 22s!
            ...
            Call trace:
             hem_list_alloc_mid_bt+0x124/0x394 [hns_roce_hw_v2]
             hns_roce_hem_list_request+0xf8/0x160 [hns_roce_hw_v2]
             hns_roce_mtr_create+0x2e4/0x360 [hns_roce_hw_v2]
             alloc_mr_pbl+0xd4/0x17c [hns_roce_hw_v2]
             hns_roce_reg_user_mr+0xf8/0x190 [hns_roce_hw_v2]
             ib_uverbs_reg_mr+0x118/0x290
    
            watchdog: BUG: soft lockup - CPU#35 stuck for 23s!
            ...
            Call trace:
             hns_roce_hem_list_find_mtt+0x7c/0xb0 [hns_roce_hw_v2]
             mtr_map_bufs+0xc4/0x204 [hns_roce_hw_v2]
             hns_roce_mtr_create+0x31c/0x3c4 [hns_roce_hw_v2]
             alloc_mr_pbl+0xb0/0x160 [hns_roce_hw_v2]
             hns_roce_reg_user_mr+0x108/0x1c0 [hns_roce_hw_v2]
             ib_uverbs_reg_mr+0x120/0x2bc
    
    Add a cond_resched() to fix soft lockup during these loops. In order not
    to affect the allocation performance of normal-size buffer, set the loop
    count of a 100GB MR as the threshold to call cond_resched().
    
    Fixes: 38389eaa4db1 ("RDMA/hns: Add mtr support for mixed multihop addressing")
    Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
    Link: https://patch.msgid.link/20250311084857.3803665-3-huangjunxian6@hisilicon.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

RDMA/hns: Fix unmatched condition in error path of alloc_user_qp_db() [+ + +]
Author: Junxian Huang <huangjunxian6@hisilicon.com>
Date:   Tue Mar 11 16:48:53 2025 +0800

    RDMA/hns: Fix unmatched condition in error path of alloc_user_qp_db()
    
    [ Upstream commit b9f59a24ba35a7d955a9f8e148dd9f85b7b40a01 ]
    
    Currently the condition of unmapping sdb in error path is not exactly
    the same as the condition of mapping in alloc_user_qp_db(). This may
    cause a problem of unmapping an unmapped db in some case, such as
    when the QP is XRC TGT. Unified the two conditions.
    
    Fixes: 90ae0b57e4a5 ("RDMA/hns: Combine enable flags of qp")
    Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
    Link: https://patch.msgid.link/20250311084857.3803665-4-huangjunxian6@hisilicon.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

RDMA/hns: Fix wrong value of max_sge_rd [+ + +]
Author: Junxian Huang <huangjunxian6@hisilicon.com>
Date:   Tue Mar 11 16:48:57 2025 +0800

    RDMA/hns: Fix wrong value of max_sge_rd
    
    [ Upstream commit 6b5e41a8b51fce520bb09bd651a29ef495e990de ]
    
    There is no difference between the sge of READ and non-READ
    operations in hns RoCE. Set max_sge_rd to the same value as
    max_send_sge.
    
    Fixes: 9a4435375cd1 ("IB/hns: Add driver files for hns RoCE driver")
    Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
    Link: https://patch.msgid.link/20250311084857.3803665-8-huangjunxian6@hisilicon.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
regulator: check that dummy regulator has been probed before using it [+ + +]
Author: Christian Eggers <ceggers@arri.de>
Date:   Thu Mar 13 11:27:39 2025 +0100

    regulator: check that dummy regulator has been probed before using it
    
    commit 2c7a50bec4958f1d1c84d19cde518d0e96a676fd upstream.
    
    Due to asynchronous driver probing there is a chance that the dummy
    regulator hasn't already been probed when first accessing it.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Christian Eggers <ceggers@arri.de>
    Link: https://patch.msgid.link/20250313103051.32430-3-ceggers@arri.de
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Revert "Bluetooth: hci_core: Fix sleeping function called from invalid context" [+ + +]
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date:   Tue Mar 4 10:06:10 2025 -0500

    Revert "Bluetooth: hci_core: Fix sleeping function called from invalid context"
    
    [ Upstream commit ab6ab707a4d060a51c45fc13e3b2228d5f7c0b87 ]
    
    This reverts commit 4d94f05558271654670d18c26c912da0c1c15549 which has
    problems (see [1]) and is no longer needed since 581dd2dc168f
    ("Bluetooth: hci_event: Fix using rcu_read_(un)lock while iterating")
    has reworked the code where the original bug has been found.
    
    [1] Link: https://lore.kernel.org/linux-bluetooth/877c55ci1r.wl-tiwai@suse.de/T/#t
    Fixes: 4d94f0555827 ("Bluetooth: hci_core: Fix sleeping function called from invalid context")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Revert "gre: Fix IPv6 link-local address generation." [+ + +]
Author: Guillaume Nault <gnault@redhat.com>
Date:   Wed Mar 19 22:26:50 2025 +0100

    Revert "gre: Fix IPv6 link-local address generation."
    
    [ Upstream commit fc486c2d060f67d672ddad81724f7c8a4d329570 ]
    
    This reverts commit 183185a18ff96751db52a46ccf93fff3a1f42815.
    
    This patch broke net/forwarding/ip6gre_custom_multipath_hash.sh in some
    circumstances (https://lore.kernel.org/netdev/Z9RIyKZDNoka53EO@mini-arch/).
    Let's revert it while the problem is being investigated.
    
    Fixes: 183185a18ff9 ("gre: Fix IPv6 link-local address generation.")
    Signed-off-by: Guillaume Nault <gnault@redhat.com>
    Link: https://patch.msgid.link/8b1ce738eb15dd841aab9ef888640cab4f6ccfea.1742418408.git.gnault@redhat.com
    Acked-by: Stanislav Fomichev <sdf@fomichev.me>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
rust: Disallow BTF generation with Rust + LTO [+ + +]
Author: Matthew Maurer <mmaurer@google.com>
Date:   Wed Jan 8 23:35:08 2025 +0000

    rust: Disallow BTF generation with Rust + LTO
    
    commit 5daa0c35a1f0e7a6c3b8ba9cb721e7d1ace6e619 upstream.
    
    The kernel cannot currently self-parse BTF containing Rust debug
    information. pahole uses the language of the CU to determine whether to
    filter out debug information when generating the BTF. When LTO is
    enabled, Rust code can cross CU boundaries, resulting in Rust debug
    information in CUs labeled as C. This results in a system which cannot
    parse its own BTF.
    
    Signed-off-by: Matthew Maurer <mmaurer@google.com>
    Cc: stable@vger.kernel.org
    Fixes: c1177979af9c ("btf, scripts: Exclude Rust CUs with pahole")
    Link: https://lore.kernel.org/r/20250108-rust-btf-lto-incompat-v1-1-60243ff6d820@google.com
    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
s390/cio: Fix CHPID "configure" attribute caching [+ + +]
Author: Peter Oberparleiter <oberpar@linux.ibm.com>
Date:   Fri Jan 31 12:02:55 2025 +0100

    s390/cio: Fix CHPID "configure" attribute caching
    
    [ Upstream commit 32ae4a2992529e2c7934e422035fad1d9b0f1fb5 ]
    
    In some environments, the SCLP firmware interface used to query a
    CHPID's configured state is not supported. On these environments,
    rapidly reading the corresponding sysfs attribute produces inconsistent
    results:
    
      $ cat /sys/devices/css0/chp0.00/configure
      cat: /sys/devices/css0/chp0.00/configure: Operation not supported
      $ cat /sys/devices/css0/chp0.00/configure
      3
    
    This occurs for example when Linux is run as a KVM guest. The
    inconsistency is a result of CIO using cached results for generating
    the value of the "configure" attribute while failing to handle the
    situation where no data was returned by SCLP.
    
    Fix this by not updating the cache-expiration timestamp when SCLP
    returns no data. With the fix applied, the system response is
    consistent:
    
      $ cat /sys/devices/css0/chp0.00/configure
      cat: /sys/devices/css0/chp0.00/configure: Operation not supported
      $ cat /sys/devices/css0/chp0.00/configure
      cat: /sys/devices/css0/chp0.00/configure: Operation not supported
    
    Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
    Reviewed-by: Eric Farman <farman@linux.ibm.com>
    Tested-by: Eric Farman <farman@linux.ibm.com>
    Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
    Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
sched/isolation: Prevent boot crash when the boot CPU is nohz_full [+ + +]
Author: Oleg Nesterov <oleg@redhat.com>
Date:   Thu Apr 11 16:39:05 2024 +0200

    sched/isolation: Prevent boot crash when the boot CPU is nohz_full
    
    Documentation/timers/no_hz.rst states that the "nohz_full=" mask must not
    include the boot CPU, which is no longer true after:
    
      08ae95f4fd3b ("nohz_full: Allow the boot CPU to be nohz_full").
    
    However after:
    
      aae17ebb53cd ("workqueue: Avoid using isolated cpus' timers on queue_delayed_work")
    
    the kernel will crash at boot time in this case; housekeeping_any_cpu()
    returns an invalid CPU number until smp_init() brings the first
    housekeeping CPU up.
    
    Change housekeeping_any_cpu() to check the result of cpumask_any_and() and
    return smp_processor_id() in this case.
    
    This is just the simple and backportable workaround which fixes the
    symptom, but smp_processor_id() at boot time should be safe at least for
    type == HK_TYPE_TIMER, this more or less matches the tick_do_timer_boot_cpu
    logic.
    
    There is no worry about cpu_down(); tick_nohz_cpu_down() will not allow to
    offline tick_do_timer_cpu (the 1st online housekeeping CPU).
    
    [ Apply only documentation changes as commit which causes boot
      crash when boot CPU is nohz_full is not backported to stable
      kernels - Krishanth ]
    
    Reported-by: Chris von Recklinghausen <crecklin@redhat.com>
    Signed-off-by: Oleg Nesterov <oleg@redhat.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Reviewed-by: Phil Auld <pauld@redhat.com>
    Acked-by: Frederic Weisbecker <frederic@kernel.org>
    Link: https://lore.kernel.org/r/20240411143905.GA19288@redhat.com
    Closes: https://lore.kernel.org/all/20240402105847.GA24832@redhat.com/
    Signed-off-by: Krishanth Jagaduri <Krishanth.Jagaduri@sony.com>
    [ strip out upstream commit and Fixes: so tools don't get confused that
      this commit actually does anything real - gregkh]
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
sched: address a potential NULL pointer dereference in the GRED scheduler. [+ + +]
Author: Jun Yang <juny24602@gmail.com>
Date:   Wed Mar 5 23:44:10 2025 +0800

    sched: address a potential NULL pointer dereference in the GRED scheduler.
    
    [ Upstream commit 115ef44a98220fddfab37a39a19370497cd718b9 ]
    
    If kzalloc in gred_init returns a NULL pointer, the code follows the
    error handling path, invoking gred_destroy. This, in turn, calls
    gred_offload, where memset could receive a NULL pointer as input,
    potentially leading to a kernel crash.
    
    When table->opt is NULL in gred_init(), gred_change_table_def()
    is not called yet, so it is not necessary to call ->ndo_setup_tc()
    in gred_offload().
    
    Signed-off-by: Jun Yang <juny24602@gmail.com>
    Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
    Fixes: f25c0515c521 ("net: sched: gred: dynamically allocate tc_gred_qopt_offload")
    Link: https://patch.msgid.link/20250305154410.3505642-1-juny24602@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

sched: Clarify wake_up_q()'s write to task->wake_q.next [+ + +]
Author: Jann Horn <jannh@google.com>
Date:   Wed Jan 29 20:53:03 2025 +0100

    sched: Clarify wake_up_q()'s write to task->wake_q.next
    
    [ Upstream commit bcc6244e13b4d4903511a1ea84368abf925031c0 ]
    
    Clarify that wake_up_q() does an atomic write to task->wake_q.next, after
    which a concurrent __wake_q_add() can immediately overwrite
    task->wake_q.next again.
    
    Signed-off-by: Jann Horn <jannh@google.com>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20250129-sched-wakeup-prettier-v1-1-2f51f5f663fa@google.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
scripts: `make rust-analyzer` for out-of-tree modules [+ + +]
Author: Vinay Varma <varmavinaym@gmail.com>
Date:   Tue Apr 11 17:17:15 2023 +0800

    scripts: `make rust-analyzer` for out-of-tree modules
    
    [ Upstream commit 49a9ef76740206d52e7393f6fe25fc764de8df32 ]
    
    Adds support for out-of-tree rust modules to use the `rust-analyzer`
    make target to generate the rust-project.json file.
    
    The change involves adding an optional parameter `external_src` to the
    `generate_rust_analyzer.py` which expects the path to the out-of-tree
    module's source directory. When this parameter is passed, I have chosen
    not to add the non-core modules (samples and drivers) into the result
    since these are not expected to be used in third party modules. Related
    changes are also made to the Makefile and rust/Makefile allowing the
    `rust-analyzer` target to be used for out-of-tree modules as well.
    
    Link: https://github.com/Rust-for-Linux/linux/pull/914
    Link: https://github.com/Rust-for-Linux/rust-out-of-tree-module/pull/2
    Signed-off-by: Vinay Varma <varmavinaym@gmail.com>
    Link: https://lore.kernel.org/r/20230411091714.130525-1-varmavinaym@gmail.com
    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    Stable-dep-of: 2e0f91aba507 ("scripts: generate_rust_analyzer: add missing macros deps")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

scripts: generate_rust_analyzer: add missing macros deps [+ + +]
Author: Tamir Duberstein <tamird@gmail.com>
Date:   Mon Feb 10 12:03:24 2025 -0500

    scripts: generate_rust_analyzer: add missing macros deps
    
    [ Upstream commit 2e0f91aba507a3cb59f7a12fc3ea2b7d4d6675b7 ]
    
    The macros crate has depended on std and proc_macro since its
    introduction in commit 1fbde52bde73 ("rust: add `macros` crate"). These
    dependencies were omitted from commit 8c4555ccc55c ("scripts: add
    `generate_rust_analyzer.py`") resulting in missing go-to-definition and
    autocomplete, and false-positive warnings emitted from rust-analyzer
    such as:
    
      [{
            "resource": "/Users/tamird/src/linux/rust/macros/module.rs",
            "owner": "_generated_diagnostic_collection_name_#1",
            "code": {
                    "value": "non_snake_case",
                    "target": {
                            "$mid": 1,
                            "path": "/rustc/",
                            "scheme": "https",
                            "authority": "doc.rust-lang.org",
                            "query": "search=non_snake_case"
                    }
            },
            "severity": 4,
            "message": "Variable `None` should have snake_case name, e.g. `none`",
            "source": "rust-analyzer",
            "startLineNumber": 123,
            "startColumn": 17,
            "endLineNumber": 123,
            "endColumn": 21
      }]
    
    Add the missing dependencies to improve the developer experience.
    
      [ Fiona had a different approach (thanks!) at:
    
            https://lore.kernel.org/rust-for-linux/20241205115438.234221-1-me@kloenk.dev/
    
        But Tamir and Fiona agreed to this one. - Miguel ]
    
    Fixes: 8c4555ccc55c ("scripts: add `generate_rust_analyzer.py`")
    Reviewed-by: Fiona Behrens <me@kloenk.dev>
    Diagnosed-by: Chayim Refael Friedman <chayimfr@gmail.com>
    Link: https://github.com/rust-lang/rust-analyzer/issues/17759#issuecomment-2646328275
    Signed-off-by: Tamir Duberstein <tamird@gmail.com>
    Tested-by: Andreas Hindborg <a.hindborg@kernel.org>
    Link: https://lore.kernel.org/r/20250210-rust-analyzer-macros-core-dep-v3-1-45eb4836f218@gmail.com
    [ Removed `return`. Changed tag name. Added Link. Slightly
      reworded. - Miguel ]
    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

scripts: generate_rust_analyzer: Handle sub-modules with no Makefile [+ + +]
Author: Asahi Lina <lina@asahilina.net>
Date:   Fri Apr 7 00:25:22 2023 +0200

    scripts: generate_rust_analyzer: Handle sub-modules with no Makefile
    
    [ Upstream commit 5c7548d5a25306dcdb97689479be81cacc8ce596 ]
    
    More complex drivers might want to use modules to organize their Rust
    code, but those module folders do not need a Makefile.
    generate_rust_analyzer.py currently crashes on those. Fix it so that a
    missing Makefile is silently ignored.
    
    Link: https://github.com/Rust-for-Linux/linux/pull/883
    Signed-off-by: Asahi Lina <lina@asahilina.net>
    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    Stable-dep-of: 2e0f91aba507 ("scripts: generate_rust_analyzer: add missing macros deps")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

scripts: generate_rust_analyzer: provide `cfg`s for `core` and `alloc` [+ + +]
Author: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Date:   Fri Aug 4 14:14:39 2023 -0300

    scripts: generate_rust_analyzer: provide `cfg`s for `core` and `alloc`
    
    [ Upstream commit 4f353e0d1282dfe6b8082290fe8e606c5739a954 ]
    
    Both `core` and `alloc` have their `cfgs` (such as `no_rc`) missing
    in `rust-project.json`.
    
    To remedy this, pass the flags to `generate_rust_analyzer.py` for
    them to be added to a dictionary where each key corresponds to
    a crate and each value to a list of `cfg`s. The dictionary is then
    used to pass the `cfg`s to each crate in the generated file (for
    `core` and `alloc` only).
    
    Signed-off-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
    Link: https://lore.kernel.org/r/20230804171448.54976-1-yakoyoku@gmail.com
    [ Removed `Suggested-by` as discussed in mailing list. ]
    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    Stable-dep-of: 2e0f91aba507 ("scripts: generate_rust_analyzer: add missing macros deps")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
scsi: core: Use GFP_NOIO to avoid circular locking dependency [+ + +]
Author: Rik van Riel <riel@surriel.com>
Date:   Tue Jan 28 16:35:39 2025 -0500

    scsi: core: Use GFP_NOIO to avoid circular locking dependency
    
    [ Upstream commit 5363ee9d110e139584c2d92a0b640bc210588506 ]
    
    Filesystems can write to disk from page reclaim with __GFP_FS
    set. Marc found a case where scsi_realloc_sdev_budget_map() ends up in
    page reclaim with GFP_KERNEL, where it could try to take filesystem
    locks again, leading to a deadlock.
    
    WARNING: possible circular locking dependency detected
    6.13.0 #1 Not tainted
    ------------------------------------------------------
    kswapd0/70 is trying to acquire lock:
    ffff8881025d5d78 (&q->q_usage_counter(io)){++++}-{0:0}, at: blk_mq_submit_bio+0x461/0x6e0
    
    but task is already holding lock:
    ffffffff81ef5f40 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x9f/0x760
    
    The full lockdep splat can be found in Marc's report:
    
    https://lkml.org/lkml/2025/1/24/1101
    
    Avoid the potential deadlock by doing the allocation with GFP_NOIO, which
    prevents both filesystem and block layer recursion.
    
    Reported-by: Marc Aurèle La France <tsi@tuyoix.net>
    Signed-off-by: Rik van Riel <riel@surriel.com>
    Link: https://lore.kernel.org/r/20250129104525.0ae8421e@fangorn
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

scsi: qla1280: Fix kernel oops when debug level > 2 [+ + +]
Author: Magnus Lindholm <linmag7@gmail.com>
Date:   Sat Jan 25 10:49:22 2025 +0100

    scsi: qla1280: Fix kernel oops when debug level > 2
    
    [ Upstream commit 5233e3235dec3065ccc632729675575dbe3c6b8a ]
    
    A null dereference or oops exception will eventually occur when qla1280.c
    driver is compiled with DEBUG_QLA1280 enabled and ql_debug_level > 2.  I
    think its clear from the code that the intention here is sg_dma_len(s) not
    length of sg_next(s) when printing the debug info.
    
    Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
    Link: https://lore.kernel.org/r/20250125095033.26188-1-linmag7@gmail.com
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
sctp: Fix undefined behavior in left shift operation [+ + +]
Author: Yu-Chun Lin <eleanor15x@gmail.com>
Date:   Tue Feb 18 16:12:16 2025 +0800

    sctp: Fix undefined behavior in left shift operation
    
    [ Upstream commit 606572eb22c1786a3957d24307f5760bb058ca19 ]
    
    According to the C11 standard (ISO/IEC 9899:2011, 6.5.7):
    "If E1 has a signed type and E1 x 2^E2 is not representable in the result
    type, the behavior is undefined."
    
    Shifting 1 << 31 causes signed integer overflow, which leads to undefined
    behavior.
    
    Fix this by explicitly using '1U << 31' to ensure the shift operates on
    an unsigned type, avoiding undefined behavior.
    
    Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
    Link: https://patch.msgid.link/20250218081217.3468369-1-eleanor15x@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
smb3: add support for IAKerb [+ + +]
Author: Steve French <stfrench@microsoft.com>
Date:   Tue Jan 28 01:04:23 2025 -0600

    smb3: add support for IAKerb
    
    [ Upstream commit eea5119fa5979c350af5783a8148eacdd4219715 ]
    
    There are now more servers which advertise support for IAKerb (passthrough
    Kerberos authentication via proxy).  IAKerb is a public extension industry
    standard Kerberos protocol that allows a client without line-of-sight
    to a Domain Controller to authenticate. There can be cases where we
    would fail to mount if the server only advertises the OID for IAKerb
    in SPNEGO/GSSAPI.  Add code to allow us to still upcall to userspace
    in these cases to obtain the Kerberos ticket.
    
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Stable-dep-of: 605b249ea967 ("smb: client: Fix match_session bug preventing session reuse")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
smb: client: Fix match_session bug preventing session reuse [+ + +]
Author: Henrique Carvalho <henrique.carvalho@suse.com>
Date:   Tue Mar 11 15:23:59 2025 -0300

    smb: client: Fix match_session bug preventing session reuse
    
    [ Upstream commit 605b249ea96770ac4fac4b8510a99e0f8442be5e ]
    
    Fix a bug in match_session() that can causes the session to not be
    reused in some cases.
    
    Reproduction steps:
    
    mount.cifs //server/share /mnt/a -o credentials=creds
    mount.cifs //server/share /mnt/b -o credentials=creds,sec=ntlmssp
    cat /proc/fs/cifs/DebugData | grep SessionId | wc -l
    
    mount.cifs //server/share /mnt/b -o credentials=creds,sec=ntlmssp
    mount.cifs //server/share /mnt/a -o credentials=creds
    cat /proc/fs/cifs/DebugData | grep SessionId | wc -l
    
    Cc: stable@vger.kernel.org
    Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de>
    Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

smb: client: fix noisy when tree connecting to DFS interlink targets [+ + +]
Author: Paulo Alcantara <pc@manguebit.com>
Date:   Wed Feb 5 13:22:11 2025 -0300

    smb: client: fix noisy when tree connecting to DFS interlink targets
    
    [ Upstream commit 773dc23ff81838b6f74d7fabba5a441cc6a93982 ]
    
    When the client attempts to tree connect to a domain-based DFS
    namespace from a DFS interlink target, the server will return
    STATUS_BAD_NETWORK_NAME and the following will appear on dmesg:
    
            CIFS: VFS:  BAD_NETWORK_NAME: \\dom\dfs
    
    Since a DFS share might contain several DFS interlinks and they expire
    after 10 minutes, the above message might end up being flooded on
    dmesg when mounting or accessing them.
    
    Print this only once per share.
    
    Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

smb: client: fix potential UAF in cifs_dump_full_key() [+ + +]
Author: Paulo Alcantara <pc@manguebit.com>
Date:   Tue Apr 2 16:33:54 2024 -0300

    smb: client: fix potential UAF in cifs_dump_full_key()
    
    commit 58acd1f497162e7d282077f816faa519487be045 upstream.
    
    Skip sessions that are being teared down (status == SES_EXITING) to
    avoid UAF.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Jianqi Ren <jianqi.ren.cn@windriver.com>
    Signed-off-by: He Zhe <zhe.he@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
soc: imx8m: Remove global soc_uid [+ + +]
Author: Marek Vasut <marex@denx.de>
Date:   Sun Sep 29 20:49:17 2024 +0200

    soc: imx8m: Remove global soc_uid
    
    [ Upstream commit 9c1c02fe8d7f33c18547b79c41f3fa41ef7bae8f ]
    
    The static global soc_uid is only ever used as kasprintf() parameter in
    imx8m_soc_probe(). Pass pointer to local u64 variable to .soc_revision()
    callback instead and let the .soc_revision() callback fill in the content.
    Remove the unnecessary static global variable.
    
    Signed-off-by: Marek Vasut <marex@denx.de>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>
    Stable-dep-of: cf7139aac463 ("soc: imx8m: Unregister cpufreq and soc dev in cleanup path")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

soc: imx8m: Unregister cpufreq and soc dev in cleanup path [+ + +]
Author: Peng Fan <peng.fan@nxp.com>
Date:   Fri Feb 14 16:47:51 2025 +0800

    soc: imx8m: Unregister cpufreq and soc dev in cleanup path
    
    [ Upstream commit cf7139aac463880cbd5c5e999c118fbe91631411 ]
    
    Unregister the cpufreq device and soc device when resource unwinding,
    otherwise there will be warning when do removing test:
    sysfs: cannot create duplicate filename '/devices/platform/imx-cpufreq-dt'
    CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.13.0-rc1-next-20241204
    Hardware name: NXP i.MX8MPlus EVK board (DT)
    
    Fixes: 9cc832d37799 ("soc: imx8m: Probe the SoC driver as platform driver")
    Cc: Marco Felsch <m.felsch@pengutronix.de>
    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

soc: imx8m: Use devm_* to simplify probe failure handling [+ + +]
Author: Marek Vasut <marex@denx.de>
Date:   Sun Sep 29 20:49:18 2024 +0200

    soc: imx8m: Use devm_* to simplify probe failure handling
    
    [ Upstream commit 22b03a4e957e462b380a982759ccf0f6554735d3 ]
    
    Use device managed functions to simplify handling of failures during
    probe. Remove fail paths which are no longer necessary.
    
    Signed-off-by: Marek Vasut <marex@denx.de>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>
    Stable-dep-of: cf7139aac463 ("soc: imx8m: Unregister cpufreq and soc dev in cleanup path")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

soc: qcom: pdr: Fix the potential deadlock [+ + +]
Author: Saranya R <quic_sarar@quicinc.com>
Date:   Wed Feb 12 22:07:20 2025 +0530

    soc: qcom: pdr: Fix the potential deadlock
    
    commit 2eeb03ad9f42dfece63051be2400af487ddb96d2 upstream.
    
    When some client process A call pdr_add_lookup() to add the look up for
    the service and does schedule locator work, later a process B got a new
    server packet indicating locator is up and call pdr_locator_new_server()
    which eventually sets pdr->locator_init_complete to true which process A
    sees and takes list lock and queries domain list but it will timeout due
    to deadlock as the response will queued to the same qmi->wq and it is
    ordered workqueue and process B is not able to complete new server
    request work due to deadlock on list lock.
    
    Fix it by removing the unnecessary list iteration as the list iteration
    is already being done inside locator work, so avoid it here and just
    call schedule_work() here.
    
           Process A                        Process B
    
                                         process_scheduled_works()
    pdr_add_lookup()                      qmi_data_ready_work()
     process_scheduled_works()             pdr_locator_new_server()
                                             pdr->locator_init_complete=true;
       pdr_locator_work()
        mutex_lock(&pdr->list_lock);
    
         pdr_locate_service()                  mutex_lock(&pdr->list_lock);
    
          pdr_get_domain_list()
           pr_err("PDR: %s get domain list
                   txn wait failed: %d\n",
                   req->service_name,
                   ret);
    
    Timeout error log due to deadlock:
    
    "
     PDR: tms/servreg get domain list txn wait failed: -110
     PDR: service lookup for msm/adsp/sensor_pd:tms/servreg failed: -110
    "
    
    Thanks to Bjorn and Johan for letting me know that this commit also fixes
    an audio regression when using the in-kernel pd-mapper as that makes it
    easier to hit this race. [1]
    
    Link: https://lore.kernel.org/lkml/Zqet8iInnDhnxkT9@hovoldconsulting.com/ # [1]
    Fixes: fbe639b44a82 ("soc: qcom: Introduce Protection Domain Restart helpers")
    CC: stable@vger.kernel.org
    Reviewed-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
    Tested-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
    Tested-by: Johan Hovold <johan+linaro@kernel.org>
    Signed-off-by: Saranya R <quic_sarar@quicinc.com>
    Co-developed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
    Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
    Link: https://lore.kernel.org/r/20250212163720.1577876-1-mukesh.ojha@oss.qualcomm.com
    Signed-off-by: Bjorn Andersson <andersson@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tcp: fix forever orphan socket caused by tcp_abort [+ + +]
Author: Xueming Feng <kuro@kuroa.me>
Date:   Mon Aug 26 18:23:27 2024 +0800

    tcp: fix forever orphan socket caused by tcp_abort
    
    commit bac76cf89816bff06c4ec2f3df97dc34e150a1c4 upstream.
    
    We have some problem closing zero-window fin-wait-1 tcp sockets in our
    environment. This patch come from the investigation.
    
    Previously tcp_abort only sends out reset and calls tcp_done when the
    socket is not SOCK_DEAD, aka orphan. For orphan socket, it will only
    purging the write queue, but not close the socket and left it to the
    timer.
    
    While purging the write queue, tp->packets_out and sk->sk_write_queue
    is cleared along the way. However tcp_retransmit_timer have early
    return based on !tp->packets_out and tcp_probe_timer have early
    return based on !sk->sk_write_queue.
    
    This caused ICSK_TIME_RETRANS and ICSK_TIME_PROBE0 not being resched
    and socket not being killed by the timers, converting a zero-windowed
    orphan into a forever orphan.
    
    This patch removes the SOCK_DEAD check in tcp_abort, making it send
    reset to peer and close the socket accordingly. Preventing the
    timer-less orphan from happening.
    
    According to Lorenzo's email in the v1 thread, the check was there to
    prevent force-closing the same socket twice. That situation is handled
    by testing for TCP_CLOSE inside lock, and returning -ENOENT if it is
    already closed.
    
    The -ENOENT code comes from the associate patch Lorenzo made for
    iproute2-ss; link attached below, which also conform to RFC 9293.
    
    At the end of the patch, tcp_write_queue_purge(sk) is removed because it
    was already called in tcp_done_with_error().
    
    p.s. This is the same patch with v2. Resent due to mis-labeled "changes
    requested" on patchwork.kernel.org.
    
    Link: https://patchwork.ozlabs.org/project/netdev/patch/1450773094-7978-3-git-send-email-lorenzo@google.com/
    Fixes: c1e64e298b8c ("net: diag: Support destroying TCP sockets.")
    Signed-off-by: Xueming Feng <kuro@kuroa.me>
    Tested-by: Lorenzo Colitti <lorenzo@google.com>
    Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Link: https://patch.msgid.link/20240826102327.1461482-1-kuro@kuroa.me
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [youngmin: Resolved minor conflict in net/ipv4/tcp.c]
    Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

tcp: fix races in tcp_abort() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Tue May 28 12:52:52 2024 +0000

    tcp: fix races in tcp_abort()
    
    commit 5ce4645c23cf5f048eb8e9ce49e514bababdee85 upstream.
    
    tcp_abort() has the same issue than the one fixed in the prior patch
    in tcp_write_err().
    
    In order to get consistent results from tcp_poll(), we must call
    sk_error_report() after tcp_done().
    
    We can use tcp_done_with_error() to centralize this logic.
    
    Fixes: c1e64e298b8c ("net: diag: Support destroying TCP sockets.")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Acked-by: Neal Cardwell <ncardwell@google.com>
    Link: https://lore.kernel.org/r/20240528125253.1966136-4-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [youngmin: Resolved minor conflict in net/ipv4/tcp.c]
    Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
thermal/cpufreq_cooling: Remove structure member documentation [+ + +]
Author: Daniel Lezcano <daniel.lezcano@linaro.org>
Date:   Tue Feb 11 09:47:11 2025 +0100

    thermal/cpufreq_cooling: Remove structure member documentation
    
    [ Upstream commit a6768c4f92e152265590371975d44c071a5279c7 ]
    
    The structure member documentation refers to a member which does not
    exist any more. Remove it.
    
    Link: https://lore.kernel.org/all/202501220046.h3PMBCti-lkp@intel.com/
    Reported-by: kernel test robot <lkp@intel.com>
    Closes: https://lore.kernel.org/oe-kbuild-all/202501220046.h3PMBCti-lkp@intel.com/
    Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
    Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
    Link: https://patch.msgid.link/20250211084712.2746705-1-daniel.lezcano@linaro.org
    [ rjw: Minor changelog edits ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
USB: serial: ftdi_sio: add support for Altera USB Blaster 3 [+ + +]
Author: Boon Khai Ng <boon.khai.ng@intel.com>
Date:   Wed Mar 12 11:05:44 2025 +0800

    USB: serial: ftdi_sio: add support for Altera USB Blaster 3
    
    commit 18e0885bd2ca738407036434418a26a58394a60e upstream.
    
    The Altera USB Blaster 3, available as both a cable and an on-board
    solution, is primarily used for programming and debugging FPGAs.
    
    It interfaces with host software such as Quartus Programmer,
    System Console, SignalTap, and Nios Debugger. The device utilizes
    either an FT2232 or FT4232 chip.
    
    Enabling the support for various configurations of the on-board
    USB Blaster 3 by including the appropriate VID/PID pairs,
    allowing it to function as a serial device via ftdi_sio.
    
    Note that this check-in does not include support for the
    cable solution, as it does not support UART functionality.
    The supported configurations are determined by the
    hardware design and include:
    
    1) PID 0x6022, FT2232, 1 JTAG port (Port A) + Port B as UART
    2) PID 0x6025, FT4232, 1 JTAG port (Port A) + Port C as UART
    3) PID 0x6026, FT4232, 1 JTAG port (Port A) + Port C, D as UART
    4) PID 0x6029, FT4232, 1 JTAG port (Port B) + Port C as UART
    5) PID 0x602a, FT4232, 1 JTAG port (Port B) + Port C, D as UART
    6) PID 0x602c, FT4232, 1 JTAG port (Port A) + Port B as UART
    7) PID 0x602d, FT4232, 1 JTAG port (Port A) + Port B, C as UART
    8) PID 0x602e, FT4232, 1 JTAG port (Port A) + Port B, C, D as UART
    
    These configurations allow for flexibility in how the USB Blaster 3 is
    used, depending on the specific needs of the hardware design.
    
    Signed-off-by: Boon Khai Ng <boon.khai.ng@intel.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: option: add Telit Cinterion FE990B compositions [+ + +]
Author: Fabio Porcedda <fabio.porcedda@gmail.com>
Date:   Tue Mar 4 10:19:38 2025 +0100

    USB: serial: option: add Telit Cinterion FE990B compositions
    
    commit 4981bb50392b7515b765da28cf8768ce624c2670 upstream.
    
    Add the following Telit Cinterion FE990B40 compositions:
    
    0x10b0: rmnet + tty (AT/NMEA) + tty (AT) + tty (AT) + tty (AT) +
            tty (diag) + DPL + QDSS (Qualcomm Debug SubSystem) + adb
    T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  7 Spd=480  MxCh= 0
    D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=10b0 Rev=05.15
    S:  Manufacturer=Telit Cinterion
    S:  Product=FE990
    S:  SerialNumber=28c2595e
    C:  #Ifs= 9 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
    I:  If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=88(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8a(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
    E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 6 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none)
    E:  Ad=8c(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 7 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=70 Driver=(none)
    E:  Ad=8d(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
    E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    0x10b1: MBIM + tty (AT/NMEA) + tty (AT) + tty (AT) + tty (AT) +
            tty (diag) + DPL + QDSS (Qualcomm Debug SubSystem) + adb
    T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  8 Spd=480  MxCh= 0
    D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=10b1 Rev=05.15
    S:  Manufacturer=Telit Cinterion
    S:  Product=FE990
    S:  SerialNumber=28c2595e
    C:  #Ifs=10 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
    E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
    I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=88(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8a(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
    E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 7 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none)
    E:  Ad=8c(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 8 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=70 Driver=(none)
    E:  Ad=8d(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
    E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    0x10b2: RNDIS + tty (AT/NMEA) + tty (AT) + tty (AT) + tty (AT) +
            tty (diag) + DPL + QDSS (Qualcomm Debug SubSystem) + adb
    T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  9 Spd=480  MxCh= 0
    D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=10b2 Rev=05.15
    S:  Manufacturer=Telit Cinterion
    S:  Product=FE990
    S:  SerialNumber=28c2595e
    C:  #Ifs=10 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host
    E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
    I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=88(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8a(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
    E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 7 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none)
    E:  Ad=8c(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 8 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=70 Driver=(none)
    E:  Ad=8d(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
    E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    0x10b3: ECM + tty (AT/NMEA) + tty (AT) + tty (AT) + tty (AT) +
            tty (diag) + DPL + QDSS (Qualcomm Debug SubSystem) + adb
    T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 11 Spd=480  MxCh= 0
    D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=10b3 Rev=05.15
    S:  Manufacturer=Telit Cinterion
    S:  Product=FE990
    S:  SerialNumber=28c2595e
    C:  #Ifs=10 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether
    E:  Ad=82(I) Atr=03(Int.) MxPS=  16 Ivl=32ms
    I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=88(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8a(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
    E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 7 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none)
    E:  Ad=8c(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 8 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=70 Driver=(none)
    E:  Ad=8d(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
    E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
    Reviewed-by: Daniele Palmas <dnlplm@gmail.com>
    [ johan: use USB_DEVICE_AND_INTERFACE_INFO() and sort by protocol ]
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: option: fix Telit Cinterion FE990A name [+ + +]
Author: Fabio Porcedda <fabio.porcedda@gmail.com>
Date:   Tue Mar 4 10:19:39 2025 +0100

    USB: serial: option: fix Telit Cinterion FE990A name
    
    commit 6232f0d8e100a26275bbd773fc56a60af2c95322 upstream.
    
    The correct name for FE990 is FE990A so use it in order to avoid
    confusion with FE990B.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: option: match on interface class for Telit FN990B [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Mar 6 11:44:41 2025 +0100

    USB: serial: option: match on interface class for Telit FN990B
    
    commit 9a665fe3d967fe46edb4fd2497c7a5cc2dac2f55 upstream.
    
    The device id entries for Telit FN990B ended up matching only on the
    interface protocol. While this works, the protocol is qualified by the
    interface class (and subclass) which should have been included.
    
    Switch to matching using USB_DEVICE_AND_INTERFACE_INFO() while keeping
    the entries sorted also by protocol for consistency.
    
    Link: https://lore.kernel.org/20250227110655.3647028-2-fabio.porcedda@gmail.com/
    Cc: Fabio Porcedda <fabio.porcedda@gmail.com>
    Cc: Daniele Palmas <dnlplm@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
vboxsf: fix building with GCC 15 [+ + +]
Author: Brahmajit Das <brahmajit.xyz@gmail.com>
Date:   Tue Jan 21 21:56:48 2025 +0530

    vboxsf: fix building with GCC 15
    
    [ Upstream commit 4e7487245abcbc5a1a1aea54e4d3b33c53804bda ]
    
    Building with GCC 15 results in build error
    fs/vboxsf/super.c:24:54: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization]
       24 | static const unsigned char VBSF_MOUNT_SIGNATURE[4] = "\000\377\376\375";
          |                                                      ^~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    
    Due to GCC having enabled -Werror=unterminated-string-initialization[0]
    by default. Separately initializing each array element of
    VBSF_MOUNT_SIGNATURE to ensure NUL termination, thus satisfying GCC 15
    and fixing the build error.
    
    [0]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-unterminated-string-initialization
    
    Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
    Link: https://lore.kernel.org/r/20250121162648.1408743-1-brahmajit.xyz@gmail.com
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Christian Brauner <brauner@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
wifi: cfg80211: cancel wiphy_work before freeing wiphy [+ + +]
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Thu Mar 6 12:37:59 2025 +0200

    wifi: cfg80211: cancel wiphy_work before freeing wiphy
    
    [ Upstream commit 72d520476a2fab6f3489e8388ab524985d6c4b90 ]
    
    A wiphy_work can be queued from the moment the wiphy is allocated and
    initialized (i.e. wiphy_new_nm). When a wiphy_work is queued, the
    rdev::wiphy_work is getting queued.
    
    If wiphy_free is called before the rdev::wiphy_work had a chance to run,
    the wiphy memory will be freed, and then when it eventally gets to run
    it'll use invalid memory.
    
    Fix this by canceling the work before freeing the wiphy.
    
    Fixes: a3ee4dc84c4e ("wifi: cfg80211: add a work abstraction with special semantics")
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://patch.msgid.link/20250306123626.efd1d19f6e07.I48229f96f4067ef73f5b87302335e2fd750136c9@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: iwlwifi: mvm: ensure offloading TID queue exists [+ + +]
Author: Benjamin Berg <benjamin.berg@intel.com>
Date:   Sun Feb 18 19:51:47 2024 +0200

    wifi: iwlwifi: mvm: ensure offloading TID queue exists
    
    commit 78f65fbf421a61894c14a1b91fe2fb4437b3fe5f upstream.
    
    The resume code path assumes that the TX queue for the offloading TID
    has been configured. At resume time it then tries to sync the write
    pointer as it may have been updated by the firmware.
    
    In the unusual event that no packets have been send on TID 0, the queue
    will not have been allocated and this causes a crash. Fix this by
    ensuring the queue exist at suspend time.
    
    Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240218194912.6632e6dc7b35.Ie6e6a7488c9c7d4529f13d48f752b5439d8ac3c4@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Jianqi Ren <jianqi.ren.cn@windriver.com>
    Signed-off-by: He Zhe <zhe.he@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
x86/irq: Define trace events conditionally [+ + +]
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Tue Feb 25 22:32:33 2025 +0100

    x86/irq: Define trace events conditionally
    
    [ Upstream commit 9de7695925d5d2d2085681ba935857246eb2817d ]
    
    When both of X86_LOCAL_APIC and X86_THERMAL_VECTOR are disabled,
    the irq tracing produces a W=1 build warning for the tracing
    definitions:
    
      In file included from include/trace/trace_events.h:27,
                     from include/trace/define_trace.h:113,
                     from arch/x86/include/asm/trace/irq_vectors.h:383,
                     from arch/x86/kernel/irq.c:29:
      include/trace/stages/init.h:2:23: error: 'str__irq_vectors__trace_system_name' defined but not used [-Werror=unused-const-variable=]
    
    Make the tracepoints conditional on the same symbosl that guard
    their usage.
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20250225213236.3141752-1-arnd@kernel.org
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
x86/microcode/AMD: Fix out-of-bounds on systems with CPU-less NUMA nodes [+ + +]
Author: Florent Revest <revest@chromium.org>
Date:   Mon Mar 10 15:42:43 2025 +0100

    x86/microcode/AMD: Fix out-of-bounds on systems with CPU-less NUMA nodes
    
    commit e3e89178a9f4a80092578af3ff3c8478f9187d59 upstream.
    
    Currently, load_microcode_amd() iterates over all NUMA nodes, retrieves their
    CPU masks and unconditionally accesses per-CPU data for the first CPU of each
    mask.
    
    According to Documentation/admin-guide/mm/numaperf.rst:
    
      "Some memory may share the same node as a CPU, and others are provided as
      memory only nodes."
    
    Therefore, some node CPU masks may be empty and wouldn't have a "first CPU".
    
    On a machine with far memory (and therefore CPU-less NUMA nodes):
    - cpumask_of_node(nid) is 0
    - cpumask_first(0) is CONFIG_NR_CPUS
    - cpu_data(CONFIG_NR_CPUS) accesses the cpu_info per-CPU array at an
      index that is 1 out of bounds
    
    This does not have any security implications since flashing microcode is
    a privileged operation but I believe this has reliability implications by
    potentially corrupting memory while flashing a microcode update.
    
    When booting with CONFIG_UBSAN_BOUNDS=y on an AMD machine that flashes
    a microcode update. I get the following splat:
    
      UBSAN: array-index-out-of-bounds in arch/x86/kernel/cpu/microcode/amd.c:X:Y
      index 512 is out of range for type 'unsigned long[512]'
      [...]
      Call Trace:
       dump_stack
       __ubsan_handle_out_of_bounds
       load_microcode_amd
       request_microcode_amd
       reload_store
       kernfs_fop_write_iter
       vfs_write
       ksys_write
       do_syscall_64
       entry_SYSCALL_64_after_hwframe
    
    Change the loop to go over only NUMA nodes which have CPUs before determining
    whether the first CPU on the respective node needs microcode update.
    
      [ bp: Massage commit message, fix typo. ]
    
    Fixes: 7ff6edf4fef3 ("x86/microcode/AMD: Fix mixed steppings support")
    Signed-off-by: Florent Revest <revest@chromium.org>
    Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20250310144243.861978-1-revest@chromium.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Xen/swiotlb: mark xen_swiotlb_fixup() __init [+ + +]
Author: Jan Beulich <jbeulich@suse.com>
Date:   Wed Feb 12 16:14:38 2025 +0100

    Xen/swiotlb: mark xen_swiotlb_fixup() __init
    
    [ Upstream commit 75ad02318af2e4ae669e26a79f001bd5e1f97472 ]
    
    It's sole user (pci_xen_swiotlb_init()) is __init, too.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    
    Message-ID: <e1198286-99ec-41c1-b5ad-e04e285836c9@suse.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
xfrm_output: Force software GSO only in tunnel mode [+ + +]
Author: Cosmin Ratiu <cratiu@nvidia.com>
Date:   Wed Feb 19 12:52:48 2025 +0200

    xfrm_output: Force software GSO only in tunnel mode
    
    [ Upstream commit 0aae2867aa6067f73d066bc98385e23c8454a1d7 ]
    
    The cited commit fixed a software GSO bug with VXLAN + IPSec in tunnel
    mode. Unfortunately, it is slightly broader than necessary, as it also
    severely affects performance for Geneve + IPSec transport mode over a
    device capable of both HW GSO and IPSec crypto offload. In this case,
    xfrm_output unnecessarily triggers software GSO instead of letting the
    HW do it. In simple iperf3 tests over Geneve + IPSec transport mode over
    a back-2-back pair of NICs with MTU 1500, the performance was observed
    to be up to 6x worse when doing software GSO compared to leaving it to
    the hardware.
    
    This commit makes xfrm_output only trigger software GSO in crypto
    offload cases for already encapsulated packets in tunnel mode, as not
    doing so would then cause the inner tunnel skb->inner_networking_header
    to be overwritten and break software GSO for that packet later if the
    device turns out to not be capable of HW GSO.
    
    Taking a closer look at the conditions for the original bug, to better
    understand the reasons for this change:
    - vxlan_build_skb -> iptunnel_handle_offloads sets inner_protocol and
      inner network header.
    - then, udp_tunnel_xmit_skb -> ip_tunnel_xmit adds outer transport and
      network headers.
    - later in the xmit path, xfrm_output -> xfrm_outer_mode_output ->
      xfrm4_prepare_output -> xfrm4_tunnel_encap_add overwrites the inner
      network header with the one set in ip_tunnel_xmit before adding the
      second outer header.
    - __dev_queue_xmit -> validate_xmit_skb checks whether GSO segmentation
      needs to happen based on dev features. In the original bug, the hw
      couldn't segment the packets, so skb_gso_segment was invoked.
    - deep in the .gso_segment callback machinery, __skb_udp_tunnel_segment
      tries to use the wrong inner network header, expecting the one set in
      iptunnel_handle_offloads but getting the one set by xfrm instead.
    - a bit later, ipv6_gso_segment accesses the wrong memory based on that
      wrong inner network header.
    
    With the new change, the original bug (or similar ones) cannot happen
    again, as xfrm will now trigger software GSO before applying a tunnel.
    This concern doesn't exist in packet offload mode, when the HW adds
    encapsulation headers. For the non-offloaded packets (crypto in SW),
    software GSO is still done unconditionally in the else branch.
    
    Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
    Reviewed-by: Yael Chemla <ychemla@nvidia.com>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Fixes: a204aef9fd77 ("xfrm: call xfrm_output_gso when inner_protocol is set in xfrm_output")
    Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
xfs: add lock protection when remove perag from radix tree [+ + +]
Author: Long Li <leo.lilong@huawei.com>
Date:   Thu Mar 13 13:25:44 2025 -0700

    xfs: add lock protection when remove perag from radix tree
    
    [ Upstream commit 07afd3173d0c6d24a47441839a835955ec6cf0d4 ]
    
    [ 6.1: resolved conflict in xfs_ag.c ]
    
    Take mp->m_perag_lock for deletions from the perag radix tree in
    xfs_initialize_perag to prevent racing with tagging operations.
    Lookups are fine - they are RCU protected so already deal with the
    tree changing shape underneath the lookup - but tagging operations
    require the tree to be stable while the tags are propagated back up
    to the root.
    
    Right now there's nothing stopping radix tree tagging from operating
    while a growfs operation is progress and adding/removing new entries
    into the radix tree.
    
    Hence we can have traversals that require a stable tree occurring at
    the same time we are removing unused entries from the radix tree which
    causes the shape of the tree to change.
    
    Likely this hasn't caused a problem in the past because we are only
    doing append addition and removal so the active AG part of the tree
    is not changing shape, but that doesn't mean it is safe. Just making
    the radix tree modifications serialise against each other is obviously
    correct.
    
    Signed-off-by: Long Li <leo.lilong@huawei.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
    Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
    Acked-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: consider minlen sized extents in xfs_rtallocate_extent_block [+ + +]
Author: Christoph Hellwig <hch@lst.de>
Date:   Thu Mar 13 13:25:32 2025 -0700

    xfs: consider minlen sized extents in xfs_rtallocate_extent_block
    
    [ Upstream commit 944df75958807d56f2db9fdc769eb15dd9f0366a ]
    
    minlen is the lower bound on the extent length that the caller can
    accept, and maxlen is at this point the maximal available length.
    This means a minlen extent is perfectly fine to use, so do it.  This
    matches the equivalent logic in xfs_rtallocate_extent_exact that also
    accepts a minlen sized extent.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: convert rt bitmap extent lengths to xfs_rtbxlen_t [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:31 2025 -0700

    xfs: convert rt bitmap extent lengths to xfs_rtbxlen_t
    
    [ Upstream commit f29c3e745dc253bf9d9d06ddc36af1a534ba1dd0 ]
    
    [ 6.1: excluded changes to trace.h as xchk_rtsum_record_free
    does not exist yet ]
    
    XFS uses xfs_rtblock_t for many different uses, which makes it much more
    difficult to perform a unit analysis on the codebase.  One of these
    (ab)uses is when we need to store the length of a free space extent as
    stored in the realtime bitmap.  Because there can be up to 2^64 realtime
    extents in a filesystem, we need a new type that is larger than
    xfs_rtxlen_t for callers that are querying the bitmap directly.  This
    means scrub and growfs.
    
    Create this type as "xfs_rtbxlen_t" and use it to store 64-bit rtx
    lengths.  'b' stands for 'bitmap' or 'big'; reader's choice.
    
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
    Acked-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: don't allow overly small or large realtime volumes [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:39 2025 -0700

    xfs: don't allow overly small or large realtime volumes
    
    [ Upstream commit e14293803f4e84eb23a417b462b56251033b5a66 ]
    
    Don't allow realtime volumes that are less than one rt extent long.
    This has been broken across 4 LTS kernels with nobody noticing, so let's
    just disable it.
    
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: don't leak recovered attri intent items [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:33 2025 -0700

    xfs: don't leak recovered attri intent items
    
    [ Upstream commit 07bcbdf020c9fd3c14bec51c50225a2a02707b94 ]
    
    If recovery finds an xattr log intent item calling for the removal of an
    attribute and the file doesn't even have an attr fork, we know that the
    removal is trivially complete.  However, we can't just exit the recovery
    function without doing something about the recovered log intent item --
    it's still on the AIL, and not logging an attrd item means it stays
    there forever.
    
    This has likely not been seen in practice because few people use LARP
    and the runtime code won't log the attri for a no-attrfork removexattr
    operation.  But let's fix this anyway.
    
    Also we shouldn't really be testing the attr fork presence until we've
    taken the ILOCK, though this doesn't matter much in recovery, which is
    single threaded.
    
    Fixes: fdaf1bb3cafc ("xfs: ATTR_REPLACE algorithm with LARP enabled needs rework")
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: ensure logflagsp is initialized in xfs_bmap_del_extent_real [+ + +]
Author: Jiachen Zhang <zhangjiachen.jaycee@bytedance.com>
Date:   Thu Mar 13 13:25:46 2025 -0700

    xfs: ensure logflagsp is initialized in xfs_bmap_del_extent_real
    
    [ Upstream commit e6af9c98cbf0164a619d95572136bfb54d482dd6 ]
    
    In the case of returning -ENOSPC, ensure logflagsp is initialized by 0.
    Otherwise the caller __xfs_bunmapi will set uninitialized illegal
    tmp_logflags value into xfs log, which might cause unpredictable error
    in the log recovery procedure.
    
    Also, remove the flags variable and set the *logflagsp directly, so that
    the code should be more robust in the long run.
    
    Fixes: 1b24b633aafe ("xfs: move some more code into xfs_bmap_del_extent_real")
    Signed-off-by: Jiachen Zhang <zhangjiachen.jaycee@bytedance.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: fix 32-bit truncation in xfs_compute_rextslog [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:38 2025 -0700

    xfs: fix 32-bit truncation in xfs_compute_rextslog
    
    [ Upstream commit cf8f0e6c1429be7652869059ea44696b72d5b726 ]
    
    It's quite reasonable that some customer somewhere will want to
    configure a realtime volume with more than 2^32 extents.  If they try to
    do this, the highbit32() call will truncate the upper bits of the
    xfs_rtbxlen_t and produce the wrong value for rextslog.  This in turn
    causes the rsumlevels to be wrong, which results in a realtime summary
    file that is the wrong length.  Fix that.
    
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: fix bounds check in xfs_defer_agfl_block() [+ + +]
Author: Dave Chinner <dchinner@redhat.com>
Date:   Thu Mar 13 13:25:27 2025 -0700

    xfs: fix bounds check in xfs_defer_agfl_block()
    
    [ Upstream commit 2bed0d82c2f78b91a0a9a5a73da57ee883a0c070 ]
    
    Need to happen before we allocate and then leak the xefi. Found by
    coverity via an xfsprogs libxfs scan.
    
    [djwong: This also fixes the type of the @agbno argument.]
    
    Fixes: 7dfee17b13e5 ("xfs: validate block number being freed before adding to xefi")
    Signed-off-by: Dave Chinner <dchinner@redhat.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: fix confusing xfs_extent_item variable names [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:23 2025 -0700

    xfs: fix confusing xfs_extent_item variable names
    
    [ Upstream commit 578c714b215d474c52949e65a914dae67924f0fe ]
    
    Change the name of all pointers to xfs_extent_item structures to "xefi"
    to make the name consistent and because the current selections ("new"
    and "free") mean other things in C.
    
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: fix perag leak when growfs fails [+ + +]
Author: Long Li <leo.lilong@huawei.com>
Date:   Thu Mar 13 13:25:45 2025 -0700

    xfs: fix perag leak when growfs fails
    
    [ Upstream commit 7823921887750b39d02e6b44faafdd1cc617c651 ]
    
    [ 6.1: resolved conflicts in xfs_ag.c and xfs_ag.h ]
    
    During growfs, if new ag in memory has been initialized, however
    sb_agcount has not been updated, if an error occurs at this time it
    will cause perag leaks as follows, these new AGs will not been freed
    during umount , because of these new AGs are not visible(that is
    included in mp->m_sb.sb_agcount).
    
    unreferenced object 0xffff88810be40200 (size 512):
      comm "xfs_growfs", pid 857, jiffies 4294909093
      hex dump (first 32 bytes):
        00 c0 c1 05 81 88 ff ff 04 00 00 00 00 00 00 00  ................
        01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      backtrace (crc 381741e2):
        [<ffffffff8191aef6>] __kmalloc+0x386/0x4f0
        [<ffffffff82553e65>] kmem_alloc+0xb5/0x2f0
        [<ffffffff8238dac5>] xfs_initialize_perag+0xc5/0x810
        [<ffffffff824f679c>] xfs_growfs_data+0x9bc/0xbc0
        [<ffffffff8250b90e>] xfs_file_ioctl+0x5fe/0x14d0
        [<ffffffff81aa5194>] __x64_sys_ioctl+0x144/0x1c0
        [<ffffffff83c3d81f>] do_syscall_64+0x3f/0xe0
        [<ffffffff83e00087>] entry_SYSCALL_64_after_hwframe+0x62/0x6a
    unreferenced object 0xffff88810be40800 (size 512):
      comm "xfs_growfs", pid 857, jiffies 4294909093
      hex dump (first 32 bytes):
        20 00 00 00 00 00 00 00 57 ef be dc 00 00 00 00   .......W.......
        10 08 e4 0b 81 88 ff ff 10 08 e4 0b 81 88 ff ff  ................
      backtrace (crc bde50e2d):
        [<ffffffff8191b43a>] __kmalloc_node+0x3da/0x540
        [<ffffffff81814489>] kvmalloc_node+0x99/0x160
        [<ffffffff8286acff>] bucket_table_alloc.isra.0+0x5f/0x400
        [<ffffffff8286bdc5>] rhashtable_init+0x405/0x760
        [<ffffffff8238dda3>] xfs_initialize_perag+0x3a3/0x810
        [<ffffffff824f679c>] xfs_growfs_data+0x9bc/0xbc0
        [<ffffffff8250b90e>] xfs_file_ioctl+0x5fe/0x14d0
        [<ffffffff81aa5194>] __x64_sys_ioctl+0x144/0x1c0
        [<ffffffff83c3d81f>] do_syscall_64+0x3f/0xe0
        [<ffffffff83e00087>] entry_SYSCALL_64_after_hwframe+0x62/0x6a
    
    Factor out xfs_free_unused_perag_range() from xfs_initialize_perag(),
    used for freeing unused perag within a specified range in error handling,
    included in the error path of the growfs failure.
    
    Fixes: 1c1c6ebcf528 ("xfs: Replace per-ag array with a radix tree")
    Signed-off-by: Long Li <leo.lilong@huawei.com>
    Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
    Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
    Acked-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: force all buffers to be written during btree bulk load [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:42 2025 -0700

    xfs: force all buffers to be written during btree bulk load
    
    [ Upstream commit 13ae04d8d45227c2ba51e188daf9fc13d08a1b12 ]
    
    While stress-testing online repair of btrees, I noticed periodic
    assertion failures from the buffer cache about buffers with incorrect
    DELWRI_Q state.  Looking further, I observed this race between the AIL
    trying to write out a btree block and repair zapping a btree block after
    the fact:
    
    AIL:    Repair0:
    
    pin buffer X
    delwri_queue:
    set DELWRI_Q
    add to delwri list
    
            stale buf X:
            clear DELWRI_Q
            does not clear b_list
            free space X
            commit
    
    delwri_submit   # oops
    
    Worse yet, I discovered that running the same repair over and over in a
    tight loop can result in a second race that cause data integrity
    problems with the repair:
    
    AIL:    Repair0:        Repair1:
    
    pin buffer X
    delwri_queue:
    set DELWRI_Q
    add to delwri list
    
            stale buf X:
            clear DELWRI_Q
            does not clear b_list
            free space X
            commit
    
                            find free space X
                            get buffer
                            rewrite buffer
                            delwri_queue:
                            set DELWRI_Q
                            already on a list, do not add
                            commit
    
                            BAD: committed tree root before all blocks written
    
    delwri_submit   # too late now
    
    I traced this to my own misunderstanding of how the delwri lists work,
    particularly with regards to the AIL's buffer list.  If a buffer is
    logged and committed, the buffer can end up on that AIL buffer list.  If
    btree repairs are run twice in rapid succession, it's possible that the
    first repair will invalidate the buffer and free it before the next time
    the AIL wakes up.  Marking the buffer stale clears DELWRI_Q from the
    buffer state without removing the buffer from its delwri list.  The
    buffer doesn't know which list it's on, so it cannot know which lock to
    take to protect the list for a removal.
    
    If the second repair allocates the same block, it will then recycle the
    buffer to start writing the new btree block.  Meanwhile, if the AIL
    wakes up and walks the buffer list, it will ignore the buffer because it
    can't lock it, and go back to sleep.
    
    When the second repair calls delwri_queue to put the buffer on the
    list of buffers to write before committing the new btree, it will set
    DELWRI_Q again, but since the buffer hasn't been removed from the AIL's
    buffer list, it won't add it to the bulkload buffer's list.
    
    This is incorrect, because the bulkload caller relies on delwri_submit
    to ensure that all the buffers have been sent to disk /before/
    committing the new btree root pointer.  This ordering requirement is
    required for data consistency.
    
    Worse, the AIL won't clear DELWRI_Q from the buffer when it does finally
    drop it, so the next thread to walk through the btree will trip over a
    debug assertion on that flag.
    
    To fix this, create a new function that waits for the buffer to be
    removed from any other delwri lists before adding the buffer to the
    caller's delwri list.  By waiting for the buffer to clear both the
    delwri list and any potential delwri wait list, we can be sure that
    repair will initiate writes of all buffers and report all write errors
    back to userspace instead of committing the new structure.
    
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: give xfs_extfree_intent its own perag reference [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Tue Apr 11 18:59:54 2023 -0700

    xfs: give xfs_extfree_intent its own perag reference
    
    commit f6b384631e1e3482c24e35b53adbd3da50e47e8f upstream.
    
    Give the xfs_extfree_intent an passive reference to the perag structure
    data.  This reference will be used to enable scrub intent draining
    functionality in subsequent patches.  The space being freed must already
    be allocated, so we need to able to run even if the AG is being offlined
    or shrunk.
    
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Dave Chinner <dchinner@redhat.com>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: initialise di_crc in xfs_log_dinode [+ + +]
Author: Dave Chinner <dchinner@redhat.com>
Date:   Thu Mar 13 13:25:43 2025 -0700

    xfs: initialise di_crc in xfs_log_dinode
    
    [ Upstream commit 0573676fdde7ce3829ee6a42a8e5a56355234712 ]
    
    Alexander Potapenko report that KMSAN was issuing these warnings:
    
    kmalloc-ed xlog buffer of size 512 : ffff88802fc26200
    kmalloc-ed xlog buffer of size 368 : ffff88802fc24a00
    kmalloc-ed xlog buffer of size 648 : ffff88802b631000
    kmalloc-ed xlog buffer of size 648 : ffff88802b632800
    kmalloc-ed xlog buffer of size 648 : ffff88802b631c00
    xlog_write_iovec: copying 12 bytes from ffff888017ddbbd8 to ffff88802c300400
    xlog_write_iovec: copying 28 bytes from ffff888017ddbbe4 to ffff88802c30040c
    xlog_write_iovec: copying 68 bytes from ffff88802fc26274 to ffff88802c300428
    xlog_write_iovec: copying 188 bytes from ffff88802fc262bc to ffff88802c30046c
    =====================================================
    BUG: KMSAN: uninit-value in xlog_write_iovec fs/xfs/xfs_log.c:2227
    BUG: KMSAN: uninit-value in xlog_write_full fs/xfs/xfs_log.c:2263
    BUG: KMSAN: uninit-value in xlog_write+0x1fac/0x2600 fs/xfs/xfs_log.c:2532
     xlog_write_iovec fs/xfs/xfs_log.c:2227
     xlog_write_full fs/xfs/xfs_log.c:2263
     xlog_write+0x1fac/0x2600 fs/xfs/xfs_log.c:2532
     xlog_cil_write_chain fs/xfs/xfs_log_cil.c:918
     xlog_cil_push_work+0x30f2/0x44e0 fs/xfs/xfs_log_cil.c:1263
     process_one_work kernel/workqueue.c:2630
     process_scheduled_works+0x1188/0x1e30 kernel/workqueue.c:2703
     worker_thread+0xee5/0x14f0 kernel/workqueue.c:2784
     kthread+0x391/0x500 kernel/kthread.c:388
     ret_from_fork+0x66/0x80 arch/x86/kernel/process.c:147
     ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
    
    Uninit was created at:
     slab_post_alloc_hook+0x101/0xac0 mm/slab.h:768
     slab_alloc_node mm/slub.c:3482
     __kmem_cache_alloc_node+0x612/0xae0 mm/slub.c:3521
     __do_kmalloc_node mm/slab_common.c:1006
     __kmalloc+0x11a/0x410 mm/slab_common.c:1020
     kmalloc ./include/linux/slab.h:604
     xlog_kvmalloc fs/xfs/xfs_log_priv.h:704
     xlog_cil_alloc_shadow_bufs fs/xfs/xfs_log_cil.c:343
     xlog_cil_commit+0x487/0x4dc0 fs/xfs/xfs_log_cil.c:1574
     __xfs_trans_commit+0x8df/0x1930 fs/xfs/xfs_trans.c:1017
     xfs_trans_commit+0x30/0x40 fs/xfs/xfs_trans.c:1061
     xfs_create+0x15af/0x2150 fs/xfs/xfs_inode.c:1076
     xfs_generic_create+0x4cd/0x1550 fs/xfs/xfs_iops.c:199
     xfs_vn_create+0x4a/0x60 fs/xfs/xfs_iops.c:275
     lookup_open fs/namei.c:3477
     open_last_lookups fs/namei.c:3546
     path_openat+0x29ac/0x6180 fs/namei.c:3776
     do_filp_open+0x24d/0x680 fs/namei.c:3809
     do_sys_openat2+0x1bc/0x330 fs/open.c:1440
     do_sys_open fs/open.c:1455
     __do_sys_openat fs/open.c:1471
     __se_sys_openat fs/open.c:1466
     __x64_sys_openat+0x253/0x330 fs/open.c:1466
     do_syscall_x64 arch/x86/entry/common.c:51
     do_syscall_64+0x4f/0x140 arch/x86/entry/common.c:82
     entry_SYSCALL_64_after_hwframe+0x63/0x6b arch/x86/entry/entry_64.S:120
    
    Bytes 112-115 of 188 are uninitialized
    Memory access of size 188 starts at ffff88802fc262bc
    
    This is caused by the struct xfs_log_dinode not having the di_crc
    field initialised. Log recovery never uses this field (it is only
    present these days for on-disk format compatibility reasons) and so
    it's value is never checked so nothing in XFS has caught this.
    
    Further, none of the uninitialised memory access warning tools have
    caught this (despite catching other uninit memory accesses in the
    struct xfs_log_dinode back in 2017!) until recently. Alexander
    annotated the XFS code to get the dump of the actual bytes that were
    detected as uninitialised, and from that report it took me about 30s
    to realise what the issue was.
    
    The issue was introduced back in 2016 and every inode that is logged
    fails to initialise this field. This is no actual bad behaviour
    caused by this issue - I find it hard to even classify it as a
    bug...
    
    Reported-and-tested-by: Alexander Potapenko <glider@google.com>
    Fixes: f8d55aa0523a ("xfs: introduce inode log format object")
    Signed-off-by: Dave Chinner <dchinner@redhat.com>
    Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: make rextslog computation consistent with mkfs [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:37 2025 -0700

    xfs: make rextslog computation consistent with mkfs
    
    [ Upstream commit a6a38f309afc4a7ede01242b603f36c433997780 ]
    
    There's a weird discrepancy in xfsprogs dating back to the creation of
    the Linux port -- if there are zero rt extents, mkfs will set
    sb_rextents and sb_rextslog both to zero:
    
            sbp->sb_rextslog =
                    (uint8_t)(rtextents ?
                            libxfs_highbit32((unsigned int)rtextents) : 0);
    
    However, that's not the check that xfs_repair uses for nonzero rtblocks:
    
            if (sb->sb_rextslog !=
                            libxfs_highbit32((unsigned int)sb->sb_rextents))
    
    The difference here is that xfs_highbit32 returns -1 if its argument is
    zero.  Unfortunately, this means that in the weird corner case of a
    realtime volume shorter than 1 rt extent, xfs_repair will immediately
    flag a freshly formatted filesystem as corrupt.  Because mkfs has been
    writing ondisk artifacts like this for decades, we have to accept that
    as "correct".  TBH, zero rextslog for zero rtextents makes more sense to
    me anyway.
    
    Regrettably, the superblock verifier checks created in commit copied
    xfs_repair even though mkfs has been writing out such filesystems for
    ages.  Fix the superblock verifier to accept what mkfs spits out; the
    userspace version of this patch will have to fix xfs_repair as well.
    
    Note that the new helper leaves the zeroday bug where the upper 32 bits
    of sb_rextents is ripped off and fed to highbit32.  This leads to a
    seriously undersized rt summary file, which immediately breaks mkfs:
    
    $ hugedisk.sh foo /dev/sdc $(( 0x100000080 * 4096))B
    $ /sbin/mkfs.xfs -f /dev/sda -m rmapbt=0,reflink=0 -r rtdev=/dev/mapper/foo
    meta-data=/dev/sda               isize=512    agcount=4, agsize=1298176 blks
             =                       sectsz=512   attr=2, projid32bit=1
             =                       crc=1        finobt=1, sparse=1, rmapbt=0
             =                       reflink=0    bigtime=1 inobtcount=1 nrext64=1
    data     =                       bsize=4096   blocks=5192704, imaxpct=25
             =                       sunit=0      swidth=0 blks
    naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
    log      =internal log           bsize=4096   blocks=16384, version=2
             =                       sectsz=512   sunit=0 blks, lazy-count=1
    realtime =/dev/mapper/foo        extsz=4096   blocks=4294967424, rtextents=4294967424
    Discarding blocks...Done.
    mkfs.xfs: Error initializing the realtime space [117 - Structure needs cleaning]
    
    The next patch will drop support for rt volumes with fewer than 1 or
    more than 2^32-1 rt extents, since they've clearly been broken forever.
    
    Fixes: f8e566c0f5e1f ("xfs: validate the realtime geometry in xfs_validate_sb_common")
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: move the xfs_rtbitmap.c declarations to xfs_rtbitmap.h [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:30 2025 -0700

    xfs: move the xfs_rtbitmap.c declarations to xfs_rtbitmap.h
    
    [ Upstream commit 13928113fc5b5e79c91796290a99ed991ac0efe2 ]
    
    [6.1: resolved conflicts with fscounters.c and rtsummary.c ]
    
    Move all the declarations for functionality in xfs_rtbitmap.c into a
    separate xfs_rtbitmap.h header file.
    
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
    Acked-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: pass per-ag references to xfs_free_extent [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:25 2025 -0700

    xfs: pass per-ag references to xfs_free_extent
    
    [ Upstream commit b2ccab3199aa7cea9154d80ea2585312c5f6eba0 ]
    
    Pass a reference to the per-AG structure to xfs_free_extent.  Most
    callers already have one, so we can eliminate unnecessary lookups.  The
    one exception to this is the EFI code, which the next patch will fix.
    
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Dave Chinner <dchinner@redhat.com>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: pass refcount intent directly through the log intent code [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:21 2025 -0700

    xfs: pass refcount intent directly through the log intent code
    
    [ Upstream commit 0b11553ec54a6d88907e60d0595dbcef98539747 ]
    
    Pass the incore refcount intent through the CUI logging code instead of
    repeatedly boxing and unboxing parameters.
    
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: pass the xfs_bmbt_irec directly through the log intent code [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:24 2025 -0700

    xfs: pass the xfs_bmbt_irec directly through the log intent code
    
    [ Upstream commit ddccb81b26ec021ae1f3366aa996cc4c68dd75ce ]
    
    Instead of repeatedly boxing and unboxing the incore extent mapping
    structure as it passes through the BUI code, pass the pointer directly
    through.
    
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: pass xfs_extent_free_item directly through the log intent code [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:22 2025 -0700

    xfs: pass xfs_extent_free_item directly through the log intent code
    
    [ Upstream commit 72ba455599ad13d08c29dafa22a32360e07b1961 ]
    
    Pass the incore xfs_extent_free_item through the EFI logging code
    instead of repeatedly boxing and unboxing parameters.
    
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: recompute growfsrtfree transaction reservation while growing rt volume [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:41 2025 -0700

    xfs: recompute growfsrtfree transaction reservation while growing rt volume
    
    [ Upstream commit 578bd4ce7100ae34f98c6b0147fe75cfa0dadbac ]
    
    While playing with growfs to create a 20TB realtime section on a
    filesystem that didn't previously have an rt section, I noticed that
    growfs would occasionally shut down the log due to a transaction
    reservation overflow.
    
    xfs_calc_growrtfree_reservation uses the current size of the realtime
    summary file (m_rsumsize) to compute the transaction reservation for a
    growrtfree transaction.  The reservations are computed at mount time,
    which means that m_rsumsize is zero when growfs starts "freeing" the new
    realtime extents into the rt volume.  As a result, the transaction is
    undersized and fails.
    
    Fix this by recomputing the transaction reservations every time we
    change m_rsumsize.
    
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: remove conditional building of rt geometry validator functions [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:49 2025 -0700

    xfs: remove conditional building of rt geometry validator functions
    
    [ Upstream commit 881f78f472556ed05588172d5b5676b48dc48240 ]
    
    [ 6.1: used 6.6 backport to minimize conflicts ]
    
    [backport: resolve merge conflicts due to refactoring rtbitmap/summary
    macros and accessors]
    
    I mistakenly turned off CONFIG_XFS_RT in the Kconfig file for arm64
    variant of the djwong-wtf git branch.  Unfortunately, it took me a good
    hour to figure out that RT wasn't built because this is what got printed
    to dmesg:
    
    XFS (sda2): realtime geometry sanity check failed
    XFS (sda2): Metadata corruption detected at xfs_sb_read_verify+0x170/0x190 [xfs], xfs_sb block 0x0
    
    Whereas I would have expected:
    
    XFS (sda2): Not built with CONFIG_XFS_RT
    XFS (sda2): RT mount failed
    
    The root cause of these problems is the conditional compilation of the
    new functions xfs_validate_rtextents and xfs_compute_rextslog that I
    introduced in the two commits listed below.  The !RT versions of these
    functions return false and 0, respectively, which causes primary
    superblock validation to fail, which explains the first message.
    
    Move the two functions to other parts of libxfs that are not
    conditionally defined by CONFIG_XFS_RT and remove the broken stubs so
    that validation works again.
    
    Fixes: e14293803f4e ("xfs: don't allow overly small or large realtime volumes")
    Fixes: a6a38f309afc ("xfs: make rextslog computation consistent with mkfs")
    Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
    Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
    Acked-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: remove unused fields from struct xbtree_ifakeroot [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:40 2025 -0700

    xfs: remove unused fields from struct xbtree_ifakeroot
    
    [ Upstream commit 4c8ecd1cfdd01fb727121035014d9f654a30bdf2 ]
    
    Remove these unused fields since nobody uses them.  They should have
    been removed years ago in a different cleanup series from Christoph
    Hellwig.
    
    Fixes: daf83964a3681 ("xfs: move the per-fork nextents fields into struct xfs_ifork")
    Fixes: f7e67b20ecbbc ("xfs: move the fork format fields into struct xfs_ifork")
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Dave Chinner <dchinner@redhat.com>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: reserve less log space when recovering log intent items [+ + +]
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Thu Mar 13 13:25:29 2025 -0700

    xfs: reserve less log space when recovering log intent items
    
    [ Upstream commit 3c919b0910906cc69d76dea214776f0eac73358b ]
    
    Wengang Wang reports that a customer's system was running a number of
    truncate operations on a filesystem with a very small log.  Contention
    on the reserve heads lead to other threads stalling on smaller updates
    (e.g.  mtime updates) long enough to result in the node being rebooted
    on account of the lack of responsivenes.  The node failed to recover
    because log recovery of an EFI became stuck waiting for a grant of
    reserve space.  From Wengang's report:
    
    "For the file deletion, log bytes are reserved basing on
    xfs_mount->tr_itruncate which is:
    
        tr_logres = 175488,
        tr_logcount = 2,
        tr_logflags = XFS_TRANS_PERM_LOG_RES,
    
    "You see it's a permanent log reservation with two log operations (two
    transactions in rolling mode).  After calculation (xlog_calc_unit_res()
    adds space for various log headers), the final log space needed per
    transaction changes from  175488 to 180208 bytes.  So the total log
    space needed is 360416 bytes (180208 * 2).  [That quantity] of log space
    (360416 bytes) needs to be reserved for both run time inode removing
    (xfs_inactive_truncate()) and EFI recover (xfs_efi_item_recover())."
    
    In other words, runtime pre-reserves 360K of space in anticipation of
    running a chain of two transactions in which each transaction gets a
    180K reservation.
    
    Now that we've allocated the transaction, we delete the bmap mapping,
    log an EFI to free the space, and roll the transaction as part of
    finishing the deferops chain.  Rolling creates a new xfs_trans which
    shares its ticket with the old transaction.  Next, xfs_trans_roll calls
    __xfs_trans_commit with regrant == true, which calls xlog_cil_commit
    with the same regrant parameter.
    
    xlog_cil_commit calls xfs_log_ticket_regrant, which decrements t_cnt and
    subtracts t_curr_res from the reservation and write heads.
    
    If the filesystem is fresh and the first transaction only used (say)
    20K, then t_curr_res will be 160K, and we give that much reservation
    back to the reservation head.  Or if the file is really fragmented and
    the first transaction actually uses 170K, then t_curr_res will be 10K,
    and that's what we give back to the reservation.
    
    Having done that, we're now headed into the second transaction with an
    EFI and 180K of reservation.  Other threads apparently consumed all the
    reservation for smaller transactions, such as timestamp updates.
    
    Now let's say the first transaction gets written to disk and we crash
    without ever completing the second transaction.  Now we remount the fs,
    log recovery finds the unfinished EFI, and calls xfs_efi_recover to
    finish the EFI.  However, xfs_efi_recover starts a new tr_itruncate
    tranasction, which asks for 360K log reservation.  This is a lot more
    than the 180K that we had reserved at the time of the crash.  If the
    first EFI to be recovered is also pinning the tail of the log, we will
    be unable to free any space in the log, and recovery livelocks.
    
    Wengang confirmed this:
    
    "Now we have the second transaction which has 180208 log bytes reserved
    too. The second transaction is supposed to process intents including
    extent freeing.  With my hacking patch, I blocked the extent freeing 5
    hours. So in that 5 hours, 180208 (NOT 360416) log bytes are reserved.
    
    "With my test case, other transactions (update timestamps) then happen.
    As my hacking patch pins the journal tail, those timestamp-updating
    transactions finally use up (almost) all the left available log space
    (in memory in on disk).  And finally the on disk (and in memory)
    available log space goes down near to 180208 bytes.  Those 180208 bytes
    are reserved by [the] second (extent-free) transaction [in the chain]."
    
    Wengang and I noticed that EFI recovery starts a transaction, completes
    one step of the chain, and commits the transaction without completing
    any other steps of the chain.  Those subsequent steps are completed by
    xlog_finish_defer_ops, which allocates yet another transaction to
    finish the rest of the chain.  That transaction gets the same tr_logres
    as the head transaction, but with tr_logcount = 1 to force regranting
    with every roll to avoid livelocks.
    
    In other words, we already figured this out in commit 929b92f64048d
    ("xfs: xfs_defer_capture should absorb remaining transaction
    reservation"), but should have applied that logic to each intent item's
    recovery function.  For Wengang's case, the xfs_trans_alloc call in the
    EFI recovery function should only be asking for a single transaction's
    worth of log reservation -- 180K, not 360K.
    
    Quoting Wengang again:
    
    "With log recovery, during EFI recovery, we use tr_itruncate again to
    reserve two transactions that needs 360416 log bytes.  Reserving 360416
    bytes fails [stalls] because we now only have about 180208 available.
    
    "Actually during the EFI recover, we only need one transaction to free
    the extents just like the 2nd transaction at RUNTIME.  So it only needs
    to reserve 180208 rather than 360416 bytes.  We have (a bit) more than
    180208 available log bytes on disk, so [if we decrease the reservation
    to 180K] the reservation goes and the recovery [finishes].  That is to
    say: we can fix the log recover part to fix the issue. We can introduce
    a new xfs_trans_res xfs_mount->tr_ext_free
    
    {
      tr_logres = 175488,
      tr_logcount = 0,
      tr_logflags = 0,
    }
    
    "and use tr_ext_free instead of tr_itruncate in EFI recover."
    
    However, I don't think it quite makes sense to create an entirely new
    transaction reservation type to handle single-stepping during log
    recovery.  Instead, we should copy the transaction reservation
    information in the xfs_mount, change tr_logcount to 1, and pass that
    into xfs_trans_alloc.  We know this won't risk changing the min log size
    computation since we always ask for a fraction of the reservation for
    all known transaction types.
    
    This looks like it's been lurking in the codebase since commit
    3d3c8b5222b92, which changed the xfs_trans_reserve call in
    xlog_recover_process_efi to use the tr_logcount in tr_itruncate.
    That changed the EFI recovery transaction from making a
    non-XFS_TRANS_PERM_LOG_RES request for one transaction's worth of log
    space to a XFS_TRANS_PERM_LOG_RES request for two transactions worth.
    
    Fixes: 3d3c8b5222b92 ("xfs: refactor xfs_trans_reserve() interface")
    Complements: 929b92f64048d ("xfs: xfs_defer_capture should absorb remaining transaction reservation")
    Suggested-by: Wengang Wang <wen.gang.wang@oracle.com>
    Cc: Srikanth C S <srikanth.c.s@oracle.com>
    [djwong: apply the same transformation to all log intent recovery]
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Dave Chinner <dchinner@redhat.com>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: reset XFS_ATTR_INCOMPLETE filter on node removal [+ + +]
Author: Andrey Albershteyn <aalbersh@redhat.com>
Date:   Thu Mar 13 13:25:48 2025 -0700

    xfs: reset XFS_ATTR_INCOMPLETE filter on node removal
    
    [ Upstream commit 82ef1a5356572219f41f9123ca047259a77bd67b ]
    
    In XFS_DAS_NODE_REMOVE_ATTR case, xfs_attr_mode_remove_attr() sets
    filter to XFS_ATTR_INCOMPLETE. The filter is then reset in
    xfs_attr_complete_op() if XFS_DA_OP_REPLACE operation is performed.
    
    The filter is not reset though if XFS just removes the attribute
    (args->value == NULL) with xfs_attr_defer_remove(). attr code goes
    to XFS_DAS_DONE state.
    
    Fix this by always resetting XFS_ATTR_INCOMPLETE filter. The replace
    operation already resets this filter in anyway and others are
    completed at this step hence don't need it.
    
    Fixes: fdaf1bb3cafc ("xfs: ATTR_REPLACE algorithm with LARP enabled needs rework")
    Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: update dir3 leaf block metadata after swap [+ + +]
Author: Zhang Tianci <zhangtianci.1997@bytedance.com>
Date:   Thu Mar 13 13:25:47 2025 -0700

    xfs: update dir3 leaf block metadata after swap
    
    [ Upstream commit 5759aa4f956034b289b0ae2c99daddfc775442e1 ]
    
    xfs_da3_swap_lastblock() copy the last block content to the dead block,
    but do not update the metadata in it. We need update some metadata
    for some kinds of type block, such as dir3 leafn block records its
    blkno, we shall update it to the dead block blkno. Otherwise,
    before write the xfs_buf to disk, the verify_write() will fail in
    blk_hdr->blkno != xfs_buf->b_bn, then xfs will be shutdown.
    
    We will get this warning:
    
      XFS (dm-0): Metadata corruption detected at xfs_dir3_leaf_verify+0xa8/0xe0 [xfs], xfs_dir3_leafn block 0x178
      XFS (dm-0): Unmount and run xfs_repair
      XFS (dm-0): First 128 bytes of corrupted metadata buffer:
      00000000e80f1917: 00 80 00 0b 00 80 00 07 3d ff 00 00 00 00 00 00  ........=.......
      000000009604c005: 00 00 00 00 00 00 01 a0 00 00 00 00 00 00 00 00  ................
      000000006b6fb2bf: e4 44 e3 97 b5 64 44 41 8b 84 60 0e 50 43 d9 bf  .D...dDA..`.PC..
      00000000678978a2: 00 00 00 00 00 00 00 83 01 73 00 93 00 00 00 00  .........s......
      00000000b28b247c: 99 29 1d 38 00 00 00 00 99 29 1d 40 00 00 00 00  .).8.....).@....
      000000002b2a662c: 99 29 1d 48 00 00 00 00 99 49 11 00 00 00 00 00  .).H.....I......
      00000000ea2ffbb8: 99 49 11 08 00 00 45 25 99 49 11 10 00 00 48 fe  .I....E%.I....H.
      0000000069e86440: 99 49 11 18 00 00 4c 6b 99 49 11 20 00 00 4d 97  .I....Lk.I. ..M.
      XFS (dm-0): xfs_do_force_shutdown(0x8) called from line 1423 of file fs/xfs/xfs_buf.c.  Return address = 00000000c0ff63c1
      XFS (dm-0): Corruption of in-memory data detected.  Shutting down filesystem
      XFS (dm-0): Please umount the filesystem and rectify the problem(s)
    
    >>From the log above, we know xfs_buf->b_no is 0x178, but the block's hdr record
    its blkno is 0x1a0.
    
    Fixes: 24df33b45ecf ("xfs: add CRC checking to dir2 leaf blocks")
    Signed-off-by: Zhang Tianci <zhangtianci.1997@bytedance.com>
    Suggested-by: Dave Chinner <david@fromorbit.com>
    Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: use deferred frees for btree block freeing [+ + +]
Author: Dave Chinner <dchinner@redhat.com>
Date:   Thu Mar 13 13:25:28 2025 -0700

    xfs: use deferred frees for btree block freeing
    
    [ Upstream commit b742d7b4f0e03df25c2a772adcded35044b625ca ]
    
    [ 6.1: resolved conflict in xfs_extfree_item.c ]
    
    Btrees that aren't freespace management trees use the normal extent
    allocation and freeing routines for their blocks. Hence when a btree
    block is freed, a direct call to xfs_free_extent() is made and the
    extent is immediately freed. This puts the entire free space
    management btrees under this path, so we are stacking btrees on
    btrees in the call stack. The inobt, finobt and refcount btrees
    all do this.
    
    However, the bmap btree does not do this - it calls
    xfs_free_extent_later() to defer the extent free operation via an
    XEFI and hence it gets processed in deferred operation processing
    during the commit of the primary transaction (i.e. via intent
    chaining).
    
    We need to change xfs_free_extent() to behave in a non-blocking
    manner so that we can avoid deadlocks with busy extents near ENOSPC
    in transactions that free multiple extents. Inserting or removing a
    record from a btree can cause a multi-level tree merge operation and
    that will free multiple blocks from the btree in a single
    transaction. i.e. we can call xfs_free_extent() multiple times, and
    hence the btree manipulation transaction is vulnerable to this busy
    extent deadlock vector.
    
    To fix this, convert all the remaining callers of xfs_free_extent()
    to use xfs_free_extent_later() to queue XEFIs and hence defer
    processing of the extent frees to a context that can be safely
    restarted if a deadlock condition is detected.
    
    Signed-off-by: Dave Chinner <dchinner@redhat.com>
    Reviewed-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfs: validate block number being freed before adding to xefi [+ + +]
Author: Dave Chinner <dchinner@redhat.com>
Date:   Thu Mar 13 13:25:26 2025 -0700

    xfs: validate block number being freed before adding to xefi
    
    [ Upstream commit 7dfee17b13e5024c5c0ab1911859ded4182de3e5 ]
    
    Bad things happen in defered extent freeing operations if it is
    passed a bad block number in the xefi. This can come from a bogus
    agno/agbno pair from deferred agfl freeing, or just a bad fsbno
    being passed to __xfs_free_extent_later(). Either way, it's very
    difficult to diagnose where a null perag oops in EFI creation
    is coming from when the operation that queued the xefi has already
    been completed and there's no longer any trace of it around....
    
    Signed-off-by: Dave Chinner <dchinner@redhat.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Dave Chinner <david@fromorbit.com>
    Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
    Acked-by: "Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
xsk: fix an integer overflow in xp_create_and_assign_umem() [+ + +]
Author: Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
Date:   Thu Mar 13 08:50:08 2025 +0000

    xsk: fix an integer overflow in xp_create_and_assign_umem()
    
    commit 559847f56769037e5b2e0474d3dbff985b98083d upstream.
    
    Since the i and pool->chunk_size variables are of type 'u32',
    their product can wrap around and then be cast to 'u64'.
    This can lead to two different XDP buffers pointing to the same
    memory area.
    
    Found by InfoTeCS on behalf of Linux Verification Center
    (linuxtesting.org) with SVACE.
    
    Fixes: 94033cd8e73b ("xsk: Optimize for aligned case")
    Cc: stable@vger.kernel.org
    Signed-off-by: Ilia Gavrilov <Ilia.Gavrilov@infotecs.ru>
    Link: https://patch.msgid.link/20250313085007.3116044-1-Ilia.Gavrilov@infotecs.ru
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>