]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Aug 2024 13:20:00 +0000 (15:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Aug 2024 13:20:00 +0000 (15:20 +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
nfsd-don-t-call-freezable_schedule_timeout-after-each-successful-page-allocation-in-svc_alloc_arg.patch

queue-5.10/alsa-timer-relax-start-tick-time-check-for-slave-timer-elements.patch [new file with mode: 0644]
queue-5.10/bluetooth-hci_ldisc-check-hci_uart_proto_ready-flag-in-hciuartgetproto.patch [new file with mode: 0644]
queue-5.10/nfsd-don-t-call-freezable_schedule_timeout-after-each-successful-page-allocation-in-svc_alloc_arg.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/alsa-timer-relax-start-tick-time-check-for-slave-timer-elements.patch b/queue-5.10/alsa-timer-relax-start-tick-time-check-for-slave-timer-elements.patch
new file mode 100644 (file)
index 0000000..8ca9678
--- /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
+@@ -556,7 +556,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.10/bluetooth-hci_ldisc-check-hci_uart_proto_ready-flag-in-hciuartgetproto.patch b/queue-5.10/bluetooth-hci_ldisc-check-hci_uart_proto_ready-flag-in-hciuartgetproto.patch
new file mode 100644 (file)
index 0000000..068ec9b
--- /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
+@@ -768,7 +768,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.10/nfsd-don-t-call-freezable_schedule_timeout-after-each-successful-page-allocation-in-svc_alloc_arg.patch b/queue-5.10/nfsd-don-t-call-freezable_schedule_timeout-after-each-successful-page-allocation-in-svc_alloc_arg.patch
new file mode 100644 (file)
index 0000000..4c307ee
--- /dev/null
@@ -0,0 +1,51 @@
+From kuniyu@amazon.com  Tue Aug 27 14:47:41 2024
+From: Kuniyuki Iwashima <kuniyu@amazon.com>
+Date: Mon, 19 Aug 2024 10:05:51 -0700
+Subject: nfsd: Don't call freezable_schedule_timeout() after each successful page allocation in svc_alloc_arg().
+To: <stable@vger.kernel.org>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Sasha Levin <sashal@kernel.org>, Jeff Layton <jlayton@kernel.org>, NeilBrown <neilb@suse.de>, Chuck Lever <chuck.lever@oracle.com>, Kuniyuki Iwashima <kuniyu@amazon.com>, Kuniyuki Iwashima <kuni1840@gmail.com>, Hughdan Liu <hughliu@amazon.com>
+Message-ID: <20240819170551.10764-1-kuniyu@amazon.com>
+
+From: Kuniyuki Iwashima <kuniyu@amazon.com>
+
+When commit 390390240145 ("nfsd: don't allow nfsd threads to be
+signalled.") is backported to 5.10, it was adjusted considering commit
+3feac2b55293 ("sunrpc: exclude from freezer when waiting for requests:").
+
+However, 3feac2b55293 is based on commit f6e70aab9dfe ("SUNRPC: refresh
+rq_pages using a bulk page allocator"), which converted page-by-page
+allocation to a batch allocation, so schedule_timeout() is placed
+un-nested.
+
+As a result, the backported commit 7229200f6866 ("nfsd: don't allow nfsd
+threads to be signalled.") placed freezable_schedule_timeout() in the wrong
+place.
+
+Now, freezable_schedule_timeout() is called after every successful page
+allocation, and we see 30%+ performance regression on 5.10.220 in our
+test suite.
+
+Let's move it to the correct place so that freezable_schedule_timeout()
+is called only when page allocation fails.
+
+Fixes: 7229200f6866 ("nfsd: don't allow nfsd threads to be signalled.")
+Reported-by: Hughdan Liu <hughliu@amazon.com>
+Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
+Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/sunrpc/svc_xprt.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/sunrpc/svc_xprt.c
++++ b/net/sunrpc/svc_xprt.c
+@@ -679,8 +679,8 @@ static int svc_alloc_arg(struct svc_rqst
+                                       set_current_state(TASK_RUNNING);
+                                       return -EINTR;
+                               }
++                              freezable_schedule_timeout(msecs_to_jiffies(500));
+                       }
+-                      freezable_schedule_timeout(msecs_to_jiffies(500));
+                       rqstp->rq_pages[i] = p;
+               }
+       rqstp->rq_page_end = &rqstp->rq_pages[i];
index c346172e5846e04161d5872d14ede71a245c4e4e..59be8ec60e5ce4fedb61363bf5b9effba899139c 100644 (file)
@@ -115,3 +115,6 @@ cxgb4-add-forgotten-u64-ivlan-cast-before-shift.patch
 kvm-arm64-make-icc_-sgi-_el1-undef-in-the-absence-of-a-vgicv3.patch
 mmc-dw_mmc-allow-biu-and-ciu-clocks-to-defer.patch
 revert-drm-amd-display-validate-hw_points_num-before-using-it.patch
+alsa-timer-relax-start-tick-time-check-for-slave-timer-elements.patch
+nfsd-don-t-call-freezable_schedule_timeout-after-each-successful-page-allocation-in-svc_alloc_arg.patch
+bluetooth-hci_ldisc-check-hci_uart_proto_ready-flag-in-hciuartgetproto.patch