]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jun 2022 13:12:51 +0000 (15:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jun 2022 13:12:51 +0000 (15:12 +0200)
added patches:
arm64-dts-imx8mm-beacon-enable-rts-cts-on-uart3.patch
bpf-fix-incorrect-memory-charge-cost-calculation-in-stack_map_alloc.patch

queue-5.10/arm64-dts-imx8mm-beacon-enable-rts-cts-on-uart3.patch [new file with mode: 0644]
queue-5.10/bpf-fix-incorrect-memory-charge-cost-calculation-in-stack_map_alloc.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/arm64-dts-imx8mm-beacon-enable-rts-cts-on-uart3.patch b/queue-5.10/arm64-dts-imx8mm-beacon-enable-rts-cts-on-uart3.patch
new file mode 100644 (file)
index 0000000..13bb3fe
--- /dev/null
@@ -0,0 +1,39 @@
+From 4ce01ce36d77137cf60776b320babed89de6bd4c Mon Sep 17 00:00:00 2001
+From: Adam Ford <aford173@gmail.com>
+Date: Tue, 26 Apr 2022 15:51:43 -0500
+Subject: arm64: dts: imx8mm-beacon: Enable RTS-CTS on UART3
+
+From: Adam Ford <aford173@gmail.com>
+
+commit 4ce01ce36d77137cf60776b320babed89de6bd4c upstream.
+
+There is a header for a DB9 serial port, but any attempts to use
+hardware handshaking fail.  Enable RTS and CTS pin muxing and enable
+handshaking in the uart node.
+
+Signed-off-by: Adam Ford <aford173@gmail.com>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
++++ b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
+@@ -167,6 +167,7 @@
+       pinctrl-0 = <&pinctrl_uart3>;
+       assigned-clocks = <&clk IMX8MM_CLK_UART3>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
++      uart-has-rtscts;
+       status = "okay";
+ };
+@@ -237,6 +238,8 @@
+               fsl,pins = <
+                       MX8MM_IOMUXC_ECSPI1_SCLK_UART3_DCE_RX   0x40
+                       MX8MM_IOMUXC_ECSPI1_MOSI_UART3_DCE_TX   0x40
++                      MX8MM_IOMUXC_ECSPI1_MISO_UART3_DCE_CTS_B        0x40
++                      MX8MM_IOMUXC_ECSPI1_SS0_UART3_DCE_RTS_B 0x40
+               >;
+       };
diff --git a/queue-5.10/bpf-fix-incorrect-memory-charge-cost-calculation-in-stack_map_alloc.patch b/queue-5.10/bpf-fix-incorrect-memory-charge-cost-calculation-in-stack_map_alloc.patch
new file mode 100644 (file)
index 0000000..ce70b35
--- /dev/null
@@ -0,0 +1,52 @@
+From ytcoode@gmail.com  Thu Jun 16 15:08:23 2022
+From: Yuntao Wang <ytcoode@gmail.com>
+Date: Tue, 14 Jun 2022 22:26:22 +0800
+Subject: bpf: Fix incorrect memory charge cost calculation in stack_map_alloc()
+To: gregkh@linuxfoundation.org
+Cc: daniel@iogearbox.net, linux-kernel@vger.kernel.org, pavel@denx.de, sashal@kernel.org, stable@vger.kernel.org, ytcoode@gmail.com, ast@kernel.org, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, bpf@vger.kernel.org
+Message-ID: <20220614142622.998611-1-ytcoode@gmail.com>
+
+From: Yuntao Wang <ytcoode@gmail.com>
+
+commit b45043192b3e481304062938a6561da2ceea46a6 upstream.
+
+This is a backport of the original upstream patch for 5.4/5.10.
+
+The original upstream patch has been applied to 5.4/5.10 branches, which
+simply removed the line:
+
+  cost += n_buckets * (value_size + sizeof(struct stack_map_bucket));
+
+This is correct for upstream branch but incorrect for 5.4/5.10 branches,
+as the 5.4/5.10 branches do not have the commit 370868107bf6 ("bpf:
+Eliminate rlimit-based memory accounting for stackmap maps"), so the
+bpf_map_charge_init() function has not been removed.
+
+Currently the bpf_map_charge_init() function in 5.4/5.10 branches takes a
+wrong memory charge cost, the
+
+  attr->max_entries * (sizeof(struct stack_map_bucket) + (u64)value_size))
+
+part is missing, let's fix it.
+
+Cc: <stable@vger.kernel.org> # 5.4.y
+Cc: <stable@vger.kernel.org> # 5.10.y
+Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/bpf/stackmap.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/kernel/bpf/stackmap.c
++++ b/kernel/bpf/stackmap.c
+@@ -121,7 +121,8 @@ static struct bpf_map *stack_map_alloc(u
+               return ERR_PTR(-E2BIG);
+       cost = n_buckets * sizeof(struct stack_map_bucket *) + sizeof(*smap);
+-      err = bpf_map_charge_init(&mem, cost);
++      err = bpf_map_charge_init(&mem, cost + attr->max_entries *
++                         (sizeof(struct stack_map_bucket) + (u64)value_size));
+       if (err)
+               return ERR_PTR(err);
index 5f36fa4a4c61282bbe9c0a5e97e7f63f433fd2b3..b934ea3f88d5e5ee1b6d3bc6619529ed6cd99d1a 100644 (file)
@@ -1,2 +1,4 @@
 9p-missing-chunk-of-fs-9p-don-t-update-file-type-when-updating-file-attributes.patch
 nfsd-replace-use-of-rwsem-with-errseq_t.patch
+bpf-fix-incorrect-memory-charge-cost-calculation-in-stack_map_alloc.patch
+arm64-dts-imx8mm-beacon-enable-rts-cts-on-uart3.patch