]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Aug 2024 13:19:49 +0000 (15:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Aug 2024 13:19:49 +0000 (15:19 +0200)
added patches:
alsa-timer-relax-start-tick-time-check-for-slave-timer-elements.patch
bluetooth-hci_ldisc-check-hci_uart_proto_ready-flag-in-hciuartgetproto.patch
revert-s390-dasd-establish-dma-alignment.patch

queue-5.4/alsa-timer-relax-start-tick-time-check-for-slave-timer-elements.patch [new file with mode: 0644]
queue-5.4/bluetooth-hci_ldisc-check-hci_uart_proto_ready-flag-in-hciuartgetproto.patch [new file with mode: 0644]
queue-5.4/revert-s390-dasd-establish-dma-alignment.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/alsa-timer-relax-start-tick-time-check-for-slave-timer-elements.patch b/queue-5.4/alsa-timer-relax-start-tick-time-check-for-slave-timer-elements.patch
new file mode 100644 (file)
index 0000000..aec7baa
--- /dev/null
@@ -0,0 +1,38 @@
+From ccbfcac05866ebe6eb3bc6d07b51d4ed4fcde436 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Sat, 10 Aug 2024 10:48:32 +0200
+Subject: ALSA: timer: Relax start tick time check for slave timer elements
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit ccbfcac05866ebe6eb3bc6d07b51d4ed4fcde436 upstream.
+
+The recent addition of a sanity check for a too low start tick time
+seems breaking some applications that uses aloop with a certain slave
+timer setup.  They may have the initial resolution 0, hence it's
+treated as if it were a too low value.
+
+Relax and skip the check for the slave timer instance for addressing
+the regression.
+
+Fixes: 4a63bd179fa8 ("ALSA: timer: Set lower bound of start tick time")
+Cc: <stable@vger.kernel.org>
+Link: https://github.com/raspberrypi/linux/issues/6294
+Link: https://patch.msgid.link/20240810084833.10939-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/core/timer.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/core/timer.c
++++ b/sound/core/timer.c
+@@ -527,7 +527,7 @@ static int snd_timer_start1(struct snd_t
+       /* check the actual time for the start tick;
+        * bail out as error if it's way too low (< 100us)
+        */
+-      if (start) {
++      if (start && !(timer->hw.flags & SNDRV_TIMER_HW_SLAVE)) {
+               if ((u64)snd_timer_hw_resolution(timer) * ticks < 100000) {
+                       result = -EINVAL;
+                       goto unlock;
diff --git a/queue-5.4/bluetooth-hci_ldisc-check-hci_uart_proto_ready-flag-in-hciuartgetproto.patch b/queue-5.4/bluetooth-hci_ldisc-check-hci_uart_proto_ready-flag-in-hciuartgetproto.patch
new file mode 100644 (file)
index 0000000..ee4dc60
--- /dev/null
@@ -0,0 +1,42 @@
+From 9c33663af9ad115f90c076a1828129a3fbadea98 Mon Sep 17 00:00:00 2001
+From: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>
+Date: Mon, 10 Jul 2023 23:17:23 +0800
+Subject: Bluetooth: hci_ldisc: check HCI_UART_PROTO_READY flag in HCIUARTGETPROTO
+
+From: Lee, Chun-Yi <joeyli.kernel@gmail.com>
+
+commit 9c33663af9ad115f90c076a1828129a3fbadea98 upstream.
+
+This patch adds code to check HCI_UART_PROTO_READY flag before
+accessing hci_uart->proto. It fixes the race condition in
+hci_uart_tty_ioctl() between HCIUARTSETPROTO and HCIUARTGETPROTO.
+This issue bug found by Yu Hao and Weiteng Chen:
+
+BUG: general protection fault in hci_uart_tty_ioctl [1]
+
+The information of C reproducer can also reference the link [2]
+
+Reported-by: Yu Hao <yhao016@ucr.edu>
+Closes: https://lore.kernel.org/all/CA+UBctC3p49aTgzbVgkSZ2+TQcqq4fPDO7yZitFT5uBPDeCO2g@mail.gmail.com/ [1]
+Reported-by: Weiteng Chen <wchen130@ucr.edu>
+Closes: https://lore.kernel.org/lkml/CA+UBctDPEvHdkHMwD340=n02rh+jNRJNNQ5LBZNA+Wm4Keh2ow@mail.gmail.com/T/ [2]
+Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com>
+Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/bluetooth/hci_ldisc.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/bluetooth/hci_ldisc.c
++++ b/drivers/bluetooth/hci_ldisc.c
+@@ -765,7 +765,8 @@ static int hci_uart_tty_ioctl(struct tty
+               break;
+       case HCIUARTGETPROTO:
+-              if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
++              if (test_bit(HCI_UART_PROTO_SET, &hu->flags) &&
++                  test_bit(HCI_UART_PROTO_READY, &hu->flags))
+                       err = hu->proto->id;
+               else
+                       err = -EUNATCH;
diff --git a/queue-5.4/revert-s390-dasd-establish-dma-alignment.patch b/queue-5.4/revert-s390-dasd-establish-dma-alignment.patch
new file mode 100644 (file)
index 0000000..36f79cb
--- /dev/null
@@ -0,0 +1,103 @@
+From hoeppner@linux.ibm.com  Tue Aug 27 15:13:30 2024
+From: "Jan Höppner" <hoeppner@linux.ibm.com>
+Date: Tue, 20 Aug 2024 16:13:07 +0200
+Subject: Revert "s390/dasd: Establish DMA alignment"
+To: gregkh@linuxfoundation.org
+Cc: stable@vger.kernel.org, sth@linux.ibm.com
+Message-ID: <20240820141307.2869182-1-hoeppner@linux.ibm.com>
+
+From: "Jan Höppner" <hoeppner@linux.ibm.com>
+
+This reverts commit bc792884b76f ("s390/dasd: Establish DMA alignment").
+
+Quoting the original commit:
+    linux-next commit bf8d08532bc1 ("iomap: add support for dma aligned
+    direct-io") changes the alignment requirement to come from the block
+    device rather than the block size, and the default alignment
+    requirement is 512-byte boundaries. Since DASD I/O has page
+    alignments for IDAW/TIDAW requests, let's override this value to
+    restore the expected behavior.
+
+I mentioned TIDAW, but that was wrong. TIDAWs have no distinct alignment
+requirement (per p. 15-70 of POPS SA22-7832-13):
+
+   Unless otherwise specified, TIDAWs may designate
+   a block of main storage on any boundary and length
+   up to 4K bytes, provided the specified block does not
+   cross a 4 K-byte boundary.
+
+IDAWs do, but the original commit neglected that while ECKD DASD are
+typically formatted in 4096-byte blocks, they don't HAVE to be. Formatting
+an ECKD volume with smaller blocks is permitted (dasdfmt -b xxx), and the
+problematic commit enforces alignment properties to such a device that
+will result in errors, such as:
+
+   [test@host ~]# lsdasd -l a367 | grep blksz
+     blksz:                            512
+   [test@host ~]# mkfs.xfs -f /dev/disk/by-path/ccw-0.0.a367-part1
+   meta-data=/dev/dasdc1            isize=512    agcount=4, agsize=230075 blks
+            =                       sectsz=512   attr=2, projid32bit=1
+            =                       crc=1        finobt=1, sparse=1, rmapbt=1
+            =                       reflink=1    bigtime=1 inobtcount=1 nrext64=1
+   data     =                       bsize=4096   blocks=920299, imaxpct=25
+            =                       sunit=0      swidth=0 blks
+   naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
+   log      =internal log           bsize=4096   blocks=16384, version=2
+            =                       sectsz=512   sunit=0 blks, lazy-count=1
+   realtime =none                   extsz=4096   blocks=0, rtextents=0
+   error reading existing superblock: Invalid argument
+   mkfs.xfs: pwrite failed: Invalid argument
+   libxfs_bwrite: write failed on (unknown) bno 0x70565c/0x100, err=22
+   mkfs.xfs: Releasing dirty buffer to free list!
+   found dirty buffer (bulk) on free list!
+   mkfs.xfs: pwrite failed: Invalid argument
+   ...snipped...
+
+The original commit omitted the FBA discipline for just this reason,
+but the formatted block size of the other disciplines was overlooked.
+The solution to all of this is to revert to the original behavior,
+such that the block size can be respected.
+
+But what of the original problem? That was manifested with a direct-io
+QEMU guest, where QEMU itself was changed a month or two later with
+commit 25474d90aa ("block: use the request length for iov alignment")
+such that the blamed kernel commit is unnecessary.
+
+Note: This is an adapted version of the original upstream commit
+2a07bb64d801 ("s390/dasd: Remove DMA alignment").
+
+Cc: stable@vger.kernel.org # 6.0+
+Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/s390/block/dasd_diag.c | 1 -
+ drivers/s390/block/dasd_eckd.c | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
+index 2e4e555b37c3..12db1046aad0 100644
+--- a/drivers/s390/block/dasd_diag.c
++++ b/drivers/s390/block/dasd_diag.c
+@@ -639,7 +639,6 @@ static void dasd_diag_setup_blk_queue(struct dasd_block *block)
+       /* With page sized segments each segment can be translated into one idaw/tidaw */
+       blk_queue_max_segment_size(q, PAGE_SIZE);
+       blk_queue_segment_boundary(q, PAGE_SIZE - 1);
+-      blk_queue_dma_alignment(q, PAGE_SIZE - 1);
+ }
+ static int dasd_diag_pe_handler(struct dasd_device *device,
+diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
+index bd89b032968a..18b63210ac5d 100644
+--- a/drivers/s390/block/dasd_eckd.c
++++ b/drivers/s390/block/dasd_eckd.c
+@@ -6895,7 +6895,6 @@ static void dasd_eckd_setup_blk_queue(struct dasd_block *block)
+       /* With page sized segments each segment can be translated into one idaw/tidaw */
+       blk_queue_max_segment_size(q, PAGE_SIZE);
+       blk_queue_segment_boundary(q, PAGE_SIZE - 1);
+-      blk_queue_dma_alignment(q, PAGE_SIZE - 1);
+ }
+ static struct ccw_driver dasd_eckd_driver = {
+-- 
+2.43.0
+
index 1e04969a67f27adef551a717abadeb427a9c94f3..cb0cb6fdb4184310224766c98ba27d31a8f240e1 100644 (file)
@@ -102,3 +102,6 @@ hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch
 hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch
 cxgb4-add-forgotten-u64-ivlan-cast-before-shift.patch
 mmc-dw_mmc-allow-biu-and-ciu-clocks-to-defer.patch
+alsa-timer-relax-start-tick-time-check-for-slave-timer-elements.patch
+bluetooth-hci_ldisc-check-hci_uart_proto_ready-flag-in-hciuartgetproto.patch
+revert-s390-dasd-establish-dma-alignment.patch