From: Sasha Levin Date: Mon, 18 Mar 2024 22:55:59 +0000 (-0400) Subject: Fixes for 5.4 X-Git-Tag: v6.8.2~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=878b76d86570567a11bbce05d890ae6d8a93f0be;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.4 Signed-off-by: Sasha Levin --- diff --git a/queue-5.4/asoc-intel-bytcr_rt5640-add-an-extra-entry-for-the-c.patch b/queue-5.4/asoc-intel-bytcr_rt5640-add-an-extra-entry-for-the-c.patch new file mode 100644 index 00000000000..b740cc8ee39 --- /dev/null +++ b/queue-5.4/asoc-intel-bytcr_rt5640-add-an-extra-entry-for-the-c.patch @@ -0,0 +1,52 @@ +From 22712bf903e4c8b7d6f30545b954c4788b1563d4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Feb 2024 19:28:41 +0000 +Subject: ASoC: Intel: bytcr_rt5640: Add an extra entry for the Chuwi Vi8 + tablet +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Alban Boyé + +[ Upstream commit f8b0127aca8c60826e7354e504a12d4a46b1c3bb ] + +The bios version can differ depending if it is a dual-boot variant of the tablet. +Therefore another DMI match is required. + +Signed-off-by: Alban Boyé +Reviewed-by: Cezary Rojewski +Acked-by: Pierre-Louis Bossart +Link: https://msgid.link/r/20240228192807.15130-1-alban.boye@protonmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/boards/bytcr_rt5640.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c +index df3b370fe7292..c740dec00f83b 100644 +--- a/sound/soc/intel/boards/bytcr_rt5640.c ++++ b/sound/soc/intel/boards/bytcr_rt5640.c +@@ -526,6 +526,18 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { + BYT_RT5640_SSP0_AIF1 | + BYT_RT5640_MCLK_EN), + }, ++ { /* Chuwi Vi8 dual-boot (CWI506) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Insyde"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "i86"), ++ /* The above are too generic, also match BIOS info */ ++ DMI_MATCH(DMI_BIOS_VERSION, "CHUWI2.D86JHBNR02"), ++ }, ++ .driver_data = (void *)(BYTCR_INPUT_DEFAULTS | ++ BYT_RT5640_MONO_SPEAKER | ++ BYT_RT5640_SSP0_AIF1 | ++ BYT_RT5640_MCLK_EN), ++ }, + { + /* Chuwi Vi10 (CWI505) */ + .matches = { +-- +2.43.0 + diff --git a/queue-5.4/asoc-rt5645-make-lattepanda-board-dmi-match-more-pre.patch b/queue-5.4/asoc-rt5645-make-lattepanda-board-dmi-match-more-pre.patch new file mode 100644 index 00000000000..630e4a5122d --- /dev/null +++ b/queue-5.4/asoc-rt5645-make-lattepanda-board-dmi-match-more-pre.patch @@ -0,0 +1,63 @@ +From 2d96ae2a06b475e4ace4929f4185ab32f6cbdabc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 11 Feb 2024 22:27:35 +0100 +Subject: ASoC: rt5645: Make LattePanda board DMI match more precise + +From: Hans de Goede + +[ Upstream commit 551539a8606e28cb2a130f8ef3e9834235b456c4 ] + +The DMI strings used for the LattePanda board DMI quirks are very generic. + +Using the dmidecode database from https://linux-hardware.org/ shows +that the chosen DMI strings also match the following 2 laptops +which also have a rt5645 codec: + +Insignia NS-P11W7100 https://linux-hardware.org/?computer=E092FFF8BA04 +Insignia NS-P10W8100 https://linux-hardware.org/?computer=AFB6C0BF7934 + +All 4 hw revisions of the LattePanda board have "S70CR" in their BIOS +version DMI strings: + +DF-BI-7-S70CR100-* +DF-BI-7-S70CR110-* +DF-BI-7-S70CR200-* +LP-BS-7-S70CR700-* + +See e.g. https://linux-hardware.org/?computer=D98250A817C0 + +Add a partial (non exact) DMI match on this string to make the LattePanda +board DMI match more precise to avoid false-positive matches. + +Signed-off-by: Hans de Goede +Link: https://msgid.link/r/20240211212736.179605-1-hdegoede@redhat.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/rt5645.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c +index 88093e58dd845..c78d5833c9cd9 100644 +--- a/sound/soc/codecs/rt5645.c ++++ b/sound/soc/codecs/rt5645.c +@@ -3766,6 +3766,16 @@ static const struct dmi_system_id dmi_platform_data[] = { + DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"), + DMI_EXACT_MATCH(DMI_BOARD_VERSION, "Default string"), ++ /* ++ * Above strings are too generic, LattePanda BIOS versions for ++ * all 4 hw revisions are: ++ * DF-BI-7-S70CR100-* ++ * DF-BI-7-S70CR110-* ++ * DF-BI-7-S70CR200-* ++ * LP-BS-7-S70CR700-* ++ * Do a partial match for S70CR to avoid false positive matches. ++ */ ++ DMI_MATCH(DMI_BIOS_VERSION, "S70CR"), + }, + .driver_data = (void *)&lattepanda_board_platform_data, + }, +-- +2.43.0 + diff --git a/queue-5.4/asoc-wm8962-enable-both-spkoutr_ena-and-spkoutl_ena-.patch b/queue-5.4/asoc-wm8962-enable-both-spkoutr_ena-and-spkoutl_ena-.patch new file mode 100644 index 00000000000..89776fa1b9f --- /dev/null +++ b/queue-5.4/asoc-wm8962-enable-both-spkoutr_ena-and-spkoutl_ena-.patch @@ -0,0 +1,76 @@ +From 4e1f0925474b63dd27e02c5209dd4463a0da2f63 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Mar 2024 16:14:36 +0000 +Subject: ASoC: wm8962: Enable both SPKOUTR_ENA and SPKOUTL_ENA in mono mode + +From: Stuart Henderson + +[ Upstream commit 6fa849e4d78b880e878138bf238e4fd2bac3c4fa ] + +Signed-off-by: Stuart Henderson +Link: https://msgid.link/r/20240306161439.1385643-2-stuarth@opensource.cirrus.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/wm8962.c | 23 ++++++++++++++--------- + 1 file changed, 14 insertions(+), 9 deletions(-) + +diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c +index c84afc1d02dab..9ccec511352a0 100644 +--- a/sound/soc/codecs/wm8962.c ++++ b/sound/soc/codecs/wm8962.c +@@ -2218,6 +2218,9 @@ SND_SOC_DAPM_PGA_E("HPOUT", SND_SOC_NOPM, 0, 0, NULL, 0, hp_event, + + SND_SOC_DAPM_OUTPUT("HPOUTL"), + SND_SOC_DAPM_OUTPUT("HPOUTR"), ++ ++SND_SOC_DAPM_PGA("SPKOUTL Output", WM8962_CLASS_D_CONTROL_1, 6, 0, NULL, 0), ++SND_SOC_DAPM_PGA("SPKOUTR Output", WM8962_CLASS_D_CONTROL_1, 7, 0, NULL, 0), + }; + + static const struct snd_soc_dapm_widget wm8962_dapm_spk_mono_widgets[] = { +@@ -2225,7 +2228,6 @@ SND_SOC_DAPM_MIXER("Speaker Mixer", WM8962_MIXER_ENABLES, 1, 0, + spkmixl, ARRAY_SIZE(spkmixl)), + SND_SOC_DAPM_MUX_E("Speaker PGA", WM8962_PWR_MGMT_2, 4, 0, &spkoutl_mux, + out_pga_event, SND_SOC_DAPM_POST_PMU), +-SND_SOC_DAPM_PGA("Speaker Output", WM8962_CLASS_D_CONTROL_1, 7, 0, NULL, 0), + SND_SOC_DAPM_OUTPUT("SPKOUT"), + }; + +@@ -2240,9 +2242,6 @@ SND_SOC_DAPM_MUX_E("SPKOUTL PGA", WM8962_PWR_MGMT_2, 4, 0, &spkoutl_mux, + SND_SOC_DAPM_MUX_E("SPKOUTR PGA", WM8962_PWR_MGMT_2, 3, 0, &spkoutr_mux, + out_pga_event, SND_SOC_DAPM_POST_PMU), + +-SND_SOC_DAPM_PGA("SPKOUTR Output", WM8962_CLASS_D_CONTROL_1, 7, 0, NULL, 0), +-SND_SOC_DAPM_PGA("SPKOUTL Output", WM8962_CLASS_D_CONTROL_1, 6, 0, NULL, 0), +- + SND_SOC_DAPM_OUTPUT("SPKOUTL"), + SND_SOC_DAPM_OUTPUT("SPKOUTR"), + }; +@@ -2352,12 +2351,18 @@ static const struct snd_soc_dapm_route wm8962_spk_mono_intercon[] = { + { "Speaker PGA", "Mixer", "Speaker Mixer" }, + { "Speaker PGA", "DAC", "DACL" }, + +- { "Speaker Output", NULL, "Speaker PGA" }, +- { "Speaker Output", NULL, "SYSCLK" }, +- { "Speaker Output", NULL, "TOCLK" }, +- { "Speaker Output", NULL, "TEMP_SPK" }, ++ { "SPKOUTL Output", NULL, "Speaker PGA" }, ++ { "SPKOUTL Output", NULL, "SYSCLK" }, ++ { "SPKOUTL Output", NULL, "TOCLK" }, ++ { "SPKOUTL Output", NULL, "TEMP_SPK" }, ++ ++ { "SPKOUTR Output", NULL, "Speaker PGA" }, ++ { "SPKOUTR Output", NULL, "SYSCLK" }, ++ { "SPKOUTR Output", NULL, "TOCLK" }, ++ { "SPKOUTR Output", NULL, "TEMP_SPK" }, + +- { "SPKOUT", NULL, "Speaker Output" }, ++ { "SPKOUT", NULL, "SPKOUTL Output" }, ++ { "SPKOUT", NULL, "SPKOUTR Output" }, + }; + + static const struct snd_soc_dapm_route wm8962_spk_stereo_intercon[] = { +-- +2.43.0 + diff --git a/queue-5.4/asoc-wm8962-enable-oscillator-if-selecting-wm8962_fl.patch b/queue-5.4/asoc-wm8962-enable-oscillator-if-selecting-wm8962_fl.patch new file mode 100644 index 00000000000..d2079e615d6 --- /dev/null +++ b/queue-5.4/asoc-wm8962-enable-oscillator-if-selecting-wm8962_fl.patch @@ -0,0 +1,37 @@ +From 8a7dfb8e8f7b10c3bcdb6e26be2b78a471ddb5b4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Mar 2024 16:14:35 +0000 +Subject: ASoC: wm8962: Enable oscillator if selecting WM8962_FLL_OSC + +From: Stuart Henderson + +[ Upstream commit 03c7874106ca5032a312626b927b1c35f07b1f35 ] + +Signed-off-by: Stuart Henderson +Link: https://msgid.link/r/20240306161439.1385643-1-stuarth@opensource.cirrus.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/wm8962.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c +index c384ca3681e9b..c84afc1d02dab 100644 +--- a/sound/soc/codecs/wm8962.c ++++ b/sound/soc/codecs/wm8962.c +@@ -2889,8 +2889,12 @@ static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int s + switch (fll_id) { + case WM8962_FLL_MCLK: + case WM8962_FLL_BCLK: ++ fll1 |= (fll_id - 1) << WM8962_FLL_REFCLK_SRC_SHIFT; ++ break; + case WM8962_FLL_OSC: + fll1 |= (fll_id - 1) << WM8962_FLL_REFCLK_SRC_SHIFT; ++ snd_soc_component_update_bits(component, WM8962_PLL2, ++ WM8962_OSC_ENA, WM8962_OSC_ENA); + break; + case WM8962_FLL_INT: + snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_1, +-- +2.43.0 + diff --git a/queue-5.4/asoc-wm8962-fix-up-incorrect-error-message-in-wm8962.patch b/queue-5.4/asoc-wm8962-fix-up-incorrect-error-message-in-wm8962.patch new file mode 100644 index 00000000000..bff63538c42 --- /dev/null +++ b/queue-5.4/asoc-wm8962-fix-up-incorrect-error-message-in-wm8962.patch @@ -0,0 +1,36 @@ +From 41c902e6a806ef09b959ea26f713701dba6fc72e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Mar 2024 16:14:39 +0000 +Subject: ASoC: wm8962: Fix up incorrect error message in wm8962_set_fll + +From: Stuart Henderson + +[ Upstream commit 96e202f8c52ac49452f83317cf3b34cd1ad81e18 ] + +Use source instead of ret, which seems to be unrelated and will always +be zero. + +Signed-off-by: Stuart Henderson +Link: https://msgid.link/r/20240306161439.1385643-5-stuarth@opensource.cirrus.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/wm8962.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c +index 9ccec511352a0..15828ae62f9de 100644 +--- a/sound/soc/codecs/wm8962.c ++++ b/sound/soc/codecs/wm8962.c +@@ -2908,7 +2908,7 @@ static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int s + WM8962_FLL_FRC_NCO, WM8962_FLL_FRC_NCO); + break; + default: +- dev_err(component->dev, "Unknown FLL source %d\n", ret); ++ dev_err(component->dev, "Unknown FLL source %d\n", source); + return -EINVAL; + } + +-- +2.43.0 + diff --git a/queue-5.4/block-sed-opal-handle-empty-atoms-when-parsing-respo.patch b/queue-5.4/block-sed-opal-handle-empty-atoms-when-parsing-respo.patch new file mode 100644 index 00000000000..7176c1b695e --- /dev/null +++ b/queue-5.4/block-sed-opal-handle-empty-atoms-when-parsing-respo.patch @@ -0,0 +1,65 @@ +From c779b48b829fe75ec06f9abf0b2b436e5057d5f6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Feb 2024 15:04:17 -0600 +Subject: block: sed-opal: handle empty atoms when parsing response + +From: Greg Joyce + +[ Upstream commit 5429c8de56f6b2bd8f537df3a1e04e67b9c04282 ] + +The SED Opal response parsing function response_parse() does not +handle the case of an empty atom in the response. This causes +the entry count to be too high and the response fails to be +parsed. Recognizing, but ignoring, empty atoms allows response +handling to succeed. + +Signed-off-by: Greg Joyce +Link: https://lore.kernel.org/r/20240216210417.3526064-2-gjoyce@linux.ibm.com +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + block/opal_proto.h | 1 + + block/sed-opal.c | 6 +++++- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/block/opal_proto.h b/block/opal_proto.h +index 5532412d567c0..354b4e93bf63e 100644 +--- a/block/opal_proto.h ++++ b/block/opal_proto.h +@@ -65,6 +65,7 @@ enum opal_response_token { + #define SHORT_ATOM_BYTE 0xBF + #define MEDIUM_ATOM_BYTE 0xDF + #define LONG_ATOM_BYTE 0xE3 ++#define EMPTY_ATOM_BYTE 0xFF + + #define OPAL_INVAL_PARAM 12 + #define OPAL_MANUFACTURED_INACTIVE 0x08 +diff --git a/block/sed-opal.c b/block/sed-opal.c +index 401d33ae01580..1a08762515291 100644 +--- a/block/sed-opal.c ++++ b/block/sed-opal.c +@@ -893,16 +893,20 @@ static int response_parse(const u8 *buf, size_t length, + token_length = response_parse_medium(iter, pos); + else if (pos[0] <= LONG_ATOM_BYTE) /* long atom */ + token_length = response_parse_long(iter, pos); ++ else if (pos[0] == EMPTY_ATOM_BYTE) /* empty atom */ ++ token_length = 1; + else /* TOKEN */ + token_length = response_parse_token(iter, pos); + + if (token_length < 0) + return token_length; + ++ if (pos[0] != EMPTY_ATOM_BYTE) ++ num_entries++; ++ + pos += token_length; + total -= token_length; + iter++; +- num_entries++; + } + + resp->num = num_entries; +-- +2.43.0 + diff --git a/queue-5.4/bluetooth-rfcomm-fix-null-ptr-deref-in-rfcomm_check_.patch b/queue-5.4/bluetooth-rfcomm-fix-null-ptr-deref-in-rfcomm_check_.patch new file mode 100644 index 00000000000..b65a7f520c3 --- /dev/null +++ b/queue-5.4/bluetooth-rfcomm-fix-null-ptr-deref-in-rfcomm_check_.patch @@ -0,0 +1,58 @@ +From 86484462ea38346926f7286726582e005e050851 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 3 Jan 2024 17:10:43 +0800 +Subject: Bluetooth: rfcomm: Fix null-ptr-deref in rfcomm_check_security + +From: Yuxuan Hu <20373622@buaa.edu.cn> + +[ Upstream commit 2535b848fa0f42ddff3e5255cf5e742c9b77bb26 ] + +During our fuzz testing of the connection and disconnection process at the +RFCOMM layer, we discovered this bug. By comparing the packets from a +normal connection and disconnection process with the testcase that +triggered a KASAN report. We analyzed the cause of this bug as follows: + +1. In the packets captured during a normal connection, the host sends a +`Read Encryption Key Size` type of `HCI_CMD` packet +(Command Opcode: 0x1408) to the controller to inquire the length of +encryption key.After receiving this packet, the controller immediately +replies with a Command Completepacket (Event Code: 0x0e) to return the +Encryption Key Size. + +2. In our fuzz test case, the timing of the controller's response to this +packet was delayed to an unexpected point: after the RFCOMM and L2CAP +layers had disconnected but before the HCI layer had disconnected. + +3. After receiving the Encryption Key Size Response at the time described +in point 2, the host still called the rfcomm_check_security function. +However, by this time `struct l2cap_conn *conn = l2cap_pi(sk)->chan->conn;` +had already been released, and when the function executed +`return hci_conn_security(conn->hcon, d->sec_level, auth_type, d->out);`, +specifically when accessing `conn->hcon`, a null-ptr-deref error occurred. + +To fix this bug, check if `sk->sk_state` is BT_CLOSED before calling +rfcomm_recv_frame in rfcomm_process_rx. + +Signed-off-by: Yuxuan Hu <20373622@buaa.edu.cn> +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + net/bluetooth/rfcomm/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c +index 2db9e285215c5..596fa3172642b 100644 +--- a/net/bluetooth/rfcomm/core.c ++++ b/net/bluetooth/rfcomm/core.c +@@ -1940,7 +1940,7 @@ static struct rfcomm_session *rfcomm_process_rx(struct rfcomm_session *s) + /* Get data directly from socket receive queue without copying it. */ + while ((skb = skb_dequeue(&sk->sk_receive_queue))) { + skb_orphan(skb); +- if (!skb_linearize(skb)) { ++ if (!skb_linearize(skb) && sk->sk_state != BT_CLOSED) { + s = rfcomm_recv_frame(s, skb); + if (!s) + break; +-- +2.43.0 + diff --git a/queue-5.4/btrfs-fix-data-race-at-btrfs_use_block_rsv-when-acce.patch b/queue-5.4/btrfs-fix-data-race-at-btrfs_use_block_rsv-when-acce.patch new file mode 100644 index 00000000000..06edc6e23ac --- /dev/null +++ b/queue-5.4/btrfs-fix-data-race-at-btrfs_use_block_rsv-when-acce.patch @@ -0,0 +1,104 @@ +From 43fcf9eab96dc130dcd031dc78bbc16edb11e0a5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 19 Feb 2024 20:10:07 +0000 +Subject: btrfs: fix data race at btrfs_use_block_rsv() when accessing block + reserve + +From: Filipe Manana + +[ Upstream commit c7bb26b847e5b97814f522686068c5628e2b3646 ] + +At btrfs_use_block_rsv() we read the size of a block reserve without +locking its spinlock, which makes KCSAN complain because the size of a +block reserve is always updated while holding its spinlock. The report +from KCSAN is the following: + + [653.313148] BUG: KCSAN: data-race in btrfs_update_delayed_refs_rsv [btrfs] / btrfs_use_block_rsv [btrfs] + + [653.314755] read to 0x000000017f5871b8 of 8 bytes by task 7519 on cpu 0: + [653.314779] btrfs_use_block_rsv+0xe4/0x2f8 [btrfs] + [653.315606] btrfs_alloc_tree_block+0xdc/0x998 [btrfs] + [653.316421] btrfs_force_cow_block+0x220/0xe38 [btrfs] + [653.317242] btrfs_cow_block+0x1ac/0x568 [btrfs] + [653.318060] btrfs_search_slot+0xda2/0x19b8 [btrfs] + [653.318879] btrfs_del_csums+0x1dc/0x798 [btrfs] + [653.319702] __btrfs_free_extent.isra.0+0xc24/0x2028 [btrfs] + [653.320538] __btrfs_run_delayed_refs+0xd3c/0x2390 [btrfs] + [653.321340] btrfs_run_delayed_refs+0xae/0x290 [btrfs] + [653.322140] flush_space+0x5e4/0x718 [btrfs] + [653.322958] btrfs_preempt_reclaim_metadata_space+0x102/0x2f8 [btrfs] + [653.323781] process_one_work+0x3b6/0x838 + [653.323800] worker_thread+0x75e/0xb10 + [653.323817] kthread+0x21a/0x230 + [653.323836] __ret_from_fork+0x6c/0xb8 + [653.323855] ret_from_fork+0xa/0x30 + + [653.323887] write to 0x000000017f5871b8 of 8 bytes by task 576 on cpu 3: + [653.323906] btrfs_update_delayed_refs_rsv+0x1a4/0x250 [btrfs] + [653.324699] btrfs_add_delayed_data_ref+0x468/0x6d8 [btrfs] + [653.325494] btrfs_free_extent+0x76/0x120 [btrfs] + [653.326280] __btrfs_mod_ref+0x6a8/0x6b8 [btrfs] + [653.327064] btrfs_dec_ref+0x50/0x70 [btrfs] + [653.327849] walk_up_proc+0x236/0xa50 [btrfs] + [653.328633] walk_up_tree+0x21c/0x448 [btrfs] + [653.329418] btrfs_drop_snapshot+0x802/0x1328 [btrfs] + [653.330205] btrfs_clean_one_deleted_snapshot+0x184/0x238 [btrfs] + [653.330995] cleaner_kthread+0x2b0/0x2f0 [btrfs] + [653.331781] kthread+0x21a/0x230 + [653.331800] __ret_from_fork+0x6c/0xb8 + [653.331818] ret_from_fork+0xa/0x30 + +So add a helper to get the size of a block reserve while holding the lock. +Reading the field while holding the lock instead of using the data_race() +annotation is used in order to prevent load tearing. + +Signed-off-by: Filipe Manana +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + fs/btrfs/block-rsv.c | 2 +- + fs/btrfs/block-rsv.h | 16 ++++++++++++++++ + 2 files changed, 17 insertions(+), 1 deletion(-) + +diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c +index 36ef3228bac86..63205d2f4d84c 100644 +--- a/fs/btrfs/block-rsv.c ++++ b/fs/btrfs/block-rsv.c +@@ -392,7 +392,7 @@ struct btrfs_block_rsv *btrfs_use_block_rsv(struct btrfs_trans_handle *trans, + + block_rsv = get_block_rsv(trans, root); + +- if (unlikely(block_rsv->size == 0)) ++ if (unlikely(btrfs_block_rsv_size(block_rsv) == 0)) + goto try_reserve; + again: + ret = btrfs_block_rsv_use_bytes(block_rsv, blocksize); +diff --git a/fs/btrfs/block-rsv.h b/fs/btrfs/block-rsv.h +index d1428bb73fc5a..69770360917cb 100644 +--- a/fs/btrfs/block-rsv.h ++++ b/fs/btrfs/block-rsv.h +@@ -98,4 +98,20 @@ static inline void btrfs_unuse_block_rsv(struct btrfs_fs_info *fs_info, + btrfs_block_rsv_release(fs_info, block_rsv, 0); + } + ++/* ++ * Get the size of a block reserve in a context where getting a stale value is ++ * acceptable, instead of accessing it directly and trigger data race warning ++ * from KCSAN. ++ */ ++static inline u64 btrfs_block_rsv_size(struct btrfs_block_rsv *rsv) ++{ ++ u64 ret; ++ ++ spin_lock(&rsv->lock); ++ ret = rsv->size; ++ spin_unlock(&rsv->lock); ++ ++ return ret; ++} ++ + #endif /* BTRFS_BLOCK_RSV_H */ +-- +2.43.0 + diff --git a/queue-5.4/dm-verity-dm-crypt-align-struct-bvec_iter-correctly.patch b/queue-5.4/dm-verity-dm-crypt-align-struct-bvec_iter-correctly.patch new file mode 100644 index 00000000000..72bce2eddba --- /dev/null +++ b/queue-5.4/dm-verity-dm-crypt-align-struct-bvec_iter-correctly.patch @@ -0,0 +1,70 @@ +From 51de750d029a1fe516b67d3bc7c0fb63a9962b47 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Feb 2024 19:11:51 +0100 +Subject: dm-verity, dm-crypt: align "struct bvec_iter" correctly + +From: Mikulas Patocka + +[ Upstream commit 787f1b2800464aa277236a66eb3c279535edd460 ] + +"struct bvec_iter" is defined with the __packed attribute, so it is +aligned on a single byte. On X86 (and on other architectures that support +unaligned addresses in hardware), "struct bvec_iter" is accessed using the +8-byte and 4-byte memory instructions, however these instructions are less +efficient if they operate on unaligned addresses. + +(on RISC machines that don't have unaligned access in hardware, GCC +generates byte-by-byte accesses that are very inefficient - see [1]) + +This commit reorders the entries in "struct dm_verity_io" and "struct +convert_context", so that "struct bvec_iter" is aligned on 8 bytes. + +[1] https://lore.kernel.org/all/ZcLuWUNRZadJr0tQ@fedora/T/ + +Signed-off-by: Mikulas Patocka +Signed-off-by: Mike Snitzer +Signed-off-by: Sasha Levin +--- + drivers/md/dm-crypt.c | 4 ++-- + drivers/md/dm-verity.h | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c +index 6b4fb4e7506f8..6866aa2aade3b 100644 +--- a/drivers/md/dm-crypt.c ++++ b/drivers/md/dm-crypt.c +@@ -46,11 +46,11 @@ + struct convert_context { + struct completion restart; + struct bio *bio_in; +- struct bio *bio_out; + struct bvec_iter iter_in; ++ struct bio *bio_out; + struct bvec_iter iter_out; +- u64 cc_sector; + atomic_t cc_pending; ++ u64 cc_sector; + union { + struct skcipher_request *req; + struct aead_request *req_aead; +diff --git a/drivers/md/dm-verity.h b/drivers/md/dm-verity.h +index 74ad36b6dbf53..fee7c7a81ce4e 100644 +--- a/drivers/md/dm-verity.h ++++ b/drivers/md/dm-verity.h +@@ -73,11 +73,11 @@ struct dm_verity_io { + /* original value of bio->bi_end_io */ + bio_end_io_t *orig_bi_end_io; + ++ struct bvec_iter iter; ++ + sector_t block; + unsigned n_blocks; + +- struct bvec_iter iter; +- + struct work_struct work; + + /* +-- +2.43.0 + diff --git a/queue-5.4/firewire-core-use-long-bus-reset-on-gap-count-error.patch b/queue-5.4/firewire-core-use-long-bus-reset-on-gap-count-error.patch new file mode 100644 index 00000000000..dab5a52d65e --- /dev/null +++ b/queue-5.4/firewire-core-use-long-bus-reset-on-gap-count-error.patch @@ -0,0 +1,65 @@ +From 9428628e595ba6536f421c24e9828410b8f80d20 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 29 Feb 2024 22:17:37 +0900 +Subject: firewire: core: use long bus reset on gap count error + +From: Takashi Sakamoto + +[ Upstream commit d0b06dc48fb15902d7da09c5c0861e7f042a9381 ] + +When resetting the bus after a gap count error, use a long rather than +short bus reset. + +IEEE 1394-1995 uses only long bus resets. IEEE 1394a adds the option of +short bus resets. When video or audio transmission is in progress and a +device is hot-plugged elsewhere on the bus, the resulting bus reset can +cause video frame drops or audio dropouts. Short bus resets reduce or +eliminate this problem. Accordingly, short bus resets are almost always +preferred. + +However, on a mixed 1394/1394a bus, a short bus reset can trigger an +immediate additional bus reset. This double bus reset can be interpreted +differently by different nodes on the bus, resulting in an inconsistent gap +count after the bus reset. An inconsistent gap count will cause another bus +reset, leading to a neverending bus reset loop. This only happens for some +bus topologies, not for all mixed 1394/1394a buses. + +By instead sending a long bus reset after a gap count inconsistency, we +avoid the doubled bus reset, restoring the bus to normal operation. + +Signed-off-by: Adam Goldman +Link: https://sourceforge.net/p/linux1394/mailman/message/58741624/ +Signed-off-by: Takashi Sakamoto +Signed-off-by: Sasha Levin +--- + drivers/firewire/core-card.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c +index be195ba834632..d446a72629414 100644 +--- a/drivers/firewire/core-card.c ++++ b/drivers/firewire/core-card.c +@@ -500,7 +500,19 @@ static void bm_work(struct work_struct *work) + fw_notice(card, "phy config: new root=%x, gap_count=%d\n", + new_root_id, gap_count); + fw_send_phy_config(card, new_root_id, generation, gap_count); +- reset_bus(card, true); ++ /* ++ * Where possible, use a short bus reset to minimize ++ * disruption to isochronous transfers. But in the event ++ * of a gap count inconsistency, use a long bus reset. ++ * ++ * As noted in 1394a 8.4.6.2, nodes on a mixed 1394/1394a bus ++ * may set different gap counts after a bus reset. On a mixed ++ * 1394/1394a bus, a short bus reset can get doubled. Some ++ * nodes may treat the double reset as one bus reset and others ++ * may treat it as two, causing a gap count inconsistency ++ * again. Using a long bus reset prevents this. ++ */ ++ reset_bus(card, card->gap_count != 0); + /* Will allocate broadcast channel after the reset. */ + goto out; + } +-- +2.43.0 + diff --git a/queue-5.4/hid-multitouch-add-required-quirk-for-synaptics-0xcd.patch b/queue-5.4/hid-multitouch-add-required-quirk-for-synaptics-0xcd.patch new file mode 100644 index 00000000000..b970d97566c --- /dev/null +++ b/queue-5.4/hid-multitouch-add-required-quirk-for-synaptics-0xcd.patch @@ -0,0 +1,40 @@ +From 66a594ae6a5c6ad7ef51c8fd869805c9e678364e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 11 Feb 2024 19:04:29 +0000 +Subject: HID: multitouch: Add required quirk for Synaptics 0xcddc device + +From: Manuel Fombuena + +[ Upstream commit 1741a8269e1c51fa08d4bfdf34667387a6eb10ec ] + +Add support for the pointing stick (Accupoint) and 2 mouse buttons. + +Present on some Toshiba/dynabook Portege X30 and X40 laptops. + +It should close https://bugzilla.kernel.org/show_bug.cgi?id=205817 + +Signed-off-by: Manuel Fombuena +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-multitouch.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index c37399f61c67b..c3810e7140a55 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -2090,6 +2090,10 @@ static const struct hid_device_id mt_devices[] = { + HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, + USB_VENDOR_ID_SYNAPTICS, 0xcd7e) }, + ++ { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT, ++ HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, ++ USB_VENDOR_ID_SYNAPTICS, 0xcddc) }, ++ + { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT, + HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, + USB_VENDOR_ID_SYNAPTICS, 0xce08) }, +-- +2.43.0 + diff --git a/queue-5.4/input-gpio_keys_polled-suppress-deferred-probe-error.patch b/queue-5.4/input-gpio_keys_polled-suppress-deferred-probe-error.patch new file mode 100644 index 00000000000..b4ad5ec5190 --- /dev/null +++ b/queue-5.4/input-gpio_keys_polled-suppress-deferred-probe-error.patch @@ -0,0 +1,55 @@ +From 505d0b9bff4b9b3fb6ec9e957ae9c55da7dc4dec Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 5 Mar 2024 11:10:42 +0100 +Subject: Input: gpio_keys_polled - suppress deferred probe error for gpio +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +[ Upstream commit 963465a33141d0d52338e77f80fe543d2c9dc053 ] + +On a PC Engines APU our admins are faced with: + + $ dmesg | grep -c "gpio-keys-polled gpio-keys-polled: unable to claim gpio 0, err=-517" + 261 + +Such a message always appears when e.g. a new USB device is plugged in. + +Suppress this message which considerably clutters the kernel log for +EPROBE_DEFER (i.e. -517). + +Signed-off-by: Uwe Kleine-König +Reviewed-by: Linus Walleij +Link: https://lore.kernel.org/r/20240305101042.10953-2-u.kleine-koenig@pengutronix.de +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/keyboard/gpio_keys_polled.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c +index 465eecfa6b3f0..825fff00e4f88 100644 +--- a/drivers/input/keyboard/gpio_keys_polled.c ++++ b/drivers/input/keyboard/gpio_keys_polled.c +@@ -325,12 +325,10 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) + + error = devm_gpio_request_one(dev, button->gpio, + flags, button->desc ? : DRV_NAME); +- if (error) { +- dev_err(dev, +- "unable to claim gpio %u, err=%d\n", +- button->gpio, error); +- return error; +- } ++ if (error) ++ return dev_err_probe(dev, error, ++ "unable to claim gpio %u\n", ++ button->gpio); + + bdata->gpiod = gpio_to_desc(button->gpio); + if (!bdata->gpiod) { +-- +2.43.0 + diff --git a/queue-5.4/mips-clear-cause.bd-in-instruction_pointer_set.patch b/queue-5.4/mips-clear-cause.bd-in-instruction_pointer_set.patch new file mode 100644 index 00000000000..c2996500392 --- /dev/null +++ b/queue-5.4/mips-clear-cause.bd-in-instruction_pointer_set.patch @@ -0,0 +1,39 @@ +From d942159cd8192c0ff2f1deed3a417850d11c8a16 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 2 Feb 2024 12:30:27 +0000 +Subject: MIPS: Clear Cause.BD in instruction_pointer_set + +From: Jiaxun Yang + +[ Upstream commit 9d6e21ddf20293b3880ae55b9d14de91c5891c59 ] + +Clear Cause.BD after we use instruction_pointer_set to override +EPC. + +This can prevent exception_epc check against instruction code at +new return address. +It won't be considered as "in delay slot" after epc being overridden +anyway. + +Signed-off-by: Jiaxun Yang +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Sasha Levin +--- + arch/mips/include/asm/ptrace.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h +index 1e76774b36ddf..2849a9b65a055 100644 +--- a/arch/mips/include/asm/ptrace.h ++++ b/arch/mips/include/asm/ptrace.h +@@ -60,6 +60,7 @@ static inline void instruction_pointer_set(struct pt_regs *regs, + unsigned long val) + { + regs->cp0_epc = val; ++ regs->cp0_cause &= ~CAUSEF_BD; + } + + /* Query offset/name of register from its name/offset */ +-- +2.43.0 + diff --git a/queue-5.4/net-iucv-fix-the-allocation-size-of-iucv_path_table-.patch b/queue-5.4/net-iucv-fix-the-allocation-size-of-iucv_path_table-.patch new file mode 100644 index 00000000000..6e0389ac584 --- /dev/null +++ b/queue-5.4/net-iucv-fix-the-allocation-size-of-iucv_path_table-.patch @@ -0,0 +1,46 @@ +From 6cc56e7f856cb3224c71ff2439f4c162e6315c24 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Feb 2024 17:32:40 +0100 +Subject: net/iucv: fix the allocation size of iucv_path_table array + +From: Alexander Gordeev + +[ Upstream commit b4ea9b6a18ebf7f9f3a7a60f82e925186978cfcf ] + +iucv_path_table is a dynamically allocated array of pointers to +struct iucv_path items. Yet, its size is calculated as if it was +an array of struct iucv_path items. + +Signed-off-by: Alexander Gordeev +Reviewed-by: Alexandra Winter +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/iucv/iucv.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c +index 392f8ddf97191..8b5b8cc93ff8b 100644 +--- a/net/iucv/iucv.c ++++ b/net/iucv/iucv.c +@@ -179,7 +179,7 @@ static char iucv_error_pathid[16] = "INVALID PATHID"; + static LIST_HEAD(iucv_handler_list); + + /* +- * iucv_path_table: an array of iucv_path structures. ++ * iucv_path_table: array of pointers to iucv_path structures. + */ + static struct iucv_path **iucv_path_table; + static unsigned long iucv_max_pathid; +@@ -590,7 +590,7 @@ static int iucv_enable(void) + + get_online_cpus(); + rc = -ENOMEM; +- alloc_size = iucv_max_pathid * sizeof(struct iucv_path); ++ alloc_size = iucv_max_pathid * sizeof(*iucv_path_table); + iucv_path_table = kzalloc(alloc_size, GFP_KERNEL); + if (!iucv_path_table) + goto out; +-- +2.43.0 + diff --git a/queue-5.4/parisc-ftrace-add-missing-config_dynamic_ftrace-chec.patch b/queue-5.4/parisc-ftrace-add-missing-config_dynamic_ftrace-chec.patch new file mode 100644 index 00000000000..7b48521ab75 --- /dev/null +++ b/queue-5.4/parisc-ftrace-add-missing-config_dynamic_ftrace-chec.patch @@ -0,0 +1,42 @@ +From d1039342486e19e1547be8a953b0a28330367e66 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 11 Feb 2024 23:43:14 +0100 +Subject: parisc/ftrace: add missing CONFIG_DYNAMIC_FTRACE check + +From: Max Kellermann + +[ Upstream commit 250f5402e636a5cec9e0e95df252c3d54307210f ] + +Fixes a bug revealed by -Wmissing-prototypes when +CONFIG_FUNCTION_GRAPH_TRACER is enabled but not CONFIG_DYNAMIC_FTRACE: + + arch/parisc/kernel/ftrace.c:82:5: error: no previous prototype for 'ftrace_enable_ftrace_graph_caller' [-Werror=missing-prototypes] + 82 | int ftrace_enable_ftrace_graph_caller(void) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + arch/parisc/kernel/ftrace.c:88:5: error: no previous prototype for 'ftrace_disable_ftrace_graph_caller' [-Werror=missing-prototypes] + 88 | int ftrace_disable_ftrace_graph_caller(void) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Max Kellermann +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + arch/parisc/kernel/ftrace.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/parisc/kernel/ftrace.c b/arch/parisc/kernel/ftrace.c +index b836fc61a24f4..f3a5c5e480cf0 100644 +--- a/arch/parisc/kernel/ftrace.c ++++ b/arch/parisc/kernel/ftrace.c +@@ -80,7 +80,7 @@ void notrace __hot ftrace_function_trampoline(unsigned long parent, + #endif + } + +-#ifdef CONFIG_FUNCTION_GRAPH_TRACER ++#if defined(CONFIG_DYNAMIC_FTRACE) && defined(CONFIG_FUNCTION_GRAPH_TRACER) + int ftrace_enable_ftrace_graph_caller(void) + { + return 0; +-- +2.43.0 + diff --git a/queue-5.4/rdma-mlx5-relax-devx-access-upon-modify-commands.patch b/queue-5.4/rdma-mlx5-relax-devx-access-upon-modify-commands.patch new file mode 100644 index 00000000000..a7d408a472c --- /dev/null +++ b/queue-5.4/rdma-mlx5-relax-devx-access-upon-modify-commands.patch @@ -0,0 +1,47 @@ +From 61a3921c3b7679f4886ed4a3caf8796a7e6a52d8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jan 2024 11:29:13 +0200 +Subject: RDMA/mlx5: Relax DEVX access upon modify commands + +From: Yishai Hadas + +[ Upstream commit be551ee1574280ef8afbf7c271212ac3e38933ef ] + +Relax DEVX access upon modify commands to be UVERBS_ACCESS_READ. + +The kernel doesn't need to protect what firmware protects, or what +causes no damage to anyone but the user. + +As firmware needs to protect itself from parallel access to the same +object, don't block parallel modify/query commands on the same object in +the kernel side. + +This change will allow user space application to run parallel updates to +different entries in the same bulk object. + +Tested-by: Tamar Mashiah +Signed-off-by: Yishai Hadas +Reviewed-by: Michael Guralnik +Link: https://lore.kernel.org/r/7407d5ed35dc427c1097699e12b49c01e1073406.1706433934.git.leon@kernel.org +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/mlx5/devx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c +index 26cc7bbcdfe6a..7a3b56c150799 100644 +--- a/drivers/infiniband/hw/mlx5/devx.c ++++ b/drivers/infiniband/hw/mlx5/devx.c +@@ -2811,7 +2811,7 @@ DECLARE_UVERBS_NAMED_METHOD( + MLX5_IB_METHOD_DEVX_OBJ_MODIFY, + UVERBS_ATTR_IDR(MLX5_IB_ATTR_DEVX_OBJ_MODIFY_HANDLE, + UVERBS_IDR_ANY_OBJECT, +- UVERBS_ACCESS_WRITE, ++ UVERBS_ACCESS_READ, + UA_MANDATORY), + UVERBS_ATTR_PTR_IN( + MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_IN, +-- +2.43.0 + diff --git a/queue-5.4/scsi-mpt3sas-prevent-sending-diag_reset-when-the-con.patch b/queue-5.4/scsi-mpt3sas-prevent-sending-diag_reset-when-the-con.patch new file mode 100644 index 00000000000..e3c1abcada3 --- /dev/null +++ b/queue-5.4/scsi-mpt3sas-prevent-sending-diag_reset-when-the-con.patch @@ -0,0 +1,44 @@ +From 112f7a5c931e65b9d6d2c0373e873bb84b24a15d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Feb 2024 12:47:24 +0530 +Subject: scsi: mpt3sas: Prevent sending diag_reset when the controller is + ready + +From: Ranjan Kumar + +[ Upstream commit ee0017c3ed8a8abfa4d40e42f908fb38c31e7515 ] + +If the driver detects that the controller is not ready before sending the +first IOC facts command, it will wait for a maximum of 10 seconds for it to +become ready. However, even if the controller becomes ready within 10 +seconds, the driver will still issue a diagnostic reset. + +Modify the driver to avoid sending a diag reset if the controller becomes +ready within the 10-second wait time. + +Signed-off-by: Ranjan Kumar +Link: https://lore.kernel.org/r/20240221071724.14986-1-ranjan.kumar@broadcom.com +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/mpt3sas/mpt3sas_base.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c +index e72f1dbc91f7f..04fa7337cb1ef 100644 +--- a/drivers/scsi/mpt3sas/mpt3sas_base.c ++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c +@@ -6040,7 +6040,9 @@ _base_wait_for_iocstate(struct MPT3SAS_ADAPTER *ioc, int timeout) + return -EFAULT; + } + +- issue_diag_reset: ++ return 0; ++ ++issue_diag_reset: + rc = _base_diag_reset(ioc); + return rc; + } +-- +2.43.0 + diff --git a/queue-5.4/selftests-tls-use-exact-comparison-in-recv_partial.patch b/queue-5.4/selftests-tls-use-exact-comparison-in-recv_partial.patch new file mode 100644 index 00000000000..21dce5d3aad --- /dev/null +++ b/queue-5.4/selftests-tls-use-exact-comparison-in-recv_partial.patch @@ -0,0 +1,44 @@ +From 1d8be54d782802fa736703311e9923502a7821aa Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 6 Feb 2024 17:18:23 -0800 +Subject: selftests: tls: use exact comparison in recv_partial + +From: Jakub Kicinski + +[ Upstream commit 49d821064c44cb5ffdf272905236012ea9ce50e3 ] + +This exact case was fail for async crypto and we weren't +catching it. + +Signed-off-by: Jakub Kicinski +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/net/tls.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c +index 837206dbe5d6e..81bb3cc6704f8 100644 +--- a/tools/testing/selftests/net/tls.c ++++ b/tools/testing/selftests/net/tls.c +@@ -580,12 +580,12 @@ TEST_F(tls, recv_partial) + + memset(recv_mem, 0, sizeof(recv_mem)); + EXPECT_EQ(send(self->fd, test_str, send_len, 0), send_len); +- EXPECT_NE(recv(self->cfd, recv_mem, strlen(test_str_first), +- MSG_WAITALL), -1); ++ EXPECT_EQ(recv(self->cfd, recv_mem, strlen(test_str_first), ++ MSG_WAITALL), strlen(test_str_first)); + EXPECT_EQ(memcmp(test_str_first, recv_mem, strlen(test_str_first)), 0); + memset(recv_mem, 0, sizeof(recv_mem)); +- EXPECT_NE(recv(self->cfd, recv_mem, strlen(test_str_second), +- MSG_WAITALL), -1); ++ EXPECT_EQ(recv(self->cfd, recv_mem, strlen(test_str_second), ++ MSG_WAITALL), strlen(test_str_second)); + EXPECT_EQ(memcmp(test_str_second, recv_mem, strlen(test_str_second)), + 0); + } +-- +2.43.0 + diff --git a/queue-5.4/series b/queue-5.4/series index 35f67cbf642..e712dc4af85 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -1,2 +1,21 @@ io_uring-unix-drop-usage-of-io_uring-socket.patch io_uring-drop-any-code-related-to-scm_rights.patch +selftests-tls-use-exact-comparison-in-recv_partial.patch +asoc-rt5645-make-lattepanda-board-dmi-match-more-pre.patch +x86-xen-add-some-null-pointer-checking-to-smp.c.patch +mips-clear-cause.bd-in-instruction_pointer_set.patch +hid-multitouch-add-required-quirk-for-synaptics-0xcd.patch +rdma-mlx5-relax-devx-access-upon-modify-commands.patch +net-iucv-fix-the-allocation-size-of-iucv_path_table-.patch +parisc-ftrace-add-missing-config_dynamic_ftrace-chec.patch +block-sed-opal-handle-empty-atoms-when-parsing-respo.patch +dm-verity-dm-crypt-align-struct-bvec_iter-correctly.patch +btrfs-fix-data-race-at-btrfs_use_block_rsv-when-acce.patch +scsi-mpt3sas-prevent-sending-diag_reset-when-the-con.patch +bluetooth-rfcomm-fix-null-ptr-deref-in-rfcomm_check_.patch +firewire-core-use-long-bus-reset-on-gap-count-error.patch +asoc-intel-bytcr_rt5640-add-an-extra-entry-for-the-c.patch +input-gpio_keys_polled-suppress-deferred-probe-error.patch +asoc-wm8962-enable-oscillator-if-selecting-wm8962_fl.patch +asoc-wm8962-enable-both-spkoutr_ena-and-spkoutl_ena-.patch +asoc-wm8962-fix-up-incorrect-error-message-in-wm8962.patch diff --git a/queue-5.4/x86-xen-add-some-null-pointer-checking-to-smp.c.patch b/queue-5.4/x86-xen-add-some-null-pointer-checking-to-smp.c.patch new file mode 100644 index 00000000000..6b6a956cbec --- /dev/null +++ b/queue-5.4/x86-xen-add-some-null-pointer-checking-to-smp.c.patch @@ -0,0 +1,79 @@ +From debd0c9678f3a5b7b8182d61c3054e8405fb4009 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 Jan 2024 17:49:48 +0800 +Subject: x86/xen: Add some null pointer checking to smp.c + +From: Kunwu Chan + +[ Upstream commit 3693bb4465e6e32a204a5b86d3ec7e6b9f7e67c2 ] + +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 +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202401161119.iof6BQsf-lkp@intel.com/ +Suggested-by: Markus Elfring +Reviewed-by: Juergen Gross +Link: https://lore.kernel.org/r/20240119094948.275390-1-chentao@kylinos.cn +Signed-off-by: Juergen Gross +Signed-off-by: Sasha Levin +--- + arch/x86/xen/smp.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c +index a1cc855c539c1..a76ba342a6695 100644 +--- a/arch/x86/xen/smp.c ++++ b/arch/x86/xen/smp.c +@@ -65,6 +65,8 @@ int xen_smp_intr_init(unsigned int cpu) + char *resched_name, *callfunc_name, *debug_name; + + resched_name = kasprintf(GFP_KERNEL, "resched%d", cpu); ++ if (!resched_name) ++ goto fail_mem; + per_cpu(xen_resched_irq, cpu).name = resched_name; + rc = bind_ipi_to_irqhandler(XEN_RESCHEDULE_VECTOR, + cpu, +@@ -77,6 +79,8 @@ int xen_smp_intr_init(unsigned int cpu) + per_cpu(xen_resched_irq, cpu).irq = rc; + + callfunc_name = kasprintf(GFP_KERNEL, "callfunc%d", cpu); ++ if (!callfunc_name) ++ goto fail_mem; + per_cpu(xen_callfunc_irq, cpu).name = callfunc_name; + rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_VECTOR, + cpu, +@@ -90,6 +94,9 @@ int xen_smp_intr_init(unsigned int cpu) + + if (!xen_fifo_events) { + debug_name = kasprintf(GFP_KERNEL, "debug%d", cpu); ++ if (!debug_name) ++ goto fail_mem; ++ + per_cpu(xen_debug_irq, cpu).name = debug_name; + rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu, + xen_debug_interrupt, +@@ -101,6 +108,9 @@ int xen_smp_intr_init(unsigned int cpu) + } + + callfunc_name = kasprintf(GFP_KERNEL, "callfuncsingle%d", cpu); ++ if (!callfunc_name) ++ goto fail_mem; ++ + per_cpu(xen_callfuncsingle_irq, cpu).name = callfunc_name; + rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_SINGLE_VECTOR, + cpu, +@@ -114,6 +124,8 @@ int xen_smp_intr_init(unsigned int cpu) + + return 0; + ++ fail_mem: ++ rc = -ENOMEM; + fail: + xen_smp_intr_free(cpu); + return rc; +-- +2.43.0 +