]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Feb 2025 12:35:06 +0000 (13:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Feb 2025 12:35:06 +0000 (13:35 +0100)
added patches:
arm64-handle-.arm.attributes-section-in-linker-scripts.patch
mlxsw-add-return-value-check-for-mlxsw_sp_port_get_stats_raw.patch
regmap-irq-add-missing-kfree.patch

queue-5.10/arm64-handle-.arm.attributes-section-in-linker-scripts.patch [new file with mode: 0644]
queue-5.10/mlxsw-add-return-value-check-for-mlxsw_sp_port_get_stats_raw.patch [new file with mode: 0644]
queue-5.10/regmap-irq-add-missing-kfree.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/arm64-handle-.arm.attributes-section-in-linker-scripts.patch b/queue-5.10/arm64-handle-.arm.attributes-section-in-linker-scripts.patch
new file mode 100644 (file)
index 0000000..7ed9798
--- /dev/null
@@ -0,0 +1,57 @@
+From ca0f4fe7cf7183bfbdc67ca2de56ae1fc3a8db2b Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Thu, 6 Feb 2025 10:21:38 -0700
+Subject: arm64: Handle .ARM.attributes section in linker scripts
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+commit ca0f4fe7cf7183bfbdc67ca2de56ae1fc3a8db2b upstream.
+
+A recent LLVM commit [1] started generating an .ARM.attributes section
+similar to the one that exists for 32-bit, which results in orphan
+section warnings (or errors if CONFIG_WERROR is enabled) from the linker
+because it is not handled in the arm64 linker scripts.
+
+  ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes'
+  ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes'
+
+  ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes'
+  ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes'
+  ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes'
+
+Discard the new sections in the necessary linker scripts to resolve the
+warnings, as the kernel and vDSO do not need to retain it, similar to
+the .note.gnu.property section.
+
+Cc: stable@vger.kernel.org
+Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement")
+Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1]
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Link: https://lore.kernel.org/r/20250206-arm64-handle-arm-attributes-in-linker-script-v3-1-d53d169913eb@kernel.org
+Signed-off-by: Will Deacon <will@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/kernel/vdso/vdso.lds.S |    1 +
+ arch/arm64/kernel/vmlinux.lds.S   |    1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/arch/arm64/kernel/vdso/vdso.lds.S
++++ b/arch/arm64/kernel/vdso/vdso.lds.S
+@@ -37,6 +37,7 @@ SECTIONS
+        */
+       /DISCARD/       : {
+               *(.note.GNU-stack .note.gnu.property)
++              *(.ARM.attributes)
+       }
+       .note           : { *(.note.*) }                :text   :note
+--- a/arch/arm64/kernel/vmlinux.lds.S
++++ b/arch/arm64/kernel/vmlinux.lds.S
+@@ -113,6 +113,7 @@ SECTIONS
+       /DISCARD/ : {
+               *(.interp .dynamic)
+               *(.dynsym .dynstr .hash .gnu.hash)
++              *(.ARM.attributes)
+       }
+       . = KIMAGE_VADDR;
diff --git a/queue-5.10/mlxsw-add-return-value-check-for-mlxsw_sp_port_get_stats_raw.patch b/queue-5.10/mlxsw-add-return-value-check-for-mlxsw_sp_port_get_stats_raw.patch
new file mode 100644 (file)
index 0000000..e428650
--- /dev/null
@@ -0,0 +1,38 @@
+From fee5d688940690cc845937459e340e4e02598e90 Mon Sep 17 00:00:00 2001
+From: Wentao Liang <vulab@iscas.ac.cn>
+Date: Wed, 12 Feb 2025 23:23:11 +0800
+Subject: mlxsw: Add return value check for mlxsw_sp_port_get_stats_raw()
+
+From: Wentao Liang <vulab@iscas.ac.cn>
+
+commit fee5d688940690cc845937459e340e4e02598e90 upstream.
+
+Add a check for the return value of mlxsw_sp_port_get_stats_raw()
+in __mlxsw_sp_port_get_stats(). If mlxsw_sp_port_get_stats_raw()
+returns an error, exit the function to prevent further processing
+with potentially invalid data.
+
+Fixes: 614d509aa1e7 ("mlxsw: Move ethtool_ops to spectrum_ethtool.c")
+Cc: stable@vger.kernel.org # 5.9+
+Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
+Reviewed-by: Petr Machata <petrm@nvidia.com>
+Link: https://patch.msgid.link/20250212152311.1332-1-vulab@iscas.ac.cn
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c
++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c
+@@ -761,7 +761,9 @@ static void __mlxsw_sp_port_get_stats(st
+       err = mlxsw_sp_get_hw_stats_by_group(&hw_stats, &len, grp);
+       if (err)
+               return;
+-      mlxsw_sp_port_get_stats_raw(dev, grp, prio, ppcnt_pl);
++      err = mlxsw_sp_port_get_stats_raw(dev, grp, prio, ppcnt_pl);
++      if (err)
++              return;
+       for (i = 0; i < len; i++) {
+               data[data_index + i] = hw_stats[i].getter(ppcnt_pl);
+               if (!hw_stats[i].cells_bytes)
diff --git a/queue-5.10/regmap-irq-add-missing-kfree.patch b/queue-5.10/regmap-irq-add-missing-kfree.patch
new file mode 100644 (file)
index 0000000..85f607d
--- /dev/null
@@ -0,0 +1,40 @@
+From 32ffed055dcee17f6705f545b069e44a66067808 Mon Sep 17 00:00:00 2001
+From: Jiasheng Jiang <jiashengjiangcool@gmail.com>
+Date: Wed, 5 Feb 2025 00:43:43 +0000
+Subject: regmap-irq: Add missing kfree()
+
+From: Jiasheng Jiang <jiashengjiangcool@gmail.com>
+
+commit 32ffed055dcee17f6705f545b069e44a66067808 upstream.
+
+Add kfree() for "d->main_status_buf" to the error-handling path to prevent
+a memory leak.
+
+Fixes: a2d21848d921 ("regmap: regmap-irq: Add main status register support")
+Cc: stable@vger.kernel.org  # v5.1+
+Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
+Link: https://patch.msgid.link/20250205004343.14413-1-jiashengjiangcool@gmail.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/base/regmap/regmap-irq.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/base/regmap/regmap-irq.c
++++ b/drivers/base/regmap/regmap-irq.c
+@@ -834,6 +834,7 @@ err_alloc:
+       kfree(d->wake_buf);
+       kfree(d->mask_buf_def);
+       kfree(d->mask_buf);
++      kfree(d->main_status_buf);
+       kfree(d->status_buf);
+       kfree(d->status_reg_buf);
+       kfree(d);
+@@ -904,6 +905,7 @@ void regmap_del_irq_chip(int irq, struct
+       kfree(d->wake_buf);
+       kfree(d->mask_buf_def);
+       kfree(d->mask_buf);
++      kfree(d->main_status_buf);
+       kfree(d->status_reg_buf);
+       kfree(d->status_buf);
+       kfree(d);
index 44d26fc750dbb456b96d42dc858848cb50203648..2c749c2fe57af31bb88955b6bbd1f73d7233ecca 100644 (file)
@@ -282,3 +282,6 @@ serial-8250-fix-fifo-underflow-on-flush.patch
 alpha-align-stack-for-page-fault-and-user-unaligned-trap-handlers.patch
 gpio-stmpe-check-return-value-of-stmpe_reg_read-in-stmpe_gpio_irq_sync_unlock.patch
 partitions-mac-fix-handling-of-bogus-partition-table.patch
+regmap-irq-add-missing-kfree.patch
+arm64-handle-.arm.attributes-section-in-linker-scripts.patch
+mlxsw-add-return-value-check-for-mlxsw_sp_port_get_stats_raw.patch