]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Feb 2024 17:02:33 +0000 (18:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Feb 2024 17:02:33 +0000 (18:02 +0100)
added patches:
alsa-hda-cs8409-suppress-vmaster-control-for-dolphin-models.patch
alsa-hda-realtek-enable-headset-mic-on-vaio-vjfe-adl.patch
asoc-codecs-wcd938x-handle-deferred-probe.patch
binder-signal-epoll-threads-of-self-work.patch
ext4-fix-double-free-of-blocks-due-to-wrong-extents-moved_len.patch
firewire-core-correct-documentation-of-fw_csr_string-kernel-api.patch
iio-accel-bma400-fix-a-compilation-problem.patch
iio-core-fix-memleak-in-iio_device_register_sysfs.patch
iio-magnetometer-rm3100-add-boundary-check-for-the-value-read-from-rm3100_reg_tmrc.patch
kbuild-fix-changing-elf-file-type-for-output-of-gen_btf-for-big-endian.patch
lsm-fix-the-logic-in-security_inode_getsecctx.patch
media-rc-bpf-attach-detach-requires-write-permission.patch
misc-fastrpc-mark-all-sessions-as-invalid-in-cb_remove.patch
mptcp-fix-data-re-injection-from-stale-subflow.patch
net-hsr-remove-warn_once-in-send_hsr_supervision_frame.patch
nfc-nci-free-rx_data_reassembly-skb-on-nci-device-cleanup.patch
revert-drm-amd-flush-any-delayed-gfxoff-on-suspend-entry.patch
scsi-revert-scsi-fcoe-fix-potential-deadlock-on-fip-ctlr_lock.patch
staging-iio-ad5933-fix-type-mismatch-regression.patch
tracing-fix-wasted-memory-in-saved_cmdlines-logic.patch
um-fix-adding-no-pie-for-clang.patch
xen-netback-properly-sync-tx-responses.patch

23 files changed:
queue-5.15/alsa-hda-cs8409-suppress-vmaster-control-for-dolphin-models.patch [new file with mode: 0644]
queue-5.15/alsa-hda-realtek-enable-headset-mic-on-vaio-vjfe-adl.patch [new file with mode: 0644]
queue-5.15/asoc-codecs-wcd938x-handle-deferred-probe.patch [new file with mode: 0644]
queue-5.15/binder-signal-epoll-threads-of-self-work.patch [new file with mode: 0644]
queue-5.15/ext4-fix-double-free-of-blocks-due-to-wrong-extents-moved_len.patch [new file with mode: 0644]
queue-5.15/firewire-core-correct-documentation-of-fw_csr_string-kernel-api.patch [new file with mode: 0644]
queue-5.15/iio-accel-bma400-fix-a-compilation-problem.patch [new file with mode: 0644]
queue-5.15/iio-core-fix-memleak-in-iio_device_register_sysfs.patch [new file with mode: 0644]
queue-5.15/iio-magnetometer-rm3100-add-boundary-check-for-the-value-read-from-rm3100_reg_tmrc.patch [new file with mode: 0644]
queue-5.15/kbuild-fix-changing-elf-file-type-for-output-of-gen_btf-for-big-endian.patch [new file with mode: 0644]
queue-5.15/lsm-fix-the-logic-in-security_inode_getsecctx.patch [new file with mode: 0644]
queue-5.15/media-rc-bpf-attach-detach-requires-write-permission.patch [new file with mode: 0644]
queue-5.15/misc-fastrpc-mark-all-sessions-as-invalid-in-cb_remove.patch [new file with mode: 0644]
queue-5.15/mptcp-fix-data-re-injection-from-stale-subflow.patch [new file with mode: 0644]
queue-5.15/net-hsr-remove-warn_once-in-send_hsr_supervision_frame.patch [new file with mode: 0644]
queue-5.15/nfc-nci-free-rx_data_reassembly-skb-on-nci-device-cleanup.patch [new file with mode: 0644]
queue-5.15/revert-drm-amd-flush-any-delayed-gfxoff-on-suspend-entry.patch [new file with mode: 0644]
queue-5.15/scsi-revert-scsi-fcoe-fix-potential-deadlock-on-fip-ctlr_lock.patch [new file with mode: 0644]
queue-5.15/series
queue-5.15/staging-iio-ad5933-fix-type-mismatch-regression.patch [new file with mode: 0644]
queue-5.15/tracing-fix-wasted-memory-in-saved_cmdlines-logic.patch [new file with mode: 0644]
queue-5.15/um-fix-adding-no-pie-for-clang.patch [new file with mode: 0644]
queue-5.15/xen-netback-properly-sync-tx-responses.patch [new file with mode: 0644]

diff --git a/queue-5.15/alsa-hda-cs8409-suppress-vmaster-control-for-dolphin-models.patch b/queue-5.15/alsa-hda-cs8409-suppress-vmaster-control-for-dolphin-models.patch
new file mode 100644 (file)
index 0000000..4d2a7ab
--- /dev/null
@@ -0,0 +1,35 @@
+From a2ed0a44d637ef9deca595054c206da7d6cbdcbc Mon Sep 17 00:00:00 2001
+From: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
+Date: Mon, 22 Jan 2024 18:47:10 +0000
+Subject: ALSA: hda/cs8409: Suppress vmaster control for Dolphin models
+
+From: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
+
+commit a2ed0a44d637ef9deca595054c206da7d6cbdcbc upstream.
+
+Customer has reported an issue with specific desktop platform
+where two CS42L42 codecs are connected to CS8409 HDA bridge.
+If "Master Volume Control" is created then on Ubuntu OS UCM
+left/right balance slider in UI audio settings has no effect.
+This patch will fix this issue for a target paltform.
+
+Fixes: 20e507724113 ("ALSA: hda/cs8409: Add support for dolphin")
+Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20240122184710.5802-1-vitalyr@opensource.cirrus.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/patch_cs8409.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_cs8409.c
++++ b/sound/pci/hda/patch_cs8409.c
+@@ -1200,6 +1200,7 @@ void dolphin_fixups(struct hda_codec *co
+               spec->scodecs[CS8409_CODEC1] = &dolphin_cs42l42_1;
+               spec->scodecs[CS8409_CODEC1]->codec = codec;
+               spec->num_scodecs = 2;
++              spec->gen.suppress_vmaster = 1;
+               codec->patch_ops = cs8409_dolphin_patch_ops;
diff --git a/queue-5.15/alsa-hda-realtek-enable-headset-mic-on-vaio-vjfe-adl.patch b/queue-5.15/alsa-hda-realtek-enable-headset-mic-on-vaio-vjfe-adl.patch
new file mode 100644 (file)
index 0000000..a6d8395
--- /dev/null
@@ -0,0 +1,31 @@
+From c7de2d9bb68a5fc71c25ff96705a80a76c8436eb Mon Sep 17 00:00:00 2001
+From: Edson Juliano Drosdeck <edson.drosdeck@gmail.com>
+Date: Thu, 1 Feb 2024 09:21:14 -0300
+Subject: ALSA: hda/realtek: Enable headset mic on Vaio VJFE-ADL
+
+From: Edson Juliano Drosdeck <edson.drosdeck@gmail.com>
+
+commit c7de2d9bb68a5fc71c25ff96705a80a76c8436eb upstream.
+
+Vaio VJFE-ADL is equipped with ALC269VC, and it needs
+ALC298_FIXUP_SPK_VOLUME quirk to make its headset mic work.
+
+Signed-off-by: Edson Juliano Drosdeck <edson.drosdeck@gmail.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20240201122114.30080-1-edson.drosdeck@gmail.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/patch_realtek.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -9415,6 +9415,7 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
+       SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
+       SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
++      SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
+       SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
+       SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
+       SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
diff --git a/queue-5.15/asoc-codecs-wcd938x-handle-deferred-probe.patch b/queue-5.15/asoc-codecs-wcd938x-handle-deferred-probe.patch
new file mode 100644 (file)
index 0000000..91cbce9
--- /dev/null
@@ -0,0 +1,37 @@
+From 086df711d9b886194481b4fbe525eb43e9ae7403 Mon Sep 17 00:00:00 2001
+From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Date: Wed, 17 Jan 2024 16:12:06 +0100
+Subject: ASoC: codecs: wcd938x: handle deferred probe
+
+From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+
+commit 086df711d9b886194481b4fbe525eb43e9ae7403 upstream.
+
+WCD938x sound codec driver ignores return status of getting regulators
+and returns EINVAL instead of EPROBE_DEFER.  If regulator provider
+probes after the codec, system is left without probed audio:
+
+  wcd938x_codec audio-codec: wcd938x_probe: Fail to obtain platform data
+  wcd938x_codec: probe of audio-codec failed with error -22
+
+Fixes: 16572522aece ("ASoC: codecs: wcd938x-sdw: add SoundWire driver")
+Cc:  <stable@vger.kernel.org>
+Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Link: https://msgid.link/r/20240117151208.1219755-1-krzysztof.kozlowski@linaro.org
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/soc/codecs/wcd938x.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/codecs/wcd938x.c
++++ b/sound/soc/codecs/wcd938x.c
+@@ -4573,7 +4573,7 @@ static int wcd938x_probe(struct platform
+       ret = wcd938x_populate_dt_data(wcd938x, dev);
+       if (ret) {
+               dev_err(dev, "%s: Fail to obtain platform data\n", __func__);
+-              return -EINVAL;
++              return ret;
+       }
+       ret = wcd938x_add_slave_components(wcd938x, dev, &match);
diff --git a/queue-5.15/binder-signal-epoll-threads-of-self-work.patch b/queue-5.15/binder-signal-epoll-threads-of-self-work.patch
new file mode 100644 (file)
index 0000000..92a1d2d
--- /dev/null
@@ -0,0 +1,55 @@
+From 97830f3c3088638ff90b20dfba2eb4d487bf14d7 Mon Sep 17 00:00:00 2001
+From: Carlos Llamas <cmllamas@google.com>
+Date: Wed, 31 Jan 2024 21:53:46 +0000
+Subject: binder: signal epoll threads of self-work
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Carlos Llamas <cmllamas@google.com>
+
+commit 97830f3c3088638ff90b20dfba2eb4d487bf14d7 upstream.
+
+In (e)poll mode, threads often depend on I/O events to determine when
+data is ready for consumption. Within binder, a thread may initiate a
+command via BINDER_WRITE_READ without a read buffer and then make use
+of epoll_wait() or similar to consume any responses afterwards.
+
+It is then crucial that epoll threads are signaled via wakeup when they
+queue their own work. Otherwise, they risk waiting indefinitely for an
+event leaving their work unhandled. What is worse, subsequent commands
+won't trigger a wakeup either as the thread has pending work.
+
+Fixes: 457b9a6f09f0 ("Staging: android: add binder driver")
+Cc: Arve Hjønnevåg <arve@android.com>
+Cc: Martijn Coenen <maco@android.com>
+Cc: Alice Ryhl <aliceryhl@google.com>
+Cc: Steven Moreland <smoreland@google.com>
+Cc: stable@vger.kernel.org # v4.19+
+Signed-off-by: Carlos Llamas <cmllamas@google.com>
+Link: https://lore.kernel.org/r/20240131215347.1808751-1-cmllamas@google.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/android/binder.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/android/binder.c
++++ b/drivers/android/binder.c
+@@ -450,6 +450,16 @@ binder_enqueue_thread_work_ilocked(struc
+ {
+       WARN_ON(!list_empty(&thread->waiting_thread_node));
+       binder_enqueue_work_ilocked(work, &thread->todo);
++
++      /* (e)poll-based threads require an explicit wakeup signal when
++       * queuing their own work; they rely on these events to consume
++       * messages without I/O block. Without it, threads risk waiting
++       * indefinitely without handling the work.
++       */
++      if (thread->looper & BINDER_LOOPER_STATE_POLL &&
++          thread->pid == current->pid && !thread->process_todo)
++              wake_up_interruptible_sync(&thread->wait);
++
+       thread->process_todo = true;
+ }
diff --git a/queue-5.15/ext4-fix-double-free-of-blocks-due-to-wrong-extents-moved_len.patch b/queue-5.15/ext4-fix-double-free-of-blocks-due-to-wrong-extents-moved_len.patch
new file mode 100644 (file)
index 0000000..ead592f
--- /dev/null
@@ -0,0 +1,68 @@
+From 55583e899a5357308274601364741a83e78d6ac4 Mon Sep 17 00:00:00 2001
+From: Baokun Li <libaokun1@huawei.com>
+Date: Thu, 4 Jan 2024 22:20:33 +0800
+Subject: ext4: fix double-free of blocks due to wrong extents moved_len
+
+From: Baokun Li <libaokun1@huawei.com>
+
+commit 55583e899a5357308274601364741a83e78d6ac4 upstream.
+
+In ext4_move_extents(), moved_len is only updated when all moves are
+successfully executed, and only discards orig_inode and donor_inode
+preallocations when moved_len is not zero. When the loop fails to exit
+after successfully moving some extents, moved_len is not updated and
+remains at 0, so it does not discard the preallocations.
+
+If the moved extents overlap with the preallocated extents, the
+overlapped extents are freed twice in ext4_mb_release_inode_pa() and
+ext4_process_freed_data() (as described in commit 94d7c16cbbbd ("ext4:
+Fix double-free of blocks with EXT4_IOC_MOVE_EXT")), and bb_free is
+incremented twice. Hence when trim is executed, a zero-division bug is
+triggered in mb_update_avg_fragment_size() because bb_free is not zero
+and bb_fragments is zero.
+
+Therefore, update move_len after each extent move to avoid the issue.
+
+Reported-by: Wei Chen <harperchen1110@gmail.com>
+Reported-by: xingwei lee <xrivendell7@gmail.com>
+Closes: https://lore.kernel.org/r/CAO4mrferzqBUnCag8R3m2zf897ts9UEuhjFQGPtODT92rYyR2Q@mail.gmail.com
+Fixes: fcf6b1b729bc ("ext4: refactor ext4_move_extents code base")
+CC:  <stable@vger.kernel.org> # 3.18
+Signed-off-by: Baokun Li <libaokun1@huawei.com>
+Reviewed-by: Jan Kara <jack@suse.cz>
+Link: https://lore.kernel.org/r/20240104142040.2835097-2-libaokun1@huawei.com
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ext4/move_extent.c |    6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/fs/ext4/move_extent.c
++++ b/fs/ext4/move_extent.c
+@@ -615,6 +615,7 @@ ext4_move_extents(struct file *o_filp, s
+               goto out;
+       o_end = o_start + len;
++      *moved_len = 0;
+       while (o_start < o_end) {
+               struct ext4_extent *ex;
+               ext4_lblk_t cur_blk, next_blk;
+@@ -670,7 +671,7 @@ ext4_move_extents(struct file *o_filp, s
+                */
+               ext4_double_up_write_data_sem(orig_inode, donor_inode);
+               /* Swap original branches with new branches */
+-              move_extent_per_page(o_filp, donor_inode,
++              *moved_len += move_extent_per_page(o_filp, donor_inode,
+                                    orig_page_index, donor_page_index,
+                                    offset_in_page, cur_len,
+                                    unwritten, &ret);
+@@ -680,9 +681,6 @@ ext4_move_extents(struct file *o_filp, s
+               o_start += cur_len;
+               d_start += cur_len;
+       }
+-      *moved_len = o_start - orig_blk;
+-      if (*moved_len > len)
+-              *moved_len = len;
+ out:
+       if (*moved_len) {
diff --git a/queue-5.15/firewire-core-correct-documentation-of-fw_csr_string-kernel-api.patch b/queue-5.15/firewire-core-correct-documentation-of-fw_csr_string-kernel-api.patch
new file mode 100644 (file)
index 0000000..f08adea
--- /dev/null
@@ -0,0 +1,39 @@
+From 5f9ab17394f831cb7986ec50900fa37507a127f1 Mon Sep 17 00:00:00 2001
+From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
+Date: Thu, 1 Feb 2024 20:53:18 +0900
+Subject: firewire: core: correct documentation of fw_csr_string() kernel API
+
+From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
+
+commit 5f9ab17394f831cb7986ec50900fa37507a127f1 upstream.
+
+Against its current description, the kernel API can accepts all types of
+directory entries.
+
+This commit corrects the documentation.
+
+Cc: stable@vger.kernel.org
+Fixes: 3c2c58cb33b3 ("firewire: core: fw_csr_string addendum")
+Link: https://lore.kernel.org/r/20240130100409.30128-2-o-takashi@sakamocchi.jp
+Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/firewire/core-device.c |    7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/drivers/firewire/core-device.c
++++ b/drivers/firewire/core-device.c
+@@ -100,10 +100,9 @@ static int textual_leaf_to_string(const
+  * @buf:      where to put the string
+  * @size:     size of @buf, in bytes
+  *
+- * The string is taken from a minimal ASCII text descriptor leaf after
+- * the immediate entry with @key.  The string is zero-terminated.
+- * An overlong string is silently truncated such that it and the
+- * zero byte fit into @size.
++ * The string is taken from a minimal ASCII text descriptor leaf just after the entry with the
++ * @key. The string is zero-terminated. An overlong string is silently truncated such that it
++ * and the zero byte fit into @size.
+  *
+  * Returns strlen(buf) or a negative error code.
+  */
diff --git a/queue-5.15/iio-accel-bma400-fix-a-compilation-problem.patch b/queue-5.15/iio-accel-bma400-fix-a-compilation-problem.patch
new file mode 100644 (file)
index 0000000..8477c4c
--- /dev/null
@@ -0,0 +1,43 @@
+From 4cb81840d8f29b66d9d05c6d7f360c9560f7e2f4 Mon Sep 17 00:00:00 2001
+From: Mario Limonciello <mario.limonciello@amd.com>
+Date: Wed, 31 Jan 2024 16:52:46 -0600
+Subject: iio: accel: bma400: Fix a compilation problem
+
+From: Mario Limonciello <mario.limonciello@amd.com>
+
+commit 4cb81840d8f29b66d9d05c6d7f360c9560f7e2f4 upstream.
+
+The kernel fails when compiling without `CONFIG_REGMAP_I2C` but with
+`CONFIG_BMA400`.
+```
+ld: drivers/iio/accel/bma400_i2c.o: in function `bma400_i2c_probe':
+bma400_i2c.c:(.text+0x23): undefined reference to `__devm_regmap_init_i2c'
+```
+
+Link: https://download.01.org/0day-ci/archive/20240131/202401311634.FE5CBVwe-lkp@intel.com/config
+Fixes: 465c811f1f20 ("iio: accel: Add driver for the BMA400")
+Fixes: 9bea10642396 ("iio: accel: bma400: add support for bma400 spi")
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+Link: https://lore.kernel.org/r/20240131225246.14169-1-mario.limonciello@amd.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/accel/Kconfig |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/iio/accel/Kconfig
++++ b/drivers/iio/accel/Kconfig
+@@ -128,10 +128,12 @@ config BMA400
+ config BMA400_I2C
+       tristate
++      select REGMAP_I2C
+       depends on BMA400
+ config BMA400_SPI
+       tristate
++      select REGMAP_SPI
+       depends on BMA400
+ config BMC150_ACCEL
diff --git a/queue-5.15/iio-core-fix-memleak-in-iio_device_register_sysfs.patch b/queue-5.15/iio-core-fix-memleak-in-iio_device_register_sysfs.patch
new file mode 100644 (file)
index 0000000..efde84f
--- /dev/null
@@ -0,0 +1,40 @@
+From 95a0d596bbd0552a78e13ced43f2be1038883c81 Mon Sep 17 00:00:00 2001
+From: Dinghao Liu <dinghao.liu@zju.edu.cn>
+Date: Fri, 8 Dec 2023 15:31:19 +0800
+Subject: iio: core: fix memleak in iio_device_register_sysfs
+
+From: Dinghao Liu <dinghao.liu@zju.edu.cn>
+
+commit 95a0d596bbd0552a78e13ced43f2be1038883c81 upstream.
+
+When iio_device_register_sysfs_group() fails, we should
+free iio_dev_opaque->chan_attr_group.attrs to prevent
+potential memleak.
+
+Fixes: 32f171724e5c ("iio: core: rework iio device group creation")
+Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
+Link: https://lore.kernel.org/r/20231208073119.29283-1-dinghao.liu@zju.edu.cn
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/industrialio-core.c |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/iio/industrialio-core.c
++++ b/drivers/iio/industrialio-core.c
+@@ -1610,10 +1610,13 @@ static int iio_device_register_sysfs(str
+       ret = iio_device_register_sysfs_group(indio_dev,
+                                             &iio_dev_opaque->chan_attr_group);
+       if (ret)
+-              goto error_clear_attrs;
++              goto error_free_chan_attrs;
+       return 0;
++error_free_chan_attrs:
++      kfree(iio_dev_opaque->chan_attr_group.attrs);
++      iio_dev_opaque->chan_attr_group.attrs = NULL;
+ error_clear_attrs:
+       iio_free_chan_devattr_list(&iio_dev_opaque->channel_attr_list);
diff --git a/queue-5.15/iio-magnetometer-rm3100-add-boundary-check-for-the-value-read-from-rm3100_reg_tmrc.patch b/queue-5.15/iio-magnetometer-rm3100-add-boundary-check-for-the-value-read-from-rm3100_reg_tmrc.patch
new file mode 100644 (file)
index 0000000..cba198c
--- /dev/null
@@ -0,0 +1,52 @@
+From 792595bab4925aa06532a14dd256db523eb4fa5e Mon Sep 17 00:00:00 2001
+From: "zhili.liu" <zhili.liu@ucas.com.cn>
+Date: Tue, 2 Jan 2024 09:07:11 +0800
+Subject: iio: magnetometer: rm3100: add boundary check for the value read from RM3100_REG_TMRC
+
+From: zhili.liu <zhili.liu@ucas.com.cn>
+
+commit 792595bab4925aa06532a14dd256db523eb4fa5e upstream.
+
+Recently, we encounter kernel crash in function rm3100_common_probe
+caused by out of bound access of array rm3100_samp_rates (because of
+underlying hardware failures). Add boundary check to prevent out of
+bound access.
+
+Fixes: 121354b2eceb ("iio: magnetometer: Add driver support for PNI RM3100")
+Suggested-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
+Signed-off-by: zhili.liu <zhili.liu@ucas.com.cn>
+Link: https://lore.kernel.org/r/1704157631-3814-1-git-send-email-zhouzhouyi@gmail.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/magnetometer/rm3100-core.c |   10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+--- a/drivers/iio/magnetometer/rm3100-core.c
++++ b/drivers/iio/magnetometer/rm3100-core.c
+@@ -538,6 +538,7 @@ int rm3100_common_probe(struct device *d
+       struct rm3100_data *data;
+       unsigned int tmp;
+       int ret;
++      int samp_rate_index;
+       indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
+       if (!indio_dev)
+@@ -595,9 +596,14 @@ int rm3100_common_probe(struct device *d
+       ret = regmap_read(regmap, RM3100_REG_TMRC, &tmp);
+       if (ret < 0)
+               return ret;
++
++      samp_rate_index = tmp - RM3100_TMRC_OFFSET;
++      if (samp_rate_index < 0 || samp_rate_index >=  RM3100_SAMP_NUM) {
++              dev_err(dev, "The value read from RM3100_REG_TMRC is invalid!\n");
++              return -EINVAL;
++      }
+       /* Initializing max wait time, which is double conversion time. */
+-      data->conversion_time = rm3100_samp_rates[tmp - RM3100_TMRC_OFFSET][2]
+-                              * 2;
++      data->conversion_time = rm3100_samp_rates[samp_rate_index][2] * 2;
+       /* Cycle count values may not be what we want. */
+       if ((tmp - RM3100_TMRC_OFFSET) == 0)
diff --git a/queue-5.15/kbuild-fix-changing-elf-file-type-for-output-of-gen_btf-for-big-endian.patch b/queue-5.15/kbuild-fix-changing-elf-file-type-for-output-of-gen_btf-for-big-endian.patch
new file mode 100644 (file)
index 0000000..584ba44
--- /dev/null
@@ -0,0 +1,75 @@
+From e3a9ee963ad8ba677ca925149812c5932b49af69 Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Mon, 12 Feb 2024 19:05:10 -0700
+Subject: kbuild: Fix changing ELF file type for output of gen_btf for big endian
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+commit e3a9ee963ad8ba677ca925149812c5932b49af69 upstream.
+
+Commit 90ceddcb4950 ("bpf: Support llvm-objcopy for vmlinux BTF")
+changed the ELF type of .btf.vmlinux.bin.o to ET_REL via dd, which works
+fine for little endian platforms:
+
+   00000000  7f 45 4c 46 02 01 01 00  00 00 00 00 00 00 00 00  |.ELF............|
+  -00000010  03 00 b7 00 01 00 00 00  00 00 00 80 00 80 ff ff  |................|
+  +00000010  01 00 b7 00 01 00 00 00  00 00 00 80 00 80 ff ff  |................|
+
+However, for big endian platforms, it changes the wrong byte, resulting
+in an invalid ELF file type, which ld.lld rejects:
+
+   00000000  7f 45 4c 46 02 02 01 00  00 00 00 00 00 00 00 00  |.ELF............|
+  -00000010  00 03 00 16 00 00 00 01  00 00 00 00 00 10 00 00  |................|
+  +00000010  01 03 00 16 00 00 00 01  00 00 00 00 00 10 00 00  |................|
+
+  Type:                              <unknown>: 103
+
+  ld.lld: error: .btf.vmlinux.bin.o: unknown file type
+
+Fix this by updating the entire 16-bit e_type field rather than just a
+single byte, so that everything works correctly for all platforms and
+linkers.
+
+   00000000  7f 45 4c 46 02 02 01 00  00 00 00 00 00 00 00 00  |.ELF............|
+  -00000010  00 03 00 16 00 00 00 01  00 00 00 00 00 10 00 00  |................|
+  +00000010  00 01 00 16 00 00 00 01  00 00 00 00 00 10 00 00  |................|
+
+  Type:                              REL (Relocatable file)
+
+While in the area, update the comment to mention that binutils 2.35+
+matches LLD's behavior of rejecting an ET_EXEC input, which occurred
+after the comment was added.
+
+Cc: stable@vger.kernel.org
+Fixes: 90ceddcb4950 ("bpf: Support llvm-objcopy for vmlinux BTF")
+Link: https://github.com/llvm/llvm-project/pull/75643
+Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Reviewed-by: Fangrui Song <maskray@google.com>
+Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
+Reviewed-by: Kees Cook <keescook@chromium.org>
+Reviewed-by: Justin Stitt <justinstitt@google.com>
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ scripts/link-vmlinux.sh |    9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/scripts/link-vmlinux.sh
++++ b/scripts/link-vmlinux.sh
+@@ -236,8 +236,13 @@ gen_btf()
+       ${OBJCOPY} --only-section=.BTF --set-section-flags .BTF=alloc,readonly \
+               --strip-all ${1} ${2} 2>/dev/null
+       # Change e_type to ET_REL so that it can be used to link final vmlinux.
+-      # Unlike GNU ld, lld does not allow an ET_EXEC input.
+-      printf '\1' | dd of=${2} conv=notrunc bs=1 seek=16 status=none
++      # GNU ld 2.35+ and lld do not allow an ET_EXEC input.
++      if is_enabled CONFIG_CPU_BIG_ENDIAN; then
++              et_rel='\0\1'
++      else
++              et_rel='\1\0'
++      fi
++      printf "${et_rel}" | dd of=${2} conv=notrunc bs=1 seek=16 status=none
+ }
+ # Create ${2} .S file with all symbols from the ${1} object file
diff --git a/queue-5.15/lsm-fix-the-logic-in-security_inode_getsecctx.patch b/queue-5.15/lsm-fix-the-logic-in-security_inode_getsecctx.patch
new file mode 100644 (file)
index 0000000..3a95e79
--- /dev/null
@@ -0,0 +1,60 @@
+From 99b817c173cd213671daecd25ca27f56b0c7c4ec Mon Sep 17 00:00:00 2001
+From: Ondrej Mosnacek <omosnace@redhat.com>
+Date: Fri, 26 Jan 2024 11:44:03 +0100
+Subject: lsm: fix the logic in security_inode_getsecctx()
+
+From: Ondrej Mosnacek <omosnace@redhat.com>
+
+commit 99b817c173cd213671daecd25ca27f56b0c7c4ec upstream.
+
+The inode_getsecctx LSM hook has previously been corrected to have
+-EOPNOTSUPP instead of 0 as the default return value to fix BPF LSM
+behavior. However, the call_int_hook()-generated loop in
+security_inode_getsecctx() was left treating 0 as the neutral value, so
+after an LSM returns 0, the loop continues to try other LSMs, and if one
+of them returns a non-zero value, the function immediately returns with
+said value. So in a situation where SELinux and the BPF LSMs registered
+this hook, -EOPNOTSUPP would be incorrectly returned whenever SELinux
+returned 0.
+
+Fix this by open-coding the call_int_hook() loop and making it use the
+correct LSM_RET_DEFAULT() value as the neutral one, similar to what
+other hooks do.
+
+Cc: stable@vger.kernel.org
+Reported-by: Stephen Smalley <stephen.smalley.work@gmail.com>
+Link: https://lore.kernel.org/selinux/CAEjxPJ4ev-pasUwGx48fDhnmjBnq_Wh90jYPwRQRAqXxmOKD4Q@mail.gmail.com/
+Link: https://bugzilla.redhat.com/show_bug.cgi?id=2257983
+Fixes: b36995b8609a ("lsm: fix default return value for inode_getsecctx")
+Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
+Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
+[PM: subject line tweak]
+Signed-off-by: Paul Moore <paul@paul-moore.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ security/security.c |   14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+--- a/security/security.c
++++ b/security/security.c
+@@ -2163,7 +2163,19 @@ EXPORT_SYMBOL(security_inode_setsecctx);
+ int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen)
+ {
+-      return call_int_hook(inode_getsecctx, -EOPNOTSUPP, inode, ctx, ctxlen);
++      struct security_hook_list *hp;
++      int rc;
++
++      /*
++       * Only one module will provide a security context.
++       */
++      hlist_for_each_entry(hp, &security_hook_heads.inode_getsecctx, list) {
++              rc = hp->hook.inode_getsecctx(inode, ctx, ctxlen);
++              if (rc != LSM_RET_DEFAULT(inode_getsecctx))
++                      return rc;
++      }
++
++      return LSM_RET_DEFAULT(inode_getsecctx);
+ }
+ EXPORT_SYMBOL(security_inode_getsecctx);
diff --git a/queue-5.15/media-rc-bpf-attach-detach-requires-write-permission.patch b/queue-5.15/media-rc-bpf-attach-detach-requires-write-permission.patch
new file mode 100644 (file)
index 0000000..172a764
--- /dev/null
@@ -0,0 +1,82 @@
+From 6a9d552483d50953320b9d3b57abdee8d436f23f Mon Sep 17 00:00:00 2001
+From: Sean Young <sean@mess.org>
+Date: Thu, 13 Apr 2023 10:50:32 +0200
+Subject: media: rc: bpf attach/detach requires write permission
+
+From: Sean Young <sean@mess.org>
+
+commit 6a9d552483d50953320b9d3b57abdee8d436f23f upstream.
+
+Note that bpf attach/detach also requires CAP_NET_ADMIN.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Sean Young <sean@mess.org>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/media/rc/bpf-lirc.c     |    6 +++---
+ drivers/media/rc/lirc_dev.c     |    5 ++++-
+ drivers/media/rc/rc-core-priv.h |    2 +-
+ 3 files changed, 8 insertions(+), 5 deletions(-)
+
+--- a/drivers/media/rc/bpf-lirc.c
++++ b/drivers/media/rc/bpf-lirc.c
+@@ -249,7 +249,7 @@ int lirc_prog_attach(const union bpf_att
+       if (attr->attach_flags)
+               return -EINVAL;
+-      rcdev = rc_dev_get_from_fd(attr->target_fd);
++      rcdev = rc_dev_get_from_fd(attr->target_fd, true);
+       if (IS_ERR(rcdev))
+               return PTR_ERR(rcdev);
+@@ -274,7 +274,7 @@ int lirc_prog_detach(const union bpf_att
+       if (IS_ERR(prog))
+               return PTR_ERR(prog);
+-      rcdev = rc_dev_get_from_fd(attr->target_fd);
++      rcdev = rc_dev_get_from_fd(attr->target_fd, true);
+       if (IS_ERR(rcdev)) {
+               bpf_prog_put(prog);
+               return PTR_ERR(rcdev);
+@@ -299,7 +299,7 @@ int lirc_prog_query(const union bpf_attr
+       if (attr->query.query_flags)
+               return -EINVAL;
+-      rcdev = rc_dev_get_from_fd(attr->query.target_fd);
++      rcdev = rc_dev_get_from_fd(attr->query.target_fd, false);
+       if (IS_ERR(rcdev))
+               return PTR_ERR(rcdev);
+--- a/drivers/media/rc/lirc_dev.c
++++ b/drivers/media/rc/lirc_dev.c
+@@ -827,7 +827,7 @@ void __exit lirc_dev_exit(void)
+       unregister_chrdev_region(lirc_base_dev, RC_DEV_MAX);
+ }
+-struct rc_dev *rc_dev_get_from_fd(int fd)
++struct rc_dev *rc_dev_get_from_fd(int fd, bool write)
+ {
+       struct fd f = fdget(fd);
+       struct lirc_fh *fh;
+@@ -841,6 +841,9 @@ struct rc_dev *rc_dev_get_from_fd(int fd
+               return ERR_PTR(-EINVAL);
+       }
++      if (write && !(f.file->f_mode & FMODE_WRITE))
++              return ERR_PTR(-EPERM);
++
+       fh = f.file->private_data;
+       dev = fh->rc;
+--- a/drivers/media/rc/rc-core-priv.h
++++ b/drivers/media/rc/rc-core-priv.h
+@@ -325,7 +325,7 @@ void lirc_raw_event(struct rc_dev *dev,
+ void lirc_scancode_event(struct rc_dev *dev, struct lirc_scancode *lsc);
+ int lirc_register(struct rc_dev *dev);
+ void lirc_unregister(struct rc_dev *dev);
+-struct rc_dev *rc_dev_get_from_fd(int fd);
++struct rc_dev *rc_dev_get_from_fd(int fd, bool write);
+ #else
+ static inline int lirc_dev_init(void) { return 0; }
+ static inline void lirc_dev_exit(void) {}
diff --git a/queue-5.15/misc-fastrpc-mark-all-sessions-as-invalid-in-cb_remove.patch b/queue-5.15/misc-fastrpc-mark-all-sessions-as-invalid-in-cb_remove.patch
new file mode 100644 (file)
index 0000000..6a76085
--- /dev/null
@@ -0,0 +1,36 @@
+From a4e61de63e34860c36a71d1a364edba16fb6203b Mon Sep 17 00:00:00 2001
+From: Ekansh Gupta <quic_ekangupt@quicinc.com>
+Date: Mon, 8 Jan 2024 17:18:33 +0530
+Subject: misc: fastrpc: Mark all sessions as invalid in cb_remove
+
+From: Ekansh Gupta <quic_ekangupt@quicinc.com>
+
+commit a4e61de63e34860c36a71d1a364edba16fb6203b upstream.
+
+In remoteproc shutdown sequence, rpmsg_remove will get called which
+would depopulate all the child nodes that have been created during
+rpmsg_probe. This would result in cb_remove call for all the context
+banks for the remoteproc. In cb_remove function, session 0 is
+getting skipped which is not correct as session 0 will never become
+available again. Add changes to mark session 0 also as invalid.
+
+Fixes: f6f9279f2bf0 ("misc: fastrpc: Add Qualcomm fastrpc basic driver model")
+Cc: stable <stable@kernel.org>
+Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com>
+Link: https://lore.kernel.org/r/20240108114833.20480-1-quic_ekangupt@quicinc.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/misc/fastrpc.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/misc/fastrpc.c
++++ b/drivers/misc/fastrpc.c
+@@ -1594,7 +1594,7 @@ static int fastrpc_cb_remove(struct plat
+       int i;
+       spin_lock_irqsave(&cctx->lock, flags);
+-      for (i = 1; i < FASTRPC_MAX_SESSIONS; i++) {
++      for (i = 0; i < FASTRPC_MAX_SESSIONS; i++) {
+               if (cctx->session[i].sid == sess->sid) {
+                       cctx->session[i].valid = false;
+                       cctx->sesscount--;
diff --git a/queue-5.15/mptcp-fix-data-re-injection-from-stale-subflow.patch b/queue-5.15/mptcp-fix-data-re-injection-from-stale-subflow.patch
new file mode 100644 (file)
index 0000000..98eaceb
--- /dev/null
@@ -0,0 +1,52 @@
+From b6c620dc43ccb4e802894e54b651cf81495e9598 Mon Sep 17 00:00:00 2001
+From: Paolo Abeni <pabeni@redhat.com>
+Date: Wed, 31 Jan 2024 22:49:46 +0100
+Subject: mptcp: fix data re-injection from stale subflow
+
+From: Paolo Abeni <pabeni@redhat.com>
+
+commit b6c620dc43ccb4e802894e54b651cf81495e9598 upstream.
+
+When the MPTCP PM detects that a subflow is stale, all the packet
+scheduler must re-inject all the mptcp-level unacked data. To avoid
+acquiring unneeded locks, it first try to check if any unacked data
+is present at all in the RTX queue, but such check is currently
+broken, as it uses TCP-specific helper on an MPTCP socket.
+
+Funnily enough fuzzers and static checkers are happy, as the accessed
+memory still belongs to the mptcp_sock struct, and even from a
+functional perspective the recovery completed successfully, as
+the short-cut test always failed.
+
+A recent unrelated TCP change - commit d5fed5addb2b ("tcp: reorganize
+tcp_sock fast path variables") - exposed the issue, as the tcp field
+reorganization makes the mptcp code always skip the re-inection.
+
+Fix the issue dropping the bogus call: we are on a slow path, the early
+optimization proved once again to be evil.
+
+Fixes: 1e1d9d6f119c ("mptcp: handle pending data on closed subflow")
+Cc: stable@vger.kernel.org
+Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/468
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Reviewed-by: Mat Martineau <martineau@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Link: https://lore.kernel.org/r/20240131-upstream-net-20240131-mptcp-ci-issues-v1-1-4c1c11e571ff@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/mptcp/protocol.c |    3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/net/mptcp/protocol.c
++++ b/net/mptcp/protocol.c
+@@ -2203,9 +2203,6 @@ bool __mptcp_retransmit_pending_data(str
+       if (__mptcp_check_fallback(mptcp_sk(sk)))
+               return false;
+-      if (tcp_rtx_and_write_queues_empty(sk))
+-              return false;
+-
+       /* the closing socket has some data untransmitted and/or unacked:
+        * some data in the mptcp rtx queue has not really xmitted yet.
+        * keep it simple and re-inject the whole mptcp level rtx queue
diff --git a/queue-5.15/net-hsr-remove-warn_once-in-send_hsr_supervision_frame.patch b/queue-5.15/net-hsr-remove-warn_once-in-send_hsr_supervision_frame.patch
new file mode 100644 (file)
index 0000000..6b996d8
--- /dev/null
@@ -0,0 +1,72 @@
+From 37e8c97e539015637cb920d3e6f1e404f707a06e Mon Sep 17 00:00:00 2001
+From: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
+Date: Wed, 24 Jan 2024 02:21:47 -0800
+Subject: net: hsr: remove WARN_ONCE() in send_hsr_supervision_frame()
+
+From: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
+
+commit 37e8c97e539015637cb920d3e6f1e404f707a06e upstream.
+
+Syzkaller reported [1] hitting a warning after failing to allocate
+resources for skb in hsr_init_skb(). Since a WARN_ONCE() call will
+not help much in this case, it might be prudent to switch to
+netdev_warn_once(). At the very least it will suppress syzkaller
+reports such as [1].
+
+Just in case, use netdev_warn_once() in send_prp_supervision_frame()
+for similar reasons.
+
+[1]
+HSR: Could not send supervision frame
+WARNING: CPU: 1 PID: 85 at net/hsr/hsr_device.c:294 send_hsr_supervision_frame+0x60a/0x810 net/hsr/hsr_device.c:294
+RIP: 0010:send_hsr_supervision_frame+0x60a/0x810 net/hsr/hsr_device.c:294
+...
+Call Trace:
+ <IRQ>
+ hsr_announce+0x114/0x370 net/hsr/hsr_device.c:382
+ call_timer_fn+0x193/0x590 kernel/time/timer.c:1700
+ expire_timers kernel/time/timer.c:1751 [inline]
+ __run_timers+0x764/0xb20 kernel/time/timer.c:2022
+ run_timer_softirq+0x58/0xd0 kernel/time/timer.c:2035
+ __do_softirq+0x21a/0x8de kernel/softirq.c:553
+ invoke_softirq kernel/softirq.c:427 [inline]
+ __irq_exit_rcu kernel/softirq.c:632 [inline]
+ irq_exit_rcu+0xb7/0x120 kernel/softirq.c:644
+ sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1076
+ </IRQ>
+ <TASK>
+ asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649
+...
+
+This issue is also found in older kernels (at least up to 5.10).
+
+Cc: stable@vger.kernel.org
+Reported-by: syzbot+3ae0a3f42c84074b7c8e@syzkaller.appspotmail.com
+Fixes: 121c33b07b31 ("net: hsr: introduce common code for skb initialization")
+Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/hsr/hsr_device.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/hsr/hsr_device.c
++++ b/net/hsr/hsr_device.c
+@@ -291,7 +291,7 @@ static void send_hsr_supervision_frame(s
+       skb = hsr_init_skb(master);
+       if (!skb) {
+-              WARN_ONCE(1, "HSR: Could not send supervision frame\n");
++              netdev_warn_once(master->dev, "HSR: Could not send supervision frame\n");
+               return;
+       }
+@@ -338,7 +338,7 @@ static void send_prp_supervision_frame(s
+       skb = hsr_init_skb(master);
+       if (!skb) {
+-              WARN_ONCE(1, "PRP: Could not send supervision frame\n");
++              netdev_warn_once(master->dev, "PRP: Could not send supervision frame\n");
+               return;
+       }
diff --git a/queue-5.15/nfc-nci-free-rx_data_reassembly-skb-on-nci-device-cleanup.patch b/queue-5.15/nfc-nci-free-rx_data_reassembly-skb-on-nci-device-cleanup.patch
new file mode 100644 (file)
index 0000000..c4223cb
--- /dev/null
@@ -0,0 +1,45 @@
+From bfb007aebe6bff451f7f3a4be19f4f286d0d5d9c Mon Sep 17 00:00:00 2001
+From: Fedor Pchelkin <pchelkin@ispras.ru>
+Date: Thu, 25 Jan 2024 12:53:09 +0300
+Subject: nfc: nci: free rx_data_reassembly skb on NCI device cleanup
+
+From: Fedor Pchelkin <pchelkin@ispras.ru>
+
+commit bfb007aebe6bff451f7f3a4be19f4f286d0d5d9c upstream.
+
+rx_data_reassembly skb is stored during NCI data exchange for processing
+fragmented packets. It is dropped only when the last fragment is processed
+or when an NTF packet with NCI_OP_RF_DEACTIVATE_NTF opcode is received.
+However, the NCI device may be deallocated before that which leads to skb
+leak.
+
+As by design the rx_data_reassembly skb is bound to the NCI device and
+nothing prevents the device to be freed before the skb is processed in
+some way and cleaned, free it on the NCI device cleanup.
+
+Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
+
+Fixes: 6a2968aaf50c ("NFC: basic NCI protocol implementation")
+Cc: stable@vger.kernel.org
+Reported-by: syzbot+6b7c68d9c21e4ee4251b@syzkaller.appspotmail.com
+Closes: https://lore.kernel.org/lkml/000000000000f43987060043da7b@google.com/
+Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/nfc/nci/core.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/net/nfc/nci/core.c
++++ b/net/nfc/nci/core.c
+@@ -1211,6 +1211,10 @@ void nci_free_device(struct nci_dev *nde
+ {
+       nfc_free_device(ndev->nfc_dev);
+       nci_hci_deallocate(ndev);
++
++      /* drop partial rx data packet if present */
++      if (ndev->rx_data_reassembly)
++              kfree_skb(ndev->rx_data_reassembly);
+       kfree(ndev);
+ }
+ EXPORT_SYMBOL(nci_free_device);
diff --git a/queue-5.15/revert-drm-amd-flush-any-delayed-gfxoff-on-suspend-entry.patch b/queue-5.15/revert-drm-amd-flush-any-delayed-gfxoff-on-suspend-entry.patch
new file mode 100644 (file)
index 0000000..45b3c3c
--- /dev/null
@@ -0,0 +1,58 @@
+From 916361685319098f696b798ef1560f69ed96e934 Mon Sep 17 00:00:00 2001
+From: Mario Limonciello <mario.limonciello@amd.com>
+Date: Wed, 7 Feb 2024 23:52:54 -0600
+Subject: Revert "drm/amd: flush any delayed gfxoff on suspend entry"
+
+From: Mario Limonciello <mario.limonciello@amd.com>
+
+commit 916361685319098f696b798ef1560f69ed96e934 upstream.
+
+commit ab4750332dbe ("drm/amdgpu/sdma5.2: add begin/end_use ring
+callbacks") caused GFXOFF control to be used more heavily and the
+codepath that was removed from commit 0dee72639533 ("drm/amd: flush any
+delayed gfxoff on suspend entry") now can be exercised at suspend again.
+
+Users report that by using GNOME to suspend the lockscreen trigger will
+cause SDMA traffic and the system can deadlock.
+
+This reverts commit 0dee726395333fea833eaaf838bc80962df886c8.
+
+Acked-by: Alex Deucher <alexander.deucher@amd.com>
+Fixes: ab4750332dbe ("drm/amdgpu/sdma5.2: add begin/end_use ring callbacks")
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |    1 -
+ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c    |    9 ++++++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+@@ -4089,7 +4089,6 @@ int amdgpu_device_suspend(struct drm_dev
+               amdgpu_fbdev_set_suspend(adev, 1);
+       cancel_delayed_work_sync(&adev->delayed_init_work);
+-      flush_delayed_work(&adev->gfx.gfx_off_delay_work);
+       amdgpu_ras_suspend(adev);
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+@@ -579,8 +579,15 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_d
+               if (adev->gfx.gfx_off_req_count == 0 &&
+                   !adev->gfx.gfx_off_state) {
+-                      schedule_delayed_work(&adev->gfx.gfx_off_delay_work,
++                      /* If going to s2idle, no need to wait */
++                      if (adev->in_s0ix) {
++                              if (!amdgpu_dpm_set_powergating_by_smu(adev,
++                                              AMD_IP_BLOCK_TYPE_GFX, true))
++                                      adev->gfx.gfx_off_state = true;
++                      } else {
++                              schedule_delayed_work(&adev->gfx.gfx_off_delay_work,
+                                             delay);
++                      }
+               }
+       } else {
+               if (adev->gfx.gfx_off_req_count == 0) {
diff --git a/queue-5.15/scsi-revert-scsi-fcoe-fix-potential-deadlock-on-fip-ctlr_lock.patch b/queue-5.15/scsi-revert-scsi-fcoe-fix-potential-deadlock-on-fip-ctlr_lock.patch
new file mode 100644 (file)
index 0000000..deeecdd
--- /dev/null
@@ -0,0 +1,113 @@
+From 977fe773dcc7098d8eaf4ee6382cb51e13e784cb Mon Sep 17 00:00:00 2001
+From: Lee Duncan <lduncan@suse.com>
+Date: Fri, 9 Feb 2024 10:07:34 -0800
+Subject: scsi: Revert "scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock"
+
+From: Lee Duncan <lduncan@suse.com>
+
+commit 977fe773dcc7098d8eaf4ee6382cb51e13e784cb upstream.
+
+This reverts commit 1a1975551943f681772720f639ff42fbaa746212.
+
+This commit causes interrupts to be lost for FCoE devices, since it changed
+sping locks from "bh" to "irqsave".
+
+Instead, a work queue should be used, and will be addressed in a separate
+commit.
+
+Fixes: 1a1975551943 ("scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock")
+Signed-off-by: Lee Duncan <lduncan@suse.com>
+Link: https://lore.kernel.org/r/c578cdcd46b60470535c4c4a953e6a1feca0dffd.1707500786.git.lduncan@suse.com
+Reviewed-by: Hannes Reinecke <hare@suse.de>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/fcoe/fcoe_ctlr.c |   20 ++++++++------------
+ 1 file changed, 8 insertions(+), 12 deletions(-)
+
+--- a/drivers/scsi/fcoe/fcoe_ctlr.c
++++ b/drivers/scsi/fcoe/fcoe_ctlr.c
+@@ -319,17 +319,16 @@ static void fcoe_ctlr_announce(struct fc
+ {
+       struct fcoe_fcf *sel;
+       struct fcoe_fcf *fcf;
+-      unsigned long flags;
+       mutex_lock(&fip->ctlr_mutex);
+-      spin_lock_irqsave(&fip->ctlr_lock, flags);
++      spin_lock_bh(&fip->ctlr_lock);
+       kfree_skb(fip->flogi_req);
+       fip->flogi_req = NULL;
+       list_for_each_entry(fcf, &fip->fcfs, list)
+               fcf->flogi_sent = 0;
+-      spin_unlock_irqrestore(&fip->ctlr_lock, flags);
++      spin_unlock_bh(&fip->ctlr_lock);
+       sel = fip->sel_fcf;
+       if (sel && ether_addr_equal(sel->fcf_mac, fip->dest_addr))
+@@ -700,7 +699,6 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr
+ {
+       struct fc_frame *fp;
+       struct fc_frame_header *fh;
+-      unsigned long flags;
+       u16 old_xid;
+       u8 op;
+       u8 mac[ETH_ALEN];
+@@ -734,11 +732,11 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr
+               op = FIP_DT_FLOGI;
+               if (fip->mode == FIP_MODE_VN2VN)
+                       break;
+-              spin_lock_irqsave(&fip->ctlr_lock, flags);
++              spin_lock_bh(&fip->ctlr_lock);
+               kfree_skb(fip->flogi_req);
+               fip->flogi_req = skb;
+               fip->flogi_req_send = 1;
+-              spin_unlock_irqrestore(&fip->ctlr_lock, flags);
++              spin_unlock_bh(&fip->ctlr_lock);
+               schedule_work(&fip->timer_work);
+               return -EINPROGRESS;
+       case ELS_FDISC:
+@@ -1715,11 +1713,10 @@ static int fcoe_ctlr_flogi_send_locked(s
+ static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *fip)
+ {
+       struct fcoe_fcf *fcf;
+-      unsigned long flags;
+       int error;
+       mutex_lock(&fip->ctlr_mutex);
+-      spin_lock_irqsave(&fip->ctlr_lock, flags);
++      spin_lock_bh(&fip->ctlr_lock);
+       LIBFCOE_FIP_DBG(fip, "re-sending FLOGI - reselect\n");
+       fcf = fcoe_ctlr_select(fip);
+       if (!fcf || fcf->flogi_sent) {
+@@ -1730,7 +1727,7 @@ static int fcoe_ctlr_flogi_retry(struct
+               fcoe_ctlr_solicit(fip, NULL);
+               error = fcoe_ctlr_flogi_send_locked(fip);
+       }
+-      spin_unlock_irqrestore(&fip->ctlr_lock, flags);
++      spin_unlock_bh(&fip->ctlr_lock);
+       mutex_unlock(&fip->ctlr_mutex);
+       return error;
+ }
+@@ -1747,9 +1744,8 @@ static int fcoe_ctlr_flogi_retry(struct
+ static void fcoe_ctlr_flogi_send(struct fcoe_ctlr *fip)
+ {
+       struct fcoe_fcf *fcf;
+-      unsigned long flags;
+-      spin_lock_irqsave(&fip->ctlr_lock, flags);
++      spin_lock_bh(&fip->ctlr_lock);
+       fcf = fip->sel_fcf;
+       if (!fcf || !fip->flogi_req_send)
+               goto unlock;
+@@ -1776,7 +1772,7 @@ static void fcoe_ctlr_flogi_send(struct
+       } else /* XXX */
+               LIBFCOE_FIP_DBG(fip, "No FCF selected - defer send\n");
+ unlock:
+-      spin_unlock_irqrestore(&fip->ctlr_lock, flags);
++      spin_unlock_bh(&fip->ctlr_lock);
+ }
+ /**
index 2b8a6d388feadf6b6a4a34ff1a7639c18d5fa11f..308d34793aafb9096b7b0cdd401873451d77c9c9 100644 (file)
@@ -382,3 +382,25 @@ powerpc-kasan-fix-addr-error-caused-by-page-alignmen.patch
 i2c-i801-remove-i801_set_block_buffer_mode.patch
 i2c-i801-fix-block-process-call-transactions.patch
 modpost-trim-leading-spaces-when-processing-source-f.patch
+mptcp-fix-data-re-injection-from-stale-subflow.patch
+scsi-revert-scsi-fcoe-fix-potential-deadlock-on-fip-ctlr_lock.patch
+revert-drm-amd-flush-any-delayed-gfxoff-on-suspend-entry.patch
+lsm-fix-the-logic-in-security_inode_getsecctx.patch
+firewire-core-correct-documentation-of-fw_csr_string-kernel-api.patch
+kbuild-fix-changing-elf-file-type-for-output-of-gen_btf-for-big-endian.patch
+nfc-nci-free-rx_data_reassembly-skb-on-nci-device-cleanup.patch
+net-hsr-remove-warn_once-in-send_hsr_supervision_frame.patch
+xen-netback-properly-sync-tx-responses.patch
+um-fix-adding-no-pie-for-clang.patch
+alsa-hda-realtek-enable-headset-mic-on-vaio-vjfe-adl.patch
+asoc-codecs-wcd938x-handle-deferred-probe.patch
+alsa-hda-cs8409-suppress-vmaster-control-for-dolphin-models.patch
+binder-signal-epoll-threads-of-self-work.patch
+misc-fastrpc-mark-all-sessions-as-invalid-in-cb_remove.patch
+ext4-fix-double-free-of-blocks-due-to-wrong-extents-moved_len.patch
+tracing-fix-wasted-memory-in-saved_cmdlines-logic.patch
+staging-iio-ad5933-fix-type-mismatch-regression.patch
+iio-magnetometer-rm3100-add-boundary-check-for-the-value-read-from-rm3100_reg_tmrc.patch
+iio-core-fix-memleak-in-iio_device_register_sysfs.patch
+iio-accel-bma400-fix-a-compilation-problem.patch
+media-rc-bpf-attach-detach-requires-write-permission.patch
diff --git a/queue-5.15/staging-iio-ad5933-fix-type-mismatch-regression.patch b/queue-5.15/staging-iio-ad5933-fix-type-mismatch-regression.patch
new file mode 100644 (file)
index 0000000..f678db9
--- /dev/null
@@ -0,0 +1,42 @@
+From 6db053cd949fcd6254cea9f2cd5d39f7bd64379c Mon Sep 17 00:00:00 2001
+From: David Schiller <david.schiller@jku.at>
+Date: Mon, 22 Jan 2024 14:49:17 +0100
+Subject: staging: iio: ad5933: fix type mismatch regression
+
+From: David Schiller <david.schiller@jku.at>
+
+commit 6db053cd949fcd6254cea9f2cd5d39f7bd64379c upstream.
+
+Commit 4c3577db3e4f ("Staging: iio: impedance-analyzer: Fix sparse
+warning") fixed a compiler warning, but introduced a bug that resulted
+in one of the two 16 bit IIO channels always being zero (when both are
+enabled).
+
+This is because int is 32 bits wide on most architectures and in the
+case of a little-endian machine the two most significant bytes would
+occupy the buffer for the second channel as 'val' is being passed as a
+void pointer to 'iio_push_to_buffers()'.
+
+Fix by defining 'val' as u16. Tested working on ARM64.
+
+Fixes: 4c3577db3e4f ("Staging: iio: impedance-analyzer: Fix sparse warning")
+Signed-off-by: David Schiller <david.schiller@jku.at>
+Link: https://lore.kernel.org/r/20240122134916.2137957-1-david.schiller@jku.at
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/staging/iio/impedance-analyzer/ad5933.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
++++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
+@@ -608,7 +608,7 @@ static void ad5933_work(struct work_stru
+               struct ad5933_state, work.work);
+       struct iio_dev *indio_dev = i2c_get_clientdata(st->client);
+       __be16 buf[2];
+-      int val[2];
++      u16 val[2];
+       unsigned char status;
+       int ret;
diff --git a/queue-5.15/tracing-fix-wasted-memory-in-saved_cmdlines-logic.patch b/queue-5.15/tracing-fix-wasted-memory-in-saved_cmdlines-logic.patch
new file mode 100644 (file)
index 0000000..5f3f707
--- /dev/null
@@ -0,0 +1,181 @@
+From 44dc5c41b5b1267d4dd037d26afc0c4d3a568acb Mon Sep 17 00:00:00 2001
+From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
+Date: Fri, 9 Feb 2024 06:36:22 -0500
+Subject: tracing: Fix wasted memory in saved_cmdlines logic
+
+From: Steven Rostedt (Google) <rostedt@goodmis.org>
+
+commit 44dc5c41b5b1267d4dd037d26afc0c4d3a568acb upstream.
+
+While looking at improving the saved_cmdlines cache I found a huge amount
+of wasted memory that should be used for the cmdlines.
+
+The tracing data saves pids during the trace. At sched switch, if a trace
+occurred, it will save the comm of the task that did the trace. This is
+saved in a "cache" that maps pids to comms and exposed to user space via
+the /sys/kernel/tracing/saved_cmdlines file. Currently it only caches by
+default 128 comms.
+
+The structure that uses this creates an array to store the pids using
+PID_MAX_DEFAULT (which is usually set to 32768). This causes the structure
+to be of the size of 131104 bytes on 64 bit machines.
+
+In hex: 131104 = 0x20020, and since the kernel allocates generic memory in
+powers of two, the kernel would allocate 0x40000 or 262144 bytes to store
+this structure. That leaves 131040 bytes of wasted space.
+
+Worse, the structure points to an allocated array to store the comm names,
+which is 16 bytes times the amount of names to save (currently 128), which
+is 2048 bytes. Instead of allocating a separate array, make the structure
+end with a variable length string and use the extra space for that.
+
+This is similar to a recommendation that Linus had made about eventfs_inode names:
+
+  https://lore.kernel.org/all/20240130190355.11486-5-torvalds@linux-foundation.org/
+
+Instead of allocating a separate string array to hold the saved comms,
+have the structure end with: char saved_cmdlines[]; and round up to the
+next power of two over sizeof(struct saved_cmdline_buffers) + num_cmdlines * TASK_COMM_LEN
+It will use this extra space for the saved_cmdline portion.
+
+Now, instead of saving only 128 comms by default, by using this wasted
+space at the end of the structure it can save over 8000 comms and even
+saves space by removing the need for allocating the other array.
+
+Link: https://lore.kernel.org/linux-trace-kernel/20240209063622.1f7b6d5f@rorschach.local.home
+
+Cc: stable@vger.kernel.org
+Cc: Masami Hiramatsu <mhiramat@kernel.org>
+Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+Cc: Vincent Donnefort <vdonnefort@google.com>
+Cc: Sven Schnelle <svens@linux.ibm.com>
+Cc: Mete Durlu <meted@linux.ibm.com>
+Fixes: 939c7a4f04fcd ("tracing: Introduce saved_cmdlines_size file")
+Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/trace/trace.c |   75 +++++++++++++++++++++++++--------------------------
+ 1 file changed, 37 insertions(+), 38 deletions(-)
+
+--- a/kernel/trace/trace.c
++++ b/kernel/trace/trace.c
+@@ -2236,7 +2236,7 @@ struct saved_cmdlines_buffer {
+       unsigned *map_cmdline_to_pid;
+       unsigned cmdline_num;
+       int cmdline_idx;
+-      char *saved_cmdlines;
++      char saved_cmdlines[];
+ };
+ static struct saved_cmdlines_buffer *savedcmd;
+@@ -2250,47 +2250,58 @@ static inline void set_cmdline(int idx,
+       strncpy(get_saved_cmdlines(idx), cmdline, TASK_COMM_LEN);
+ }
+-static int allocate_cmdlines_buffer(unsigned int val,
+-                                  struct saved_cmdlines_buffer *s)
++static void free_saved_cmdlines_buffer(struct saved_cmdlines_buffer *s)
+ {
++      int order = get_order(sizeof(*s) + s->cmdline_num * TASK_COMM_LEN);
++
++      kfree(s->map_cmdline_to_pid);
++      free_pages((unsigned long)s, order);
++}
++
++static struct saved_cmdlines_buffer *allocate_cmdlines_buffer(unsigned int val)
++{
++      struct saved_cmdlines_buffer *s;
++      struct page *page;
++      int orig_size, size;
++      int order;
++
++      /* Figure out how much is needed to hold the given number of cmdlines */
++      orig_size = sizeof(*s) + val * TASK_COMM_LEN;
++      order = get_order(orig_size);
++      size = 1 << (order + PAGE_SHIFT);
++      page = alloc_pages(GFP_KERNEL, order);
++      if (!page)
++              return NULL;
++
++      s = page_address(page);
++      memset(s, 0, sizeof(*s));
++
++      /* Round up to actual allocation */
++      val = (size - sizeof(*s)) / TASK_COMM_LEN;
++      s->cmdline_num = val;
++
+       s->map_cmdline_to_pid = kmalloc_array(val,
+                                             sizeof(*s->map_cmdline_to_pid),
+                                             GFP_KERNEL);
+-      if (!s->map_cmdline_to_pid)
+-              return -ENOMEM;
+-
+-      s->saved_cmdlines = kmalloc_array(TASK_COMM_LEN, val, GFP_KERNEL);
+-      if (!s->saved_cmdlines) {
+-              kfree(s->map_cmdline_to_pid);
+-              return -ENOMEM;
++      if (!s->map_cmdline_to_pid) {
++              free_saved_cmdlines_buffer(s);
++              return NULL;
+       }
+       s->cmdline_idx = 0;
+-      s->cmdline_num = val;
+       memset(&s->map_pid_to_cmdline, NO_CMDLINE_MAP,
+              sizeof(s->map_pid_to_cmdline));
+       memset(s->map_cmdline_to_pid, NO_CMDLINE_MAP,
+              val * sizeof(*s->map_cmdline_to_pid));
+-      return 0;
++      return s;
+ }
+ static int trace_create_savedcmd(void)
+ {
+-      int ret;
+-
+-      savedcmd = kmalloc(sizeof(*savedcmd), GFP_KERNEL);
+-      if (!savedcmd)
+-              return -ENOMEM;
++      savedcmd = allocate_cmdlines_buffer(SAVED_CMDLINES_DEFAULT);
+-      ret = allocate_cmdlines_buffer(SAVED_CMDLINES_DEFAULT, savedcmd);
+-      if (ret < 0) {
+-              kfree(savedcmd);
+-              savedcmd = NULL;
+-              return -ENOMEM;
+-      }
+-
+-      return 0;
++      return savedcmd ? 0 : -ENOMEM;
+ }
+ int is_tracing_stopped(void)
+@@ -5947,26 +5958,14 @@ tracing_saved_cmdlines_size_read(struct
+       return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
+ }
+-static void free_saved_cmdlines_buffer(struct saved_cmdlines_buffer *s)
+-{
+-      kfree(s->saved_cmdlines);
+-      kfree(s->map_cmdline_to_pid);
+-      kfree(s);
+-}
+-
+ static int tracing_resize_saved_cmdlines(unsigned int val)
+ {
+       struct saved_cmdlines_buffer *s, *savedcmd_temp;
+-      s = kmalloc(sizeof(*s), GFP_KERNEL);
++      s = allocate_cmdlines_buffer(val);
+       if (!s)
+               return -ENOMEM;
+-      if (allocate_cmdlines_buffer(val, s) < 0) {
+-              kfree(s);
+-              return -ENOMEM;
+-      }
+-
+       preempt_disable();
+       arch_spin_lock(&trace_cmdline_lock);
+       savedcmd_temp = savedcmd;
diff --git a/queue-5.15/um-fix-adding-no-pie-for-clang.patch b/queue-5.15/um-fix-adding-no-pie-for-clang.patch
new file mode 100644 (file)
index 0000000..b8ca0fa
--- /dev/null
@@ -0,0 +1,63 @@
+From 846cfbeed09b45d985079a9173cf390cc053715b Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Tue, 23 Jan 2024 15:59:54 -0700
+Subject: um: Fix adding '-no-pie' for clang
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+commit 846cfbeed09b45d985079a9173cf390cc053715b upstream.
+
+The kernel builds with -fno-PIE, so commit 883354afbc10 ("um: link
+vmlinux with -no-pie") added the compiler linker flag '-no-pie' via
+cc-option because '-no-pie' was only supported in GCC 6.1.0 and newer.
+
+While this works for GCC, this does not work for clang because cc-option
+uses '-c', which stops the pipeline right before linking, so '-no-pie'
+is unconsumed and clang warns, causing cc-option to fail just as it
+would if the option was entirely unsupported:
+
+  $ clang -Werror -no-pie -c -o /dev/null -x c /dev/null
+  clang-16: error: argument unused during compilation: '-no-pie' [-Werror,-Wunused-command-line-argument]
+
+A recent version of clang exposes this because it generates a relocation
+under '-mcmodel=large' that is not supported in PIE mode:
+
+  /usr/sbin/ld: init/main.o: relocation R_X86_64_32 against symbol `saved_command_line' can not be used when making a PIE object; recompile with -fPIE
+  /usr/sbin/ld: failed to set dynamic section sizes: bad value
+  clang: error: linker command failed with exit code 1 (use -v to see invocation)
+
+Remove the cc-option check altogether. It is wasteful to invoke the
+compiler to check for '-no-pie' because only one supported compiler
+version does not support it, GCC 5.x (as it is supported with the
+minimum version of clang and GCC 6.1.0+). Use a combination of the
+gcc-min-version macro and CONFIG_CC_IS_CLANG to unconditionally add
+'-no-pie' with CONFIG_LD_SCRIPT_DYN=y, so that it is enabled with all
+compilers that support this. Furthermore, using gcc-min-version can help
+turn this back into
+
+  LINK-$(CONFIG_LD_SCRIPT_DYN) += -no-pie
+
+when the minimum version of GCC is bumped past 6.1.0.
+
+Cc: stable@vger.kernel.org
+Closes: https://github.com/ClangBuiltLinux/linux/issues/1982
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/um/Makefile |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/arch/um/Makefile
++++ b/arch/um/Makefile
+@@ -118,7 +118,9 @@ archprepare:
+       $(Q)$(MAKE) $(build)=$(HOST_DIR)/um include/generated/user_constants.h
+ LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
+-LINK-$(CONFIG_LD_SCRIPT_DYN) += $(call cc-option, -no-pie)
++ifdef CONFIG_LD_SCRIPT_DYN
++LINK-$(call gcc-min-version, 60100)$(CONFIG_CC_IS_CLANG) += -no-pie
++endif
+ LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib
+ CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \
diff --git a/queue-5.15/xen-netback-properly-sync-tx-responses.patch b/queue-5.15/xen-netback-properly-sync-tx-responses.patch
new file mode 100644 (file)
index 0000000..c8104a5
--- /dev/null
@@ -0,0 +1,205 @@
+From 7b55984c96ffe9e236eb9c82a2196e0b1f84990d Mon Sep 17 00:00:00 2001
+From: Jan Beulich <jbeulich@suse.com>
+Date: Mon, 29 Jan 2024 14:03:08 +0100
+Subject: xen-netback: properly sync TX responses
+
+From: Jan Beulich <jbeulich@suse.com>
+
+commit 7b55984c96ffe9e236eb9c82a2196e0b1f84990d upstream.
+
+Invoking the make_tx_response() / push_tx_responses() pair with no lock
+held would be acceptable only if all such invocations happened from the
+same context (NAPI instance or dealloc thread). Since this isn't the
+case, and since the interface "spec" also doesn't demand that multicast
+operations may only be performed with no in-flight transmits,
+MCAST_{ADD,DEL} processing also needs to acquire the response lock
+around the invocations.
+
+To prevent similar mistakes going forward, "downgrade" the present
+functions to private helpers of just the two remaining ones using them
+directly, with no forward declarations anymore. This involves renaming
+what so far was make_tx_response(), for the new function of that name
+to serve the new (wrapper) purpose.
+
+While there,
+- constify the txp parameters,
+- correct xenvif_idx_release()'s status parameter's type,
+- rename {,_}make_tx_response()'s status parameters for consistency with
+  xenvif_idx_release()'s.
+
+Fixes: 210c34dcd8d9 ("xen-netback: add support for multicast control")
+Cc: stable@vger.kernel.org
+Signed-off-by: Jan Beulich <jbeulich@suse.com>
+Reviewed-by: Paul Durrant <paul@xen.org>
+Link: https://lore.kernel.org/r/980c6c3d-e10e-4459-8565-e8fbde122f00@suse.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/xen-netback/netback.c |   84 ++++++++++++++++++--------------------
+ 1 file changed, 40 insertions(+), 44 deletions(-)
+
+--- a/drivers/net/xen-netback/netback.c
++++ b/drivers/net/xen-netback/netback.c
+@@ -104,13 +104,12 @@ bool provides_xdp_headroom = true;
+ module_param(provides_xdp_headroom, bool, 0644);
+ static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx,
+-                             u8 status);
++                             s8 status);
+ static void make_tx_response(struct xenvif_queue *queue,
+-                           struct xen_netif_tx_request *txp,
++                           const struct xen_netif_tx_request *txp,
+                            unsigned int extra_count,
+-                           s8       st);
+-static void push_tx_responses(struct xenvif_queue *queue);
++                           s8 status);
+ static void xenvif_idx_unmap(struct xenvif_queue *queue, u16 pending_idx);
+@@ -208,13 +207,9 @@ static void xenvif_tx_err(struct xenvif_
+                         unsigned int extra_count, RING_IDX end)
+ {
+       RING_IDX cons = queue->tx.req_cons;
+-      unsigned long flags;
+       do {
+-              spin_lock_irqsave(&queue->response_lock, flags);
+               make_tx_response(queue, txp, extra_count, XEN_NETIF_RSP_ERROR);
+-              push_tx_responses(queue);
+-              spin_unlock_irqrestore(&queue->response_lock, flags);
+               if (cons == end)
+                       break;
+               RING_COPY_REQUEST(&queue->tx, cons++, txp);
+@@ -465,12 +460,7 @@ static void xenvif_get_requests(struct x
+       for (shinfo->nr_frags = 0; nr_slots > 0 && shinfo->nr_frags < MAX_SKB_FRAGS;
+            nr_slots--) {
+               if (unlikely(!txp->size)) {
+-                      unsigned long flags;
+-
+-                      spin_lock_irqsave(&queue->response_lock, flags);
+                       make_tx_response(queue, txp, 0, XEN_NETIF_RSP_OKAY);
+-                      push_tx_responses(queue);
+-                      spin_unlock_irqrestore(&queue->response_lock, flags);
+                       ++txp;
+                       continue;
+               }
+@@ -496,14 +486,8 @@ static void xenvif_get_requests(struct x
+               for (shinfo->nr_frags = 0; shinfo->nr_frags < nr_slots; ++txp) {
+                       if (unlikely(!txp->size)) {
+-                              unsigned long flags;
+-
+-                              spin_lock_irqsave(&queue->response_lock, flags);
+                               make_tx_response(queue, txp, 0,
+                                                XEN_NETIF_RSP_OKAY);
+-                              push_tx_responses(queue);
+-                              spin_unlock_irqrestore(&queue->response_lock,
+-                                                     flags);
+                               continue;
+                       }
+@@ -997,7 +981,6 @@ static void xenvif_tx_build_gops(struct
+                                        (ret == 0) ?
+                                        XEN_NETIF_RSP_OKAY :
+                                        XEN_NETIF_RSP_ERROR);
+-                      push_tx_responses(queue);
+                       continue;
+               }
+@@ -1009,7 +992,6 @@ static void xenvif_tx_build_gops(struct
+                       make_tx_response(queue, &txreq, extra_count,
+                                        XEN_NETIF_RSP_OKAY);
+-                      push_tx_responses(queue);
+                       continue;
+               }
+@@ -1445,8 +1427,35 @@ int xenvif_tx_action(struct xenvif_queue
+       return work_done;
+ }
++static void _make_tx_response(struct xenvif_queue *queue,
++                           const struct xen_netif_tx_request *txp,
++                           unsigned int extra_count,
++                           s8 status)
++{
++      RING_IDX i = queue->tx.rsp_prod_pvt;
++      struct xen_netif_tx_response *resp;
++
++      resp = RING_GET_RESPONSE(&queue->tx, i);
++      resp->id     = txp->id;
++      resp->status = status;
++
++      while (extra_count-- != 0)
++              RING_GET_RESPONSE(&queue->tx, ++i)->status = XEN_NETIF_RSP_NULL;
++
++      queue->tx.rsp_prod_pvt = ++i;
++}
++
++static void push_tx_responses(struct xenvif_queue *queue)
++{
++      int notify;
++
++      RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&queue->tx, notify);
++      if (notify)
++              notify_remote_via_irq(queue->tx_irq);
++}
++
+ static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx,
+-                             u8 status)
++                             s8 status)
+ {
+       struct pending_tx_info *pending_tx_info;
+       pending_ring_idx_t index;
+@@ -1456,8 +1465,8 @@ static void xenvif_idx_release(struct xe
+       spin_lock_irqsave(&queue->response_lock, flags);
+-      make_tx_response(queue, &pending_tx_info->req,
+-                       pending_tx_info->extra_count, status);
++      _make_tx_response(queue, &pending_tx_info->req,
++                        pending_tx_info->extra_count, status);
+       /* Release the pending index before pusing the Tx response so
+        * its available before a new Tx request is pushed by the
+@@ -1471,32 +1480,19 @@ static void xenvif_idx_release(struct xe
+       spin_unlock_irqrestore(&queue->response_lock, flags);
+ }
+-
+ static void make_tx_response(struct xenvif_queue *queue,
+-                           struct xen_netif_tx_request *txp,
++                           const struct xen_netif_tx_request *txp,
+                            unsigned int extra_count,
+-                           s8       st)
++                           s8 status)
+ {
+-      RING_IDX i = queue->tx.rsp_prod_pvt;
+-      struct xen_netif_tx_response *resp;
+-
+-      resp = RING_GET_RESPONSE(&queue->tx, i);
+-      resp->id     = txp->id;
+-      resp->status = st;
+-
+-      while (extra_count-- != 0)
+-              RING_GET_RESPONSE(&queue->tx, ++i)->status = XEN_NETIF_RSP_NULL;
++      unsigned long flags;
+-      queue->tx.rsp_prod_pvt = ++i;
+-}
++      spin_lock_irqsave(&queue->response_lock, flags);
+-static void push_tx_responses(struct xenvif_queue *queue)
+-{
+-      int notify;
++      _make_tx_response(queue, txp, extra_count, status);
++      push_tx_responses(queue);
+-      RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&queue->tx, notify);
+-      if (notify)
+-              notify_remote_via_irq(queue->tx_irq);
++      spin_unlock_irqrestore(&queue->response_lock, flags);
+ }
+ static void xenvif_idx_unmap(struct xenvif_queue *queue, u16 pending_idx)