From: Sasha Levin Date: Sun, 29 Aug 2021 23:37:59 +0000 (-0400) Subject: Fixes for 5.13 X-Git-Tag: v4.4.283~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1c80633d49cd4a6fa010bc6e0dca9cd0ba27e5a9;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.13 Signed-off-by: Sasha Levin --- diff --git a/queue-5.13/clk-renesas-rcar-usb2-clock-sel-fix-kernel-null-poin.patch b/queue-5.13/clk-renesas-rcar-usb2-clock-sel-fix-kernel-null-poin.patch new file mode 100644 index 00000000000..8864545fe84 --- /dev/null +++ b/queue-5.13/clk-renesas-rcar-usb2-clock-sel-fix-kernel-null-poin.patch @@ -0,0 +1,39 @@ +From 49abfca0e67e4831f0ec47e45eee25fd8eb59228 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 26 Aug 2021 09:17:21 -0500 +Subject: clk: renesas: rcar-usb2-clock-sel: Fix kernel NULL pointer + dereference + +From: Adam Ford + +[ Upstream commit 1669a941f7c4844ae808cf441db51dde9e94db07 ] + +The probe was manually passing NULL instead of dev to devm_clk_hw_register. +This caused a Unable to handle kernel NULL pointer dereference error. +Fix this by passing 'dev'. + +Signed-off-by: Adam Ford +Fixes: a20a40a8bbc2 ("clk: renesas: rcar-usb2-clock-sel: Fix error handling in .probe()") +Reviewed-by: Geert Uytterhoeven +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/renesas/rcar-usb2-clock-sel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/renesas/rcar-usb2-clock-sel.c b/drivers/clk/renesas/rcar-usb2-clock-sel.c +index 9fb79bd79435..684d8937965e 100644 +--- a/drivers/clk/renesas/rcar-usb2-clock-sel.c ++++ b/drivers/clk/renesas/rcar-usb2-clock-sel.c +@@ -187,7 +187,7 @@ static int rcar_usb2_clock_sel_probe(struct platform_device *pdev) + init.ops = &usb2_clock_sel_clock_ops; + priv->hw.init = &init; + +- ret = devm_clk_hw_register(NULL, &priv->hw); ++ ret = devm_clk_hw_register(dev, &priv->hw); + if (ret) + goto pm_put; + +-- +2.30.2 + diff --git a/queue-5.13/perf-x86-intel-uncore-fix-integer-overflow-on-23-bit.patch b/queue-5.13/perf-x86-intel-uncore-fix-integer-overflow-on-23-bit.patch new file mode 100644 index 00000000000..2324ee0d493 --- /dev/null +++ b/queue-5.13/perf-x86-intel-uncore-fix-integer-overflow-on-23-bit.patch @@ -0,0 +1,49 @@ +From acbec5f66d0c416dbeef2e2542ef75a872e63b29 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 6 Jul 2021 12:45:53 +0100 +Subject: perf/x86/intel/uncore: Fix integer overflow on 23 bit left shift of a + u32 + +From: Colin Ian King + +[ Upstream commit 0b3a8738b76fe2087f7bc2bd59f4c78504c79180 ] + +The u32 variable pci_dword is being masked with 0x1fffffff and then left +shifted 23 places. The shift is a u32 operation,so a value of 0x200 or +more in pci_dword will overflow the u32 and only the bottow 32 bits +are assigned to addr. I don't believe this was the original intent. +Fix this by casting pci_dword to a resource_size_t to ensure no +overflow occurs. + +Note that the mask and 12 bit left shift operation does not need this +because the mask SNR_IMC_MMIO_MEM0_MASK and shift is always a 32 bit +value. + +Fixes: ee49532b38dd ("perf/x86/intel/uncore: Add IMC uncore support for Snow Ridge") +Addresses-Coverity: ("Unintentional integer overflow") +Signed-off-by: Colin Ian King +Signed-off-by: Peter Zijlstra (Intel) +Signed-off-by: Ingo Molnar +Reviewed-by: Kan Liang +Link: https://lore.kernel.org/r/20210706114553.28249-1-colin.king@canonical.com +Signed-off-by: Sasha Levin +--- + arch/x86/events/intel/uncore_snbep.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c +index 1f7bb4898a9d..a8f02c889ae8 100644 +--- a/arch/x86/events/intel/uncore_snbep.c ++++ b/arch/x86/events/intel/uncore_snbep.c +@@ -4701,7 +4701,7 @@ static void __snr_uncore_mmio_init_box(struct intel_uncore_box *box, + return; + + pci_read_config_dword(pdev, SNR_IMC_MMIO_BASE_OFFSET, &pci_dword); +- addr = (pci_dword & SNR_IMC_MMIO_BASE_MASK) << 23; ++ addr = ((resource_size_t)pci_dword & SNR_IMC_MMIO_BASE_MASK) << 23; + + pci_read_config_dword(pdev, mem_offset, &pci_dword); + addr |= (pci_dword & SNR_IMC_MMIO_MEM0_MASK) << 12; +-- +2.30.2 + diff --git a/queue-5.13/sched-fix-get_push_task-vs-migrate_disable.patch b/queue-5.13/sched-fix-get_push_task-vs-migrate_disable.patch new file mode 100644 index 00000000000..6fc27404f10 --- /dev/null +++ b/queue-5.13/sched-fix-get_push_task-vs-migrate_disable.patch @@ -0,0 +1,48 @@ +From c85a4428d01c923ac7a66ca155297f4f6c972c45 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 26 Aug 2021 15:37:38 +0200 +Subject: sched: Fix get_push_task() vs migrate_disable() + +From: Sebastian Andrzej Siewior + +[ Upstream commit e681dcbaa4b284454fecd09617f8b24231448446 ] + +push_rt_task() attempts to move the currently running task away if the +next runnable task has migration disabled and therefore is pinned on the +current CPU. + +The current task is retrieved via get_push_task() which only checks for +nr_cpus_allowed == 1, but does not check whether the task has migration +disabled and therefore cannot be moved either. The consequence is a +pointless invocation of the migration thread which correctly observes +that the task cannot be moved. + +Return NULL if the task has migration disabled and cannot be moved to +another CPU. + +Fixes: a7c81556ec4d3 ("sched: Fix migrate_disable() vs rt/dl balancing") +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Peter Zijlstra (Intel) +Link: https://lkml.kernel.org/r/20210826133738.yiotqbtdaxzjsnfj@linutronix.de +Signed-off-by: Sasha Levin +--- + kernel/sched/sched.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h +index 35f7efed75c4..f2bc99ca01e5 100644 +--- a/kernel/sched/sched.h ++++ b/kernel/sched/sched.h +@@ -1977,6 +1977,9 @@ static inline struct task_struct *get_push_task(struct rq *rq) + if (p->nr_cpus_allowed == 1) + return NULL; + ++ if (p->migration_disabled) ++ return NULL; ++ + rq->push_busy = true; + return get_task_struct(p); + } +-- +2.30.2 + diff --git a/queue-5.13/series b/queue-5.13/series index 38eb1fb2fce..b5755cf61c9 100644 --- a/queue-5.13/series +++ b/queue-5.13/series @@ -68,3 +68,6 @@ revert-mmc-sdhci-iproc-set-sdhci_quirk_cap_clock_bas.patch net-stmmac-add-mutex-lock-to-protect-est-parameters.patch net-stmmac-fix-kernel-panic-due-to-null-pointer-dere.patch usb-gadget-u_audio-fix-race-condition-on-endpoint-st.patch +perf-x86-intel-uncore-fix-integer-overflow-on-23-bit.patch +sched-fix-get_push_task-vs-migrate_disable.patch +clk-renesas-rcar-usb2-clock-sel-fix-kernel-null-poin.patch