]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jun 2021 14:03:23 +0000 (16:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jun 2021 14:03:23 +0000 (16:03 +0200)
added patches:
net-fec_ptp-add-clock-rate-zero-check.patch
tools-headers-uapi-sync-linux-in.h-copy-with-the-kernel-sources.patch

queue-4.19/net-fec_ptp-add-clock-rate-zero-check.patch [new file with mode: 0644]
queue-4.19/series
queue-4.19/tools-headers-uapi-sync-linux-in.h-copy-with-the-kernel-sources.patch [new file with mode: 0644]

diff --git a/queue-4.19/net-fec_ptp-add-clock-rate-zero-check.patch b/queue-4.19/net-fec_ptp-add-clock-rate-zero-check.patch
new file mode 100644 (file)
index 0000000..530d341
--- /dev/null
@@ -0,0 +1,33 @@
+From cb3cefe3f3f8af27c6076ef7d1f00350f502055d Mon Sep 17 00:00:00 2001
+From: Fugang Duan <fugang.duan@nxp.com>
+Date: Wed, 16 Jun 2021 17:14:25 +0800
+Subject: net: fec_ptp: add clock rate zero check
+
+From: Fugang Duan <fugang.duan@nxp.com>
+
+commit cb3cefe3f3f8af27c6076ef7d1f00350f502055d upstream.
+
+Add clock rate zero check to fix coverity issue of "divide by 0".
+
+Fixes: commit 85bd1798b24a ("net: fec: fix spin_lock dead lock")
+Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
+Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/freescale/fec_ptp.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/net/ethernet/freescale/fec_ptp.c
++++ b/drivers/net/ethernet/freescale/fec_ptp.c
+@@ -597,6 +597,10 @@ void fec_ptp_init(struct platform_device
+       fep->ptp_caps.enable = fec_ptp_enable;
+       fep->cycle_speed = clk_get_rate(fep->clk_ptp);
++      if (!fep->cycle_speed) {
++              fep->cycle_speed = NSEC_PER_SEC;
++              dev_err(&fep->pdev->dev, "clk_ptp clock rate is zero\n");
++      }
+       fep->ptp_inc = NSEC_PER_SEC / fep->cycle_speed;
+       spin_lock_init(&fep->tmreg_lock);
index ea505864ff97bd81fd82e1b7fbc62b69676ac234..be581f7d9304d505c51a94d06e6a61ce4a758c17 100644 (file)
@@ -72,3 +72,5 @@ net-bridge-fix-vlan-tunnel-dst-null-pointer-dereference.patch
 net-bridge-fix-vlan-tunnel-dst-refcnt-when-egressing.patch
 mm-slub-clarify-verification-reporting.patch
 mm-slub.c-include-swab.h.patch
+net-fec_ptp-add-clock-rate-zero-check.patch
+tools-headers-uapi-sync-linux-in.h-copy-with-the-kernel-sources.patch
diff --git a/queue-4.19/tools-headers-uapi-sync-linux-in.h-copy-with-the-kernel-sources.patch b/queue-4.19/tools-headers-uapi-sync-linux-in.h-copy-with-the-kernel-sources.patch
new file mode 100644 (file)
index 0000000..c1b8a0d
--- /dev/null
@@ -0,0 +1,44 @@
+From 1792a59eab9593de2eae36c40c5a22d70f52c026 Mon Sep 17 00:00:00 2001
+From: Arnaldo Carvalho de Melo <acme@redhat.com>
+Date: Sat, 19 Jun 2021 10:15:22 -0300
+Subject: tools headers UAPI: Sync linux/in.h copy with the kernel sources
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Arnaldo Carvalho de Melo <acme@redhat.com>
+
+commit 1792a59eab9593de2eae36c40c5a22d70f52c026 upstream.
+
+To pick the changes in:
+
+  321827477360934d ("icmp: don't send out ICMP messages with a source address of 0.0.0.0")
+
+That don't result in any change in tooling, as INADDR_ are not used to
+generate id->string tables used by 'perf trace'.
+
+This addresses this build warning:
+
+  Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h'
+  diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h
+
+Cc: David S. Miller <davem@davemloft.net>
+Cc: Toke Høiland-Jørgensen <toke@redhat.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/include/uapi/linux/in.h |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/tools/include/uapi/linux/in.h
++++ b/tools/include/uapi/linux/in.h
+@@ -280,6 +280,9 @@ struct sockaddr_in {
+ /* Address indicating an error return. */
+ #define       INADDR_NONE             ((unsigned long int) 0xffffffff)
++/* Dummy address for src of ICMP replies if no real address is set (RFC7600). */
++#define       INADDR_DUMMY            ((unsigned long int) 0xc0000008)
++
+ /* Network number for local host loopback. */
+ #define       IN_LOOPBACKNET          127