Linux 6.8.6

 
accel/habanalabs: increase HL_MAX_STR to 64 bytes to avoid warnings [+ + +]
Author: Koby Elbaz <kelbaz@habana.ai>
Date:   Mon Dec 11 10:03:29 2023 +0200

    accel/habanalabs: increase HL_MAX_STR to 64 bytes to avoid warnings
    
    [ Upstream commit 8c075401f2dbda43600c61f780a165abde77877a ]
    
    Fix a warning of a buffer overflow:
    ‘snprintf’ output between 38 and 47 bytes into a destination of size 32
    
    Signed-off-by: Koby Elbaz <kelbaz@habana.ai>
    Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
    Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ACPI: resource: Add IRQ override quirk for ASUS ExpertBook B2502FBA [+ + +]
Author: Sviatoslav Harasymchuk <sviatoslav.harasymchuk@gmail.com>
Date:   Sun Feb 11 01:08:07 2024 +0100

    ACPI: resource: Add IRQ override quirk for ASUS ExpertBook B2502FBA
    
    [ Upstream commit 0793e511c4c66c38dd26add86f7236bcdc70c3b5 ]
    
    In order to fix the keyboard on ASUS ExpertBook B2502FBA, add an IRQ override
    quirk for it in analogy with how it was done for other members of this machine
    family.
    
    Link: https://lore.kernel.org/linux-acpi/20230411183144.6932-1-pmenzel@molgen.mpg.de
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=217323
    Signed-off-by: Sviatoslav Harasymchuk <sviatoslav.harasymchuk@gmail.com>
    [ rjw: Subject and changelog rewrite, fix broken white space ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ACPI: x86: Add DELL0501 handling to acpi_quirk_skip_serdev_enumeration() [+ + +]
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sun Feb 18 16:15:33 2024 +0100

    ACPI: x86: Add DELL0501 handling to acpi_quirk_skip_serdev_enumeration()
    
    [ Upstream commit 99b572e6136eab69a8c91d72cf8595b256e304b5 ]
    
    Some recent(ish) Dell AIO devices have a backlight controller board
    connected to an UART.
    
    This UART has a DELL0501 HID with CID set to PNP0501 so that the UART is
    still handled by 8250_pnp.c. Unfortunately there is no separate ACPI device
    with an UartSerialBusV2() resource to model the backlight-controller.
    This causes the kernel to create a /dev/ttyS0 char-device for the UART
    instead of creating an in kernel serdev-controller + serdev-device pair
    for a kernel backlight driver.
    
    Use the existing acpi_quirk_skip_serdev_enumeration() mechanism to work
    around this by returning skip=true for tty-ctrl parents with a HID
    of DELL0501.
    
    Like other cases where the UartSerialBusV2() resource is missing or broken
    this will only create the serdev-controller device and the serdev-device
    itself will need to be instantiated by platform code.
    
    Unfortunately in this case there is no device for the platform-code
    instantiating the serdev-device to bind to. So also create
    a platform_device for this.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ACPI: x86: Move acpi_quirk_skip_serdev_enumeration() out of CONFIG_X86_ANDROID_TABLETS [+ + +]
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sun Feb 18 16:15:32 2024 +0100

    ACPI: x86: Move acpi_quirk_skip_serdev_enumeration() out of CONFIG_X86_ANDROID_TABLETS
    
    [ Upstream commit 7c86e17455de1a442ec906d3449148b5e9a218a4 ]
    
    Some recent(ish) Dell AIO devices have a backlight controller board
    connected to an UART.
    
    This UART has a DELL0501 HID with CID set to PNP0501 so that the UART is
    still handled by 8250_pnp.c. Unfortunately there is no separate ACPI device
    with an UartSerialBusV2() resource to model the backlight-controller.
    
    The next patch in this series will use acpi_quirk_skip_serdev_enumeration()
    to still create a serdev for this for a backlight driver to bind to
    instead of creating a /dev/ttyS0.
    
    This new acpi_quirk_skip_serdev_enumeration() use is not limited to Android
    X86 tablets, so move it out of the ifdef CONFIG_X86_ANDROID_TABLETS block.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ALSA: firewire-lib: handle quirk to calculate payload quadlets as data block counter [+ + +]
Author: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Date:   Sun Feb 18 16:41:27 2024 +0900

    ALSA: firewire-lib: handle quirk to calculate payload quadlets as data block counter
    
    [ Upstream commit 4a486439d2ca85752c46711f373b6ddc107bb35d ]
    
    Miglia Harmony Audio (OXFW970) has a quirk to put the number of
    accumulated quadlets in CIP payload into the dbc field of CIP header.
    
    This commit handles the quirk in the packet processing layer.
    
    Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
    Link: https://lore.kernel.org/r/20240218074128.95210-4-o-takashi@sakamocchi.jp
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ALSA: hda/realtek: Add quirk for Lenovo Yoga 9 14IMH9 [+ + +]
Author: Jichi Zhang <i@jichi.ca>
Date:   Fri Mar 15 01:19:56 2024 -0700

    ALSA: hda/realtek: Add quirk for Lenovo Yoga 9 14IMH9
    
    [ Upstream commit 9b714a59b719b1ba9382c092f0f7aa4bbe94eba1 ]
    
    The speakers on the Lenovo Yoga 9 14IMH9 are similar to previous generations
    such as the 14IAP7, and the bass speakers can be fixed using similar methods
    with one caveat: 14IMH9 uses CS35L41 amplifiers which need to be activated
    separately.
    
    Signed-off-by: Jichi Zhang <i@jichi.ca>
    Message-ID: <20240315081954.45470-3-i@jichi.ca>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ALSA: hda/realtek: Add quirks for some Clevo laptops [+ + +]
Author: Tim Crawford <tcrawford@system76.com>
Date:   Tue Mar 19 15:27:26 2024 -0600

    ALSA: hda/realtek: Add quirks for some Clevo laptops
    
    [ Upstream commit 33affa7fb46c0c07f6c49d4ddac9dd436715064c ]
    
    Add audio quirks to fix speaker output and headset detection on some new
    Clevo models:
    
    - L240TU (ALC245)
    - PE60SNE-G (ALC1220)
    - V350SNEQ (ALC245)
    
    Co-authored-by: Jeremy Soller <jeremy@system76.com>
    Signed-off-by: Tim Crawford <tcrawford@system76.com>
    Message-ID: <20240319212726.62888-1-tcrawford@system76.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
amdkfd: use calloc instead of kzalloc to avoid integer overflow [+ + +]
Author: Dave Airlie <airlied@redhat.com>
Date:   Fri Apr 12 06:11:25 2024 +1000

    amdkfd: use calloc instead of kzalloc to avoid integer overflow
    
    commit 3b0daecfeac0103aba8b293df07a0cbaf8b43f29 upstream.
    
    This uses calloc instead of doing the multiplication which might
    overflow.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
arm64: dts: qcom: qcm6490-idp: Add definition for three LEDs [+ + +]
Author: Hui Liu <quic_huliu@quicinc.com>
Date:   Fri Jan 26 10:56:52 2024 +0800

    arm64: dts: qcom: qcm6490-idp: Add definition for three LEDs
    
    [ Upstream commit 8385383cc2c2f7039ecc57864043112cdc7026c7 ]
    
    Add definition for three LEDs to make sure they can
    be enabled base on QCOM LPG LED driver.
    
    Signed-off-by: Hui Liu <quic_huliu@quicinc.com>
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    Link: https://lore.kernel.org/r/20240126-lpg-v6-1-f879cecbce69@quicinc.com
    Signed-off-by: Bjorn Andersson <andersson@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

arm64: dts: qcom: qcs6490-rb3gen2: Declare GCC clocks protected [+ + +]
Author: Bjorn Andersson <quic_bjorande@quicinc.com>
Date:   Fri Feb 9 15:21:48 2024 -0800

    arm64: dts: qcom: qcs6490-rb3gen2: Declare GCC clocks protected
    
    [ Upstream commit 7c6bef576a8891abce08d448165b53328032aa5f ]
    
    The SC7280 GCC binding describes clocks which, due to the difference in
    security model, are not accessible on the RB3gen2 - in the same way seen
    on QCM6490.
    
    Mark these clocks as protected, to allow the board to boot. In contrast
    to the present QCM6490 boards GCC_EDP_CLKREF_EN is left out, as this
    does not need to be "protected" and is used on the RB3Gen2 board.
    
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    Reviewed-by: Luca Weiss <luca.weiss@fairphone.com>
    Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
    Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
    Link: https://lore.kernel.org/r/20240209-qcm6490-gcc-protected-clocks-v2-1-11cd5fc13bd0@quicinc.com
    Signed-off-by: Bjorn Andersson <andersson@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

arm64: dts: qcom: qrb2210-rb1: disable cluster power domains [+ + +]
Author: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Date:   Tue Jan 30 18:48:08 2024 +0200

    arm64: dts: qcom: qrb2210-rb1: disable cluster power domains
    
    [ Upstream commit 7f492d48f08207e4ee23edc926b11de9f720aa61 ]
    
    If cluster domain idle state is enabled on the RB1, the board becomes
    significantly less responsive. Under certain circumstances (if some of
    the devices are disabled in kernel config) the board can even lock up.
    
    It seems this is caused by the MPM not updating wakeup timer during CPU
    idle (in the same way the RPMh updates it when cluster idle state is
    entered).
    
    Disable cluster domain idle for the RB1 board until MPM driver is fixed
    to cooperate with the CPU idle states.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    Link: https://lore.kernel.org/r/20240130-rb1-suspend-cluster-v2-1-5bc1109b0869@linaro.org
    Signed-off-by: Bjorn Andersson <andersson@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

arm64: dts: rockchip: fix rk3328 hdmi ports node [+ + +]
Author: Johan Jonker <jbx6244@gmail.com>
Date:   Wed Jan 31 22:17:08 2024 +0100

    arm64: dts: rockchip: fix rk3328 hdmi ports node
    
    [ Upstream commit 1d00ba4700d1e0f88ae70d028d2e17e39078fa1c ]
    
    Fix rk3328 hdmi ports node so that it matches the
    rockchip,dw-hdmi.yaml binding.
    
    Signed-off-by: Johan Jonker <jbx6244@gmail.com>
    Link: https://lore.kernel.org/r/e5dea3b7-bf84-4474-9530-cc2da3c41104@gmail.com
    Signed-off-by: Heiko Stuebner <heiko@sntech.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

arm64: dts: rockchip: fix rk3399 hdmi ports node [+ + +]
Author: Johan Jonker <jbx6244@gmail.com>
Date:   Wed Jan 31 22:17:31 2024 +0100

    arm64: dts: rockchip: fix rk3399 hdmi ports node
    
    [ Upstream commit f051b6ace7ffcc48d6d1017191f167c0a85799f6 ]
    
    Fix rk3399 hdmi ports node so that it matches the
    rockchip,dw-hdmi.yaml binding.
    
    Signed-off-by: Johan Jonker <jbx6244@gmail.com>
    Link: https://lore.kernel.org/r/a6ab6f75-3b80-40b1-bd30-3113e14becdd@gmail.com
    Signed-off-by: Heiko Stuebner <heiko@sntech.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ARM: dts: rockchip: fix rk322x hdmi ports node [+ + +]
Author: Johan Jonker <jbx6244@gmail.com>
Date:   Wed Jan 31 22:16:55 2024 +0100

    ARM: dts: rockchip: fix rk322x hdmi ports node
    
    [ Upstream commit 15a5ed03000cf61daf87d14628085cb1bc8ae72c ]
    
    Fix rk322x hdmi ports node so that it matches the
    rockchip,dw-hdmi.yaml binding.
    
    Signed-off-by: Johan Jonker <jbx6244@gmail.com>
    Link: https://lore.kernel.org/r/9b84adf0-9312-47fd-becc-cadd06941f70@gmail.com
    Signed-off-by: Heiko Stuebner <heiko@sntech.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ARM: dts: rockchip: fix rk3288 hdmi ports node [+ + +]
Author: Johan Jonker <jbx6244@gmail.com>
Date:   Wed Jan 31 22:16:41 2024 +0100

    ARM: dts: rockchip: fix rk3288 hdmi ports node
    
    [ Upstream commit 585e4dc07100a6465b3da8d24e46188064c1c925 ]
    
    Fix rk3288 hdmi ports node so that it matches the
    rockchip,dw-hdmi.yaml binding with some reordering
    to align with the (new) documentation about
    property ordering.
    
    Signed-off-by: Johan Jonker <jbx6244@gmail.com>
    Link: https://lore.kernel.org/r/cc3a9b4f-076d-4660-b464-615003b6a066@gmail.com
    Signed-off-by: Heiko Stuebner <heiko@sntech.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ASoC: amd: yc: Fix non-functional mic on ASUS M7600RE [+ + +]
Author: M Cooley <m.cooley.198@gmail.com>
Date:   Fri Mar 8 17:35:40 2024 -0500

    ASoC: amd: yc: Fix non-functional mic on ASUS M7600RE
    
    [ Upstream commit db185362fca554b201e2c62beb15a02bb39a064b ]
    
    The ASUS M7600RE (Vivobook Pro 16X OLED) needs a quirks-table entry for the
    internal microphone to function properly.
    
    Signed-off-by: Mitch Cooley <m.cooley.198@gmail.com>
    
    Link: https://msgid.link/r/CALijGznExWW4fujNWwMzmn_K=wo96sGzV_2VkT7NjvEUdkg7Gw@mail.gmail.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: Intel: avs: Populate board selection with new I2S entries [+ + +]
Author: Cezary Rojewski <cezary.rojewski@intel.com>
Date:   Tue Feb 20 12:50:35 2024 +0100

    ASoC: Intel: avs: Populate board selection with new I2S entries
    
    [ Upstream commit 5b417fe0cded0b5917683398e6519aae8045cd40 ]
    
    Update board selection with tables specifying supported I2S
    configurations. DMIC/HDAudio board selection require no update as
    dmic/hdaudio machine boards are generic and not tied to any specific
    codec.
    
    Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
    Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
    Link: https://msgid.link/r/20240220115035.770402-11-cezary.rojewski@intel.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: Intel: common: DMI remap for rebranded Intel NUC M15 (LAPRC710) laptops [+ + +]
Author: mosomate <mosomate@gmail.com>
Date:   Thu Feb 8 10:55:40 2024 -0600

    ASoC: Intel: common: DMI remap for rebranded Intel NUC M15 (LAPRC710) laptops
    
    [ Upstream commit c13e03126a5be90781084437689724254c8226e1 ]
    
    Added DMI quirk to handle the rebranded variants of Intel NUC M15
    (LAPRC710) laptops. The DMI matching is based on motherboard
    attributes.
    
    Link: https://github.com/thesofproject/linux/issues/4218
    Signed-off-by: Máté Mosonyi <mosomate@gmail.com>
    Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
    Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Link: https://lore.kernel.org/r/20240208165545.93811-20-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: Intel: sof_rt5682: dmi quirk cleanup for mtl boards [+ + +]
Author: Brent Lu <brent.lu@intel.com>
Date:   Thu Feb 8 10:55:27 2024 -0600

    ASoC: Intel: sof_rt5682: dmi quirk cleanup for mtl boards
    
    [ Upstream commit 7a2a8730d51f95b263a1e8b888598dc6395220dc ]
    
    Some dmi quirks are duplicated since codec and amplifier type are
    removed from board quirk. Remove redundant quirks.
    
    Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
    Signed-off-by: Brent Lu <brent.lu@intel.com>
    Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Link: https://lore.kernel.org/r/20240208165545.93811-7-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: soc-core.c: Skip dummy codec when adding platforms [+ + +]
Author: Chancel Liu <chancel.liu@nxp.com>
Date:   Tue Mar 5 15:56:06 2024 +0900

    ASoC: soc-core.c: Skip dummy codec when adding platforms
    
    [ Upstream commit 23fb6bc2696119391ec3a92ccaffe50e567c515e ]
    
    When pcm_runtime is adding platform components it will scan all
    registered components. In case of DPCM FE/BE some DAI links will
    configure dummy platform. However both dummy codec and dummy platform
    are using "snd-soc-dummy" as component->name. Dummy codec should be
    skipped when adding platforms otherwise there'll be overflow and UBSAN
    complains.
    
    Reported-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
    Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
    Link: https://msgid.link/r/20240305065606.3778642-1-chancel.liu@nxp.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: SOF: amd: Optimize quirk for Valve Galileo [+ + +]
Author: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Date:   Tue Dec 19 05:07:24 2023 +0200

    ASoC: SOF: amd: Optimize quirk for Valve Galileo
    
    [ Upstream commit a13f0c3c0e8fb3e61fbfd99c6b350cf9be0c4660 ]
    
    Valve's Steam Deck OLED is uniquely identified by vendor and product
    name (Galileo) DMI fields.
    
    Simplify the quirk by removing the unnecessary match on product family.
    
    Additionally, fix the related comment as it points to the old product
    variant.
    
    Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
    Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
    Link: https://msgid.link/r/20231219030728.2431640-7-cristian.ciocaltea@collabora.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
block: prevent division by zero in blk_rq_stat_sum() [+ + +]
Author: Roman Smirnov <r.smirnov@omp.ru>
Date:   Tue Mar 5 16:45:09 2024 +0300

    block: prevent division by zero in blk_rq_stat_sum()
    
    [ Upstream commit 93f52fbeaf4b676b21acfe42a5152620e6770d02 ]
    
    The expression dst->nr_samples + src->nr_samples may
    have zero value on overflow. It is necessary to add
    a check to avoid division by zero.
    
    Found by Linux Verification Center (linuxtesting.org) with Svace.
    
    Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
    Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
    Link: https://lore.kernel.org/r/20240305134509.23108-1-r.smirnov@omp.ru
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Bluetooth: Add new quirk for broken read key length on ATS2851 [+ + +]
Author: Vinicius Peixoto <nukelet64@gmail.com>
Date:   Mon Feb 26 22:43:26 2024 -0300

    Bluetooth: Add new quirk for broken read key length on ATS2851
    
    [ Upstream commit 48201a3b3f398be6a01f78a14b18bd5d31c47458 ]
    
    The ATS2851 controller erroneously reports support for the "Read
    Encryption Key Length" HCI command. This makes it unable to connect
    to any devices, since this command is issued by the kernel during the
    connection process in response to an "Encryption Change" HCI event.
    
    Add a new quirk (HCI_QUIRK_BROKEN_ENC_KEY_SIZE) to hint that the command
    is unsupported, preventing it from interrupting the connection process.
    
    This is the error log from btmon before this patch:
    
    > HCI Event: Encryption Change (0x08) plen 4
            Status: Success (0x00)
            Handle: 2048 Address: ...
            Encryption: Enabled with E0 (0x01)
    < HCI Command: Read Encryption Key Size (0x05|0x0008) plen 2
            Handle: 2048 Address: ...
    > HCI Event: Command Status (0x0f) plen 4
          Read Encryption Key Size (0x05|0x0008) ncmd 1
            Status: Unknown HCI Command (0x01)
    
    Signed-off-by: Vinicius Peixoto <nukelet64@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: btintel: Fix null ptr deref in btintel_read_version [+ + +]
Author: Edward Adam Davis <eadavis@qq.com>
Date:   Thu Jan 18 12:40:34 2024 +0800

    Bluetooth: btintel: Fix null ptr deref in btintel_read_version
    
    [ Upstream commit b79e040910101b020931ba0c9a6b77e81ab7f645 ]
    
    If hci_cmd_sync_complete() is triggered and skb is NULL, then
    hdev->req_skb is NULL, which will cause this issue.
    
    Reported-and-tested-by: syzbot+830d9e3fa61968246abd@syzkaller.appspotmail.com
    Signed-off-by: Edward Adam Davis <eadavis@qq.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: btintel: Fixe build regression [+ + +]
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date:   Fri Feb 23 12:36:23 2024 -0500

    Bluetooth: btintel: Fixe build regression
    
    commit 6e62ebfb49eb65bdcbfc5797db55e0ce7f79c3dd upstream.
    
    This fixes the following build regression:
    
    drivers-bluetooth-btintel.c-btintel_read_version()-warn:
    passing-zero-to-PTR_ERR
    
    Fixes: b79e04091010 ("Bluetooth: btintel: Fix null ptr deref in btintel_read_version")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: btmtk: Add MODULE_FIRMWARE() for MT7922 [+ + +]
Author: Takashi Iwai <tiwai@suse.de>
Date:   Tue Feb 27 11:29:14 2024 +0100

    Bluetooth: btmtk: Add MODULE_FIRMWARE() for MT7922
    
    [ Upstream commit 3e465a07cdf444140f16bc57025c23fcafdde997 ]
    
    Since dracut refers to the module info for defining the required
    firmware files and btmtk driver doesn't provide the firmware info for
    MT7922, the generate initrd misses the firmware, resulting in the
    broken Bluetooth.
    
    This patch simply adds the MODULE_FIRMWARE() for the missing entry
    for covering that.
    
    Link: https://bugzilla.suse.com/show_bug.cgi?id=1214133
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
    Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
bnx2x: Fix firmware version string character counts [+ + +]
Author: Kees Cook <keescook@chromium.org>
Date:   Thu Jan 25 20:10:48 2024 -0800

    bnx2x: Fix firmware version string character counts
    
    [ Upstream commit 5642c82b9463c3263c086efb002516244bd4c668 ]
    
    A potential string truncation was reported in bnx2x_fill_fw_str(),
    when a long bp->fw_ver and a long phy_fw_ver might coexist, but seems
    unlikely with real-world hardware.
    
    Use scnprintf() to indicate the intent that truncations are tolerated.
    
    While reading this code, I found a collection of various buffer size
    counting issues. None looked like they might lead to a buffer overflow
    with current code (the small buffers are 20 bytes and might only ever
    consume 10 bytes twice with a trailing %NUL). However, early truncation
    (due to a %NUL in the middle of the string) might be happening under
    likely rare conditions. Regardless fix the formatters and related
    functions:
    
    - Switch from a separate strscpy() to just adding an additional "%s" to
      the format string that immediately follows it in bnx2x_fill_fw_str().
    - Use sizeof() universally instead of using unbound defines.
    - Fix bnx2x_7101_format_ver() and bnx2x_null_format_ver() to report the
      number of characters written, not including the trailing %NUL (as
      already done with the other firmware formatting functions).
    - Require space for at least 1 byte in bnx2x_get_ext_phy_fw_version()
      for the trailing %NUL.
    - Correct the needed buffer size in bnx2x_3_seq_format_ver().
    
    Reported-by: kernel test robot <lkp@intel.com>
    Closes: https://lore.kernel.org/oe-kbuild-all/202401260858.jZN6vD1k-lkp@intel.com/
    Cc: Ariel Elior <aelior@marvell.com>
    Cc: Sudarsana Kalluru <skalluru@marvell.com>
    Cc: Manish Chopra <manishc@marvell.com>
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Link: https://lore.kernel.org/r/20240126041044.work.220-kees@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
btrfs: export: handle invalid inode or root reference in btrfs_get_parent() [+ + +]
Author: David Sterba <dsterba@suse.com>
Date:   Fri Jan 19 21:19:18 2024 +0100

    btrfs: export: handle invalid inode or root reference in btrfs_get_parent()
    
    [ Upstream commit 26b66d1d366a375745755ca7365f67110bbf6bd5 ]
    
    The get_parent handler looks up a parent of a given dentry, this can be
    either a subvolume or a directory. The search is set up with offset -1
    but it's never expected to find such item, as it would break allowed
    range of inode number or a root id. This means it's a corruption (ext4
    also returns this error code).
    
    Reviewed-by: Josef Bacik <josef@toxicpanda.com>
    Reviewed-by: Anand Jain <anand.jain@oracle.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

btrfs: handle chunk tree lookup error in btrfs_relocate_sys_chunks() [+ + +]
Author: David Sterba <dsterba@suse.com>
Date:   Tue Jan 23 23:42:29 2024 +0100

    btrfs: handle chunk tree lookup error in btrfs_relocate_sys_chunks()
    
    [ Upstream commit 7411055db5ce64f836aaffd422396af0075fdc99 ]
    
    The unhandled case in btrfs_relocate_sys_chunks() loop is a corruption,
    as it could be caused only by two impossible conditions:
    
    - at first the search key is set up to look for a chunk tree item, with
      offset -1, this is an inexact search and the key->offset will contain
      the correct offset upon a successful search, a valid chunk tree item
      cannot have an offset -1
    
    - after first successful search, the found_key corresponds to a chunk
      item, the offset is decremented by 1 before the next loop, it's
      impossible to find a chunk item there due to alignment and size
      constraints
    
    Reviewed-by: Josef Bacik <josef@toxicpanda.com>
    Reviewed-by: Anand Jain <anand.jain@oracle.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

btrfs: send: handle path ref underflow in header iterate_inode_ref() [+ + +]
Author: David Sterba <dsterba@suse.com>
Date:   Tue Feb 6 22:47:13 2024 +0100

    btrfs: send: handle path ref underflow in header iterate_inode_ref()
    
    [ Upstream commit 3c6ee34c6f9cd12802326da26631232a61743501 ]
    
    Change BUG_ON to proper error handling if building the path buffer
    fails. The pointers are not printed so we don't accidentally leak kernel
    addresses.
    
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
bus: mhi: host: Add MHI_PM_SYS_ERR_FAIL state [+ + +]
Author: Jeffrey Hugo <quic_jhugo@quicinc.com>
Date:   Fri Jan 12 11:08:00 2024 -0700

    bus: mhi: host: Add MHI_PM_SYS_ERR_FAIL state
    
    [ Upstream commit bce3f770684cc1d91ff9edab431b71ac991faf29 ]
    
    When processing a SYSERR, if the device does not respond to the MHI_RESET
    from the host, the host will be stuck in a difficult to recover state.
    The host will remain in MHI_PM_SYS_ERR_PROCESS and not clean up the host
    channels.  Clients will not be notified of the SYSERR via the destruction
    of their channel devices, which means clients may think that the device is
    still up.  Subsequent SYSERR events such as a device fatal error will not
    be processed as the state machine cannot transition from PROCESS back to
    DETECT.  The only way to recover from this is to unload the mhi module
    (wipe the state machine state) or for the mhi controller to initiate
    SHUTDOWN.
    
    This issue was discovered by stress testing soc_reset events on AIC100
    via the sysfs node.
    
    soc_reset is processed entirely in hardware.  When the register write
    hits the endpoint hardware, it causes the soc to reset without firmware
    involvement.  In stress testing, there is a rare race where soc_reset N
    will cause the soc to reset and PBL to signal SYSERR (fatal error).  If
    soc_reset N+1 is triggered before PBL can process the MHI_RESET from the
    host, then the soc will reset again, and re-run PBL from the beginning.
    This will cause PBL to lose all state.  PBL will be waiting for the host
    to respond to the new syserr, but host will be stuck expecting the
    previous MHI_RESET to be processed.
    
    Additionally, the AMSS EE firmware (QSM) was hacked to synthetically
    reproduce the issue by simulating a FW hang after the QSM issued a
    SYSERR.  In this case, soc_reset would not recover the device.
    
    For this failure case, to recover the device, we need a state similar to
    PROCESS, but can transition to DETECT.  There is not a viable existing
    state to use.  POR has the needed transitions, but assumes the device is
    in a good state and could allow the host to attempt to use the device.
    Allowing PROCESS to transition to DETECT invites the possibility of
    parallel SYSERR processing which could get the host and device out of
    sync.
    
    Thus, invent a new state - MHI_PM_SYS_ERR_FAIL
    
    This essentially a holding state.  It allows us to clean up the host
    elements that are based on the old state of the device (channels), but
    does not allow us to directly advance back to an operational state.  It
    does allow the detection and processing of another SYSERR which may
    recover the device, or allows the controller to do a clean shutdown.
    
    Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
    Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com>
    Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Link: https://lore.kernel.org/r/20240112180800.536733-1-quic_jhugo@quicinc.com
    Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
cpufreq: Don't unregister cpufreq cooling on CPU hotplug [+ + +]
Author: Viresh Kumar <viresh.kumar@linaro.org>
Date:   Thu Feb 29 13:42:07 2024 +0530

    cpufreq: Don't unregister cpufreq cooling on CPU hotplug
    
    [ Upstream commit c4d61a529db788d2e52654f5b02c8d1de4952c5b ]
    
    Offlining a CPU and bringing it back online is a common operation and it
    happens frequently during system suspend/resume, where the non-boot CPUs
    are hotplugged out during suspend and brought back at resume.
    
    The cpufreq core already tries to make this path as fast as possible as
    the changes are only temporary in nature and full cleanup of resources
    isn't required in this case. For example the drivers can implement
    online()/offline() callbacks to avoid a lot of tear down of resources.
    
    On similar lines, there is no need to unregister the cpufreq cooling
    device during suspend / resume, but only while the policy is getting
    removed.
    
    Moreover, unregistering the cpufreq cooling device is resulting in an
    unwanted outcome, where the system suspend is eventually aborted in the
    process.  Currently, during system suspend the cpufreq core unregisters
    the cooling device, which in turn removes a kobject using device_del()
    and that generates a notification to the userspace via uevent broadcast.
    This causes system suspend to abort in some setups.
    
    This was also earlier reported (indirectly) by Roman [1]. Maybe there is
    another way around to fixing that problem properly, but this change
    makes sense anyways.
    
    Move the registering and unregistering of the cooling device to policy
    creation and removal times onlyy.
    
    Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218521
    Reported-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
    Reported-by: Roman Stratiienko <r.stratiienko@gmail.com>
    Link: https://patchwork.kernel.org/project/linux-pm/patch/20220710164026.541466-1-r.stratiienko@gmail.com/ [1]
    Tested-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
    Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
    Reviewed-by: Dhruva Gole <d-gole@ti.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
cpuidle: Avoid potential overflow in integer multiplication [+ + +]
Author: C Cheng <C.Cheng@mediatek.com>
Date:   Tue Dec 19 11:14:42 2023 +0800

    cpuidle: Avoid potential overflow in integer multiplication
    
    [ Upstream commit 88390dd788db485912ee7f9a8d3d56fc5265d52f ]
    
    In detail:
    
    In C language, when you perform a multiplication operation, if
    both operands are of int type, the multiplication operation is
    performed on the int type, and then the result is converted to
    the target type. This means that if the product of int type
    multiplication exceeds the range that int type can represent,
    an overflow will occur even if you store the result in a
    variable of int64_t type.
    
    For a multiplication of two int values, it is better to use
    mul_u32_u32() rather than s->exit_latency_ns = s->exit_latency *
    NSEC_PER_USEC to avoid potential overflow happenning.
    
    Signed-off-by: C Cheng <C.Cheng@mediatek.com>
    Signed-off-by: Bo Ye <bo.ye@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    [ rjw: New subject ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
crypto: iaa - Fix async_disable descriptor leak [+ + +]
Author: Tom Zanussi <tom.zanussi@linux.intel.com>
Date:   Sun Feb 25 14:11:33 2024 -0600

    crypto: iaa - Fix async_disable descriptor leak
    
    [ Upstream commit 262534ddc88dfea7474ed18adfecf856e4fbe054 ]
    
    The disable_async paths of iaa_compress/decompress() don't free idxd
    descriptors in the async_disable case. Currently this only happens in
    the testcases where req->dst is set to null. Add a test to free them
    in those paths.
    
    Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
dma-direct: Leak pages on dma_set_decrypted() failure [+ + +]
Author: Rick Edgecombe <rick.p.edgecombe@intel.com>
Date:   Wed Feb 21 16:17:21 2024 -0800

    dma-direct: Leak pages on dma_set_decrypted() failure
    
    [ Upstream commit b9fa16949d18e06bdf728a560f5c8af56d2bdcaf ]
    
    On TDX it is possible for the untrusted host to cause
    set_memory_encrypted() or set_memory_decrypted() to fail such that an
    error is returned and the resulting memory is shared. Callers need to
    take care to handle these errors to avoid returning decrypted (shared)
    memory to the page allocator, which could lead to functional or security
    issues.
    
    DMA could free decrypted/shared pages if dma_set_decrypted() fails. This
    should be a rare case. Just leak the pages in this case instead of
    freeing them.
    
    Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drivers/nvme: Add quirks for device 126f:2262 [+ + +]
Author: Jiawei Fu (iBug) <i@ibugone.com>
Date:   Sat Mar 16 03:27:49 2024 +0800

    drivers/nvme: Add quirks for device 126f:2262
    
    [ Upstream commit e89086c43f0500bc7c4ce225495b73b8ce234c1f ]
    
    This commit adds NVME_QUIRK_NO_DEEPEST_PS and NVME_QUIRK_BOGUS_NID for
    device [126f:2262], which appears to be a generic VID:PID pair used for
    many SSDs based on the Silicon Motion SM2262/SM2262EN controller.
    
    Two of my SSDs with this VID:PID pair exhibit the same behavior:
    
      * They frequently have trouble exiting the deepest power state (5),
        resulting in the entire disk unresponsive.
        Verified by setting nvme_core.default_ps_max_latency_us=10000 and
        observing them behaving normally.
      * They produce all-zero nguid and eui64 with `nvme id-ns` command.
    
    The offending products are:
    
      * HP SSD EX950 1TB
      * HIKVISION C2000Pro 2TB
    
    Signed-off-by: Jiawei Fu <i@ibugone.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
    Signed-off-by: Keith Busch <kbusch@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drivers/perf: hisi: Enable HiSilicon Erratum 162700402 quirk for HIP09 [+ + +]
Author: Junhao He <hejunhao3@huawei.com>
Date:   Tue Feb 27 20:52:31 2024 +0800

    drivers/perf: hisi: Enable HiSilicon Erratum 162700402 quirk for HIP09
    
    [ Upstream commit e10b6976f6b9afdf3564f88c851e42d139bb19c0 ]
    
    HiSilicon UC PMU v2 suffers the erratum 162700402 that the PMU counter
    cannot be set due to the lack of clock under power saving mode. This will
    lead to error or inaccurate counts. The clock can be enabled by the PMU
    global enabling control.
    
    This patch tries to fix this by set the UC PMU enable before set event
    period to turn on the clock, and then restore the UC PMU configuration.
    The counter register can hold its value without a clock.
    
    Signed-off-by: Junhao He <hejunhao3@huawei.com>
    Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
    Link: https://lore.kernel.org/r/20240227125231.53127-1-hejunhao3@huawei.com
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init() [+ + +]
Author: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Date:   Fri Feb 23 17:08:16 2024 +0530

    drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()
    
    [ Upstream commit eb4f139888f636614dab3bcce97ff61cefc4b3a7 ]
    
    This ensures that the memory mapped by ioremap for adev->rmmio, is
    properly handled in amdgpu_device_init(). If the function exits early
    due to an error, the memory is unmapped. If the function completes
    successfully, the memory remains mapped.
    
    Reported by smatch:
    drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4337 amdgpu_device_init() warn: 'adev->rmmio' from ioremap() not released on lines: 4035,4045,4051,4058,4068,4337
    
    Cc: Christian König <christian.koenig@amd.com>
    Cc: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/amd/display: Disable idle reallow as part of command/gpint execution [+ + +]
Author: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Date:   Wed Jan 24 10:51:49 2024 -0500

    drm/amd/display: Disable idle reallow as part of command/gpint execution
    
    [ Upstream commit 6226a5aa77370329e01ee8abe50a95e60618ce97 ]
    
    [Why]
    Workaroud for a race condition where DMCUB is in the process of
    committing to IPS1 during the handshake causing us to miss the
    transition into IPS2 and touch the INBOX1 RPTR causing a HW hang.
    
    [How]
    Disable the reallow to ensure that we have enough of a gap between entry
    and exit and we're not seeing back-to-back wake_and_executes.
    
    Reviewed-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
    Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
    Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

drm/amd/display: Fix nanosec stat overflow [+ + +]
Author: Aric Cyr <aric.cyr@amd.com>
Date:   Thu Aug 29 11:53:52 2019 -0400

    drm/amd/display: Fix nanosec stat overflow
    
    [ Upstream commit 14d68acfd04b39f34eea7bea65dda652e6db5bf6 ]
    
    [Why]
    Nanosec stats can overflow on long running systems potentially causing
    statistic logging issues.
    
    [How]
    Use 64bit types for nanosec stats to ensure no overflow.
    
    Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
    Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: Aric Cyr <aric.cyr@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

drm/amd/display: increased min_dcfclk_mhz and min_fclk_mhz [+ + +]
Author: Sohaib Nadeem <sohaib.nadeem@amd.com>
Date:   Tue Jan 16 11:00:00 2024 -0500

    drm/amd/display: increased min_dcfclk_mhz and min_fclk_mhz
    
    [ Upstream commit d46fb0068c54d3dc95ae8298299c4d9edb0fb7c1 ]
    
    [why]
    Originally, PMFW said min FCLK is 300Mhz, but min DCFCLK can be increased
    to 400Mhz because min FCLK is now 600Mhz so FCLK >= 1.5 * DCFCLK hardware
    requirement will still be satisfied. Increasing min DCFCLK addresses
    underflow issues (underflow occurs when phantom pipe is turned on for some
    Sub-Viewport configs).
    
    [how]
    Increasing DCFCLK by raising the min_dcfclk_mhz
    
    Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com>
    Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
    Acked-by: Tom Chung <chiahsuan.chung@amd.com>
    Signed-off-by: Sohaib Nadeem <sohaib.nadeem@amd.com>
    Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/amdgpu: Init zone device and drm client after mode-1 reset on reload [+ + +]
Author: Ahmad Rehman <Ahmad.Rehman@amd.com>
Date:   Mon Mar 4 15:56:00 2024 -0600

    drm/amdgpu: Init zone device and drm client after mode-1 reset on reload
    
    [ Upstream commit f679fd6057fbf5ab34aaee28d58b7f81af0cbf48 ]
    
    In passthrough environment, when amdgpu is reloaded after unload, mode-1
    is triggered after initializing the necessary IPs, That init does not
    include KFD, and KFD init waits until the reset is completed. KFD init
    is called in the reset handler, but in this case, the zone device and
    drm client is not initialized, causing app to create kernel panic.
    
    v2: Removing the init KFD condition from amdgpu_amdkfd_drm_client_create.
    As the previous version has the potential of creating DRM client twice.
    
    v3: v2 patch results in SDMA engine hung as DRM open causes VM clear to SDMA
    before SDMA init. Adding the condition to in drm client creation, on top of v1,
    to guard against drm client creation call multiple times.
    
    Signed-off-by: Ahmad Rehman <Ahmad.Rehman@amd.com>
    Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

drm/amdgpu: Skip do PCI error slot reset during RAS recovery [+ + +]
Author: Stanley.Yang <Stanley.Yang@amd.com>
Date:   Wed Jan 10 16:13:50 2024 +0800

    drm/amdgpu: Skip do PCI error slot reset during RAS recovery
    
    [ Upstream commit 601429cca96b4af3be44172c3b64e4228515dbe1 ]
    
    Why:
        The PCI error slot reset maybe triggered after inject ue to UMC multi times, this
        caused system hang.
        [  557.371857] amdgpu 0000:af:00.0: amdgpu: GPU reset succeeded, trying to resume
        [  557.373718] [drm] PCIE GART of 512M enabled.
        [  557.373722] [drm] PTB located at 0x0000031FED700000
        [  557.373788] [drm] VRAM is lost due to GPU reset!
        [  557.373789] [drm] PSP is resuming...
        [  557.547012] mlx5_core 0000:55:00.0: mlx5_pci_err_detected Device state = 1 pci_status: 0. Exit, result = 3, need reset
        [  557.547067] [drm] PCI error: detected callback, state(1)!!
        [  557.547069] [drm] No support for XGMI hive yet...
        [  557.548125] mlx5_core 0000:55:00.0: mlx5_pci_slot_reset Device state = 1 pci_status: 0. Enter
        [  557.607763] mlx5_core 0000:55:00.0: wait vital counter value 0x16b5b after 1 iterations
        [  557.607777] mlx5_core 0000:55:00.0: mlx5_pci_slot_reset Device state = 1 pci_status: 1. Exit, err = 0, result = 5, recovered
        [  557.610492] [drm] PCI error: slot reset callback!!
        ...
        [  560.689382] amdgpu 0000:3f:00.0: amdgpu: GPU reset(2) succeeded!
        [  560.689546] amdgpu 0000:5a:00.0: amdgpu: GPU reset(2) succeeded!
        [  560.689562] general protection fault, probably for non-canonical address 0x5f080b54534f611f: 0000 [#1] SMP NOPTI
        [  560.701008] CPU: 16 PID: 2361 Comm: kworker/u448:9 Tainted: G           OE     5.15.0-91-generic #101-Ubuntu
        [  560.712057] Hardware name: Microsoft C278A/C278A, BIOS C2789.5.BS.1C11.AG.1 11/08/2023
        [  560.720959] Workqueue: amdgpu-reset-hive amdgpu_ras_do_recovery [amdgpu]
        [  560.728887] RIP: 0010:amdgpu_device_gpu_recover.cold+0xbf1/0xcf5 [amdgpu]
        [  560.736891] Code: ff 41 89 c6 e9 1b ff ff ff 44 0f b6 45 b0 e9 4f ff ff ff be 01 00 00 00 4c 89 e7 e8 76 c9 8b ff 44 0f b6 45 b0 e9 3c fd ff ff <48> 83 ba 18 02 00 00 00 0f 84 6a f8 ff ff 48 8d 7a 78 be 01 00 00
        [  560.757967] RSP: 0018:ffa0000032e53d80 EFLAGS: 00010202
        [  560.763848] RAX: ffa00000001dfd10 RBX: ffa0000000197090 RCX: ffa0000032e53db0
        [  560.771856] RDX: 5f080b54534f5f07 RSI: 0000000000000000 RDI: ff11000128100010
        [  560.779867] RBP: ffa0000032e53df0 R08: 0000000000000000 R09: ffffffffffe77f08
        [  560.787879] R10: 0000000000ffff0a R11: 0000000000000001 R12: 0000000000000000
        [  560.795889] R13: ffa0000032e53e00 R14: 0000000000000000 R15: 0000000000000000
        [  560.803889] FS:  0000000000000000(0000) GS:ff11007e7e800000(0000) knlGS:0000000000000000
        [  560.812973] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        [  560.819422] CR2: 000055a04c118e68 CR3: 0000000007410005 CR4: 0000000000771ee0
        [  560.827433] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        [  560.835433] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400
        [  560.843444] PKRU: 55555554
        [  560.846480] Call Trace:
        [  560.849225]  <TASK>
        [  560.851580]  ? show_trace_log_lvl+0x1d6/0x2ea
        [  560.856488]  ? show_trace_log_lvl+0x1d6/0x2ea
        [  560.861379]  ? amdgpu_ras_do_recovery+0x1b2/0x210 [amdgpu]
        [  560.867778]  ? show_regs.part.0+0x23/0x29
        [  560.872293]  ? __die_body.cold+0x8/0xd
        [  560.876502]  ? die_addr+0x3e/0x60
        [  560.880238]  ? exc_general_protection+0x1c5/0x410
        [  560.885532]  ? asm_exc_general_protection+0x27/0x30
        [  560.891025]  ? amdgpu_device_gpu_recover.cold+0xbf1/0xcf5 [amdgpu]
        [  560.898323]  amdgpu_ras_do_recovery+0x1b2/0x210 [amdgpu]
        [  560.904520]  process_one_work+0x228/0x3d0
    How:
        In RAS recovery, mode-1 reset is issued from RAS fatal error handling and expected
        all the nodes in a hive to be reset. no need to issue another mode-1 during this procedure.
    
    Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
    Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/ci: uprev mesa version: fix kdl commit fetch [+ + +]
Author: Vignesh Raman <vignesh.raman@collabora.com>
Date:   Fri Dec 22 09:04:34 2023 +0530

    drm/ci: uprev mesa version: fix kdl commit fetch
    
    [ Upstream commit d315a68e94a76310c349add3f9c914cefda0a87f ]
    
    build-kdl.sh was doing a `clone --depth 1` of the default branch,
    then checking out a commit that might not be the latest of that
    branch, resulting in container build error.
    
    https://gitlab.freedesktop.org/mesa/mesa/-/commit/5efa4d56 fixes
    kdl commit fetch issue. Uprev mesa in drm-ci to fix this.
    
    This commit updates the kernel tag and adds .never-post-merge-rules
    due to the mesa uprev. It also fixes an issue where the virtio-gpu
    pipeline was not getting created with the mesa uprev.
    
    Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
    Acked-by: Helen Koike <helen.koike@collabora.com>
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    Tested-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
    Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
    Signed-off-by: Helen Koike <helen.koike@collabora.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20231222033434.1537761-1-vignesh.raman@collabora.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/panel: simple: Add BOE BP082WX1-100 8.2" panel [+ + +]
Author: Tony Lindgren <tony@atomide.com>
Date:   Sun Feb 11 13:16:59 2024 +0200

    drm/panel: simple: Add BOE BP082WX1-100 8.2" panel
    
    [ Upstream commit dc90214ff58be575fdceb549f901506cdef5d093 ]
    
    The BOE BP082WX1-100 is a 8.2" panel similar to the 10.1" panel
    BP101WX1-100. Both panels use the same timings.
    
    Acked-by: Conor Dooley <conor.dooley@microchip.com>
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Link: https://lore.kernel.org/r/20240211111703.7567-2-tony@atomide.com
    Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240211111703.7567-2-tony@atomide.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/ttm: return ENOSPC from ttm_bo_mem_space v3 [+ + +]
Author: Christian König <christian.koenig@amd.com>
Date:   Tue Dec 5 16:40:40 2023 +0100

    drm/ttm: return ENOSPC from ttm_bo_mem_space v3
    
    [ Upstream commit 28e5126718c7b306b8c29d2ae8f48417e9303aa1 ]
    
    Only convert it to ENOMEM in ttm_bo_validate.
    
    This allows ttm_bo_validate to distinguish between an out of memory
    situation and just out of space in a placement domain.
    
    v2: improve commit message
    v3: fix kerneldoc typos
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Reviewed-by: Zack Rusin <zack.rusin@broadcom.com>
    Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240112125158.2748-3-christian.koenig@amd.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/vc4: don't check if plane->state->fb == state->fb [+ + +]
Author: Maíra Canal <mcanal@igalia.com>
Date:   Fri Jan 5 14:58:36 2024 -0300

    drm/vc4: don't check if plane->state->fb == state->fb
    
    [ Upstream commit 5ee0d47dcf33efd8950b347dcf4d20bab12a3fa9 ]
    
    Currently, when using non-blocking commits, we can see the following
    kernel warning:
    
    [  110.908514] ------------[ cut here ]------------
    [  110.908529] refcount_t: underflow; use-after-free.
    [  110.908620] WARNING: CPU: 0 PID: 1866 at lib/refcount.c:87 refcount_dec_not_one+0xb8/0xc0
    [  110.908664] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg bnep hid_logitech_hidpp vc4 brcmfmac hci_uart btbcm brcmutil bluetooth snd_soc_hdmi_codec cfg80211 cec drm_display_helper drm_dma_helper drm_kms_helper snd_soc_core snd_compress snd_pcm_dmaengine fb_sys_fops sysimgblt syscopyarea sysfillrect raspberrypi_hwmon ecdh_generic ecc rfkill libaes i2c_bcm2835 binfmt_misc joydev snd_bcm2835(C) bcm2835_codec(C) bcm2835_isp(C) v4l2_mem2mem videobuf2_dma_contig snd_pcm bcm2835_v4l2(C) raspberrypi_gpiomem bcm2835_mmal_vchiq(C) videobuf2_v4l2 snd_timer videobuf2_vmalloc videobuf2_memops videobuf2_common snd videodev vc_sm_cma(C) mc hid_logitech_dj uio_pdrv_genirq uio i2c_dev drm fuse dm_mod drm_panel_orientation_quirks backlight ip_tables x_tables ipv6
    [  110.909086] CPU: 0 PID: 1866 Comm: kodi.bin Tainted: G         C         6.1.66-v8+ #32
    [  110.909104] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT)
    [  110.909114] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [  110.909132] pc : refcount_dec_not_one+0xb8/0xc0
    [  110.909152] lr : refcount_dec_not_one+0xb4/0xc0
    [  110.909170] sp : ffffffc00913b9c0
    [  110.909177] x29: ffffffc00913b9c0 x28: 000000556969bbb0 x27: 000000556990df60
    [  110.909205] x26: 0000000000000002 x25: 0000000000000004 x24: ffffff8004448480
    [  110.909230] x23: ffffff800570b500 x22: ffffff802e03a7bc x21: ffffffecfca68c78
    [  110.909257] x20: ffffff8002b42000 x19: ffffff802e03a600 x18: 0000000000000000
    [  110.909283] x17: 0000000000000011 x16: ffffffffffffffff x15: 0000000000000004
    [  110.909308] x14: 0000000000000fff x13: ffffffed577e47e0 x12: 0000000000000003
    [  110.909333] x11: 0000000000000000 x10: 0000000000000027 x9 : c912d0d083728c00
    [  110.909359] x8 : c912d0d083728c00 x7 : 65646e75203a745f x6 : 746e756f63666572
    [  110.909384] x5 : ffffffed579f62ee x4 : ffffffed579eb01e x3 : 0000000000000000
    [  110.909409] x2 : 0000000000000000 x1 : ffffffc00913b750 x0 : 0000000000000001
    [  110.909434] Call trace:
    [  110.909441]  refcount_dec_not_one+0xb8/0xc0
    [  110.909461]  vc4_bo_dec_usecnt+0x4c/0x1b0 [vc4]
    [  110.909903]  vc4_cleanup_fb+0x44/0x50 [vc4]
    [  110.910315]  drm_atomic_helper_cleanup_planes+0x88/0xa4 [drm_kms_helper]
    [  110.910669]  vc4_atomic_commit_tail+0x390/0x9dc [vc4]
    [  110.911079]  commit_tail+0xb0/0x164 [drm_kms_helper]
    [  110.911397]  drm_atomic_helper_commit+0x1d0/0x1f0 [drm_kms_helper]
    [  110.911716]  drm_atomic_commit+0xb0/0xdc [drm]
    [  110.912569]  drm_mode_atomic_ioctl+0x348/0x4b8 [drm]
    [  110.913330]  drm_ioctl_kernel+0xec/0x15c [drm]
    [  110.914091]  drm_ioctl+0x24c/0x3b0 [drm]
    [  110.914850]  __arm64_sys_ioctl+0x9c/0xd4
    [  110.914873]  invoke_syscall+0x4c/0x114
    [  110.914897]  el0_svc_common+0xd0/0x118
    [  110.914917]  do_el0_svc+0x38/0xd0
    [  110.914936]  el0_svc+0x30/0x8c
    [  110.914958]  el0t_64_sync_handler+0x84/0xf0
    [  110.914979]  el0t_64_sync+0x18c/0x190
    [  110.914996] ---[ end trace 0000000000000000 ]---
    
    This happens because, although `prepare_fb` and `cleanup_fb` are
    perfectly balanced, we cannot guarantee consistency in the check
    plane->state->fb == state->fb. This means that sometimes we can increase
    the refcount in `prepare_fb` and don't decrease it in `cleanup_fb`. The
    opposite can also be true.
    
    In fact, the struct drm_plane .state shouldn't be accessed directly
    but instead, the `drm_atomic_get_new_plane_state()` helper function should
    be used. So, we could stick to this check, but using
    `drm_atomic_get_new_plane_state()`. But actually, this check is not really
    needed. We can increase and decrease the refcount symmetrically without
    problems.
    
    This is going to make the code more simple and consistent.
    
    Signed-off-by: Maíra Canal <mcanal@igalia.com>
    Acked-by: Maxime Ripard <mripard@kernel.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240105175908.242000-1-mcanal@igalia.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm: Check output polling initialized before disabling [+ + +]
Author: Shradha Gupta <shradhagupta@linux.microsoft.com>
Date:   Thu Feb 1 22:43:28 2024 -0800

    drm: Check output polling initialized before disabling
    
    [ Upstream commit 5abffb66d12bcac84bf7b66389c571b8bb6e82bd ]
    
    In drm_kms_helper_poll_disable() check if output polling
    support is initialized before disabling polling. If not flag
    this as a warning.
    Additionally in drm_mode_config_helper_suspend() and
    drm_mode_config_helper_resume() calls, that re the callers of these
    functions, avoid invoking them if polling is not initialized.
    For drivers like hyperv-drm, that do not initialize connector
    polling, if suspend is called without this check, it leads to
    suspend failure with following stack
    [  770.719392] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    [  770.720592] printk: Suspending console(s) (use no_console_suspend to debug)
    [  770.948823] ------------[ cut here ]------------
    [  770.948824] WARNING: CPU: 1 PID: 17197 at kernel/workqueue.c:3162 __flush_work.isra.0+0x212/0x230
    [  770.948831] Modules linked in: rfkill nft_counter xt_conntrack xt_owner udf nft_compat crc_itu_t nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nf_tables nfnetlink vfat fat mlx5_ib ib_uverbs ib_core mlx5_core intel_rapl_msr intel_rapl_common kvm_amd ccp mlxfw kvm psample hyperv_drm tls drm_shmem_helper drm_kms_helper irqbypass pcspkr syscopyarea sysfillrect sysimgblt hv_balloon hv_utils joydev drm fuse xfs libcrc32c pci_hyperv pci_hyperv_intf sr_mod sd_mod cdrom t10_pi sg hv_storvsc scsi_transport_fc hv_netvsc serio_raw hyperv_keyboard hid_hyperv crct10dif_pclmul crc32_pclmul crc32c_intel hv_vmbus ghash_clmulni_intel dm_mirror dm_region_hash dm_log dm_mod
    [  770.948863] CPU: 1 PID: 17197 Comm: systemd-sleep Not tainted 5.14.0-362.2.1.el9_3.x86_64 #1
    [  770.948865] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v4.1 05/09/2022
    [  770.948866] RIP: 0010:__flush_work.isra.0+0x212/0x230
    [  770.948869] Code: 8b 4d 00 4c 8b 45 08 89 ca 48 c1 e9 04 83 e2 08 83 e1 0f 83 ca 02 89 c8 48 0f ba 6d 00 03 e9 25 ff ff ff 0f 0b e9 4e ff ff ff <0f> 0b 45 31 ed e9 44 ff ff ff e8 8f 89 b2 00 66 66 2e 0f 1f 84 00
    [  770.948870] RSP: 0018:ffffaf4ac213fb10 EFLAGS: 00010246
    [  770.948871] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff8c992857
    [  770.948872] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff9aad82b00330
    [  770.948873] RBP: ffff9aad82b00330 R08: 0000000000000000 R09: ffff9aad87ee3d10
    [  770.948874] R10: 0000000000000200 R11: 0000000000000000 R12: ffff9aad82b00330
    [  770.948874] R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001
    [  770.948875] FS:  00007ff1b2f6bb40(0000) GS:ffff9aaf37d00000(0000) knlGS:0000000000000000
    [  770.948878] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  770.948878] CR2: 0000555f345cb666 CR3: 00000001462dc005 CR4: 0000000000370ee0
    [  770.948879] Call Trace:
    [  770.948880]  <TASK>
    [  770.948881]  ? show_trace_log_lvl+0x1c4/0x2df
    [  770.948884]  ? show_trace_log_lvl+0x1c4/0x2df
    [  770.948886]  ? __cancel_work_timer+0x103/0x190
    [  770.948887]  ? __flush_work.isra.0+0x212/0x230
    [  770.948889]  ? __warn+0x81/0x110
    [  770.948891]  ? __flush_work.isra.0+0x212/0x230
    [  770.948892]  ? report_bug+0x10a/0x140
    [  770.948895]  ? handle_bug+0x3c/0x70
    [  770.948898]  ? exc_invalid_op+0x14/0x70
    [  770.948899]  ? asm_exc_invalid_op+0x16/0x20
    [  770.948903]  ? __flush_work.isra.0+0x212/0x230
    [  770.948905]  __cancel_work_timer+0x103/0x190
    [  770.948907]  ? _raw_spin_unlock_irqrestore+0xa/0x30
    [  770.948910]  drm_kms_helper_poll_disable+0x1e/0x40 [drm_kms_helper]
    [  770.948923]  drm_mode_config_helper_suspend+0x1c/0x80 [drm_kms_helper]
    [  770.948933]  ? __pfx_vmbus_suspend+0x10/0x10 [hv_vmbus]
    [  770.948942]  hyperv_vmbus_suspend+0x17/0x40 [hyperv_drm]
    [  770.948944]  ? __pfx_vmbus_suspend+0x10/0x10 [hv_vmbus]
    [  770.948951]  dpm_run_callback+0x4c/0x140
    [  770.948954]  __device_suspend_noirq+0x74/0x220
    [  770.948956]  dpm_noirq_suspend_devices+0x148/0x2a0
    [  770.948958]  dpm_suspend_end+0x54/0xe0
    [  770.948960]  create_image+0x14/0x290
    [  770.948963]  hibernation_snapshot+0xd6/0x200
    [  770.948964]  hibernate.cold+0x8b/0x1fb
    [  770.948967]  state_store+0xcd/0xd0
    [  770.948969]  kernfs_fop_write_iter+0x124/0x1b0
    [  770.948973]  new_sync_write+0xff/0x190
    [  770.948976]  vfs_write+0x1ef/0x280
    [  770.948978]  ksys_write+0x5f/0xe0
    [  770.948979]  do_syscall_64+0x5c/0x90
    [  770.948981]  ? syscall_exit_work+0x103/0x130
    [  770.948983]  ? syscall_exit_to_user_mode+0x12/0x30
    [  770.948985]  ? do_syscall_64+0x69/0x90
    [  770.948986]  ? do_syscall_64+0x69/0x90
    [  770.948987]  ? do_user_addr_fault+0x1d6/0x6a0
    [  770.948989]  ? do_syscall_64+0x69/0x90
    [  770.948990]  ? exc_page_fault+0x62/0x150
    [  770.948992]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
    [  770.948995] RIP: 0033:0x7ff1b293eba7
    [  770.949010] Code: 0b 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
    [  770.949011] RSP: 002b:00007ffde3912128 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
    [  770.949012] RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00007ff1b293eba7
    [  770.949013] RDX: 0000000000000005 RSI: 00007ffde3912210 RDI: 0000000000000004
    [  770.949014] RBP: 00007ffde3912210 R08: 000055d7dd4c9510 R09: 00007ff1b29b14e0
    [  770.949014] R10: 00007ff1b29b13e0 R11: 0000000000000246 R12: 0000000000000005
    [  770.949015] R13: 000055d7dd4c53e0 R14: 0000000000000005 R15: 00007ff1b29f69e0
    [  770.949016]  </TASK>
    [  770.949017] ---[ end trace e6fa0618bfa2f31d ]---
    
    Built-on: Rhel9, Ubuntu22
    Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/1706856208-9617-1-git-send-email-shradhagupta@linux.microsoft.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

drm: Check polling initialized before enabling in drm_helper_probe_single_connector_modes [+ + +]
Author: Shradha Gupta <shradhagupta@linux.microsoft.com>
Date:   Thu Feb 1 22:43:44 2024 -0800

    drm: Check polling initialized before enabling in drm_helper_probe_single_connector_modes
    
    commit 048a36d8a6085bbd8ab9e5794b713b92ac986450 upstream.
    
    In function drm_helper_probe_single_connector_modes() when we enable
    polling again, if it is already uninitialized, a warning is reported.
    This patch fixes the warning message by checking if poll is initialized
    before enabling it.
    
    Reported-by: kernel test robot <oliver.sang@intel.com>
    Closes: https://lore.kernel.org/oe-lkp/202401191128.db8423f1-oliver.sang@intel.com
    Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/1706856224-9725-1-git-send-email-shradhagupta@linux.microsoft.com
    Cc: Holger Hoffstätte <holger@applied-asynchrony.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm: panel-orientation-quirks: Add quirk for GPD Win Mini [+ + +]
Author: Samuel Dionne-Riel <samuel@dionne-riel.com>
Date:   Thu Dec 21 22:01:50 2023 -0500

    drm: panel-orientation-quirks: Add quirk for GPD Win Mini
    
    [ Upstream commit 2f862fdc0fd802e728b6ca96bc78ec3f01bf161e ]
    
    This adds a DMI orientation quirk for the GPD Win Mini panel.
    
    Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20231222030149.3740815-2-samuel@dionne-riel.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
dump_stack: Do not get cpu_sync for panic CPU [+ + +]
Author: John Ogness <john.ogness@linutronix.de>
Date:   Wed Feb 7 14:47:03 2024 +0106

    dump_stack: Do not get cpu_sync for panic CPU
    
    [ Upstream commit 7412dc6d55eed6b76180e40ac3601412ebde29bd ]
    
    dump_stack() is called in panic(). If for some reason another CPU
    is holding the printk_cpu_sync and is unable to release it, the
    panic CPU will be unable to continue and print the stacktrace.
    
    Since non-panic CPUs are not allowed to store new printk messages
    anyway, there is no need to synchronize the stacktrace output in
    a panic situation.
    
    For the panic CPU, do not get the printk_cpu_sync because it is
    not needed and avoids a potential deadlock scenario in panic().
    
    Link: https://lore.kernel.org/lkml/ZcIGKU8sxti38Kok@alley
    Signed-off-by: John Ogness <john.ogness@linutronix.de>
    Reviewed-by: Petr Mladek <pmladek@suse.com>
    Link: https://lore.kernel.org/r/20240207134103.1357162-15-john.ogness@linutronix.de
    Signed-off-by: Petr Mladek <pmladek@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ext4: add a hint for block bitmap corrupt state in mb_groups [+ + +]
Author: Zhang Yi <yi.zhang@huawei.com>
Date:   Fri Jan 19 14:11:54 2024 +0800

    ext4: add a hint for block bitmap corrupt state in mb_groups
    
    [ Upstream commit 68ee261fb15457ecb17e3683cb4e6a4792ca5b71 ]
    
    If one group is marked as block bitmap corrupted, its free blocks cannot
    be used and its free count is also deducted from the global
    sbi->s_freeclusters_counter. User might be confused about the absent
    free space because we can't query the information about corrupted block
    groups except unreliable error messages in syslog. So add a hint to show
    block bitmap corrupted groups in mb_groups.
    
    Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
    Reviewed-by: Jan Kara <jack@suse.cz>
    Link: https://lore.kernel.org/r/20240119061154.1525781-1-yi.zhang@huaweicloud.com
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ext4: forbid commit inconsistent quota data when errors=remount-ro [+ + +]
Author: Ye Bin <yebin10@huawei.com>
Date:   Fri Jan 19 14:29:08 2024 +0800

    ext4: forbid commit inconsistent quota data when errors=remount-ro
    
    [ Upstream commit d8b945fa475f13d787df00c26a6dc45a3e2e1d1d ]
    
    There's issue as follows When do IO fault injection test:
    Quota error (device dm-3): find_block_dqentry: Quota for id 101 referenced but not present
    Quota error (device dm-3): qtree_read_dquot: Can't read quota structure for id 101
    Quota error (device dm-3): do_check_range: Getting block 2021161007 out of range 1-186
    Quota error (device dm-3): qtree_read_dquot: Can't read quota structure for id 661
    
    Now, ext4_write_dquot()/ext4_acquire_dquot()/ext4_release_dquot() may commit
    inconsistent quota data even if process failed. This may lead to filesystem
    corruption.
    To ensure filesystem consistent when errors=remount-ro there is need to call
    ext4_handle_error() to abort journal.
    
    Signed-off-by: Ye Bin <yebin10@huawei.com>
    Reviewed-by: Jan Kara <jack@suse.cz>
    Link: https://lore.kernel.org/r/20240119062908.3598806-1-yebin10@huawei.com
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
fbdev: viafb: fix typo in hw_bitblt_1 and hw_bitblt_2 [+ + +]
Author: Aleksandr Burakov <a.burakov@rosalinux.ru>
Date:   Fri Mar 1 14:35:43 2024 +0300

    fbdev: viafb: fix typo in hw_bitblt_1 and hw_bitblt_2
    
    [ Upstream commit bc87bb342f106a0402186bcb588fcbe945dced4b ]
    
    There are some actions with value 'tmp' but 'dst_addr' is checked instead.
    It is obvious that a copy-paste error was made here and the value
    of variable 'tmp' should be checked here.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Signed-off-by: Aleksandr Burakov <a.burakov@rosalinux.ru>
    Signed-off-by: Helge Deller <deller@gmx.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
fbmon: prevent division by zero in fb_videomode_from_videomode() [+ + +]
Author: Roman Smirnov <r.smirnov@omp.ru>
Date:   Tue Mar 19 11:13:44 2024 +0300

    fbmon: prevent division by zero in fb_videomode_from_videomode()
    
    [ Upstream commit c2d953276b8b27459baed1277a4fdd5dd9bd4126 ]
    
    The expression htotal * vtotal can have a zero value on
    overflow. It is necessary to prevent division by zero like in
    fb_var_to_videomode().
    
    Found by Linux Verification Center (linuxtesting.org) with Svace.
    
    Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
    Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
    Signed-off-by: Helge Deller <deller@gmx.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename() [+ + +]
Author: Markus Elfring <elfring@users.sourceforge.net>
Date:   Mon Dec 25 20:03:56 2023 +0100

    firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename()
    
    [ Upstream commit 1315848f1f8a0100cb6f8a7187bc320c5d98947f ]
    
    The kfree() function was called in one case by
    the get_filename() function during error handling
    even if the passed variable contained a null pointer.
    This issue was detected by using the Coccinelle software.
    
    Thus return directly after a call of the function “kzalloc” failed
    at the beginning.
    
    Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    Signed-off-by: Thierry Reding <treding@nvidia.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
gcc-plugins/stackleak: Avoid .head.text section [+ + +]
Author: Ard Biesheuvel <ardb@kernel.org>
Date:   Thu Mar 28 07:42:57 2024 +0100

    gcc-plugins/stackleak: Avoid .head.text section
    
    commit e7d24c0aa8e678f41457d1304e2091cac6fd1a2e upstream.
    
    The .head.text section carries the startup code that runs with the MMU
    off or with a translation of memory that deviates from the ordinary one.
    So avoid instrumentation with the stackleak plugin, which already avoids
    .init.text and .noinstr.text entirely.
    
    Fixes: 48204aba801f1b51 ("x86/sme: Move early SME kernel encryption handling into .head.text")
    Reported-by: kernel test robot <oliver.sang@intel.com>
    Closes: https://lore.kernel.org/oe-lkp/202403221630.2692c998-oliver.sang@intel.com
    Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
    Link: https://lore.kernel.org/r/20240328064256.2358634-2-ardb+git@google.com
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
HID: input: avoid polling stylus battery on Chromebook Pompom [+ + +]
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date:   Fri Feb 23 15:16:12 2024 -0800

    HID: input: avoid polling stylus battery on Chromebook Pompom
    
    [ Upstream commit 9a5b1521e2d0d7ace70c6e5eed073babcec91409 ]
    
    Internal touchscreen on Trogdor Pompom (AKA Dynabook Chromebook C1)
    supports USI stylus. Unfortunately the HID descriptor for the stylus
    interface does not contain "Stylus" physical collection, which makes
    the kernel to try and pull battery information, resulting in errors.
    
    Apply HID_BATTERY_QUIRK_AVOID_QUERY to the device.
    
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
i2c: designware: Fix RX FIFO depth define on Wangxun 10Gb NIC [+ + +]
Author: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Date:   Tue Feb 13 14:48:46 2024 +0200

    i2c: designware: Fix RX FIFO depth define on Wangxun 10Gb NIC
    
    [ Upstream commit c94612a72ac87b0337a0d85b9263266776ed4190 ]
    
    I believe RX FIFO depth define 0 is incorrect on Wangxun 10Gb NIC. It
    must be at least 1 since code is able to read received data from the
    DW_IC_DATA_CMD register.
    
    For now this define is irrelevant since the txgbe_i2c_dw_xfer_quirk()
    doesn't use the rx_fifo_depth member variable of struct dw_i2c_dev but
    is needed when converting code into generic polling mode implementation.
    
    Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
    Tested-by: Jiawen Wu <jiawenwu@trustnetic.com>
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ice: use relative VSI index for VFs instead of PF VSI number [+ + +]
Author: Jacob Keller <jacob.e.keller@intel.com>
Date:   Fri Feb 16 14:06:37 2024 -0800

    ice: use relative VSI index for VFs instead of PF VSI number
    
    [ Upstream commit 11fbb1bfb5bc8c98b2d7db9da332b5e568f4aaab ]
    
    When initializing over virtchnl, the PF is required to pass a VSI ID to the
    VF as part of its capabilities exchange. The VF driver reports this value
    back to the PF in a variety of commands. The PF driver validates that this
    value matches the value it sent to the VF.
    
    Some hardware families such as the E700 series could use this value when
    reading RSS registers or communicating directly with firmware over the
    Admin Queue.
    
    However, E800 series hardware does not support any of these interfaces and
    the VF's only use for this value is to report it back to the PF. Thus,
    there is no requirement that this value be an actual VSI ID value of any
    kind.
    
    The PF driver already does not trust that the VF sends it a real VSI ID.
    The VSI structure is always looked up from the VF structure. The PF does
    validate that the VSI ID provided matches a VSI associated with the VF, but
    otherwise does not use the VSI ID for any purpose.
    
    Instead of reporting the VSI number relative to the PF space, report a
    fixed value of 1. When communicating with the VF over virtchnl, validate
    that the VSI number is returned appropriately.
    
    This avoids leaking information about the firmware of the PF state.
    Currently the ice driver only supplies a VF with a single VSI. However, it
    appears that virtchnl has some support for allowing multiple VSIs. I did
    not attempt to implement this. However, space is left open to allow further
    relative indexes if additional VSIs are provided in future feature
    development. For this reason, keep the ice_vc_isvalid_vsi_id function in
    place to allow extending it for multiple VSIs in the future.
    
    This change will also simplify handling of live migration in a future
    series. Since we no longer will provide a real VSI number to the VF, there
    will be no need to keep track of this number when migrating to a new host.
    
    Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
    Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
    Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
input/touchscreen: imagis: Correct the maximum touch area value [+ + +]
Author: Markuss Broks <markuss.broks@gmail.com>
Date:   Fri Mar 1 17:41:00 2024 +0100

    input/touchscreen: imagis: Correct the maximum touch area value
    
    [ Upstream commit 54a62ed17a705ef1ac80ebca2b62136b19243e19 ]
    
    As specified in downstream IST3038B driver and proved by testing,
    the correct maximum reported value of touch area is 16.
    
    Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
    Signed-off-by: Karel Balej <balejk@matfyz.cz>
    Link: https://lore.kernel.org/r/20240301164659.13240-2-karelb@gimli.ms.mff.cuni.cz
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Input: allocate keycode for Display refresh rate toggle [+ + +]
Author: Gergo Koteles <soyer@irl.hu>
Date:   Sun Mar 10 12:31:41 2024 +0100

    Input: allocate keycode for Display refresh rate toggle
    
    [ Upstream commit cfeb98b95fff25c442f78a6f616c627bc48a26b7 ]
    
    Newer Lenovo Yogas and Legions with 60Hz/90Hz displays send a wmi event
    when Fn + R is pressed. This is intended for use to switch between the
    two refresh rates.
    
    Allocate a new KEY_REFRESH_RATE_TOGGLE keycode for it.
    
    Signed-off-by: Gergo Koteles <soyer@irl.hu>
    Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Link: https://lore.kernel.org/r/15a5d08c84cf4d7b820de34ebbcf8ae2502fb3ca.1710065750.git.soyer@irl.hu
    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>

Input: imagis - use FIELD_GET where applicable [+ + +]
Author: Duje Mihanović <duje.mihanovic@skole.hr>
Date:   Sat Mar 9 21:18:05 2024 -0800

    Input: imagis - use FIELD_GET where applicable
    
    [ Upstream commit c0ca3dbd03d66c6b9e044f48720e6ab5cef37ae5 ]
    
    Instead of manually extracting certain bits from registers with binary
    ANDs and shifts, the FIELD_GET macro can be used. With this in mind, the
    *_SHIFT macros can be dropped.
    
    Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
    Link: https://lore.kernel.org/r/20240306-b4-imagis-keys-v3-1-2c429afa8420@skole.hr
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails [+ + +]
Author: Kunwu Chan <chentao@kylinos.cn>
Date:   Thu Jan 18 11:37:59 2024 -0800

    Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails
    
    [ Upstream commit bc4996184d56cfaf56d3811ac2680c8a0e2af56e ]
    
    While input core can work with input->phys set to NULL userspace might
    depend on it, so better fail probing if allocation fails. The system must
    be in a pretty bad shape for it to happen anyway.
    
    Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
    Link: https://lore.kernel.org/r/20240117073124.143636-1-chentao@kylinos.cn
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Input: xpad - add support for Snakebyte GAMEPADs [+ + +]
Author: Matt Scialabba <matt.git@fastmail.fm>
Date:   Fri Mar 15 11:56:19 2024 -0700

    Input: xpad - add support for Snakebyte GAMEPADs
    
    [ Upstream commit 81c32343d04f8ca974681d5fb5d939d2e1f58851 ]
    
    Add Snakebyte GAMEPAD BASE X and Snakebyte GAMEPAD RGB X to the list
    of supported devices.
    
    Signed-off-by: Matt Scialabba <matt.git@fastmail.fm>
    Link: https://lore.kernel.org/r/efbfb428-06b0-48f9-8701-db291c2a9d65@app.fastmail.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
io_uring: clear opcode specific data for an early failure [+ + +]
Author: Jens Axboe <axboe@kernel.dk>
Date:   Sat Mar 16 09:51:40 2024 -0600

    io_uring: clear opcode specific data for an early failure
    
    [ Upstream commit e21e1c45e1fe2e31732f40256b49c04e76a17cee ]
    
    If failure happens before the opcode prep handler is called, ensure that
    we clear the opcode specific area of the request, which holds data
    specific to that request type. This prevents errors where opcode
    handlers either don't get to clear per-request private data since prep
    isn't even called.
    
    Reported-and-tested-by: syzbot+f8e9a371388aa62ecab4@syzkaller.appspotmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
iommu/arm-smmu-v3: Hold arm_smmu_asid_lock during all of attach_dev [+ + +]
Author: Jason Gunthorpe <jgg@ziepe.ca>
Date:   Mon Feb 26 13:07:16 2024 -0400

    iommu/arm-smmu-v3: Hold arm_smmu_asid_lock during all of attach_dev
    
    [ Upstream commit 9f7c68911579bc15c57d227d021ccd253da2b635 ]
    
    The BTM support wants to be able to change the ASID of any smmu_domain.
    When it goes to do this it holds the arm_smmu_asid_lock and iterates over
    the target domain's devices list.
    
    During attach of a S1 domain we must ensure that the devices list and
    CD are in sync, otherwise we could miss CD updates or a parallel CD update
    could push an out of date CD.
    
    This is pretty complicated, and almost works today because
    arm_smmu_detach_dev() removes the master from the linked list before
    working on the CD entries, preventing parallel update of the CD.
    
    However, it does have an issue where the CD can remain programed while the
    domain appears to be unattached. arm_smmu_share_asid() will then not clear
    any CD entriess and install its own CD entry with the same ASID
    concurrently. This creates a small race window where the IOMMU can see two
    ASIDs pointing to different translations.
    
           CPU0                                   CPU1
    arm_smmu_attach_dev()
       arm_smmu_detach_dev()
         spin_lock_irqsave(&smmu_domain->devices_lock, flags);
         list_del(&master->domain_head);
         spin_unlock_irqrestore(&smmu_domain->devices_lock, flags);
    
                                          arm_smmu_mmu_notifier_get()
                                           arm_smmu_alloc_shared_cd()
                                            arm_smmu_share_asid():
                                              // Does nothing due to list_del above
                                              arm_smmu_update_ctx_desc_devices()
                                              arm_smmu_tlb_inv_asid()
                                           arm_smmu_write_ctx_desc()
                                             ** Now the ASID is in two CDs
                                                with different translation
    
         arm_smmu_write_ctx_desc(master, IOMMU_NO_PASID, NULL);
    
    Solve this by wrapping most of the attach flow in the
    arm_smmu_asid_lock. This locks more than strictly needed to prepare for
    the next patch which will reorganize the order of the linked list, STE and
    CD changes.
    
    Move arm_smmu_detach_dev() till after we have initialized the domain so
    the lock can be held for less time.
    
    Reviewed-by: Michael Shavit <mshavit@google.com>
    Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
    Reviewed-by: Mostafa Saleh <smostafa@google.com>
    Tested-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
    Tested-by: Nicolin Chen <nicolinc@nvidia.com>
    Tested-by: Moritz Fischer <moritzf@google.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Link: https://lore.kernel.org/r/5-v6-96275f25c39d+2d4-smmuv3_newapi_p1_jgg@nvidia.com
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ionic: set adminq irq affinity [+ + +]
Author: Shannon Nelson <shannon.nelson@amd.com>
Date:   Wed Feb 14 09:59:01 2024 -0800

    ionic: set adminq irq affinity
    
    [ Upstream commit c699f35d658f3c21b69ed24e64b2ea26381e941d ]
    
    We claim to have the AdminQ on our irq0 and thus cpu id 0,
    but we need to be sure we set the affinity hint to try to
    keep it there.
    
    Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
    Reviewed-by: Brett Creeley <brett.creeley@amd.com>
    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
isofs: handle CDs with bad root inode but good Joliet root directory [+ + +]
Author: Alex Henrie <alexhenrie24@gmail.com>
Date:   Wed Feb 7 19:21:32 2024 -0700

    isofs: handle CDs with bad root inode but good Joliet root directory
    
    [ Upstream commit 4243bf80c79211a8ca2795401add9c4a3b1d37ca ]
    
    I have a CD copy of the original Tom Clancy's Ghost Recon game from
    2001. The disc mounts without error on Windows, but on Linux mounting
    fails with the message "isofs_fill_super: get root inode failed". The
    error originates in isofs_read_inode, which returns -EIO because de_len
    is 0. The superblock on this disc appears to be intentionally corrupt as
    a form of copy protection.
    
    When the root inode is unusable, instead of giving up immediately, try
    to continue with the Joliet file table. This fixes the Ghost Recon CD
    and probably other copy-protected CDs too.
    
    Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Message-Id: <20240208022134.451490-1-alexhenrie24@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Linux: Julia Lawall reported this null pointer dereference, this should fix it. [+ + +]
Author: Mike Marshall <hubcap@omnibond.com>
Date:   Wed Feb 14 15:57:53 2024 -0500

    Julia Lawall reported this null pointer dereference, this should fix it.
    
    [ Upstream commit 9bf93dcfc453fae192fe5d7874b89699e8f800ac ]
    
    Signed-off-by: Mike Marshall <hubcap@omnibond.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
kernfs: RCU protect kernfs_nodes and avoid kernfs_idr_lock in kernfs_find_and_get_node_by_id() [+ + +]
Author: Tejun Heo <tj@kernel.org>
Date:   Tue Jan 9 11:48:04 2024 -1000

    kernfs: RCU protect kernfs_nodes and avoid kernfs_idr_lock in kernfs_find_and_get_node_by_id()
    
    [ Upstream commit 4207b556e62f0a8915afc5da4c5d5ad915a253a5 ]
    
    The BPF helper bpf_cgroup_from_id() calls kernfs_find_and_get_node_by_id()
    which acquires kernfs_idr_lock, which is an non-raw non-IRQ-safe lock. This
    can lead to deadlocks as bpf_cgroup_from_id() can be called from any BPF
    programs including e.g. the ones that attach to functions which are holding
    the scheduler rq lock.
    
    Consider the following BPF program:
    
      SEC("fentry/__set_cpus_allowed_ptr_locked")
      int BPF_PROG(__set_cpus_allowed_ptr_locked, struct task_struct *p,
                   struct affinity_context *affn_ctx, struct rq *rq, struct rq_flags *rf)
      {
              struct cgroup *cgrp = bpf_cgroup_from_id(p->cgroups->dfl_cgrp->kn->id);
    
              if (cgrp) {
                      bpf_printk("%d[%s] in %s", p->pid, p->comm, cgrp->kn->name);
                      bpf_cgroup_release(cgrp);
              }
              return 0;
      }
    
    __set_cpus_allowed_ptr_locked() is called with rq lock held and the above
    BPF program calls bpf_cgroup_from_id() within leading to the following
    lockdep warning:
    
      =====================================================
      WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
      6.7.0-rc3-work-00053-g07124366a1d7-dirty #147 Not tainted
      -----------------------------------------------------
      repro/1620 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
      ffffffff833b3688 (kernfs_idr_lock){+.+.}-{2:2}, at: kernfs_find_and_get_node_by_id+0x1e/0x70
    
                    and this task is already holding:
      ffff888237ced698 (&rq->__lock){-.-.}-{2:2}, at: task_rq_lock+0x4e/0xf0
      which would create a new lock dependency:
       (&rq->__lock){-.-.}-{2:2} -> (kernfs_idr_lock){+.+.}-{2:2}
      ...
       Possible interrupt unsafe locking scenario:
    
             CPU0                    CPU1
             ----                    ----
        lock(kernfs_idr_lock);
                                     local_irq_disable();
                                     lock(&rq->__lock);
                                     lock(kernfs_idr_lock);
        <Interrupt>
          lock(&rq->__lock);
    
                     *** DEADLOCK ***
      ...
      Call Trace:
       dump_stack_lvl+0x55/0x70
       dump_stack+0x10/0x20
       __lock_acquire+0x781/0x2a40
       lock_acquire+0xbf/0x1f0
       _raw_spin_lock+0x2f/0x40
       kernfs_find_and_get_node_by_id+0x1e/0x70
       cgroup_get_from_id+0x21/0x240
       bpf_cgroup_from_id+0xe/0x20
       bpf_prog_98652316e9337a5a___set_cpus_allowed_ptr_locked+0x96/0x11a
       bpf_trampoline_6442545632+0x4f/0x1000
       __set_cpus_allowed_ptr_locked+0x5/0x5a0
       sched_setaffinity+0x1b3/0x290
       __x64_sys_sched_setaffinity+0x4f/0x60
       do_syscall_64+0x40/0xe0
       entry_SYSCALL_64_after_hwframe+0x46/0x4e
    
    Let's fix it by protecting kernfs_node and kernfs_root with RCU and making
    kernfs_find_and_get_node_by_id() acquire rcu_read_lock() instead of
    kernfs_idr_lock.
    
    This adds an rcu_head to kernfs_node making it larger by 16 bytes on 64bit.
    Combined with the preceding rearrange patch, the net increase is 8 bytes.
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Cc: Andrea Righi <andrea.righi@canonical.com>
    Cc: Geert Uytterhoeven <geert@linux-m68k.org>
    Link: https://lore.kernel.org/r/20240109214828.252092-4-tj@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ktest: force $buildonly = 1 for 'make_warnings_file' test type [+ + +]
Author: Ricardo B. Marliere <ricardo@marliere.net>
Date:   Fri Mar 15 12:28:08 2024 -0300

    ktest: force $buildonly = 1 for 'make_warnings_file' test type
    
    [ Upstream commit 07283c1873a4d0eaa0e822536881bfdaea853910 ]
    
    The test type "make_warnings_file" should have no mandatory configuration
    parameters other than the ones required by the "build" test type, because
    its purpose is to create a file with build warnings that may or may not be
    used by other subsequent tests. Currently, the only way to use it as a
    stand-alone test is by setting POWER_CYCLE, CONSOLE, SSH_USER,
    BUILD_TARGET, TARGET_IMAGE, REBOOT_TYPE and GRUB_MENU.
    
    Link: https://lkml.kernel.org/r/20240315-ktest-v2-1-c5c20a75f6a3@marliere.net
    
    Cc: John Hawley <warthog9@eaglescrag.net>
    Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
libperf evlist: Avoid out-of-bounds access [+ + +]
Author: Ian Rogers <irogers@google.com>
Date:   Wed Feb 28 23:07:57 2024 -0800

    libperf evlist: Avoid out-of-bounds access
    
    [ Upstream commit 1947b92464c3268381604bbe2ac977a3fd78192f ]
    
    Parallel testing appears to show a race between allocating and setting
    evsel ids. As there is a bounds check on the xyarray it yields a segv
    like:
    
    ```
    AddressSanitizer:DEADLYSIGNAL
    
    =================================================================
    
    ==484408==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010
    
    ==484408==The signal is caused by a WRITE memory access.
    
    ==484408==Hint: address points to the zero page.
    
        #0 0x55cef5d4eff4 in perf_evlist__id_hash tools/lib/perf/evlist.c:256
        #1 0x55cef5d4f132 in perf_evlist__id_add tools/lib/perf/evlist.c:274
        #2 0x55cef5d4f545 in perf_evlist__id_add_fd tools/lib/perf/evlist.c:315
        #3 0x55cef5a1923f in store_evsel_ids util/evsel.c:3130
        #4 0x55cef5a19400 in evsel__store_ids util/evsel.c:3147
        #5 0x55cef5888204 in __run_perf_stat tools/perf/builtin-stat.c:832
        #6 0x55cef5888c06 in run_perf_stat tools/perf/builtin-stat.c:960
        #7 0x55cef58932db in cmd_stat tools/perf/builtin-stat.c:2878
    ...
    ```
    
    Avoid this crash by early exiting the perf_evlist__id_add_fd and
    perf_evlist__id_add is the access is out-of-bounds.
    
    Signed-off-by: Ian Rogers <irogers@google.com>
    Cc: Yang Jihong <yangjihong1@huawei.com>
    Signed-off-by: Namhyung Kim <namhyung@kernel.org>
    Link: https://lore.kernel.org/r/20240229070757.796244-1-irogers@google.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Linux: Linux 6.8.6 [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Sat Apr 13 13:10:12 2024 +0200

    Linux 6.8.6
    
    Link: https://lore.kernel.org/r/20240411095420.903937140@linuxfoundation.org
    Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
    Tested-by: SeongJae Park <sj@kernel.org>
    Tested-by: Ronald Warsow <rwarsow@gmx.de>
    Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Tested-by: Shuah Khan <skhan@linuxfoundation.org>
    Tested-by: Bagas Sanjaya <bagasdotme@gmail.com>
    Tested-by: Ron Economos <re@w6rz.net>
    Tested-by: Jon Hunter <jonathanh@nvidia.com>
    Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
media: mediatek: vcodec: adding lock to protect decoder context list [+ + +]
Author: Yunfei Dong <yunfei.dong@mediatek.com>
Date:   Thu Mar 14 20:30:08 2024 +0800

    media: mediatek: vcodec: adding lock to protect decoder context list
    
    [ Upstream commit 6467cda18c9f9b5f2f9a0aa1e2861c653e41f382 ]
    
    Add a lock for the ctx_list, to avoid accessing a NULL pointer
    within the 'vpu_dec_ipi_handler' function when the ctx_list has
    been deleted due to an unexpected behavior on the SCP IP block.
    
    Hardware name: Google juniper sku16 board (DT)
    pstate: 20400005 (nzCv daif +PAN -UAO -TCO BTYPE=--)
    pc : vpu_dec_ipi_handler+0x58/0x1f8 [mtk_vcodec_dec]
    lr : scp_ipi_handler+0xd0/0x194 [mtk_scp]
    sp : ffffffc0131dbbd0
    x29: ffffffc0131dbbd0 x28: 0000000000000000
    x27: ffffff9bb277f348 x26: ffffff9bb242ad00
    x25: ffffffd2d440d3b8 x24: ffffffd2a13ff1d4
    x23: ffffff9bb7fe85a0 x22: ffffffc0133fbdb0
    x21: 0000000000000010 x20: ffffff9b050ea328
    x19: ffffffc0131dbc08 x18: 0000000000001000
    x17: 0000000000000000 x16: ffffffd2d461c6e0
    x15: 0000000000000242 x14: 000000000000018f
    x13: 000000000000004d x12: 0000000000000000
    x11: 0000000000000001 x10: fffffffffffffff0
    x9 : ffffff9bb6e793a8 x8 : 0000000000000000
    x7 : 0000000000000000 x6 : 000000000000003f
    x5 : 0000000000000040 x4 : fffffffffffffff0
    x3 : 0000000000000020 x2 : ffffff9bb6e79080
    x1 : 0000000000000010 x0 : ffffffc0131dbc08
    Call trace:
    vpu_dec_ipi_handler+0x58/0x1f8 [mtk_vcodec_dec (HASH:6c3f 2)]
    scp_ipi_handler+0xd0/0x194 [mtk_scp (HASH:7046 3)]
    mt8183_scp_irq_handler+0x44/0x88 [mtk_scp (HASH:7046 3)]
    scp_irq_handler+0x48/0x90 [mtk_scp (HASH:7046 3)]
    irq_thread_fn+0x38/0x94
    irq_thread+0x100/0x1c0
    kthread+0x140/0x1fc
    ret_from_fork+0x10/0x30
    Code: 54000088 f94ca50a eb14015f 54000060 (f9400108)
    ---[ end trace ace43ce36cbd5c93 ]---
    Kernel panic - not syncing: Oops: Fatal exception
    SMP: stopping secondary CPUs
    Kernel Offset: 0x12c4000000 from 0xffffffc010000000
    PHYS_OFFSET: 0xffffffe580000000
    CPU features: 0x08240002,2188200c
    Memory Limit: none
    
    Fixes: 655b86e52eac ("media: mediatek: vcodec: Fix possible invalid memory access for decoder")
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.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: Sasha Levin <sashal@kernel.org>

media: mediatek: vcodec: adding lock to protect encoder context list [+ + +]
Author: Yunfei Dong <yunfei.dong@mediatek.com>
Date:   Thu Mar 14 20:30:09 2024 +0800

    media: mediatek: vcodec: adding lock to protect encoder context list
    
    [ Upstream commit afaaf3a0f647a24a7bf6a2145d8ade37baaf75ad ]
    
    Add a lock for the ctx_list, to avoid accessing a NULL pointer
    within the 'vpu_enc_ipi_handler' function when the ctx_list has
    been deleted due to an unexpected behavior on the SCP IP block.
    
    Fixes: 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder")
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.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: Sasha Levin <sashal@kernel.org>

media: mediatek: vcodec: Fix oops when HEVC init fails [+ + +]
Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Date:   Mon Feb 26 16:19:52 2024 -0500

    media: mediatek: vcodec: Fix oops when HEVC init fails
    
    [ Upstream commit 97c75ee5de060d271d80109b0c47cb6008439e5b ]
    
    The stateless HEVC decoder saves the instance pointer in the context
    regardless if the initialization worked or not. This caused a use after
    free, when the pointer is freed in case of a failure in the deinit
    function.
    Only store the instance pointer when the initialization was successful,
    to solve this issue.
    
     Hardware name: Acer Tomato (rev3 - 4) board (DT)
     pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
     pc : vcodec_vpu_send_msg+0x4c/0x190 [mtk_vcodec_dec]
     lr : vcodec_send_ap_ipi+0x78/0x170 [mtk_vcodec_dec]
     sp : ffff80008750bc20
     x29: ffff80008750bc20 x28: ffff1299f6d70000 x27: 0000000000000000
     x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
     x23: ffff80008750bc98 x22: 000000000000a003 x21: ffffd45c4cfae000
     x20: 0000000000000010 x19: ffff1299fd668310 x18: 000000000000001a
     x17: 000000040044ffff x16: ffffd45cb15dc648 x15: 0000000000000000
     x14: ffff1299c08da1c0 x13: ffffd45cb1f87a10 x12: ffffd45cb2f5fe80
     x11: 0000000000000001 x10: 0000000000001b30 x9 : ffffd45c4d12b488
     x8 : 1fffe25339380d81 x7 : 0000000000000001 x6 : ffff1299c9c06c00
     x5 : 0000000000000132 x4 : 0000000000000000 x3 : 0000000000000000
     x2 : 0000000000000010 x1 : ffff80008750bc98 x0 : 0000000000000000
     Call trace:
      vcodec_vpu_send_msg+0x4c/0x190 [mtk_vcodec_dec]
      vcodec_send_ap_ipi+0x78/0x170 [mtk_vcodec_dec]
      vpu_dec_deinit+0x1c/0x30 [mtk_vcodec_dec]
      vdec_hevc_slice_deinit+0x30/0x98 [mtk_vcodec_dec]
      vdec_if_deinit+0x38/0x68 [mtk_vcodec_dec]
      mtk_vcodec_dec_release+0x20/0x40 [mtk_vcodec_dec]
      fops_vcodec_release+0x64/0x118 [mtk_vcodec_dec]
      v4l2_release+0x7c/0x100
      __fput+0x80/0x2d8
      __fput_sync+0x58/0x70
      __arm64_sys_close+0x40/0x90
      invoke_syscall+0x50/0x128
      el0_svc_common.constprop.0+0x48/0xf0
      do_el0_svc+0x24/0x38
      el0_svc+0x38/0xd8
      el0t_64_sync_handler+0xc0/0xc8
      el0t_64_sync+0x1a8/0x1b0
     Code: d503201f f9401660 b900127f b900227f (f9400400)
    
    Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
    Fixes: 2674486aac7d ("media: mediatek: vcodec: support stateless hevc decoder")
    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: Sasha Levin <sashal@kernel.org>

media: sta2x11: fix irq handler cast [+ + +]
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Tue Feb 13 10:54:47 2024 +0100

    media: sta2x11: fix irq handler cast
    
    [ Upstream commit 3de49ae81c3a0f83a554ecbce4c08e019f30168e ]
    
    clang-16 warns about casting incompatible function pointers:
    
    drivers/media/pci/sta2x11/sta2x11_vip.c:1057:6: error: cast from 'irqreturn_t (*)(int, struct sta2x11_vip *)' (aka 'enum irqreturn (*)(int, struct sta2x11_vip *)') to 'irq_handler_t' (aka 'enum irqreturn (*)(int, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    
    Change the prototype of the irq handler to the regular version with a
    local variable to adjust the argument type.
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    [hverkuil: update argument documentation]
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
modpost: fix null pointer dereference [+ + +]
Author: Max Kellermann <max.kellermann@ionos.com>
Date:   Thu Feb 15 15:13:21 2024 +0100

    modpost: fix null pointer dereference
    
    [ Upstream commit 23dfd914d2bfc4c9938b0084dffd7105de231d98 ]
    
    If the find_fromsym() call fails and returns NULL, the warn() call
    will dereference this NULL pointer and cause the program to crash.
    
    This happened when I tried to build with "test_user_copy" module.
    With this fix, it prints lots of warnings like this:
    
     WARNING: modpost: lib/test_user_copy: section mismatch in reference: (unknown)+0x4 (section: .text.fixup) -> (unknown) (section: .init.text)
    
    masahiroy@kernel.org:
     The issue is reproduced with ARCH=arm allnoconfig + CONFIG_MODULES=y +
     CONFIG_RUNTIME_TESTING_MENU=y + CONFIG_TEST_USER_COPY=m
    
    Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
    Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/smc: reduce rtnl pressure in smc_pnet_create_pnetids_list() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Sat Mar 2 10:07:44 2024 +0000

    net/smc: reduce rtnl pressure in smc_pnet_create_pnetids_list()
    
    [ Upstream commit 00af2aa93b76b1bade471ad0d0525d4d29ca5cc0 ]
    
    Many syzbot reports show extreme rtnl pressure, and many of them hint
    that smc acquires rtnl in netns creation for no good reason [1]
    
    This patch returns early from smc_pnet_net_init()
    if there is no netdevice yet.
    
    I am not even sure why smc_pnet_create_pnetids_list() even exists,
    because smc_pnet_netdev_event() is also calling
    smc_pnet_add_base_pnetid() when handling NETDEV_UP event.
    
    [1] extract of typical syzbot reports
    
    2 locks held by syz-executor.3/12252:
      #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
    2 locks held by syz-executor.4/12253:
      #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
    2 locks held by syz-executor.1/12257:
      #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
    2 locks held by syz-executor.2/12261:
      #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
    2 locks held by syz-executor.0/12265:
      #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
    2 locks held by syz-executor.3/12268:
      #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
    2 locks held by syz-executor.4/12271:
      #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
    2 locks held by syz-executor.1/12274:
      #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
    2 locks held by syz-executor.2/12280:
      #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline]
      #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Wenjia Zhang <wenjia@linux.ibm.com>
    Cc: Jan Karcher <jaka@linux.ibm.com>
    Cc: "D. Wythe" <alibuda@linux.alibaba.com>
    Cc: Tony Lu <tonylu@linux.alibaba.com>
    Cc: Wen Gu <guwen@linux.alibaba.com>
    Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
    Link: https://lore.kernel.org/r/20240302100744.3868021-1-edumazet@google.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net: add netdev_lockdep_set_classes() to virtual drivers [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Mon Feb 12 14:07:00 2024 +0000

    net: add netdev_lockdep_set_classes() to virtual drivers
    
    [ Upstream commit 0bef512012b1cd8820f0c9ec80e5f8ceb43fdd59 ]
    
    Based on a syzbot report, it appears many virtual
    drivers do not yet use netdev_lockdep_set_classes(),
    triggerring lockdep false positives.
    
    WARNING: possible recursive locking detected
    6.8.0-rc4-next-20240212-syzkaller #0 Not tainted
    
    syz-executor.0/19016 is trying to acquire lock:
     ffff8880162cb298 (_xmit_ETHER#2){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
     ffff8880162cb298 (_xmit_ETHER#2){+.-.}-{2:2}, at: __netif_tx_lock include/linux/netdevice.h:4452 [inline]
     ffff8880162cb298 (_xmit_ETHER#2){+.-.}-{2:2}, at: sch_direct_xmit+0x1c4/0x5f0 net/sched/sch_generic.c:340
    
    but task is already holding lock:
     ffff8880223db4d8 (_xmit_ETHER#2){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
     ffff8880223db4d8 (_xmit_ETHER#2){+.-.}-{2:2}, at: __netif_tx_lock include/linux/netdevice.h:4452 [inline]
     ffff8880223db4d8 (_xmit_ETHER#2){+.-.}-{2:2}, at: sch_direct_xmit+0x1c4/0x5f0 net/sched/sch_generic.c:340
    
    other info that might help us debug this:
     Possible unsafe locking scenario:
    
           CPU0
      lock(_xmit_ETHER#2);
      lock(_xmit_ETHER#2);
    
     *** DEADLOCK ***
    
     May be due to missing lock nesting notation
    
    9 locks held by syz-executor.0/19016:
      #0: ffffffff8f385208 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:79 [inline]
      #0: ffffffff8f385208 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x82c/0x1040 net/core/rtnetlink.c:6603
      #1: ffffc90000a08c00 ((&in_dev->mr_ifc_timer)){+.-.}-{0:0}, at: call_timer_fn+0xc0/0x600 kernel/time/timer.c:1697
      #2: ffffffff8e131520 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:298 [inline]
      #2: ffffffff8e131520 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:750 [inline]
      #2: ffffffff8e131520 (rcu_read_lock){....}-{1:2}, at: ip_finish_output2+0x45f/0x1360 net/ipv4/ip_output.c:228
      #3: ffffffff8e131580 (rcu_read_lock_bh){....}-{1:2}, at: local_bh_disable include/linux/bottom_half.h:20 [inline]
      #3: ffffffff8e131580 (rcu_read_lock_bh){....}-{1:2}, at: rcu_read_lock_bh include/linux/rcupdate.h:802 [inline]
      #3: ffffffff8e131580 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x2c4/0x3b10 net/core/dev.c:4284
      #4: ffff8880416e3258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: spin_trylock include/linux/spinlock.h:361 [inline]
      #4: ffff8880416e3258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: qdisc_run_begin include/net/sch_generic.h:195 [inline]
      #4: ffff8880416e3258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: __dev_xmit_skb net/core/dev.c:3771 [inline]
      #4: ffff8880416e3258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: __dev_queue_xmit+0x1262/0x3b10 net/core/dev.c:4325
      #5: ffff8880223db4d8 (_xmit_ETHER#2){+.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
      #5: ffff8880223db4d8 (_xmit_ETHER#2){+.-.}-{2:2}, at: __netif_tx_lock include/linux/netdevice.h:4452 [inline]
      #5: ffff8880223db4d8 (_xmit_ETHER#2){+.-.}-{2:2}, at: sch_direct_xmit+0x1c4/0x5f0 net/sched/sch_generic.c:340
      #6: ffffffff8e131520 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:298 [inline]
      #6: ffffffff8e131520 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:750 [inline]
      #6: ffffffff8e131520 (rcu_read_lock){....}-{1:2}, at: ip_finish_output2+0x45f/0x1360 net/ipv4/ip_output.c:228
      #7: ffffffff8e131580 (rcu_read_lock_bh){....}-{1:2}, at: local_bh_disable include/linux/bottom_half.h:20 [inline]
      #7: ffffffff8e131580 (rcu_read_lock_bh){....}-{1:2}, at: rcu_read_lock_bh include/linux/rcupdate.h:802 [inline]
      #7: ffffffff8e131580 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x2c4/0x3b10 net/core/dev.c:4284
      #8: ffff888014d9d258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: spin_trylock include/linux/spinlock.h:361 [inline]
      #8: ffff888014d9d258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: qdisc_run_begin include/net/sch_generic.h:195 [inline]
      #8: ffff888014d9d258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: __dev_xmit_skb net/core/dev.c:3771 [inline]
      #8: ffff888014d9d258 (dev->qdisc_tx_busylock ?: &qdisc_tx_busylock){+...}-{2:2}, at: __dev_queue_xmit+0x1262/0x3b10 net/core/dev.c:4325
    
    stack backtrace:
    CPU: 1 PID: 19016 Comm: syz-executor.0 Not tainted 6.8.0-rc4-next-20240212-syzkaller #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
    Call Trace:
     <IRQ>
      __dump_stack lib/dump_stack.c:88 [inline]
      dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
      check_deadlock kernel/locking/lockdep.c:3062 [inline]
      validate_chain+0x15c1/0x58e0 kernel/locking/lockdep.c:3856
      __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
      lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
      __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
      _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154
      spin_lock include/linux/spinlock.h:351 [inline]
      __netif_tx_lock include/linux/netdevice.h:4452 [inline]
      sch_direct_xmit+0x1c4/0x5f0 net/sched/sch_generic.c:340
      __dev_xmit_skb net/core/dev.c:3784 [inline]
      __dev_queue_xmit+0x1912/0x3b10 net/core/dev.c:4325
      neigh_output include/net/neighbour.h:542 [inline]
      ip_finish_output2+0xe66/0x1360 net/ipv4/ip_output.c:235
      iptunnel_xmit+0x540/0x9b0 net/ipv4/ip_tunnel_core.c:82
      ip_tunnel_xmit+0x20ee/0x2960 net/ipv4/ip_tunnel.c:831
      erspan_xmit+0x9de/0x1460 net/ipv4/ip_gre.c:720
      __netdev_start_xmit include/linux/netdevice.h:4989 [inline]
      netdev_start_xmit include/linux/netdevice.h:5003 [inline]
      xmit_one net/core/dev.c:3555 [inline]
      dev_hard_start_xmit+0x242/0x770 net/core/dev.c:3571
      sch_direct_xmit+0x2b6/0x5f0 net/sched/sch_generic.c:342
      __dev_xmit_skb net/core/dev.c:3784 [inline]
      __dev_queue_xmit+0x1912/0x3b10 net/core/dev.c:4325
      neigh_output include/net/neighbour.h:542 [inline]
      ip_finish_output2+0xe66/0x1360 net/ipv4/ip_output.c:235
      igmpv3_send_cr net/ipv4/igmp.c:723 [inline]
      igmp_ifc_timer_expire+0xb71/0xd90 net/ipv4/igmp.c:813
      call_timer_fn+0x17e/0x600 kernel/time/timer.c:1700
      expire_timers kernel/time/timer.c:1751 [inline]
      __run_timers+0x621/0x830 kernel/time/timer.c:2038
      run_timer_softirq+0x67/0xf0 kernel/time/timer.c:2051
      __do_softirq+0x2bc/0x943 kernel/softirq.c:554
      invoke_softirq kernel/softirq.c:428 [inline]
      __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633
      irq_exit_rcu+0x9/0x30 kernel/softirq.c:645
      instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1076 [inline]
      sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1076
     </IRQ>
     <TASK>
      asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
     RIP: 0010:resched_offsets_ok kernel/sched/core.c:10127 [inline]
     RIP: 0010:__might_resched+0x16f/0x780 kernel/sched/core.c:10142
    Code: 00 4c 89 e8 48 c1 e8 03 48 ba 00 00 00 00 00 fc ff df 48 89 44 24 38 0f b6 04 10 84 c0 0f 85 87 04 00 00 41 8b 45 00 c1 e0 08 <01> d8 44 39 e0 0f 85 d6 00 00 00 44 89 64 24 1c 48 8d bc 24 a0 00
    RSP: 0018:ffffc9000ee069e0 EFLAGS: 00000246
    RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8880296a9e00
    RDX: dffffc0000000000 RSI: ffff8880296a9e00 RDI: ffffffff8bfe8fa0
    RBP: ffffc9000ee06b00 R08: ffffffff82326877 R09: 1ffff11002b5ad1b
    R10: dffffc0000000000 R11: ffffed1002b5ad1c R12: 0000000000000000
    R13: ffff8880296aa23c R14: 000000000000062a R15: 1ffff92001dc0d44
      down_write+0x19/0x50 kernel/locking/rwsem.c:1578
      kernfs_activate fs/kernfs/dir.c:1403 [inline]
      kernfs_add_one+0x4af/0x8b0 fs/kernfs/dir.c:819
      __kernfs_create_file+0x22e/0x2e0 fs/kernfs/file.c:1056
      sysfs_add_file_mode_ns+0x24a/0x310 fs/sysfs/file.c:307
      create_files fs/sysfs/group.c:64 [inline]
      internal_create_group+0x4f4/0xf20 fs/sysfs/group.c:152
      internal_create_groups fs/sysfs/group.c:192 [inline]
      sysfs_create_groups+0x56/0x120 fs/sysfs/group.c:218
      create_dir lib/kobject.c:78 [inline]
      kobject_add_internal+0x472/0x8d0 lib/kobject.c:240
      kobject_add_varg lib/kobject.c:374 [inline]
      kobject_init_and_add+0x124/0x190 lib/kobject.c:457
      netdev_queue_add_kobject net/core/net-sysfs.c:1706 [inline]
      netdev_queue_update_kobjects+0x1f3/0x480 net/core/net-sysfs.c:1758
      register_queue_kobjects net/core/net-sysfs.c:1819 [inline]
      netdev_register_kobject+0x265/0x310 net/core/net-sysfs.c:2059
      register_netdevice+0x1191/0x19c0 net/core/dev.c:10298
      bond_newlink+0x3b/0x90 drivers/net/bonding/bond_netlink.c:576
      rtnl_newlink_create net/core/rtnetlink.c:3506 [inline]
      __rtnl_newlink net/core/rtnetlink.c:3726 [inline]
      rtnl_newlink+0x158f/0x20a0 net/core/rtnetlink.c:3739
      rtnetlink_rcv_msg+0x885/0x1040 net/core/rtnetlink.c:6606
      netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2543
      netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
      netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1367
      netlink_sendmsg+0xa3c/0xd70 net/netlink/af_netlink.c:1908
      sock_sendmsg_nosec net/socket.c:730 [inline]
      __sock_sendmsg+0x221/0x270 net/socket.c:745
      __sys_sendto+0x3a4/0x4f0 net/socket.c:2191
      __do_sys_sendto net/socket.c:2203 [inline]
      __se_sys_sendto net/socket.c:2199 [inline]
      __x64_sys_sendto+0xde/0x100 net/socket.c:2199
     do_syscall_64+0xfb/0x240
     entry_SYSCALL_64_after_hwframe+0x6d/0x75
    RIP: 0033:0x7fc3fa87fa9c
    
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Link: https://lore.kernel.org/r/20240212140700.2795436-4-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: dsa: qca8k: put MDIO controller OF node if unavailable [+ + +]
Author: Vladimir Oltean <vladimir.oltean@nxp.com>
Date:   Fri Feb 2 18:36:25 2024 +0200

    net: dsa: qca8k: put MDIO controller OF node if unavailable
    
    [ Upstream commit 08932323ccf7f8c4c85db9cb12a791ed81264f66 ]
    
    It was pointed out during the review [1] of commit e66bf63a7f67 ("net:
    dsa: qca8k: skip MDIO bus creation if its OF node has status =
    "disabled"") that we now leak a reference to the "mdio" OF node if it is
    disabled.
    
    This is only a concern when using dynamic OF as far as I can tell (like
    probing on an overlay), since OF nodes are never freed in the regular
    case. Additionally, I'm unaware of any actual device trees (in
    production or elsewhere) which have status = "disabled" for the MDIO OF
    node. So handling this as a simple enhancement.
    
    [1] https://lore.kernel.org/netdev/CAJq09z4--Ug+3FAmp=EimQ8HTQYOWOuVon-PUMGB5a1N=RPv4g@mail.gmail.com/
    
    Suggested-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: mpls: error out if inner headers are not set [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Thu Feb 22 15:03:10 2024 +0100

    net: mpls: error out if inner headers are not set
    
    commit 025f8ad20f2e3264d11683aa9cbbf0083eefbdcd upstream.
    
    mpls_gso_segment() assumes skb_inner_network_header() returns
    a valid result:
    
      mpls_hlen = skb_inner_network_header(skb) - skb_network_header(skb);
      if (unlikely(!mpls_hlen || mpls_hlen % MPLS_HLEN))
            goto out;
      if (unlikely(!pskb_may_pull(skb, mpls_hlen)))
    
    With syzbot reproducer, skb_inner_network_header() yields 0,
    skb_network_header() returns 108, so this will
    "pskb_may_pull(skb, -108)))" which triggers a newly added
    DEBUG_NET_WARN_ON_ONCE() check:
    
    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 5068 at include/linux/skbuff.h:2723 pskb_may_pull_reason include/linux/skbuff.h:2723 [inline]
    WARNING: CPU: 0 PID: 5068 at include/linux/skbuff.h:2723 pskb_may_pull include/linux/skbuff.h:2739 [inline]
    WARNING: CPU: 0 PID: 5068 at include/linux/skbuff.h:2723 mpls_gso_segment+0x773/0xaa0 net/mpls/mpls_gso.c:34
    [..]
     skb_mac_gso_segment+0x383/0x740 net/core/gso.c:53
     nsh_gso_segment+0x40a/0xad0 net/nsh/nsh.c:108
     skb_mac_gso_segment+0x383/0x740 net/core/gso.c:53
     __skb_gso_segment+0x324/0x4c0 net/core/gso.c:124
     skb_gso_segment include/net/gso.h:83 [inline]
     [..]
     sch_direct_xmit+0x11a/0x5f0 net/sched/sch_generic.c:327
     [..]
     packet_sendmsg+0x46a9/0x6130 net/packet/af_packet.c:3113
     [..]
    
    First iteration of this patch made mpls_hlen signed and changed
    test to error out to "mpls_hlen <= 0 || ..".
    
    Eric Dumazet said:
     > I was thinking about adding a debug check in skb_inner_network_header()
     > if inner_network_header is zero (that would mean it is not 'set' yet),
     > but this would trigger even after your patch.
    
    So add new skb_inner_network_header_was_set() helper and use that.
    
    The syzbot reproducer injects data via packet socket. The skb that gets
    allocated and passed down the stack has ->protocol set to NSH (0x894f)
    and gso_type set to SKB_GSO_UDP | SKB_GSO_DODGY.
    
    This gets passed to skb_mac_gso_segment(), which sees NSH as ptype to
    find a callback for.  nsh_gso_segment() retrieves next type:
    
            proto = tun_p_to_eth_p(nsh_hdr(skb)->np);
    
    ... which is MPLS (TUN_P_MPLS_UC). It updates skb->protocol and then
    calls mpls_gso_segment().  Inner offsets are all 0, so mpls_gso_segment()
    ends up with a negative header size.
    
    In case more callers rely on silent handling of such large may_pull values
    we could also 'legalize' this behaviour, either replacing the debug check
    with (len > INT_MAX) test or removing it and instead adding a comment
    before existing
    
     if (unlikely(len > skb->len))
        return SKB_DROP_REASON_PKT_TOO_SMALL;
    
    test in pskb_may_pull_reason(), saying that this check also implicitly
    takes care of callers that miscompute header sizes.
    
    Cc: Simon Horman <horms@kernel.org>
    Fixes: 219eee9c0d16 ("net: skbuff: add overflow debug check to pull/push helpers")
    Reported-by: syzbot+99d15fcdb0132a1e1a82@syzkaller.appspotmail.com
    Closes: https://lore.kernel.org/netdev/00000000000043b1310611e388aa@google.com/raw
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Link: https://lore.kernel.org/r/20240222140321.14080-1-fw@strlen.de
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: pcs: xpcs: Return EINVAL in the internal methods [+ + +]
Author: Serge Semin <fancer.lancer@gmail.com>
Date:   Thu Feb 22 20:58:22 2024 +0300

    net: pcs: xpcs: Return EINVAL in the internal methods
    
    [ Upstream commit f5151005d379d9ce42e327fd3b2d2aaef61cda81 ]
    
    In particular the xpcs_soft_reset() and xpcs_do_config() functions
    currently return -1 if invalid auto-negotiation mode is specified. That
    value might be then passed to the generic kernel subsystems which require
    a standard kernel errno value. Even though the erroneous conditions are
    very specific (memory corruption or buggy driver implementation) using a
    hard-coded -1 literal doesn't seem correct anyway especially when it comes
    to passing it higher to the network subsystem or printing to the system
    log.  Convert the hard-coded error values to -EINVAL then.
    
    Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
    Tested-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: phy: phy_device: Prevent nullptr exceptions on ISR [+ + +]
Author: Andre Werner <andre.werner@systec-electronic.com>
Date:   Mon Jan 29 14:55:04 2024 +0100

    net: phy: phy_device: Prevent nullptr exceptions on ISR
    
    [ Upstream commit 61c81872815f46006982bb80460c0c80a949b35b ]
    
    If phydev->irq is set unconditionally, check
    for valid interrupt handler or fall back to polling mode to prevent
    nullptr exceptions in interrupt service routine.
    
    Signed-off-by: Andre Werner <andre.werner@systec-electronic.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Link: https://lore.kernel.org/r/20240129135734.18975-2-andre.werner@systec-electronic.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: skbuff: add overflow debug check to pull/push helpers [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Fri Feb 16 12:36:57 2024 +0100

    net: skbuff: add overflow debug check to pull/push helpers
    
    [ Upstream commit 219eee9c0d16f1b754a8b85275854ab17df0850a ]
    
    syzbot managed to trigger following splat:
    BUG: KASAN: use-after-free in __skb_flow_dissect+0x4a3b/0x5e50
    Read of size 1 at addr ffff888208a4000e by task a.out/2313
    [..]
      __skb_flow_dissect+0x4a3b/0x5e50
      __skb_get_hash+0xb4/0x400
      ip_tunnel_xmit+0x77e/0x26f0
      ipip_tunnel_xmit+0x298/0x410
      ..
    
    Analysis shows that the skb has a valid ->head, but bogus ->data
    pointer.
    
    skb->data gets its bogus value via the neigh layer, which does:
    
    1556    __skb_pull(skb, skb_network_offset(skb));
    
    ... and the skb was already dodgy at this point:
    
    skb_network_offset(skb) returns a negative value due to an
    earlier overflow of skb->network_header (u16).  __skb_pull thus
    "adjusts" skb->data by a huge offset, pointing outside skb->head
    area.
    
    Allow debug builds to splat when we try to pull/push more than
    INT_MAX bytes.
    
    After this, the syzkaller reproducer yields a more precise splat
    before the flow dissector attempts to read off skb->data memory:
    
    WARNING: CPU: 5 PID: 2313 at include/linux/skbuff.h:2653 neigh_connected_output+0x28e/0x400
      ip_finish_output2+0xb25/0xed0
      iptunnel_xmit+0x4ff/0x870
      ipgre_xmit+0x78e/0xbb0
    
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://lore.kernel.org/r/20240216113700.23013-1-fw@strlen.de
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: stmmac: dwmac-starfive: Add support for JH7100 SoC [+ + +]
Author: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Date:   Fri Jan 26 21:21:26 2024 +0200

    net: stmmac: dwmac-starfive: Add support for JH7100 SoC
    
    [ Upstream commit 8d4597b871210429bda0f5c3a8816b7d9b6daf7e ]
    
    Add a missing quirk to enable support for the StarFive JH7100 SoC.
    
    Additionally, for greater flexibility in operation, allow using the
    rgmii-rxid and rgmii-txid phy modes.
    
    Co-developed-by: Emil Renner Berthing <kernel@esmil.dk>
    Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
    Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
netdev: let netlink core handle -EMSGSIZE errors [+ + +]
Author: Jakub Kicinski <kuba@kernel.org>
Date:   Sat Mar 2 21:24:07 2024 -0800

    netdev: let netlink core handle -EMSGSIZE errors
    
    [ Upstream commit 0b11b1c5c320555483e8a94c44549db24c289987 ]
    
    Previous change added -EMSGSIZE handling to af_netlink, we don't
    have to hide these errors any longer.
    
    Theoretically the error handling changes from:
     if (err == -EMSGSIZE)
    to
     if (err == -EMSGSIZE && skb->len)
    
    everywhere, but in practice it doesn't matter.
    All messages fit into NLMSG_GOODSIZE, so overflow of an empty
    skb cannot happen.
    
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
nouveau: fix devinit paths to only handle display on GSP. [+ + +]
Author: Dave Airlie <airlied@gmail.com>
Date:   Mon Apr 8 16:42:43 2024 +1000

    nouveau: fix devinit paths to only handle display on GSP.
    
    [ Upstream commit 718c4fb221dbeff9072810841b949413c5ffc345 ]
    
    This reverts:
    nouveau/gsp: don't check devinit disable on GSP.
    and applies a further fix.
    
    It turns out the open gpu driver, checks this register,
    but only for display.
    
    Match that behaviour and in the turing path only disable
    the display block. (ampere already only does displays).
    
    Fixes: 5d4e8ae6e57b ("nouveau/gsp: don't check devinit disable on GSP.")
    Reviewed-by: Danilo Krummrich <dakr@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240408064243.2219527-1-airlied@gmail.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
overflow: Allow non-type arg to type_max() and type_min() [+ + +]
Author: Kees Cook <keescook@chromium.org>
Date:   Thu Feb 29 22:22:26 2024 -0800

    overflow: Allow non-type arg to type_max() and type_min()
    
    [ Upstream commit bd1ebf2467f9c5d157bec7b025e83f8ffdae1318 ]
    
    A common use of type_max() is to find the max for the type of a
    variable. Using the pattern type_max(typeof(var)) is needlessly
    verbose. Instead, since typeof(type) == type we can just explicitly
    call typeof() on the argument to type_max() and type_min(). Add
    wrappers for readability.
    
    We can do some replacements right away:
    
    $ git grep '\btype_\(min\|max\)(typeof' | wc -l
    11
    
    Link: https://lore.kernel.org/r/20240301062221.work.840-kees@kernel.org
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
panic: Flush kernel log buffer at the end [+ + +]
Author: John Ogness <john.ogness@linutronix.de>
Date:   Wed Feb 7 14:47:02 2024 +0106

    panic: Flush kernel log buffer at the end
    
    [ Upstream commit d988d9a9b9d180bfd5c1d353b3b176cb90d6861b ]
    
    If the kernel crashes in a context where printk() calls always
    defer printing (such as in NMI or inside a printk_safe section)
    then the final panic messages will be deferred to irq_work. But
    if irq_work is not available, the messages will not get printed
    unless explicitly flushed. The result is that the final
    "end Kernel panic" banner does not get printed.
    
    Add one final flush after the last printk() call to make sure
    the final panic messages make it out as well.
    
    Signed-off-by: John Ogness <john.ogness@linutronix.de>
    Reviewed-by: Petr Mladek <pmladek@suse.com>
    Link: https://lore.kernel.org/r/20240207134103.1357162-14-john.ogness@linutronix.de
    Signed-off-by: Petr Mladek <pmladek@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
PCI: Disable D3cold on Asus B1400 PCI-NVMe bridge [+ + +]
Author: Daniel Drake <drake@endlessos.org>
Date:   Wed Feb 28 08:53:15 2024 +0100

    PCI: Disable D3cold on Asus B1400 PCI-NVMe bridge
    
    [ Upstream commit cdea98bf1faef23166262825ce44648be6ebff42 ]
    
    The Asus B1400 with original shipped firmware versions and VMD disabled
    cannot resume from suspend: the NVMe device becomes unresponsive and
    inaccessible.
    
    This appears to be an untested D3cold transition by the vendor; Intel
    socwatch shows that Windows leaves the NVMe device and parent bridge in D0
    during suspend, even though these firmware versions have StorageD3Enable=1.
    
    The NVMe device and parent PCI bridge both share the same "PXP" ACPI power
    resource, which gets turned off as both devices are put into D3cold during
    suspend. The _OFF() method calls DL23() which sets a L23E bit at offset
    0xe2 into the PCI configuration space for this root port.  This is the
    specific write that the _ON() routine is unable to recover from. This
    register is not documented in the public chipset datasheet.
    
    Disallow D3cold on the PCI bridge to enable successful suspend/resume.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=215742
    Link: https://lore.kernel.org/r/20240228075316.7404-1-drake@endlessos.org
    Signed-off-by: Daniel Drake <drake@endlessos.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Acked-by: Jian-Hong Pan <jhp@endlessos.org>
    Acked-by: Rafael J. Wysocki <rafael@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
perf/x86/amd/lbr: Discard erroneous branch entries [+ + +]
Author: Sandipan Das <sandipan.das@amd.com>
Date:   Mon Jan 29 16:36:25 2024 +0530

    perf/x86/amd/lbr: Discard erroneous branch entries
    
    [ Upstream commit 29297ffffb0bf388778bd4b581a43cee6929ae65 ]
    
    The Revision Guide for AMD Family 19h Model 10-1Fh processors declares
    Erratum 1452 which states that non-branch entries may erroneously be
    recorded in the Last Branch Record (LBR) stack with the valid and
    spec bits set.
    
    Such entries can be recognized by inspecting bit 61 of the corresponding
    LastBranchStackToIp register. This bit is currently reserved but if found
    to be set, the associated branch entry should be discarded.
    
    Signed-off-by: Sandipan Das <sandipan.das@amd.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: https://bugzilla.kernel.org/attachment.cgi?id=305518
    Link: https://lore.kernel.org/r/3ad2aa305f7396d41a40e3f054f740d464b16b7f.1706526029.git.sandipan.das@amd.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
pinctrl: renesas: checker: Limit cfg reg enum checks to provided IDs [+ + +]
Author: Geert Uytterhoeven <geert+renesas@glider.be>
Date:   Mon Jan 22 14:43:38 2024 +0100

    pinctrl: renesas: checker: Limit cfg reg enum checks to provided IDs
    
    [ Upstream commit 3803584a4e9b65bb5b013f862f55c5055aa86c25 ]
    
    If the number of provided enum IDs in a variable width config register
    description does not match the expected number, the checker uses the
    expected number for validating the individual enum IDs.
    
    However, this may cause out-of-bounds accesses on the array holding the
    enum IDs, leading to bogus enum_id conflict warnings.  Worse, if the bug
    is an incorrect bit field description (e.g. accidentally using "12"
    instead of "-12" for a reserved field), thousands of warnings may be
    printed, overflowing the kernel log buffer.
    
    Fix this by limiting the enum ID check to the number of provided enum
    IDs.
    
    Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Link: https://lore.kernel.org/r/c7385f44f2faebb8856bcbb4e908d846fc1531fb.1705930809.git.geert+renesas@glider.be
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
platform/x86/intel/hid: Don't wake on 5-button releases [+ + +]
Author: David McFarland <corngood@gmail.com>
Date:   Thu Apr 4 08:41:45 2024 -0300

    platform/x86/intel/hid: Don't wake on 5-button releases
    
    [ Upstream commit 5864e479ca4344f3a5df8074524da24c960f440b ]
    
    If, for example, the power button is configured to suspend, holding it
    and releasing it after the machine has suspended, will wake the machine.
    
    Also on some machines, power button release events are sent during
    hibernation, even if the button wasn't used to hibernate the machine.
    This causes hibernation to be aborted.
    
    Fixes: 0c4cae1bc00d ("PM: hibernate: Avoid missing wakeup events during hibernation")
    Signed-off-by: David McFarland <corngood@gmail.com>
    Tested-by: Enrik Berkhan <Enrik.Berkhan@inka.de>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Link: https://lore.kernel.org/r/878r1tpd6u.fsf_-_@gmail.com
    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>

 
platform/x86: acer-wmi: Add predator_v4 module parameter [+ + +]
Author: SungHwan Jung <onenowy@gmail.com>
Date:   Tue Feb 20 17:04:16 2024 +0900

    platform/x86: acer-wmi: Add predator_v4 module parameter
    
    [ Upstream commit f9124f2a454a6f1edb4eae9f0646b1a61fd74dba ]
    
    This parameter allows predator laptop users to test and use features
    (mode button, platform profile, fan speed monitoring) without
    adding model names to acer_quirks and compiling kernel.
    
    Signed-off-by: SungHwan Jung <onenowy@gmail.com>
    Link: https://lore.kernel.org/r/20240220080416.6395-1-onenowy@gmail.com
    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>

platform/x86: acer-wmi: Add support for Acer PH16-71 [+ + +]
Author: SungHwan Jung <onenowy@gmail.com>
Date:   Tue Feb 20 14:52:31 2024 +0900

    platform/x86: acer-wmi: Add support for Acer PH16-71
    
    [ Upstream commit 20a36ec343d4c5abc2378a45ab5e7ea1ca85020a ]
    
    Add Acer Predator PH16-71 to Acer_quirks with predator_v4
    to support mode button and fan speed sensor.
    
    Signed-off-by: SungHwan Jung <onenowy@gmail.com>
    Link: https://lore.kernel.org/r/20240220055231.6451-1-onenowy@gmail.com
    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>

platform/x86: intel-vbtn: Update tablet mode switch at end of probe [+ + +]
Author: Gwendal Grignou <gwendal@chromium.org>
Date:   Fri Mar 29 07:32:06 2024 -0700

    platform/x86: intel-vbtn: Update tablet mode switch at end of probe
    
    [ Upstream commit 434e5781d8cd2d0ed512d920c6cdeba4b33a2e81 ]
    
    ACER Vivobook Flip (TP401NAS) virtual intel switch is implemented as
    follow:
    
       Device (VGBI)
       {
           Name (_HID, EisaId ("INT33D6") ...
           Name (VBDS, Zero)
           Method (_STA, 0, Serialized)  // _STA: Status ...
           Method (VBDL, 0, Serialized)
           {
               PB1E |= 0x20
               VBDS |= 0x40
           }
           Method (VGBS, 0, Serialized)
           {
               Return (VBDS) /* \_SB_.PCI0.SBRG.EC0_.VGBI.VBDS */
           }
           ...
        }
    
    By default VBDS is set to 0. At boot it is set to clamshell (bit 6 set)
    only after method VBDL is executed.
    
    Since VBDL is now evaluated in the probe routine later, after the device
    is registered, the retrieved value of VBDS was still 0 ("tablet mode")
    when setting up the virtual switch.
    
    Make sure to evaluate VGBS after VBDL, to ensure the
    convertible boots in clamshell mode, the expected default.
    
    Fixes: 26173179fae1 ("platform/x86: intel-vbtn: Eval VBDL after registering our notifier")
    Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
    Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Link: https://lore.kernel.org/r/20240329143206.2977734-3-gwendal@chromium.org
    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>

platform/x86: touchscreen_dmi: Add an extra entry for a variant of the Chuwi Vi8 tablet [+ + +]
Author: Alban Boyé <alban.boye@protonmail.com>
Date:   Tue Feb 27 22:40:17 2024 +0000

    platform/x86: touchscreen_dmi: Add an extra entry for a variant of the Chuwi Vi8 tablet
    
    [ Upstream commit 1266e2efb7512dbf20eac820ca2ed34de6b1c3e7 ]
    
    Signed-off-by: Alban Boyé <alban.boye@protonmail.com>
    Link: https://lore.kernel.org/r/20240227223919.11587-1-alban.boye@protonmail.com
    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>

 
pmdomain: imx8mp-blk-ctrl: imx8mp_blk: Add fdcc clock to hdmimix domain [+ + +]
Author: Adam Ford <aford173@gmail.com>
Date:   Sat Feb 3 10:52:44 2024 -0600

    pmdomain: imx8mp-blk-ctrl: imx8mp_blk: Add fdcc clock to hdmimix domain
    
    [ Upstream commit 697624ee8ad557ab5417f985d2c804241a7ad30d ]
    
    According to i.MX8MP RM and HDMI ADD, the fdcc clock is part of
    hdmi rx verification IP that should not enable for HDMI TX.
    But actually if the clock is disabled before HDMI/LCDIF probe,
    LCDIF will not get pixel clock from HDMI PHY and print the error
    logs:
    
    [CRTC:39:crtc-2] vblank wait timed out
    WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_atomic_helper.c:1634 drm_atomic_helper_wait_for_vblanks.part.0+0x23c/0x260
    
    Add fdcc clock to LCDIF and HDMI TX power domains to fix the issue.
    
    Signed-off-by: Adam Ford <aford173@gmail.com>
    Reviewed-by: Jacky Bai <ping.bai@nxp.com>
    Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
    Link: https://lore.kernel.org/r/20240203165307.7806-5-aford173@gmail.com
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

pmdomain: ti: Add a null pointer check to the omap_prm_domain_init [+ + +]
Author: Kunwu Chan <chentao@kylinos.cn>
Date:   Thu Jan 18 13:42:57 2024 +0800

    pmdomain: ti: Add a null pointer check to the omap_prm_domain_init
    
    [ Upstream commit 5d7f58ee08434a33340f75ac7ac5071eea9673b3 ]
    
    devm_kasprintf() returns a pointer to dynamically allocated memory
    which can be NULL upon failure. Ensure the allocation was successful
    by checking the pointer validity.
    
    Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
    Link: https://lore.kernel.org/r/20240118054257.200814-1-chentao@kylinos.cn
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
printk: For @suppress_panic_printk check for other CPU in panic [+ + +]
Author: John Ogness <john.ogness@linutronix.de>
Date:   Wed Feb 7 14:46:55 2024 +0106

    printk: For @suppress_panic_printk check for other CPU in panic
    
    [ Upstream commit 0ab7cdd00491b532591ef065be706301de7e448f ]
    
    Currently @suppress_panic_printk is checked along with
    non-matching @panic_cpu and current CPU. This works
    because @suppress_panic_printk is only set when
    panic_in_progress() is true.
    
    Rather than relying on the @suppress_panic_printk semantics,
    use the concise helper function other_cpu_in_progress(). The
    helper function exists to avoid open coding such tests.
    
    Signed-off-by: John Ogness <john.ogness@linutronix.de>
    Reviewed-by: Petr Mladek <pmladek@suse.com>
    Link: https://lore.kernel.org/r/20240207134103.1357162-7-john.ogness@linutronix.de
    Signed-off-by: Petr Mladek <pmladek@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
pstore/zone: Add a null pointer check to the psz_kmsg_read [+ + +]
Author: Kunwu Chan <chentao@kylinos.cn>
Date:   Thu Jan 18 18:02:06 2024 +0800

    pstore/zone: Add a null pointer check to the psz_kmsg_read
    
    [ Upstream commit 98bc7e26e14fbb26a6abf97603d59532475e97f8 ]
    
    kasprintf() returns a pointer to dynamically allocated memory
    which can be NULL upon failure. Ensure the allocation was successful
    by checking the pointer validity.
    
    Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
    Link: https://lore.kernel.org/r/20240118100206.213928-1-chentao@kylinos.cn
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
randomize_kstack: Improve entropy diffusion [+ + +]
Author: Kees Cook <keescook@chromium.org>
Date:   Sat Mar 9 12:24:48 2024 -0800

    randomize_kstack: Improve entropy diffusion
    
    [ Upstream commit 9c573cd313433f6c1f7236fe64b9b743500c1628 ]
    
    The kstack_offset variable was really only ever using the low bits for
    kernel stack offset entropy. Add a ror32() to increase bit diffusion.
    
    Suggested-by: Arnd Bergmann <arnd@arndb.de>
    Fixes: 39218ff4c625 ("stack: Optionally randomize kernel stack offset each syscall")
    Link: https://lore.kernel.org/r/20240309202445.work.165-kees@kernel.org
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
rcu-tasks: Repair RCU Tasks Trace quiescence check [+ + +]
Author: Paul E. McKenney <paulmck@kernel.org>
Date:   Mon Dec 4 09:33:29 2023 -0800

    rcu-tasks: Repair RCU Tasks Trace quiescence check
    
    [ Upstream commit 2eb52fa8900e642b3b5054c4bf9776089d2a935f ]
    
    The context-switch-time check for RCU Tasks Trace quiescence expects
    current->trc_reader_special.b.need_qs to be zero, and if so, updates
    it to TRC_NEED_QS_CHECKED.  This is backwards, because if this value
    is zero, there is no RCU Tasks Trace grace period in flight, an thus
    no need for a quiescent state.  Instead, when a grace period starts,
    this field is set to TRC_NEED_QS.
    
    This commit therefore changes the check from zero to TRC_NEED_QS.
    
    Reported-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
    Tested-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
rcu/nocb: Fix WARN_ON_ONCE() in the rcu_nocb_bypass_lock() [+ + +]
Author: Zqiang <qiang.zhang1211@gmail.com>
Date:   Wed Jan 10 16:11:28 2024 +0800

    rcu/nocb: Fix WARN_ON_ONCE() in the rcu_nocb_bypass_lock()
    
    [ Upstream commit dda98810b552fc6bf650f4270edeebdc2f28bd3f ]
    
    For the kernels built with CONFIG_RCU_NOCB_CPU_DEFAULT_ALL=y and
    CONFIG_RCU_LAZY=y, the following scenarios will trigger WARN_ON_ONCE()
    in the rcu_nocb_bypass_lock() and rcu_nocb_wait_contended() functions:
    
            CPU2                                               CPU11
    kthread
    rcu_nocb_cb_kthread                                       ksys_write
    rcu_do_batch                                              vfs_write
    rcu_torture_timer_cb                                      proc_sys_write
    __kmem_cache_free                                         proc_sys_call_handler
    kmemleak_free                                             drop_caches_sysctl_handler
    delete_object_full                                        drop_slab
    __delete_object                                           shrink_slab
    put_object                                                lazy_rcu_shrink_scan
    call_rcu                                                  rcu_nocb_flush_bypass
    __call_rcu_commn                                            rcu_nocb_bypass_lock
                                                                raw_spin_trylock(&rdp->nocb_bypass_lock) fail
                                                                atomic_inc(&rdp->nocb_lock_contended);
    rcu_nocb_wait_contended                                     WARN_ON_ONCE(smp_processor_id() != rdp->cpu);
     WARN_ON_ONCE(atomic_read(&rdp->nocb_lock_contended))                                          |
                                |_ _ _ _ _ _ _ _ _ _same rdp and rdp->cpu != 11_ _ _ _ _ _ _ _ _ __|
    
    Reproduce this bug with "echo 3 > /proc/sys/vm/drop_caches".
    
    This commit therefore uses rcu_nocb_try_flush_bypass() instead of
    rcu_nocb_flush_bypass() in lazy_rcu_shrink_scan().  If the nocb_bypass
    queue is being flushed, then rcu_nocb_try_flush_bypass will return
    directly.
    
    Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
    Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
    Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
    Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
    Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
RDMA/cm: add timeout to cm_destroy_id wait [+ + +]
Author: Manjunath Patil <manjunath.b.patil@oracle.com>
Date:   Fri Mar 8 22:33:23 2024 -0800

    RDMA/cm: add timeout to cm_destroy_id wait
    
    [ Upstream commit 96d9cbe2f2ff7abde021bac75eafaceabe9a51fa ]
    
    Add timeout to cm_destroy_id, so that userspace can trigger any data
    collection that would help in analyzing the cause of delay in destroying
    the cm_id.
    
    New noinline function helps dtrace/ebpf programs to hook on to it.
    Existing functionality isn't changed except triggering a probe-able new
    function at every timeout interval.
    
    We have seen cases where CM messages stuck with MAD layer (either due to
    software bug or faulty HCA), leading to cm_id getting stuck in the
    following call stack. This patch helps in resolving such issues faster.
    
    kernel: ... INFO: task XXXX:56778 blocked for more than 120 seconds.
    ...
            Call Trace:
            __schedule+0x2bc/0x895
            schedule+0x36/0x7c
            schedule_timeout+0x1f6/0x31f
            ? __slab_free+0x19c/0x2ba
            wait_for_completion+0x12b/0x18a
            ? wake_up_q+0x80/0x73
            cm_destroy_id+0x345/0x610 [ib_cm]
            ib_destroy_cm_id+0x10/0x20 [ib_cm]
            rdma_destroy_id+0xa8/0x300 [rdma_cm]
            ucma_destroy_id+0x13e/0x190 [rdma_ucm]
            ucma_write+0xe0/0x160 [rdma_ucm]
            __vfs_write+0x3a/0x16d
            vfs_write+0xb2/0x1a1
            ? syscall_trace_enter+0x1ce/0x2b8
            SyS_write+0x5c/0xd3
            do_syscall_64+0x79/0x1b9
            entry_SYSCALL_64_after_hwframe+0x16d/0x0
    
    Signed-off-by: Manjunath Patil <manjunath.b.patil@oracle.com>
    Link: https://lore.kernel.org/r/20240309063323.458102-1-manjunath.b.patil@oracle.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Revert "ACPI: PM: Block ASUS B1400CEAE from suspend to idle by default" [+ + +]
Author: Daniel Drake <drake@endlessos.org>
Date:   Wed Feb 28 08:53:16 2024 +0100

    Revert "ACPI: PM: Block ASUS B1400CEAE from suspend to idle by default"
    
    [ Upstream commit cb98555fcd8eee98c30165537c7e394f3a66e809 ]
    
    This reverts commit d52848620de00cde4a3a5df908e231b8c8868250, which was
    originally put in place to work around a s2idle failure on this platform
    where the NVMe device was inaccessible upon resume.
    
    After extended testing, we found that the firmware's implementation of S3
    is buggy and intermittently fails to wake up the system. We need to revert
    to s2idle mode.
    
    The NVMe issue has now been solved more precisely in the commit titled
    "PCI: Disable D3cold on Asus B1400 PCI-NVMe bridge"
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=215742
    Link: https://lore.kernel.org/r/20240228075316.7404-2-drake@endlessos.org
    Signed-off-by: Daniel Drake <drake@endlessos.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Acked-by: Jian-Hong Pan <jhp@endlessos.org>
    Acked-by: Rafael J. Wysocki <rafael@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Revert "drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()" [+ + +]
Author: Ma Jun <Jun.Ma2@amd.com>
Date:   Tue Mar 19 15:24:03 2024 +0800

    Revert "drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()"
    
    commit 03c6284df179de3a4a6e0684764b1c71d2a405e2 upstream.
    
    This patch causes the following iounmap erorr and calltrace
    iounmap: bad address 00000000d0b3631f
    
    The original patch was unjustified because amdgpu_device_fini_sw() will
    always cleanup the rmmio mapping.
    
    This reverts commit eb4f139888f636614dab3bcce97ff61cefc4b3a7.
    
    Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
    Suggested-by: Christian König <christian.koenig@amd.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ring-buffer: use READ_ONCE() to read cpu_buffer->commit_page in concurrent environment [+ + +]
Author: linke li <lilinke99@qq.com>
Date:   Sat Mar 2 12:42:21 2024 +0800

    ring-buffer: use READ_ONCE() to read cpu_buffer->commit_page in concurrent environment
    
    [ Upstream commit f1e30cb6369251c03f63c564006f96a54197dcc4 ]
    
    In function ring_buffer_iter_empty(), cpu_buffer->commit_page is read
    while other threads may change it. It may cause the time_stamp that read
    in the next line come from a different page. Use READ_ONCE() to avoid
    having to reason about compiler optimizations now and in future.
    
    Link: https://lore.kernel.org/linux-trace-kernel/tencent_DFF7D3561A0686B5E8FC079150A02505180A@qq.com
    
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Signed-off-by: linke li <lilinke99@qq.com>
    Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
scsi: lpfc: Fix possible memory leak in lpfc_rcv_padisc() [+ + +]
Author: Justin Tee <justin.tee@broadcom.com>
Date:   Wed Jan 31 10:50:57 2024 -0800

    scsi: lpfc: Fix possible memory leak in lpfc_rcv_padisc()
    
    [ Upstream commit 2ae917d4bcab80ab304b774d492e2fcd6c52c06b ]
    
    The call to lpfc_sli4_resume_rpi() in lpfc_rcv_padisc() may return an
    unsuccessful status.  In such cases, the elsiocb is not issued, the
    completion is not called, and thus the elsiocb resource is leaked.
    
    Check return value after calling lpfc_sli4_resume_rpi() and conditionally
    release the elsiocb resource.
    
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Link: https://lore.kernel.org/r/20240131185112.149731-3-justintee8345@gmail.com
    Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

scsi: ufs: qcom: Avoid re-init quirk when gears match [+ + +]
Author: Eric Chanudet <echanude@redhat.com>
Date:   Tue Jan 23 14:28:57 2024 -0500

    scsi: ufs: qcom: Avoid re-init quirk when gears match
    
    [ Upstream commit 10a39667a117daf0c1baaebcbe589715ee79178b ]
    
    On sa8775p-ride, probing the HBA will go through the
    UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH path although the power info is
    the same during the second init.
    
    The REINIT quirk only applies starting with controller v4. For these,
    ufs_qcom_get_hs_gear() reads the highest supported gear when setting the
    host_params. After the negotiation, if the host and device are on the same
    gear, it is the highest gear supported between the two. Skip REINIT to save
    some time.
    
    Signed-off-by: Eric Chanudet <echanude@redhat.com>
    Link: https://lore.kernel.org/r/20240123192854.1724905-4-echanude@redhat.com
    Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8775p-ride
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
serial: 8250_of: Drop quirk fot NPCM from 8250_port [+ + +]
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date:   Thu Feb 15 16:50:08 2024 +0200

    serial: 8250_of: Drop quirk fot NPCM from 8250_port
    
    [ Upstream commit cd0eb354d441488feed6685adbeb1acd45db1b8d ]
    
    We are not supposed to spread quirks in 8250_port module especially
    when we have a separate driver for the hardware in question.
    
    Move quirk from generic module to the driver that uses it.
    
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://lore.kernel.org/r/20240215145029.581389-1-andriy.shevchenko@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
SUNRPC: increase size of rpc_wait_queue.qlen from unsigned short to unsigned int [+ + +]
Author: Dai Ngo <dai.ngo@oracle.com>
Date:   Tue Jan 30 11:38:25 2024 -0800

    SUNRPC: increase size of rpc_wait_queue.qlen from unsigned short to unsigned int
    
    [ Upstream commit 2c35f43b5a4b9cdfaa6fdd946f5a212615dac8eb ]
    
    When the NFS client is under extreme load the rpc_wait_queue.qlen counter
    can be overflowed. Here is an instant of the backlog queue overflow in a
    real world environment shown by drgn helper:
    
    rpc_task_stats(rpc_clnt):
    -------------------------
    rpc_clnt: 0xffff92b65d2bae00
    rpc_xprt: 0xffff9275db64f000
      Queue:  sending[64887] pending[524] backlog[30441] binding[0]
    XMIT task: 0xffff925c6b1d8e98
         WRITE: 750654
            __dta_call_status_580: 65463
            __dta_call_transmit_status_579: 1
            call_reserveresult: 685189
            nfs_client_init_is_complete: 1
        COMMIT: 584
            call_reserveresult: 573
            __dta_call_status_580: 11
        ACCESS: 1
            __dta_call_status_580: 1
       GETATTR: 10
            __dta_call_status_580: 4
            call_reserveresult: 6
    751249 tasks for server 111.222.333.444
    Total tasks: 751249
    
    count_rpc_wait_queues(xprt):
    ----------------------------
    **** rpc_xprt: 0xffff9275db64f000 num_reqs: 65511
    wait_queue: xprt_binding[0] cnt: 0
    wait_queue: xprt_binding[1] cnt: 0
    wait_queue: xprt_binding[2] cnt: 0
    wait_queue: xprt_binding[3] cnt: 0
    rpc_wait_queue[xprt_binding].qlen: 0 maxpriority: 0
    wait_queue: xprt_sending[0] cnt: 0
    wait_queue: xprt_sending[1] cnt: 64887
    wait_queue: xprt_sending[2] cnt: 0
    wait_queue: xprt_sending[3] cnt: 0
    rpc_wait_queue[xprt_sending].qlen: 64887 maxpriority: 3
    wait_queue: xprt_pending[0] cnt: 524
    wait_queue: xprt_pending[1] cnt: 0
    wait_queue: xprt_pending[2] cnt: 0
    wait_queue: xprt_pending[3] cnt: 0
    rpc_wait_queue[xprt_pending].qlen: 524 maxpriority: 0
    wait_queue: xprt_backlog[0] cnt: 0
    wait_queue: xprt_backlog[1] cnt: 685801
    wait_queue: xprt_backlog[2] cnt: 0
    wait_queue: xprt_backlog[3] cnt: 0
    rpc_wait_queue[xprt_backlog].qlen: 30441 maxpriority: 3 [task cnt mismatch]
    
    There is no effect on operations when this overflow occurs. However
    it causes confusion when trying to diagnose the performance problem.
    
    Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
    Reviewed-by: Jeff Layton <jlayton@kernel.org>
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
sysv: don't call sb_bread() with pointers_lock held [+ + +]
Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date:   Mon Apr 10 21:04:50 2023 +0900

    sysv: don't call sb_bread() with pointers_lock held
    
    [ Upstream commit f123dc86388cb669c3d6322702dc441abc35c31e ]
    
    syzbot is reporting sleep in atomic context in SysV filesystem [1], for
    sb_bread() is called with rw_spinlock held.
    
    A "write_lock(&pointers_lock) => read_lock(&pointers_lock) deadlock" bug
    and a "sb_bread() with write_lock(&pointers_lock)" bug were introduced by
    "Replace BKL for chain locking with sysvfs-private rwlock" in Linux 2.5.12.
    
    Then, "[PATCH] err1-40: sysvfs locking fix" in Linux 2.6.8 fixed the
    former bug by moving pointers_lock lock to the callers, but instead
    introduced a "sb_bread() with read_lock(&pointers_lock)" bug (which made
    this problem easier to hit).
    
    Al Viro suggested that why not to do like get_branch()/get_block()/
    find_shared() in Minix filesystem does. And doing like that is almost a
    revert of "[PATCH] err1-40: sysvfs locking fix" except that get_branch()
     from with find_shared() is called without write_lock(&pointers_lock).
    
    Reported-by: syzbot <syzbot+69b40dc5fd40f32c199f@syzkaller.appspotmail.com>
    Link: https://syzkaller.appspot.com/bug?extid=69b40dc5fd40f32c199f
    Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Link: https://lore.kernel.org/r/0d195f93-a22a-49a2-0020-103534d6f7f6@I-love.SAKURA.ne.jp
    Signed-off-by: Christian Brauner <brauner@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
thermal/of: Assume polling-delay(-passive) 0 when absent [+ + +]
Author: Konrad Dybcio <konrad.dybcio@linaro.org>
Date:   Thu Jan 25 13:11:16 2024 +0100

    thermal/of: Assume polling-delay(-passive) 0 when absent
    
    [ Upstream commit 488164006a281986d95abbc4b26e340c19c4c85b ]
    
    Currently, thermal zones associated with providers that have interrupts
    for signaling hot/critical trips are required to set a polling-delay
    of 0 to indicate no polling. This feels a bit backwards.
    
    Change the code such that "no polling delay" also means "no polling".
    
    Suggested-by: Bjorn Andersson <andersson@kernel.org>
    Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    Reviewed-by: Bjorn Andersson <andersson@kernel.org>
    Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
    Link: https://lore.kernel.org/r/20240125-topic-thermal-v1-2-3c9d4dced138@linaro.org
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
thunderbolt: Calculate DisplayPort tunnel bandwidth after DPRX capabilities read [+ + +]
Author: Gil Fine <gil.fine@linux.intel.com>
Date:   Tue Jan 23 15:56:42 2024 +0200

    thunderbolt: Calculate DisplayPort tunnel bandwidth after DPRX capabilities read
    
    [ Upstream commit ccd845021147dc8257a05ed8f5a7f9c61a9101e3 ]
    
    According to USB4 Connection Manager guide, after DisplayPort tunnel was
    setup, the DPRX capabilities read is performed by the DPTX. According to
    VESA spec, this shall be completed within 5 seconds after the DisplayPort
    tunnel was setup. Hence, if the bit: DPRX Capabilities Read Done, was
    not set to '1' by this time, we timeout and fail calculating DisplayPort
    tunnel consumed bandwidth.
    
    Signed-off-by: Gil Fine <gil.fine@linux.intel.com>
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

thunderbolt: Keep the domain powered when USB4 port is in redrive mode [+ + +]
Author: Mika Westerberg <mika.westerberg@linux.intel.com>
Date:   Fri Jan 26 15:55:55 2024 +0200

    thunderbolt: Keep the domain powered when USB4 port is in redrive mode
    
    [ Upstream commit a75e0684efe567ae5f6a8e91a8360c4c1773cf3a ]
    
    If a DiplayPort cable is directly connected to the host routers USB4
    port, there is no tunnel involved but the port is in "redrive" mode
    meaning that it is re-driving the DisplayPort signals from its
    DisplayPort source. In this case we need to keep the domain powered on
    otherwise once the domain enters D3cold the connected monitor blanks
    too.
    
    Since this happens only on Intel Barlow Ridge add a quirk that takes
    runtime PM reference if we detect that the USB4 port entered redrive
    mode (and release it once it exits the mode).
    
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tools/power x86_energy_perf_policy: Fix file leak in get_pkg_num() [+ + +]
Author: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
Date:   Tue Feb 13 16:19:56 2024 -0800

    tools/power x86_energy_perf_policy: Fix file leak in get_pkg_num()
    
    [ Upstream commit f85450f134f0b4ca7e042dc3dc89155656a2299d ]
    
    In function get_pkg_num() if fopen_or_die() succeeds it returns a file
    pointer to be used. But fclose() is never called before returning from
    the function.
    
    Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tools: iio: replace seekdir() in iio_generic_buffer [+ + +]
Author: Petre Rodan <petre.rodan@subdimension.ro>
Date:   Mon Jan 8 12:32:20 2024 +0200

    tools: iio: replace seekdir() in iio_generic_buffer
    
    [ Upstream commit 4e6500bfa053dc133021f9c144261b77b0ba7dc8 ]
    
    Replace seekdir() with rewinddir() in order to fix a localized glibc bug.
    
    One of the glibc patches that stable Gentoo is using causes an improper
    directory stream positioning bug on 32bit arm. That in turn ends up as a
    floating point exception in iio_generic_buffer.
    
    The attached patch provides a fix by using an equivalent function which
    should not cause trouble for other distros and is easier to reason about
    in general as it obviously always goes back to to the start.
    
    https://sourceware.org/bugzilla/show_bug.cgi?id=31212
    
    Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
    Link: https://lore.kernel.org/r/20240108103224.3986-1-petre.rodan@subdimension.ro
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
usb: gadget: uvc: mark incomplete frames with UVC_STREAM_ERR [+ + +]
Author: Michael Grzeschik <m.grzeschik@pengutronix.de>
Date:   Wed Feb 14 00:37:55 2024 +0100

    usb: gadget: uvc: mark incomplete frames with UVC_STREAM_ERR
    
    [ Upstream commit 2a3b7af120477d0571b815ccb8600cafd5ebf02f ]
    
    If an frame was transmitted incomplete to the host, we set the
    UVC_STREAM_ERR bit in the header for the last request that is going
    to be queued. This way the host will know that it should drop the
    frame instead of trying to display the corrupted content.
    
    Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
    Link: https://lore.kernel.org/r/20240214-uvc-error-tag-v1-2-37659a3877fe@pengutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

usb: gadget: uvc: refactor the check for a valid buffer in the pump worker [+ + +]
Author: Michael Grzeschik <m.grzeschik@pengutronix.de>
Date:   Wed Feb 14 00:28:01 2024 +0100

    usb: gadget: uvc: refactor the check for a valid buffer in the pump worker
    
    [ Upstream commit 5e7ea65daf13a95a6cc63d1377e4c500e4e1340f ]
    
    By toggling the condition check for a valid buffer, the else path
    can be completely avoided.
    
    Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
    Link: https://lore.kernel.org/r/20240214-uvc-gadget-cleanup-v1-2-de6d78780459@pengutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

usb: sl811-hcd: only defined function checkdone if QUIRK2 is defined [+ + +]
Author: Colin Ian King <colin.i.king@gmail.com>
Date:   Thu Mar 7 11:13:51 2024 +0000

    usb: sl811-hcd: only defined function checkdone if QUIRK2 is defined
    
    [ Upstream commit 12f371e2b6cb4b79c788f1f073992e115f4ca918 ]
    
    Function checkdone is only required if QUIRK2 is defined, so add
    appropriate #if / #endif around the function.
    
    Cleans up clang scan build warning:
    drivers/usb/host/sl811-hcd.c:588:18: warning: unused function
    'checkdone' [-Wunused-function]
    
    Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
    Link: https://lore.kernel.org/r/20240307111351.1982382-1-colin.i.king@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

usb: typec: tcpci: add generic tcpci fallback compatible [+ + +]
Author: Marco Felsch <m.felsch@pengutronix.de>
Date:   Thu Feb 22 22:09:01 2024 +0100

    usb: typec: tcpci: add generic tcpci fallback compatible
    
    [ Upstream commit 8774ea7a553e2aec323170d49365b59af0a2b7e0 ]
    
    The driver already support the tcpci binding for the i2c_device_id so
    add the support for the of_device_id too.
    
    Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
    Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Link: https://lore.kernel.org/r/20240222210903.208901-3-m.felsch@pengutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

usb: typec: ucsi: Add qcm6490-pmic-glink as needing PDOS quirk [+ + +]
Author: Luca Weiss <luca.weiss@fairphone.com>
Date:   Thu Feb 8 10:52:33 2024 +0100

    usb: typec: ucsi: Add qcm6490-pmic-glink as needing PDOS quirk
    
    [ Upstream commit 88bae831f3810e02c9c951233c7ee662aa13dc2c ]
    
    The QCM6490 Linux Android firmware needs this workaround as well. Add it
    to the list.
    
    Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
    Link: https://lore.kernel.org/r/20240208-fp5-pmic-glink-v2-2-4837d4abd5a4@fairphone.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

usb: typec: ucsi: Limit read size on v1.2 [+ + +]
Author: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Date:   Fri Feb 9 14:37:30 2024 -0800

    usb: typec: ucsi: Limit read size on v1.2
    
    [ Upstream commit b3db266fb031fba88c423d4bb8983a73a3db6527 ]
    
    Between UCSI 1.2 and UCSI 2.0, the size of the MESSAGE_IN region was
    increased from 16 to 256. In order to avoid overflowing reads for older
    systems, add a mechanism to use the read UCSI version to truncate read
    sizes on UCSI v1.2.
    
    Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
    Reviewed-by: Prashant Malani <pmalani@chromium.org>
    Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
    Link: https://lore.kernel.org/r/20240209143723.v5.1.Iacf5570a66b82b73ef03daa6557e2fc0db10266a@changeid
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host() [+ + +]
Author: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Date:   Fri Jan 5 08:40:00 2024 -0800

    VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host()
    
    [ Upstream commit 19b070fefd0d024af3daa7329cbc0d00de5302ec ]
    
    Syzkaller hit 'WARNING in dg_dispatch_as_host' bug.
    
    memcpy: detected field-spanning write (size 56) of single field "&dg_info->msg"
    at drivers/misc/vmw_vmci/vmci_datagram.c:237 (size 24)
    
    WARNING: CPU: 0 PID: 1555 at drivers/misc/vmw_vmci/vmci_datagram.c:237
    dg_dispatch_as_host+0x88e/0xa60 drivers/misc/vmw_vmci/vmci_datagram.c:237
    
    Some code commentry, based on my understanding:
    
    544 #define VMCI_DG_SIZE(_dg) (VMCI_DG_HEADERSIZE + (size_t)(_dg)->payload_size)
    /// This is 24 + payload_size
    
    memcpy(&dg_info->msg, dg, dg_size);
            Destination = dg_info->msg ---> this is a 24 byte
                                            structure(struct vmci_datagram)
            Source = dg --> this is a 24 byte structure (struct vmci_datagram)
            Size = dg_size = 24 + payload_size
    
    {payload_size = 56-24 =32} -- Syzkaller managed to set payload_size to 32.
    
     35 struct delayed_datagram_info {
     36         struct datagram_entry *entry;
     37         struct work_struct work;
     38         bool in_dg_host_queue;
     39         /* msg and msg_payload must be together. */
     40         struct vmci_datagram msg;
     41         u8 msg_payload[];
     42 };
    
    So those extra bytes of payload are copied into msg_payload[], a run time
    warning is seen while fuzzing with Syzkaller.
    
    One possible way to fix the warning is to split the memcpy() into
    two parts -- one -- direct assignment of msg and second taking care of payload.
    
    Gustavo quoted:
    "Under FORTIFY_SOURCE we should not copy data across multiple members
    in a structure."
    
    Reported-by: syzkaller <syzkaller@googlegroups.com>
    Suggested-by: Vegard Nossum <vegard.nossum@oracle.com>
    Suggested-by: Gustavo A. R. Silva <gustavoars@kernel.org>
    Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
    Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
    Link: https://lore.kernel.org/r/20240105164001.2129796-2-harshit.m.mogalapalli@oracle.com
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler() [+ + +]
Author: Vasiliy Kovalev <kovalev@altlinux.org>
Date:   Mon Feb 19 13:53:15 2024 +0300

    VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler()
    
    commit e606e4b71798cc1df20e987dde2468e9527bd376 upstream.
    
    The changes are similar to those given in the commit 19b070fefd0d
    ("VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host()").
    
    Fix filling of the msg and msg_payload in dg_info struct, which prevents a
    possible "detected field-spanning write" of memcpy warning that is issued
    by the tracking mechanism __fortify_memcpy_chk.
    
    Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
    Link: https://lore.kernel.org/r/20240219105315.76955-1-kovalev@altlinux.org
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
wifi: ath11k: decrease MHI channel buffer length to 8KB [+ + +]
Author: Baochen Qiang <quic_bqiang@quicinc.com>
Date:   Fri Feb 23 13:31:11 2024 +0800

    wifi: ath11k: decrease MHI channel buffer length to 8KB
    
    [ Upstream commit 1cca1bddf9ef080503c15378cecf4877f7510015 ]
    
    Currently buf_len field of ath11k_mhi_config_qca6390 is assigned
    with 0, making MHI use a default size, 64KB, to allocate channel
    buffers. This is likely to fail in some scenarios where system
    memory is highly fragmented and memory compaction or reclaim is
    not allowed.
    
    There is a fail report which is caused by it:
    kworker/u32:45: page allocation failure: order:4, mode:0x40c00(GFP_NOIO|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0
    CPU: 0 PID: 19318 Comm: kworker/u32:45 Not tainted 6.8.0-rc3-1.gae4495f-default #1 openSUSE Tumbleweed (unreleased) 493b6d5b382c603654d7a81fc3c144d59a1dfceb
    Workqueue: events_unbound async_run_entry_fn
    Call Trace:
     <TASK>
     dump_stack_lvl+0x47/0x60
     warn_alloc+0x13a/0x1b0
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __alloc_pages_direct_compact+0xab/0x210
     __alloc_pages_slowpath.constprop.0+0xd3e/0xda0
     __alloc_pages+0x32d/0x350
     ? mhi_prepare_channel+0x127/0x2d0 [mhi 40df44e07c05479f7a6e7b90fba9f0e0031a7814]
     __kmalloc_large_node+0x72/0x110
     __kmalloc+0x37c/0x480
     ? mhi_map_single_no_bb+0x77/0xf0 [mhi 40df44e07c05479f7a6e7b90fba9f0e0031a7814]
     ? mhi_prepare_channel+0x127/0x2d0 [mhi 40df44e07c05479f7a6e7b90fba9f0e0031a7814]
     mhi_prepare_channel+0x127/0x2d0 [mhi 40df44e07c05479f7a6e7b90fba9f0e0031a7814]
     __mhi_prepare_for_transfer+0x44/0x80 [mhi 40df44e07c05479f7a6e7b90fba9f0e0031a7814]
     ? __pfx_____mhi_prepare_for_transfer+0x10/0x10 [mhi 40df44e07c05479f7a6e7b90fba9f0e0031a7814]
     device_for_each_child+0x5c/0xa0
     ? __pfx_pci_pm_resume+0x10/0x10
     ath11k_core_resume+0x65/0x100 [ath11k a5094e22d7223135c40d93c8f5321cf09fd85e4e]
     ? srso_alias_return_thunk+0x5/0xfbef5
     ath11k_pci_pm_resume+0x32/0x60 [ath11k_pci 830b7bfc3ea80ebef32e563cafe2cb55e9cc73ec]
     ? srso_alias_return_thunk+0x5/0xfbef5
     dpm_run_callback+0x8c/0x1e0
     device_resume+0x104/0x340
     ? __pfx_dpm_watchdog_handler+0x10/0x10
     async_resume+0x1d/0x30
     async_run_entry_fn+0x32/0x120
     process_one_work+0x168/0x330
     worker_thread+0x2f5/0x410
     ? __pfx_worker_thread+0x10/0x10
     kthread+0xe8/0x120
     ? __pfx_kthread+0x10/0x10
     ret_from_fork+0x34/0x50
     ? __pfx_kthread+0x10/0x10
     ret_from_fork_asm+0x1b/0x30
     </TASK>
    
    Actually those buffers are used only by QMI target -> host communication.
    And for WCN6855 and QCA6390, the largest packet size for that is less
    than 6KB. So change buf_len field to 8KB, which results in order 1
    allocation if page size is 4KB. In this way, we can at least save some
    memory, and as well as decrease the possibility of allocation failure
    in those scenarios.
    
    Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30
    
    Reported-by: Vlastimil Babka <vbabka@suse.cz>
    Closes: https://lore.kernel.org/ath11k/96481a45-3547-4d23-ad34-3a8f1d90c1cd@suse.cz/
    Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
    Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
    Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
    Link: https://msgid.link/20240223053111.29170-1-quic_bqiang@quicinc.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: ath9k: fix LNA selection in ath_ant_try_scan() [+ + +]
Author: Dmitry Antipov <dmantipov@yandex.ru>
Date:   Sun Dec 17 13:29:03 2023 +0200

    wifi: ath9k: fix LNA selection in ath_ant_try_scan()
    
    [ Upstream commit d6b27eb997ef9a2aa51633b3111bc4a04748e6d3 ]
    
    In 'ath_ant_try_scan()', (most likely) the 2nd LNA's signal
    strength should be used in comparison against RSSI when
    selecting first LNA as the main one. Compile tested only.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
    Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
    Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
    Link: https://msgid.link/20231211172502.25202-1-dmantipov@yandex.ru
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: brcmfmac: Add DMI nvram filename quirk for ACEPC W5 Pro [+ + +]
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Fri Feb 16 22:36:49 2024 +0100

    wifi: brcmfmac: Add DMI nvram filename quirk for ACEPC W5 Pro
    
    [ Upstream commit 32167707aa5e7ae4b160c18be79d85a7b4fdfcfb ]
    
    The ACEPC W5 Pro HDMI stick contains quite generic names in the sys_vendor
    and product_name DMI strings, without this patch brcmfmac will try to load:
    "brcmfmac43455-sdio.$(DEFAULT_STRING)-$(DEFAULT_STRING).txt" as nvram file
    which is both too generic and messy with the $ symbols in the name.
    
    The ACEPC W5 Pro uses the same Ampak AP6255 module as the ACEPC T8
    and the nvram for the T8 is already in linux-firmware, so point the new
    DMI nvram filename quirk to the T8 nvram file.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://msgid.link/20240216213649.251718-1-hdegoede@redhat.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: cfg80211: check A-MSDU format more carefully [+ + +]
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Mon Feb 26 20:34:06 2024 +0100

    wifi: cfg80211: check A-MSDU format more carefully
    
    [ Upstream commit 9ad7974856926129f190ffbe3beea78460b3b7cc ]
    
    If it looks like there's another subframe in the A-MSDU
    but the header isn't fully there, we can end up reading
    data out of bounds, only to discard later. Make this a
    bit more careful and check if the subframe header can
    even be present.
    
    Reported-by: syzbot+d050d437fe47d479d210@syzkaller.appspotmail.com
    Link: https://msgid.link/20240226203405.a731e2c95e38.I82ce7d8c0cc8970ce29d0a39fdc07f1ffc425be4@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: iwlwifi: Add missing MODULE_FIRMWARE() for *.pnvm [+ + +]
Author: Takashi Iwai <tiwai@suse.de>
Date:   Wed Feb 28 17:38:37 2024 +0100

    wifi: iwlwifi: Add missing MODULE_FIRMWARE() for *.pnvm
    
    [ Upstream commit 4223675d2b5912060a85e48fd8fee51207e00957 ]
    
    A few models require *.pnvm files while we don't declare them via
    MODULE_FIRMWARE().  This resulted in the breakage of WiFi on the
    system that relies on the information from modinfo (e.g. openSUSE
    installer image).
    
    This patch adds those missing MODULE_FIRMWARE() entries for *.pnvm
    files.
    
    type=feature
    ticket=none
    
    Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1207553
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Link: https://msgid.link/20240228163837.4320-1-tiwai@suse.de
    [move to appropriate files]
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: iwlwifi: pcie: Add new PCI device id and CNVI [+ + +]
Author: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Date:   Tue Feb 6 18:02:08 2024 +0200

    wifi: iwlwifi: pcie: Add new PCI device id and CNVI
    
    [ Upstream commit 5f4e0994996fa08d57711b5b247a0cb3085ec66a ]
    
    Add the support for a new PCIE device-id 0x272E and a new CNVI
    type.
    
    Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240206175739.506db9b4a664.Ia2e3a77b880c449ac0e8d20b8cea25e6f07f1b81@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: iwlwifi: pcie: Add the PCI device id for new hardware [+ + +]
Author: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Date:   Mon Jan 29 21:22:00 2024 +0200

    wifi: iwlwifi: pcie: Add the PCI device id for new hardware
    
    [ Upstream commit 6770eee75148ba10c0c051885379714773e00b48 ]
    
    Add the support for a new PCI device id.
    
    Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
    Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240129211905.fde32107e0a3.I597cff4f340e4bed12b7568a0ad504bd4b2c1cf8@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: mt76: mt7915: add locking for accessing mapped registers [+ + +]
Author: Shayne Chen <shayne.chen@mediatek.com>
Date:   Tue Aug 15 17:28:30 2023 +0800

    wifi: mt76: mt7915: add locking for accessing mapped registers
    
    [ Upstream commit 0937f95ab07af6e663ae932d592f630d9eb591da ]
    
    Sicne the mapping is global, mapped register access needs to be protected
    against concurrent access, otherwise a race condition might cause the reads
    or writes to go towards the wrong register
    
    Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
    Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
    Signed-off-by: Felix Fietkau <nbd@nbd.name>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: mt76: mt7996: add locking for accessing mapped registers [+ + +]
Author: Shayne Chen <shayne.chen@mediatek.com>
Date:   Fri Jan 26 17:09:21 2024 +0800

    wifi: mt76: mt7996: add locking for accessing mapped registers
    
    [ Upstream commit 3687854d3e7e7fd760d939dd9e5a3520d5ab60fe ]
    
    A race condition was observed when accessing mapped registers, so add
    locking to protect against concurrent access.
    
    Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
    Signed-off-by: Felix Fietkau <nbd@nbd.name>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: mt76: mt7996: disable AMSDU for non-data frames [+ + +]
Author: Peter Chiu <chui-hao.chiu@mediatek.com>
Date:   Fri Jan 26 17:09:14 2024 +0800

    wifi: mt76: mt7996: disable AMSDU for non-data frames
    
    [ Upstream commit 5d5edc09197cd8c705b42a73cdf8ba03db53c033 ]
    
    Disable AMSDU for non-data frames to prevent TX token leak issues.
    
    Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
    Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
    Signed-off-by: Felix Fietkau <nbd@nbd.name>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: rtw89: fix null pointer access when abort scan [+ + +]
Author: Po-Hao Huang <phhuang@realtek.com>
Date:   Fri Jan 19 16:14:58 2024 +0800

    wifi: rtw89: fix null pointer access when abort scan
    
    [ Upstream commit 7e11a2966f51695c0af0b1f976a32d64dee243b2 ]
    
    During cancel scan we might use vif that weren't scanning.
    Fix this by using the actual scanning vif.
    
    Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://msgid.link/20240119081501.25223-6-pkshih@realtek.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: rtw89: pci: enlarge RX DMA buffer to consider size of RX descriptor [+ + +]
Author: Ping-Ke Shih <pkshih@realtek.com>
Date:   Sun Jan 21 15:18:26 2024 +0800

    wifi: rtw89: pci: enlarge RX DMA buffer to consider size of RX descriptor
    
    [ Upstream commit c108b4a50dd7650941d4f4ec5c161655a73711db ]
    
    Hardware puts RX descriptor and packet in RX DMA buffer, so it could be
    over one buffer size if packet size is 11454, and then it will be split
    into two segments. WiFi 7 chips use larger size of RX descriptor, so
    enlarge DMA buffer size according to RX descriptor to have better
    performance and simple flow.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://msgid.link/20240121071826.10159-5-pkshih@realtek.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: rtw89: pci: validate RX tag for RXQ and RPQ [+ + +]
Author: Ping-Ke Shih <pkshih@realtek.com>
Date:   Sun Jan 21 15:18:25 2024 +0800

    wifi: rtw89: pci: validate RX tag for RXQ and RPQ
    
    [ Upstream commit 0bc7d1d4e63cf31ff1b4396b0e2f0e3c76828d26 ]
    
    PCI RX ring is a kind of read/write index ring, and DMA and ring index are
    asynchronous, so suddenly driver gets newer index ahead before DMA. To
    resolve this rare situation, we use a RX tag as helpers to make sure DMA
    is done.
    
    The RX tag is a 13-bit value, and range is from 1 ~ 0x1FFF, but 0 isn't
    used so should be skipped.
    
    Only enable this validation to coming WiFi 7 chips, because existing
    chips use different design and don't really meet this situation.
    
    Add missed rx_ring_eq_is_full for 8851BE by the way.
    
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://msgid.link/20240121071826.10159-4-pkshih@realtek.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
x86/vdso: Fix rethunk patching for vdso-image-x32.o too [+ + +]
Author: Borislav Petkov (AMD) <bp@alien8.de>
Date:   Tue Mar 26 10:47:14 2024 +0100

    x86/vdso: Fix rethunk patching for vdso-image-x32.o too
    
    commit 4969d75dd9077e19e175e60f3c5a6c7653252e63 upstream.
    
    In a similar fashion to
    
      b388e57d4628 ("x86/vdso: Fix rethunk patching for vdso-image-{32,64}.o")
    
    annotate vdso-image-x32.o too for objtool so that it gets annotated
    properly and the unused return thunk warning doesn't fire.
    
    Reported-by: kernel test robot <oliver.sang@intel.com>
    Closes: https://lore.kernel.org/oe-lkp/202403251454.23df6278-lkp@intel.com
    Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
    Link: https://lore.kernel.org/r/202403251454.23df6278-lkp@intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

x86/vdso: Fix rethunk patching for vdso-image-{32,64}.o [+ + +]
Author: Josh Poimboeuf <jpoimboe@kernel.org>
Date:   Mon Feb 19 21:57:18 2024 -0800

    x86/vdso: Fix rethunk patching for vdso-image-{32,64}.o
    
    [ Upstream commit b388e57d4628eb22782bdad4cd5b83ca87a1b7c9 ]
    
    For CONFIG_RETHUNK kernels, objtool annotates all the function return
    sites so they can be patched during boot.  By design, after
    apply_returns() is called, all tail-calls to the compiler-generated
    default return thunk (__x86_return_thunk) should be patched out and
    replaced with whatever's needed for any mitigations (or lack thereof).
    
    The commit
    
      4461438a8405 ("x86/retpoline: Ensure default return thunk isn't used at runtime")
    
    adds a runtime check and a WARN_ONCE() if the default return thunk ever
    gets executed after alternatives have been applied.  This warning is
    a sanity check to make sure objtool and apply_returns() are doing their
    job.
    
    As Nathan reported, that check found something:
    
      Unpatched return thunk in use. This should not happen!
      WARNING: CPU: 0 PID: 1 at arch/x86/kernel/cpu/bugs.c:2856 __warn_thunk+0x27/0x40
      RIP: 0010:__warn_thunk+0x27/0x40
      Call Trace:
       <TASK>
       ? show_regs
       ? __warn
       ? __warn_thunk
       ? report_bug
       ? console_unlock
       ? handle_bug
       ? exc_invalid_op
       ? asm_exc_invalid_op
       ? ia32_binfmt_init
       ? __warn_thunk
       warn_thunk_thunk
       do_one_initcall
       kernel_init_freeable
       ? __pfx_kernel_init
       kernel_init
       ret_from_fork
       ? __pfx_kernel_init
       ret_from_fork_asm
       </TASK>
    
    Boris debugged to find that the unpatched return site was in
    init_vdso_image_64(), and its translation unit wasn't being analyzed by
    objtool, so it never got annotated.  So it got ignored by
    apply_returns().
    
    This is only a minor issue, as this function is only called during boot.
    Still, objtool needs full visibility to the kernel.  Fix it by enabling
    objtool on vdso-image-{32,64}.o.
    
    Note this problem can only be seen with !CONFIG_X86_KERNEL_IBT, as that
    requires objtool to run individually on all translation units rather on
    vmlinux.o.
    
      [ bp: Massage commit message. ]
    
    Reported-by: Nathan Chancellor <nathan@kernel.org>
    Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
    Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
    Link: https://lore.kernel.org/r/20240215032049.GA3944823@dev-arch.thelio-3990X
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
x86/xen: attempt to inflate the memory balloon on PVH [+ + +]
Author: Roger Pau Monne <roger.pau@citrix.com>
Date:   Tue Feb 20 18:43:41 2024 +0100

    x86/xen: attempt to inflate the memory balloon on PVH
    
    [ Upstream commit 38620fc4e8934f1801c7811ef39a041914ac4c1d ]
    
    When running as PVH or HVM Linux will use holes in the memory map as scratch
    space to map grants, foreign domain pages and possibly miscellaneous other
    stuff.  However the usage of such memory map holes for Xen purposes can be
    problematic.  The request of holesby Xen happen quite early in the kernel boot
    process (grant table setup already uses scratch map space), and it's possible
    that by then not all devices have reclaimed their MMIO space.  It's not
    unlikely for chunks of Xen scratch map space to end up using PCI bridge MMIO
    window memory, which (as expected) causes quite a lot of issues in the system.
    
    At least for PVH dom0 we have the possibility of using regions marked as
    UNUSABLE in the e820 memory map.  Either if the region is UNUSABLE in the
    native memory map, or it has been converted into UNUSABLE in order to hide RAM
    regions from dom0, the second stage translation page-tables can populate those
    areas without issues.
    
    PV already has this kind of logic, where the balloon driver is inflated at
    boot.  Re-use the current logic in order to also inflate it when running as
    PVH.  onvert UNUSABLE regions up to the ratio specified in EXTRA_MEM_RATIO to
    RAM, while reserving them using xen_add_extra_mem() (which is also moved so
    it's no longer tied to CONFIG_PV).
    
    [jgross: fixed build for CONFIG_PVH without CONFIG_XEN_PVH]
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Link: https://lore.kernel.org/r/20240220174341.56131-1-roger.pau@citrix.com
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>