]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jul 2022 09:15:39 +0000 (11:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jul 2022 09:15:39 +0000 (11:15 +0200)
added patches:
sched-deadline-fix-bug_on-condition-for-deboosted-tasks.patch

queue-5.10/sched-deadline-fix-bug_on-condition-for-deboosted-tasks.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/sched-deadline-fix-bug_on-condition-for-deboosted-tasks.patch b/queue-5.10/sched-deadline-fix-bug_on-condition-for-deboosted-tasks.patch
new file mode 100644 (file)
index 0000000..56a7408
--- /dev/null
@@ -0,0 +1,45 @@
+From ddfc710395cccc61247348df9eb18ea50321cbed Mon Sep 17 00:00:00 2001
+From: Juri Lelli <juri.lelli@redhat.com>
+Date: Thu, 14 Jul 2022 17:19:08 +0200
+Subject: sched/deadline: Fix BUG_ON condition for deboosted tasks
+
+From: Juri Lelli <juri.lelli@redhat.com>
+
+commit ddfc710395cccc61247348df9eb18ea50321cbed upstream.
+
+Tasks the are being deboosted from SCHED_DEADLINE might enter
+enqueue_task_dl() one last time and hit an erroneous BUG_ON condition:
+since they are not boosted anymore, the if (is_dl_boosted()) branch is
+not taken, but the else if (!dl_prio) is and inside this one we
+BUG_ON(!is_dl_boosted), which is of course false (BUG_ON triggered)
+otherwise we had entered the if branch above. Long story short, the
+current condition doesn't make sense and always leads to triggering of a
+BUG.
+
+Fix this by only checking enqueue flags, properly: ENQUEUE_REPLENISH has
+to be present, but additional flags are not a problem.
+
+Fixes: 64be6f1f5f71 ("sched/deadline: Don't replenish from a !SCHED_DEADLINE entity")
+Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Cc: stable@vger.kernel.org
+Link: https://lkml.kernel.org/r/20220714151908.533052-1-juri.lelli@redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/sched/deadline.c |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/kernel/sched/deadline.c
++++ b/kernel/sched/deadline.c
+@@ -1563,7 +1563,10 @@ static void enqueue_task_dl(struct rq *r
+                * the throttle.
+                */
+               p->dl.dl_throttled = 0;
+-              BUG_ON(!is_dl_boosted(&p->dl) || flags != ENQUEUE_REPLENISH);
++              if (!(flags & ENQUEUE_REPLENISH))
++                      printk_deferred_once("sched: DL de-boosted task PID %d: REPLENISH flag missing\n",
++                                           task_pid_nr(p));
++
+               return;
+       }
index 1b3bf2c0321b7b2c6b63c2ee81536c571aa5ae57..54051155cd1b2922024d7b567c0f3f74b9930e27 100644 (file)
@@ -78,3 +78,4 @@ spi-bcm2835-bcm2835_spi_handle_err-fix-null-pointer-deref-for-non-dma-transfers.
 kvm-don-t-null-dereference-ops-destroy.patch
 mm-mempolicy-fix-uninit-value-in-mpol_rebind_policy.patch
 bpf-make-sure-mac_header-was-set-before-using-it.patch
+sched-deadline-fix-bug_on-condition-for-deboosted-tasks.patch