kernel: bump 4.9 to 4.9.82

Refresh patches.
Remove upstreamed patches:
- ar7/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch
- backport/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch
Remove layerscape/819-Revert-dmaengine-dmatest-move-callback-wait-queue-to.patch,
it is superseded by upstream commit 297c7cc4b5651b174a62925b6c961085f04979fd.
Remove pending/650-pppoe_header_pad.patch, it is superseded by
upstream commit 1bd21b158e07e0b8c5a2ce832305a0ebfe42c480.
Update patches that no longer apply:
- ar71xx/004-register_gpio_driver_earlier.patch
- hack/204-module_strip.patch
- pending/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch

Fixes CVE-2017-8824.

Compile-tested: ar71xx.
Runtime-tested: ar71xx.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
This commit is contained in:
Stijn Tintel
2018-02-18 01:43:25 +01:00
parent 1c308bbbf5
commit f621b53951
27 changed files with 86 additions and 326 deletions

View File

@@ -421,7 +421,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
* These are the defined Ethernet Protocol ID's.
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6604,9 +6604,18 @@ int dev_set_mtu(struct net_device *dev,
@@ -6615,9 +6615,18 @@ int dev_set_mtu(struct net_device *dev,
if (new_mtu == dev->mtu)
return 0;

View File

@@ -17,7 +17,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -332,7 +332,7 @@ endif
@@ -334,7 +334,7 @@ endif
config QORIQ_CPUFREQ
tristate "CPU frequency scaling driver for Freescale QorIQ SoCs"

View File

@@ -781,7 +781,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
};
struct tcrypt_result {
@@ -1331,6 +1331,10 @@ static int do_test(const char *alg, u32
@@ -1333,6 +1333,10 @@ static int do_test(const char *alg, u32
ret += tcrypt_test("hmac(sha3-512)");
break;
@@ -792,7 +792,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
case 150:
ret += tcrypt_test("ansi_cprng");
break;
@@ -1392,6 +1396,9 @@ static int do_test(const char *alg, u32
@@ -1394,6 +1398,9 @@ static int do_test(const char *alg, u32
case 190:
ret += tcrypt_test("authenc(hmac(sha512),cbc(des3_ede))");
break;
@@ -802,7 +802,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
case 200:
test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
speed_template_16_24_32);
@@ -1406,9 +1413,9 @@ static int do_test(const char *alg, u32
@@ -1408,9 +1415,9 @@ static int do_test(const char *alg, u32
test_cipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0,
speed_template_32_40_48);
test_cipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0,
@@ -814,7 +814,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
test_cipher_speed("cts(cbc(aes))", ENCRYPT, sec, NULL, 0,
speed_template_16_24_32);
test_cipher_speed("cts(cbc(aes))", DECRYPT, sec, NULL, 0,
@@ -1839,9 +1846,9 @@ static int do_test(const char *alg, u32
@@ -1841,9 +1848,9 @@ static int do_test(const char *alg, u32
test_acipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0,
speed_template_32_40_48);
test_acipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0,
@@ -23462,7 +23462,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
/*
* Descriptor to instantiate RNG State Handle 0 in normal mode and
@@ -270,7 +271,7 @@ static int deinstantiate_rng(struct devi
@@ -274,7 +275,7 @@ static int deinstantiate_rng(struct devi
/*
* If the corresponding bit is set, then it means the state
* handle was initialized by us, and thus it needs to be
@@ -23471,7 +23471,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
*/
if ((1 << sh_idx) & state_handle_mask) {
/*
@@ -303,20 +304,24 @@ static int caam_remove(struct platform_d
@@ -307,20 +308,24 @@ static int caam_remove(struct platform_d
struct device *ctrldev;
struct caam_drv_private *ctrlpriv;
struct caam_ctrl __iomem *ctrl;
@@ -23504,7 +23504,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
deinstantiate_rng(ctrldev, ctrlpriv->rng4_sh_init);
/* Shut down debug views */
@@ -331,8 +336,8 @@ static int caam_remove(struct platform_d
@@ -335,8 +340,8 @@ static int caam_remove(struct platform_d
clk_disable_unprepare(ctrlpriv->caam_ipg);
clk_disable_unprepare(ctrlpriv->caam_mem);
clk_disable_unprepare(ctrlpriv->caam_aclk);
@@ -23515,7 +23515,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
return 0;
}
@@ -366,11 +371,8 @@ static void kick_trng(struct platform_de
@@ -370,11 +375,8 @@ static void kick_trng(struct platform_de
*/
val = (rd_reg32(&r4tst->rtsdctl) & RTSDCTL_ENT_DLY_MASK)
>> RTSDCTL_ENT_DLY_SHIFT;
@@ -23529,7 +23529,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
val = rd_reg32(&r4tst->rtsdctl);
val = (val & ~RTSDCTL_ENT_DLY_MASK) |
@@ -382,15 +384,12 @@ static void kick_trng(struct platform_de
@@ -386,15 +388,12 @@ static void kick_trng(struct platform_de
wr_reg32(&r4tst->rtfrqmax, RTFRQMAX_DISABLE);
/* read the control register */
val = rd_reg32(&r4tst->rtmctl);
@@ -23548,7 +23548,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
}
/**
@@ -411,28 +410,26 @@ int caam_get_era(void)
@@ -415,28 +414,26 @@ int caam_get_era(void)
}
EXPORT_SYMBOL(caam_get_era);
@@ -23592,7 +23592,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
struct device *dev;
struct device_node *nprop, *np;
struct caam_ctrl __iomem *ctrl;
@@ -452,9 +449,10 @@ static int caam_probe(struct platform_de
@@ -456,9 +453,10 @@ static int caam_probe(struct platform_de
dev = &pdev->dev;
dev_set_drvdata(dev, ctrlpriv);
@@ -23604,7 +23604,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
/* Enable clocking */
clk = caam_drv_identify_clk(&pdev->dev, "ipg");
if (IS_ERR(clk)) {
@@ -483,14 +481,16 @@ static int caam_probe(struct platform_de
@@ -487,14 +485,16 @@ static int caam_probe(struct platform_de
}
ctrlpriv->caam_aclk = clk;
@@ -23628,7 +23628,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
ret = clk_prepare_enable(ctrlpriv->caam_ipg);
if (ret < 0) {
@@ -511,11 +511,13 @@ static int caam_probe(struct platform_de
@@ -515,11 +515,13 @@ static int caam_probe(struct platform_de
goto disable_caam_mem;
}
@@ -23647,7 +23647,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
}
/* Get configuration properties from device tree */
@@ -542,13 +544,13 @@ static int caam_probe(struct platform_de
@@ -546,13 +548,13 @@ static int caam_probe(struct platform_de
else
BLOCK_OFFSET = PG_SIZE_64K;
@@ -23666,7 +23666,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
BLOCK_OFFSET * DECO_BLOCK_NUMBER
);
@@ -557,12 +559,17 @@ static int caam_probe(struct platform_de
@@ -561,12 +563,17 @@ static int caam_probe(struct platform_de
/*
* Enable DECO watchdogs and, if this is a PHYS_ADDR_T_64BIT kernel,
@@ -23689,7 +23689,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
/*
* Read the Compile Time paramters and SCFGR to determine
@@ -590,64 +597,69 @@ static int caam_probe(struct platform_de
@@ -594,64 +601,69 @@ static int caam_probe(struct platform_de
JRSTART_JR1_START | JRSTART_JR2_START |
JRSTART_JR3_START);
@@ -23797,7 +23797,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
}
/* If no QI and no rings specified, quit and go home */
@@ -662,8 +674,10 @@ static int caam_probe(struct platform_de
@@ -666,8 +678,10 @@ static int caam_probe(struct platform_de
/*
* If SEC has RNG version >= 4 and RNG state handle has not been
* already instantiated, do RNG instantiation
@@ -23809,7 +23809,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
ctrlpriv->rng4_sh_init =
rd_reg32(&ctrl->r4tst[0].rdsta);
/*
@@ -730,78 +744,47 @@ static int caam_probe(struct platform_de
@@ -734,78 +748,47 @@ static int caam_probe(struct platform_de
/* Report "alive" for developer to see */
dev_info(dev, "device ID = 0x%016llx (Era %d)\n", caam_id,
@@ -23923,7 +23923,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
ctrlpriv->ctl_kek_wrap.size = KEK_KEY_SIZE * sizeof(u32);
ctrlpriv->ctl_kek = debugfs_create_blob("kek",
S_IRUSR |
@@ -809,7 +792,7 @@ static int caam_probe(struct platform_de
@@ -813,7 +796,7 @@ static int caam_probe(struct platform_de
ctrlpriv->ctl,
&ctrlpriv->ctl_kek_wrap);
@@ -23932,7 +23932,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
ctrlpriv->ctl_tkek_wrap.size = KEK_KEY_SIZE * sizeof(u32);
ctrlpriv->ctl_tkek = debugfs_create_blob("tkek",
S_IRUSR |
@@ -817,7 +800,7 @@ static int caam_probe(struct platform_de
@@ -821,7 +804,7 @@ static int caam_probe(struct platform_de
ctrlpriv->ctl,
&ctrlpriv->ctl_tkek_wrap);
@@ -23941,7 +23941,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
ctrlpriv->ctl_tdsk_wrap.size = KEK_KEY_SIZE * sizeof(u32);
ctrlpriv->ctl_tdsk = debugfs_create_blob("tdsk",
S_IRUSR |
@@ -828,13 +811,17 @@ static int caam_probe(struct platform_de
@@ -832,13 +815,17 @@ static int caam_probe(struct platform_de
return 0;
caam_remove:
@@ -23960,7 +23960,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
disable_caam_aclk:
clk_disable_unprepare(ctrlpriv->caam_aclk);
disable_caam_mem:
@@ -844,17 +831,6 @@ disable_caam_ipg:
@@ -848,17 +835,6 @@ disable_caam_ipg:
return ret;
}

View File

@@ -1,134 +0,0 @@
From 8772422ee95b17d87b5cb6cb4318b7ec73f4cfcf Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Mon, 29 Jan 2018 18:04:07 +0800
Subject: [PATCH] Revert "dmaengine: dmatest: move callback wait queue to
thread context"
This reverts commit 679dbeac0b6bb551e1f3b95673695b22b2ac953d.
---
drivers/dma/dmatest.c | 55 ++++++++++++++++++++++-----------------------------
1 file changed, 24 insertions(+), 31 deletions(-)
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -158,12 +158,6 @@ MODULE_PARM_DESC(run, "Run the test (def
#define PATTERN_OVERWRITE 0x20
#define PATTERN_COUNT_MASK 0x1f
-/* poor man's completion - we want to use wait_event_freezable() on it */
-struct dmatest_done {
- bool done;
- wait_queue_head_t *wait;
-};
-
struct dmatest_thread {
struct list_head node;
struct dmatest_info *info;
@@ -172,8 +166,6 @@ struct dmatest_thread {
u8 **srcs;
u8 **dsts;
enum dma_transaction_type type;
- wait_queue_head_t done_wait;
- struct dmatest_done test_done;
bool done;
};
@@ -334,25 +326,18 @@ static unsigned int dmatest_verify(u8 **
return error_count;
}
+/* poor man's completion - we want to use wait_event_freezable() on it */
+struct dmatest_done {
+ bool done;
+ wait_queue_head_t *wait;
+};
static void dmatest_callback(void *arg)
{
struct dmatest_done *done = arg;
- struct dmatest_thread *thread =
- container_of(arg, struct dmatest_thread, done_wait);
- if (!thread->done) {
- done->done = true;
- wake_up_all(done->wait);
- } else {
- /*
- * If thread->done, it means that this callback occurred
- * after the parent thread has cleaned up. This can
- * happen in the case that driver doesn't implement
- * the terminate_all() functionality and a dma operation
- * did not occur within the timeout period
- */
- WARN(1, "dmatest: Kernel memory may be corrupted!!\n");
- }
+
+ done->done = true;
+ wake_up_all(done->wait);
}
static unsigned int min_odd(unsigned int x, unsigned int y)
@@ -423,8 +408,9 @@ static unsigned long long dmatest_KBs(s6
*/
static int dmatest_func(void *data)
{
+ DECLARE_WAIT_QUEUE_HEAD_ONSTACK(done_wait);
struct dmatest_thread *thread = data;
- struct dmatest_done *done = &thread->test_done;
+ struct dmatest_done done = { .wait = &done_wait };
struct dmatest_info *info;
struct dmatest_params *params;
struct dma_chan *chan;
@@ -651,9 +637,9 @@ static int dmatest_func(void *data)
continue;
}
- done->done = false;
+ done.done = false;
tx->callback = dmatest_callback;
- tx->callback_param = done;
+ tx->callback_param = &done;
cookie = tx->tx_submit(tx);
if (dma_submit_error(cookie)) {
@@ -666,12 +652,21 @@ static int dmatest_func(void *data)
}
dma_async_issue_pending(chan);
- wait_event_freezable_timeout(thread->done_wait, done->done,
+ wait_event_freezable_timeout(done_wait, done.done,
msecs_to_jiffies(params->timeout));
status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);
- if (!done->done) {
+ if (!done.done) {
+ /*
+ * We're leaving the timed out dma operation with
+ * dangling pointer to done_wait. To make this
+ * correct, we'll need to allocate wait_done for
+ * each test iteration and perform "who's gonna
+ * free it this time?" dancing. For now, just
+ * leave it dangling.
+ */
+ WARN(1, "dmatest: Kernel stack may be corrupted!!\n");
dmaengine_unmap_put(um);
result("test timed out", total_tests, src_off, dst_off,
len, 0);
@@ -752,7 +747,7 @@ err_thread_type:
dmatest_KBs(runtime, total_len), ret);
/* terminate all transfers on specified channels */
- if (ret || failed_tests)
+ if (ret)
dmaengine_terminate_all(chan);
thread->done = true;
@@ -812,8 +807,6 @@ static int dmatest_add_threads(struct dm
thread->info = info;
thread->chan = dtc->chan;
thread->type = type;
- thread->test_done.wait = &thread->done_wait;
- init_waitqueue_head(&thread->done_wait);
smp_wmb();
thread->task = kthread_create(dmatest_func, thread, "%s-%s%u",
dma_chan_name(chan), op, i);