summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorsten Leemhuis <fedora@leemhuis.info>2017-03-20 15:03:55 +0100
committerThorsten Leemhuis <fedora@leemhuis.info>2017-03-20 15:03:55 +0100
commit44db3f2445be1dea4a4637696de7a81536dc78aa (patch)
treea54ecc509a75bed1e377c885a080613f9d6abc30
parent09f28f3b604ae6cae2f654a102339b0cea760b0f (diff)
parent39bd1a14884ed7d45f83e6e7880f360767d86ab3 (diff)
downloadkernel-44db3f2445be1dea4a4637696de7a81536dc78aa.tar.gz
kernel-44db3f2445be1dea4a4637696de7a81536dc78aa.tar.xz
kernel-44db3f2445be1dea4a4637696de7a81536dc78aa.zip
Merge remote-tracking branch 'origin/f25' into f25-user-thl-vanilla-fedora
-rw-r--r--0001-i2c-bcm2835-Debug-test-for-curr_msg.patch29
-rw-r--r--kernel.spec16
-rw-r--r--sources2
-rw-r--r--ucount-Remove-the-atomicity-from-ucount-count.patch89
-rw-r--r--xgene-Fix-crash-on-DT-systems.patch43
-rw-r--r--xgene_enet-remove-bogus-forward-declarations.patch197
6 files changed, 250 insertions, 126 deletions
diff --git a/0001-i2c-bcm2835-Debug-test-for-curr_msg.patch b/0001-i2c-bcm2835-Debug-test-for-curr_msg.patch
deleted file mode 100644
index 4d4f0cb0f..000000000
--- a/0001-i2c-bcm2835-Debug-test-for-curr_msg.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 81c53729ee7c7f721c357ed3b531ebc97ca44051 Mon Sep 17 00:00:00 2001
-From: Eric Anholt <eric@anholt.net>
-Date: Wed, 15 Feb 2017 11:57:57 -0800
-Subject: [PATCH] i2c-bcm2835: Debug test for curr_msg
-
-Signed-off-by: Eric Anholt <eric@anholt.net>
----
- drivers/i2c/busses/i2c-bcm2835.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
-index c3436f627028..a75fab4dd660 100644
---- a/drivers/i2c/busses/i2c-bcm2835.c
-+++ b/drivers/i2c/busses/i2c-bcm2835.c
-@@ -195,7 +195,10 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data)
- }
-
- if (val & BCM2835_I2C_S_DONE) {
-- if (i2c_dev->curr_msg->flags & I2C_M_RD) {
-+ if (!i2c_dev->curr_msg) {
-+ dev_info(i2c_dev->dev,
-+ "Processing DONE interrupt with no msg\n");
-+ } else if (i2c_dev->curr_msg->flags & I2C_M_RD) {
- bcm2835_drain_rxfifo(i2c_dev);
- val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S);
- }
---
-2.11.0
-
diff --git a/kernel.spec b/kernel.spec
index 18c574ad4..a5b05af93 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -534,6 +534,9 @@ Patch425: ARM-tegra-usb-no-reset.patch
Patch426: AllWinner-net-emac.patch
+Patch427: xgene_enet-remove-bogus-forward-declarations.patch
+Patch428: xgene-Fix-crash-on-DT-systems.patch
+
# http://www.spinics.net/lists/devicetree/msg163238.html
Patch430: bcm2837-initial-support.patch
@@ -545,10 +548,6 @@ Patch432: bcm283x-VEC.patch
# http://www.spinics.net/lists/dri-devel/msg132235.html
Patch433: drm-vc4-Fix-OOPSes-from-trying-to-cache-a-partially-constructed-BO..patch
-# Fix RPi3 from crashing. Nowhere near a final fix but provides breathing room while that is sorted
-# https://github.com/anholt/linux/issues/89
-Patch434: 0001-i2c-bcm2835-Debug-test-for-curr_msg.patch
-
# Upstream fixes for i2c/serial/ethernet MAC addresses
Patch435: bcm283x-fixes.patch
@@ -629,9 +628,6 @@ Patch854: kvm-fix-page-struct-leak-in-handle_vmon.patch
#CVE-2017-6353 rhbz 1428907 1428910
Patch855: sctp-deny-peeloff-operation-on-asocs-with-threads-sl.patch
-#CVE-2017-6874 rhbz 1432429 1432430
-Patch856: ucount-Remove-the-atomicity-from-ucount-count.patch
-
# END OF PATCH DEFINITIONS
%endif
@@ -2204,6 +2200,12 @@ fi
#
#
%changelog
+* Mon Mar 20 2017 Justin M. Forbes <jforbes@fedoraproject.org> - 4.10.4-200
+- Linux v4.10.4
+
+* Sun Mar 19 2017 Peter Robinson <pbrobinson@fedoraproject.org>
+- Add upstream patches to improve xgene_enet stability a little
+
* Wed Mar 15 2017 Justin M. Forbes <jforbes@fedoraproject.org> - 4.10.3-200
- Linux v4.10.3 rebase
- CVE-2017-6874 Fix race condition in ucount.c (rhbz 1432429 1432430)
diff --git a/sources b/sources
index 31283f04e..87a5242dd 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
SHA512 (linux-4.10.tar.xz) = c3690125a8402df638095bd98a613fcf1a257b81de7611c84711d315cd11e2634ab4636302b3742aedf1e3ba9ce0fea53fe8c7d48e37865d8ee5db3565220d90
SHA512 (perf-man-4.10.tar.gz) = 2c830e06f47211d70a8330961487af73a8bc01073019475e6b6131d3bb8c95658b77ca0ae5f1b44371accf103658bc5a3a4366b3e017a4088a8fd408dd6867e8
-SHA512 (patch-4.10.3.xz) = ad297c3c9d52c15444bb76b3be6785a99219527614f39e84299f2121f2657377de4145a9a0c649b3719462c48e8aae8686267a521ad9e58a0372df117edf7594
+SHA512 (patch-4.10.4.xz) = a0631f3ee744984d9388d8e9ad98e7238d9305d94082db784b28080d9bae4f2c0cca84e4510ccfa562f5246ce1ed98c78cf41edc5a3b3bcc862ed62a1f2c8516
diff --git a/ucount-Remove-the-atomicity-from-ucount-count.patch b/ucount-Remove-the-atomicity-from-ucount-count.patch
deleted file mode 100644
index 1b4e3c03f..000000000
--- a/ucount-Remove-the-atomicity-from-ucount-count.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From 040757f738e13caaa9c5078bca79aa97e11dde88 Mon Sep 17 00:00:00 2001
-From: "Eric W. Biederman" <ebiederm@xmission.com>
-Date: Sun, 5 Mar 2017 15:03:22 -0600
-Subject: [PATCH] ucount: Remove the atomicity from ucount->count
-
-Always increment/decrement ucount->count under the ucounts_lock. The
-increments are there already and moving the decrements there means the
-locking logic of the code is simpler. This simplification in the
-locking logic fixes a race between put_ucounts and get_ucounts that
-could result in a use-after-free because the count could go zero then
-be found by get_ucounts and then be freed by put_ucounts.
-
-A bug presumably this one was found by a combination of syzkaller and
-KASAN. JongWhan Kim reported the syzkaller failure and Dmitry Vyukov
-spotted the race in the code.
-
-Cc: stable@vger.kernel.org
-Fixes: f6b2db1a3e8d ("userns: Make the count of user namespaces per user")
-Reported-by: JongHwan Kim <zzoru007@gmail.com>
-Reported-by: Dmitry Vyukov <dvyukov@google.com>
-Reviewed-by: Andrei Vagin <avagin@gmail.com>
-Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
----
- include/linux/user_namespace.h | 2 +-
- kernel/ucount.c | 18 +++++++++++-------
- 2 files changed, 12 insertions(+), 8 deletions(-)
-
-diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
-index be76523..32354b4 100644
---- a/include/linux/user_namespace.h
-+++ b/include/linux/user_namespace.h
-@@ -72,7 +72,7 @@ struct ucounts {
- struct hlist_node node;
- struct user_namespace *ns;
- kuid_t uid;
-- atomic_t count;
-+ int count;
- atomic_t ucount[UCOUNT_COUNTS];
- };
-
-diff --git a/kernel/ucount.c b/kernel/ucount.c
-index 62630a4..b4eeee0 100644
---- a/kernel/ucount.c
-+++ b/kernel/ucount.c
-@@ -144,7 +144,7 @@ static struct ucounts *get_ucounts(struct user_namespace *ns, kuid_t uid)
-
- new->ns = ns;
- new->uid = uid;
-- atomic_set(&new->count, 0);
-+ new->count = 0;
-
- spin_lock_irq(&ucounts_lock);
- ucounts = find_ucounts(ns, uid, hashent);
-@@ -155,8 +155,10 @@ static struct ucounts *get_ucounts(struct user_namespace *ns, kuid_t uid)
- ucounts = new;
- }
- }
-- if (!atomic_add_unless(&ucounts->count, 1, INT_MAX))
-+ if (ucounts->count == INT_MAX)
- ucounts = NULL;
-+ else
-+ ucounts->count += 1;
- spin_unlock_irq(&ucounts_lock);
- return ucounts;
- }
-@@ -165,13 +167,15 @@ static void put_ucounts(struct ucounts *ucounts)
- {
- unsigned long flags;
-
-- if (atomic_dec_and_test(&ucounts->count)) {
-- spin_lock_irqsave(&ucounts_lock, flags);
-+ spin_lock_irqsave(&ucounts_lock, flags);
-+ ucounts->count -= 1;
-+ if (!ucounts->count)
- hlist_del_init(&ucounts->node);
-- spin_unlock_irqrestore(&ucounts_lock, flags);
-+ else
-+ ucounts = NULL;
-+ spin_unlock_irqrestore(&ucounts_lock, flags);
-
-- kfree(ucounts);
-- }
-+ kfree(ucounts);
- }
-
- static inline bool atomic_inc_below(atomic_t *v, int u)
---
-2.9.3
-
diff --git a/xgene-Fix-crash-on-DT-systems.patch b/xgene-Fix-crash-on-DT-systems.patch
new file mode 100644
index 000000000..d91005af9
--- /dev/null
+++ b/xgene-Fix-crash-on-DT-systems.patch
@@ -0,0 +1,43 @@
+From patchwork Tue Feb 28 17:08:55 2017
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: drivers: net: xgene: Fix crash on DT systems
+From: Alban Bedel <alban.bedel@avionic-design.de>
+X-Patchwork-Id: 733734
+X-Patchwork-Delegate: davem@davemloft.net
+Message-Id: <20170228170855.8123-1-alban.bedel@avionic-design.de>
+To: netdev@vger.kernel.org
+Cc: Iyappan Subramanian <isubramanian@apm.com>,
+ Keyur Chudgar <kchudgar@apm.com>, linux-kernel@vger.kernel.org,
+ Alban Bedel <alban.bedel@avionic-design.de>
+Date: Tue, 28 Feb 2017 18:08:55 +0100
+
+On DT systems the driver require a clock, but the probe just print a
+warning and continue, leading to a crash when resetting the device.
+To fix this crash and properly handle probe deferals only ignore the
+missing clock if DT isn't used or if the clock doesn't exist.
+
+Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
+Acked-by: Iyappan Subramanian <isubramanian@apm.com>
+---
+ drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+index d0d0d12b531f..68b48edc5921 100644
+--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
++++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+@@ -1756,6 +1756,12 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
+
+ pdata->clk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(pdata->clk)) {
++ /* Abort if the clock is defined but couldn't be retrived.
++ * Always abort if the clock is missing on DT system as
++ * the driver can't cope with this case.
++ */
++ if (PTR_ERR(pdata->clk) != -ENOENT || dev->of_node)
++ return PTR_ERR(pdata->clk);
+ /* Firmware may have set up the clock already. */
+ dev_info(dev, "clocks have been setup already\n");
+ }
diff --git a/xgene_enet-remove-bogus-forward-declarations.patch b/xgene_enet-remove-bogus-forward-declarations.patch
new file mode 100644
index 000000000..f1262db85
--- /dev/null
+++ b/xgene_enet-remove-bogus-forward-declarations.patch
@@ -0,0 +1,197 @@
+From patchwork Wed Feb 1 16:46:02 2017
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [net-next] xgene_enet: remove bogus forward declarations
+From: Arnd Bergmann <arnd@arndb.de>
+X-Patchwork-Id: 9550123
+Message-Id: <20170201164639.2474782-1-arnd@arndb.de>
+To: "David S . Miller" <davem@davemloft.net>
+Cc: Arnd Bergmann <arnd@arndb.de>, Iyappan Subramanian <isubramanian@apm.com>,
+ Keyur Chudgar <kchudgar@apm.com>,
+ Florian Fainelli <f.fainelli@gmail.com>, Quan Nguyen <qnguyen@apm.com>,
+ Tanmay Inamdar <tinamdar@apm.com>,
+ stephen hemminger <stephen@networkplumber.org>,
+ netdev@vger.kernel.org, linux-kernel@vger.kernel.org
+Date: Wed, 1 Feb 2017 17:46:02 +0100
+
+The device match tables for both the xgene_enet driver and its phy driver
+have forward declarations that declare an array without a length, leading
+to a clang warning when they are not followed by an actual defitinition:
+
+drivers/net/ethernet/apm/xgene/../../../phy/mdio-xgene.h:135:34: warning: tentative array definition assumed to have one element
+drivers/net/ethernet/apm/xgene/xgene_enet_main.c:33:36: warning: tentative array definition assumed to have one element
+
+The declarations for the mdio driver are even in a header file, so they
+cause duplicate definitions of the tables for each file that includes
+them.
+
+This removes all four forward declarations and moves the actual
+definitions up a little, so they are in front of their first user. For
+the OF match tables, this means having to remove the #ifdef around them,
+and passing the actual structure into of_match_device(). This has no
+effect on the generated object code though, as the of_match_device
+function has an empty stub that does not evaluate its argument, and
+the symbol gets dropped either way.
+
+Fixes: 43b3cf6634a4 ("drivers: net: phy: xgene: Add MDIO driver")
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+---
+The bug is old, but relatively harmless, so not needed as a fixup for 4.10
+---
+ drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 50 ++++++++++++------------
+ drivers/net/phy/mdio-xgene.c | 50 ++++++++++++------------
+ drivers/net/phy/mdio-xgene.h | 4 --
+ 3 files changed, 48 insertions(+), 56 deletions(-)
+
+diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+index ab43c52723df..d0d0d12b531f 100644
+--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
++++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+@@ -1964,6 +1964,30 @@ static void xgene_enet_napi_add(struct xgene_enet_pdata *pdata)
+ }
+ }
+
++#ifdef CONFIG_ACPI
++static const struct acpi_device_id xgene_enet_acpi_match[] = {
++ { "APMC0D05", XGENE_ENET1},
++ { "APMC0D30", XGENE_ENET1},
++ { "APMC0D31", XGENE_ENET1},
++ { "APMC0D3F", XGENE_ENET1},
++ { "APMC0D26", XGENE_ENET2},
++ { "APMC0D25", XGENE_ENET2},
++ { }
++};
++MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match);
++#endif
++
++static const struct of_device_id xgene_enet_of_match[] = {
++ {.compatible = "apm,xgene-enet", .data = (void *)XGENE_ENET1},
++ {.compatible = "apm,xgene1-sgenet", .data = (void *)XGENE_ENET1},
++ {.compatible = "apm,xgene1-xgenet", .data = (void *)XGENE_ENET1},
++ {.compatible = "apm,xgene2-sgenet", .data = (void *)XGENE_ENET2},
++ {.compatible = "apm,xgene2-xgenet", .data = (void *)XGENE_ENET2},
++ {},
++};
++
++MODULE_DEVICE_TABLE(of, xgene_enet_of_match);
++
+ static int xgene_enet_probe(struct platform_device *pdev)
+ {
+ struct net_device *ndev;
+@@ -2110,32 +2134,6 @@ static void xgene_enet_shutdown(struct platform_device *pdev)
+ xgene_enet_remove(pdev);
+ }
+
+-#ifdef CONFIG_ACPI
+-static const struct acpi_device_id xgene_enet_acpi_match[] = {
+- { "APMC0D05", XGENE_ENET1},
+- { "APMC0D30", XGENE_ENET1},
+- { "APMC0D31", XGENE_ENET1},
+- { "APMC0D3F", XGENE_ENET1},
+- { "APMC0D26", XGENE_ENET2},
+- { "APMC0D25", XGENE_ENET2},
+- { }
+-};
+-MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match);
+-#endif
+-
+-#ifdef CONFIG_OF
+-static const struct of_device_id xgene_enet_of_match[] = {
+- {.compatible = "apm,xgene-enet", .data = (void *)XGENE_ENET1},
+- {.compatible = "apm,xgene1-sgenet", .data = (void *)XGENE_ENET1},
+- {.compatible = "apm,xgene1-xgenet", .data = (void *)XGENE_ENET1},
+- {.compatible = "apm,xgene2-sgenet", .data = (void *)XGENE_ENET2},
+- {.compatible = "apm,xgene2-xgenet", .data = (void *)XGENE_ENET2},
+- {},
+-};
+-
+-MODULE_DEVICE_TABLE(of, xgene_enet_of_match);
+-#endif
+-
+ static struct platform_driver xgene_enet_driver = {
+ .driver = {
+ .name = "xgene-enet",
+diff --git a/drivers/net/phy/mdio-xgene.c b/drivers/net/phy/mdio-xgene.c
+index 92af182951be..f095051beb54 100644
+--- a/drivers/net/phy/mdio-xgene.c
++++ b/drivers/net/phy/mdio-xgene.c
+@@ -311,6 +311,30 @@ static acpi_status acpi_register_phy(acpi_handle handle, u32 lvl,
+ }
+ #endif
+
++static const struct of_device_id xgene_mdio_of_match[] = {
++ {
++ .compatible = "apm,xgene-mdio-rgmii",
++ .data = (void *)XGENE_MDIO_RGMII
++ },
++ {
++ .compatible = "apm,xgene-mdio-xfi",
++ .data = (void *)XGENE_MDIO_XFI
++ },
++ {},
++};
++MODULE_DEVICE_TABLE(of, xgene_mdio_of_match);
++
++#ifdef CONFIG_ACPI
++static const struct acpi_device_id xgene_mdio_acpi_match[] = {
++ { "APMC0D65", XGENE_MDIO_RGMII },
++ { "APMC0D66", XGENE_MDIO_XFI },
++ { }
++};
++
++MODULE_DEVICE_TABLE(acpi, xgene_mdio_acpi_match);
++#endif
++
++
+ static int xgene_mdio_probe(struct platform_device *pdev)
+ {
+ struct device *dev = &pdev->dev;
+@@ -430,32 +454,6 @@ static int xgene_mdio_remove(struct platform_device *pdev)
+ return 0;
+ }
+
+-#ifdef CONFIG_OF
+-static const struct of_device_id xgene_mdio_of_match[] = {
+- {
+- .compatible = "apm,xgene-mdio-rgmii",
+- .data = (void *)XGENE_MDIO_RGMII
+- },
+- {
+- .compatible = "apm,xgene-mdio-xfi",
+- .data = (void *)XGENE_MDIO_XFI
+- },
+- {},
+-};
+-
+-MODULE_DEVICE_TABLE(of, xgene_mdio_of_match);
+-#endif
+-
+-#ifdef CONFIG_ACPI
+-static const struct acpi_device_id xgene_mdio_acpi_match[] = {
+- { "APMC0D65", XGENE_MDIO_RGMII },
+- { "APMC0D66", XGENE_MDIO_XFI },
+- { }
+-};
+-
+-MODULE_DEVICE_TABLE(acpi, xgene_mdio_acpi_match);
+-#endif
+-
+ static struct platform_driver xgene_mdio_driver = {
+ .driver = {
+ .name = "xgene-mdio",
+diff --git a/drivers/net/phy/mdio-xgene.h b/drivers/net/phy/mdio-xgene.h
+index 354241b53c1d..594a11d42401 100644
+--- a/drivers/net/phy/mdio-xgene.h
++++ b/drivers/net/phy/mdio-xgene.h
+@@ -132,10 +132,6 @@ static inline u64 xgene_enet_get_field_value(int pos, int len, u64 src)
+ #define GET_BIT(field, src) \
+ xgene_enet_get_field_value(field ## _POS, 1, src)
+
+-static const struct of_device_id xgene_mdio_of_match[];
+-#ifdef CONFIG_ACPI
+-static const struct acpi_device_id xgene_mdio_acpi_match[];
+-#endif
+ int xgene_mdio_rgmii_read(struct mii_bus *bus, int phy_id, int reg);
+ int xgene_mdio_rgmii_write(struct mii_bus *bus, int phy_id, int reg, u16 data);
+ struct phy_device *xgene_enet_phy_register(struct mii_bus *bus, int phy_addr);