From: Greg Kroah-Hartman Date: Mon, 12 Apr 2021 07:07:18 +0000 (+0200) Subject: 5.11-stable patches X-Git-Tag: v4.19.187~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=de42c687feadb6bab79af815708e7e1ca0c73bc5;p=thirdparty%2Fkernel%2Fstable-queue.git 5.11-stable patches added patches: clk-socfpga-fix-iomem-pointer-cast-on-64-bit.patch dt-bindings-net-ethernet-controller-fix-typo-in-nvmem.patch lockdep-address-clang-wformat-warning-printing-for-hd.patch net-sched-bump-refcount-for-new-action-in-act-replace-mode.patch x86-traps-correct-exc_general_protection-and-math_error-return-paths.patch --- diff --git a/queue-5.11/clk-socfpga-fix-iomem-pointer-cast-on-64-bit.patch b/queue-5.11/clk-socfpga-fix-iomem-pointer-cast-on-64-bit.patch new file mode 100644 index 00000000000..9bf15041117 --- /dev/null +++ b/queue-5.11/clk-socfpga-fix-iomem-pointer-cast-on-64-bit.patch @@ -0,0 +1,39 @@ +From 2867b9746cef78745c594894aece6f8ef826e0b4 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Sun, 14 Mar 2021 12:07:09 +0100 +Subject: clk: socfpga: fix iomem pointer cast on 64-bit +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Krzysztof Kozlowski + +commit 2867b9746cef78745c594894aece6f8ef826e0b4 upstream. + +Pointers should be cast with uintptr_t instead of integer. This fixes +warning when compile testing on ARM64: + + drivers/clk/socfpga/clk-gate.c: In function ‘socfpga_clk_recalc_rate’: + drivers/clk/socfpga/clk-gate.c:102:7: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] + +Fixes: b7cec13f082f ("clk: socfpga: Look for the GPIO_DB_CLK by its offset") +Signed-off-by: Krzysztof Kozlowski +Acked-by: Dinh Nguyen +Link: https://lore.kernel.org/r/20210314110709.32599-1-krzysztof.kozlowski@canonical.com +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman +--- + drivers/clk/socfpga/clk-gate.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/clk/socfpga/clk-gate.c ++++ b/drivers/clk/socfpga/clk-gate.c +@@ -99,7 +99,7 @@ static unsigned long socfpga_clk_recalc_ + val = readl(socfpgaclk->div_reg) >> socfpgaclk->shift; + val &= GENMASK(socfpgaclk->width - 1, 0); + /* Check for GPIO_DB_CLK by its offset */ +- if ((int) socfpgaclk->div_reg & SOCFPGA_GPIO_DB_CLK_OFFSET) ++ if ((uintptr_t) socfpgaclk->div_reg & SOCFPGA_GPIO_DB_CLK_OFFSET) + div = val + 1; + else + div = (1 << val); diff --git a/queue-5.11/dt-bindings-net-ethernet-controller-fix-typo-in-nvmem.patch b/queue-5.11/dt-bindings-net-ethernet-controller-fix-typo-in-nvmem.patch new file mode 100644 index 00000000000..4fa99464164 --- /dev/null +++ b/queue-5.11/dt-bindings-net-ethernet-controller-fix-typo-in-nvmem.patch @@ -0,0 +1,37 @@ +From af9d316f3dd6d1385fbd1631b5103e620fc4298a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 29 Mar 2021 16:03:17 +0200 +Subject: dt-bindings: net: ethernet-controller: fix typo in NVMEM +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rafał Miłecki + +commit af9d316f3dd6d1385fbd1631b5103e620fc4298a upstream. + +The correct property name is "nvmem-cell-names". This is what: +1. Was originally documented in the ethernet.txt +2. Is used in DTS files +3. Matches standard syntax for phandles +4. Linux net subsystem checks for + +Fixes: 9d3de3c58347 ("dt-bindings: net: Add YAML schemas for the generic Ethernet options") +Signed-off-by: Rafał Miłecki +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/devicetree/bindings/net/ethernet-controller.yaml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml ++++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml +@@ -49,7 +49,7 @@ properties: + description: + Reference to an nvmem node for the MAC address + +- nvmem-cells-names: ++ nvmem-cell-names: + const: mac-address + + phy-connection-type: diff --git a/queue-5.11/lockdep-address-clang-wformat-warning-printing-for-hd.patch b/queue-5.11/lockdep-address-clang-wformat-warning-printing-for-hd.patch new file mode 100644 index 00000000000..798886a7635 --- /dev/null +++ b/queue-5.11/lockdep-address-clang-wformat-warning-printing-for-hd.patch @@ -0,0 +1,43 @@ +From 6d48b7912cc72275dc7c59ff961c8bac7ef66a92 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 22 Mar 2021 12:55:25 +0100 +Subject: lockdep: Address clang -Wformat warning printing for %hd + +From: Arnd Bergmann + +commit 6d48b7912cc72275dc7c59ff961c8bac7ef66a92 upstream. + +Clang doesn't like format strings that truncate a 32-bit +value to something shorter: + + kernel/locking/lockdep.c:709:4: error: format specifies type 'short' but the argument has type 'int' [-Werror,-Wformat] + +In this case, the warning is a slightly questionable, as it could realize +that both class->wait_type_outer and class->wait_type_inner are in fact +8-bit struct members, even though the result of the ?: operator becomes an +'int'. + +However, there is really no point in printing the number as a 16-bit +'short' rather than either an 8-bit or 32-bit number, so just change +it to a normal %d. + +Fixes: de8f5e4f2dc1 ("lockdep: Introduce wait-type checks") +Signed-off-by: Arnd Bergmann +Signed-off-by: Ingo Molnar +Link: https://lore.kernel.org/r/20210322115531.3987555-1-arnd@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + kernel/locking/lockdep.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/locking/lockdep.c ++++ b/kernel/locking/lockdep.c +@@ -705,7 +705,7 @@ static void print_lock_name(struct lock_ + + printk(KERN_CONT " ("); + __print_lock_name(class); +- printk(KERN_CONT "){%s}-{%hd:%hd}", usage, ++ printk(KERN_CONT "){%s}-{%d:%d}", usage, + class->wait_type_outer ?: class->wait_type_inner, + class->wait_type_inner); + } diff --git a/queue-5.11/net-sched-bump-refcount-for-new-action-in-act-replace-mode.patch b/queue-5.11/net-sched-bump-refcount-for-new-action-in-act-replace-mode.patch new file mode 100644 index 00000000000..21fc0e77692 --- /dev/null +++ b/queue-5.11/net-sched-bump-refcount-for-new-action-in-act-replace-mode.patch @@ -0,0 +1,83 @@ +From 6855e8213e06efcaf7c02a15e12b1ae64b9a7149 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Tue, 30 Mar 2021 04:23:23 +0530 +Subject: net: sched: bump refcount for new action in ACT replace mode + +From: Kumar Kartikeya Dwivedi + +commit 6855e8213e06efcaf7c02a15e12b1ae64b9a7149 upstream. + +Currently, action creation using ACT API in replace mode is buggy. +When invoking for non-existent action index 42, + + tc action replace action bpf obj foo.o sec index 42 + +kernel creates the action, fills up the netlink response, and then just +deletes the action after notifying userspace. + + tc action show action bpf + +doesn't list the action. + +This happens due to the following sequence when ovr = 1 (replace mode) +is enabled: + +tcf_idr_check_alloc is used to atomically check and either obtain +reference for existing action at index, or reserve the index slot using +a dummy entry (ERR_PTR(-EBUSY)). + +This is necessary as pointers to these actions will be held after +dropping the idrinfo lock, so bumping the reference count is necessary +as we need to insert the actions, and notify userspace by dumping their +attributes. Finally, we drop the reference we took using the +tcf_action_put_many call in tcf_action_add. However, for the case where +a new action is created due to free index, its refcount remains one. +This when paired with the put_many call leads to the kernel setting up +the action, notifying userspace of its creation, and then tearing it +down. For existing actions, the refcount is still held so they remain +unaffected. + +Fortunately due to rtnl_lock serialization requirement, such an action +with refcount == 1 will not be concurrently deleted by anything else, at +best CLS API can move its refcount up and down by binding to it after it +has been published from tcf_idr_insert_many. Since refcount is atleast +one until put_many call, CLS API cannot delete it. Also __tcf_action_put +release path already ensures deterministic outcome (either new action +will be created or existing action will be reused in case CLS API tries +to bind to action concurrently) due to idr lock serialization. + +We fix this by making refcount of newly created actions as 2 in ACT API +replace mode. A relaxed store will suffice as visibility is ensured only +after the tcf_idr_insert_many call. + +Note that in case of creation or overwriting using CLS API only (i.e. +bind = 1), overwriting existing action object is not allowed, and any +such request is silently ignored (without error). + +The refcount bump that occurs in tcf_idr_check_alloc call there for +existing action will pair with tcf_exts_destroy call made from the +owner module for the same action. In case of action creation, there +is no existing action, so no tcf_exts_destroy callback happens. + +This means no code changes for CLS API. + +Fixes: cae422f379f3 ("net: sched: use reference counting action init") +Signed-off-by: Kumar Kartikeya Dwivedi +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/sched/act_api.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/net/sched/act_api.c ++++ b/net/sched/act_api.c +@@ -1049,6 +1049,9 @@ struct tc_action *tcf_action_init_1(stru + if (!name) + a->hw_stats = hw_stats; + ++ if (!bind && ovr && err == ACT_P_CREATED) ++ refcount_set(&a->tcfa_refcnt, 2); ++ + return a; + + err_out: diff --git a/queue-5.11/series b/queue-5.11/series index fc35778bbfa..2a1492d2335 100644 --- a/queue-5.11/series +++ b/queue-5.11/series @@ -188,3 +188,8 @@ rdma-addr-be-strict-with-gid-size.patch vdpa-mlx5-should-exclude-header-length-and-fcs-from-.patch vdpa-mlx5-fix-wrong-use-of-bit-numbers.patch ras-cec-correct-ce_add_elem-s-returned-values.patch +clk-socfpga-fix-iomem-pointer-cast-on-64-bit.patch +lockdep-address-clang-wformat-warning-printing-for-hd.patch +dt-bindings-net-ethernet-controller-fix-typo-in-nvmem.patch +net-sched-bump-refcount-for-new-action-in-act-replace-mode.patch +x86-traps-correct-exc_general_protection-and-math_error-return-paths.patch diff --git a/queue-5.11/x86-traps-correct-exc_general_protection-and-math_error-return-paths.patch b/queue-5.11/x86-traps-correct-exc_general_protection-and-math_error-return-paths.patch new file mode 100644 index 00000000000..23c50cda5d0 --- /dev/null +++ b/queue-5.11/x86-traps-correct-exc_general_protection-and-math_error-return-paths.patch @@ -0,0 +1,55 @@ +From 632a1c209b8773cb0119fe3aada9f1db14fa357c Mon Sep 17 00:00:00 2001 +From: Thomas Tai +Date: Thu, 8 Apr 2021 13:28:33 -0400 +Subject: x86/traps: Correct exc_general_protection() and math_error() return paths + +From: Thomas Tai + +commit 632a1c209b8773cb0119fe3aada9f1db14fa357c upstream. + +Commit + + 334872a09198 ("x86/traps: Attempt to fixup exceptions in vDSO before signaling") + +added return statements which bypass calling cond_local_irq_disable(). + +According to + + ca4c6a9858c2 ("x86/traps: Make interrupt enable/disable symmetric in C code"), + +cond_local_irq_disable() is needed because the asm return code no longer +disables interrupts. Follow the existing code as an example to use "goto +exit" instead of "return" statement. + + [ bp: Massage commit message. ] + +Fixes: 334872a09198 ("x86/traps: Attempt to fixup exceptions in vDSO before signaling") +Signed-off-by: Thomas Tai +Signed-off-by: Borislav Petkov +Reviewed-by: Alexandre Chartre +Link: https://lkml.kernel.org/r/1617902914-83245-1-git-send-email-thomas.tai@oracle.com +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/traps.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/x86/kernel/traps.c ++++ b/arch/x86/kernel/traps.c +@@ -556,7 +556,7 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_pr + tsk->thread.trap_nr = X86_TRAP_GP; + + if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0)) +- return; ++ goto exit; + + show_signal(tsk, SIGSEGV, "", desc, regs, error_code); + force_sig(SIGSEGV); +@@ -1057,7 +1057,7 @@ static void math_error(struct pt_regs *r + goto exit; + + if (fixup_vdso_exception(regs, trapnr, 0, 0)) +- return; ++ goto exit; + + force_sig_fault(SIGFPE, si_code, + (void __user *)uprobe_get_trap_addr(regs));