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

@@ -145,7 +145,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -311,7 +311,7 @@ static void tcp_delack_timer(unsigned lo
@@ -326,7 +326,7 @@ static void tcp_delack_timer(unsigned lo
inet_csk(sk)->icsk_ack.blocked = 1;
__NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED);
/* deleguate our work to tcp_release_cb() */
@@ -154,7 +154,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
sock_hold(sk);
}
bh_unlock_sock(sk);
@@ -594,7 +594,7 @@ static void tcp_write_timer(unsigned lon
@@ -609,7 +609,7 @@ static void tcp_write_timer(unsigned lon
tcp_write_timer_handler(sk);
} else {
/* delegate our work to tcp_release_cb() */

View File

@@ -1,25 +0,0 @@
From 4b05f09db650d215632da97f2c25ceba8235102a Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 26 Nov 2017 00:09:45 +0100
Subject: [PATCH] crypto: fix typo in KPP dependency of CRYPTO_ECDH
This fixes a typo in the CRYPTO_KPP dependency of CRYPTO_ECDH.
Fixes: 3c4b23901a0c ("crypto: ecdh - Add ECDH software support")
Cc: <stable@vger.kernel.org> # v4.8+
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
crypto/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -120,7 +120,7 @@ config CRYPTO_DH
config CRYPTO_ECDH
tristate "ECDH algorithm"
- select CRYTPO_KPP
+ select CRYPTO_KPP
help
Generic implementation of the ECDH algorithm

View File

@@ -1040,7 +1040,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
writel(irq->mask, adpt->base + EMAC_INT_MASK);
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7579,7 +7579,7 @@ static int rtl8169_poll(struct napi_stru
@@ -7574,7 +7574,7 @@ static int rtl8169_poll(struct napi_stru
}
if (work_done < budget) {
@@ -1379,7 +1379,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
*/
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1059,7 +1059,7 @@ err:
@@ -1061,7 +1061,7 @@ err:
if (work_done < budget) {
int more_to_do = 0;

View File

@@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2115,6 +2115,13 @@ config TRIM_UNUSED_KSYMS
@@ -2122,6 +2122,13 @@ config TRIM_UNUSED_KSYMS
If unsure, or if you need to build out-of-tree modules, say N.
@@ -114,7 +114,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
config MODULES_TREE_LOOKUP
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2945,9 +2945,11 @@ static struct module *setup_load_info(st
@@ -2954,9 +2954,11 @@ static struct module *setup_load_info(st
static int check_modinfo(struct module *mod, struct load_info *info, int flags)
{
@@ -127,14 +127,14 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (flags & MODULE_INIT_IGNORE_VERMAGIC)
modmagic = NULL;
@@ -2968,6 +2970,7 @@ static int check_modinfo(struct module *
@@ -2977,6 +2979,7 @@ static int check_modinfo(struct module *
mod->name);
add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);
}
+#endif
if (get_modinfo(info, "staging")) {
add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK);
check_modinfo_retpoline(mod, info);
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1965,7 +1965,9 @@ static void read_symbols(char *modname)
@@ -157,7 +157,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
buf_printf(b, "\n");
buf_printf(b, "__visible struct module __this_module\n");
buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");
@@ -2126,16 +2130,20 @@ static void add_header(struct buffer *b,
@@ -2126,24 +2130,30 @@ static void add_header(struct buffer *b,
static void add_intree_flag(struct buffer *b, int is_intree)
{
@@ -167,6 +167,16 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+#endif
}
/* Cannot check for assembler */
static void add_retpoline(struct buffer *b)
{
+#ifndef CONFIG_MODULE_STRIPPED
buf_printf(b, "\n#ifdef RETPOLINE\n");
buf_printf(b, "MODULE_INFO(retpoline, \"Y\");\n");
buf_printf(b, "#endif\n");
+#endif
}
static void add_staging_flag(struct buffer *b, const char *name)
{
+#ifndef CONFIG_MODULE_STRIPPED
@@ -178,7 +188,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
/* In kernel, this size is defined in linux/module.h;
@@ -2239,11 +2247,13 @@ static void add_depends(struct buffer *b
@@ -2247,11 +2257,13 @@ static void add_depends(struct buffer *b
static void add_srcversion(struct buffer *b, struct module *mod)
{
@@ -192,7 +202,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
static void write_if_changed(struct buffer *b, const char *fname)
@@ -2477,7 +2487,9 @@ int main(int argc, char **argv)
@@ -2486,7 +2498,9 @@ int main(int argc, char **argv)
add_staging_flag(&buf, mod->name);
err |= add_versions(&buf, mod);
add_depends(&buf, mod, modules);

View File

@@ -132,7 +132,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
do { \
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -1058,6 +1058,9 @@ void __init msg_init(void)
@@ -1061,6 +1061,9 @@ void __init msg_init(void)
{
msg_init_ns(&init_ipc_ns);

View File

@@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf <dev-NTEO@vplace.de>
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5923,7 +5923,7 @@ static void __ref alloc_node_mem_map(str
@@ -5918,7 +5918,7 @@ static void __ref alloc_node_mem_map(str
mem_map = NODE_DATA(0)->node_mem_map;
#if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM)
if (page_to_pfn(mem_map) != pgdat->node_start_pfn)

View File

@@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/drivers/mtd/ubi/block.c
+++ b/drivers/mtd/ubi/block.c
@@ -627,6 +627,44 @@ static void __init ubiblock_create_from_
@@ -635,6 +635,44 @@ static void __init ubiblock_create_from_
}
}
@@ -53,7 +53,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
static void ubiblock_remove_all(void)
{
struct ubiblock *next;
@@ -657,6 +695,10 @@ int __init ubiblock_init(void)
@@ -667,6 +705,10 @@ int __init ubiblock_init(void)
*/
ubiblock_create_from_param();

View File

@@ -17,9 +17,9 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
#include "ubi-media.h"
#include "ubi.h"
@@ -447,6 +448,15 @@ int ubiblock_create(struct ubi_volume_in
add_disk(dev->gd);
dev_info(disk_to_dev(dev->gd), "created from ubi%d:%d(%s)",
dev->ubi_num, dev->vol_id, vi->name);
mutex_unlock(&devices_mutex);
+
+ if (!strcmp(vi->name, "rootfs") &&
+ IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) &&

View File

@@ -1,29 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Subject: pppoe: add extra padding for the header (useful for drivers that need headroom)
lede-commit 6517a757ec711fc3354b857e273e2621042f3c7a
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
drivers/net/ppp/pppoe.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -861,7 +861,7 @@ static int pppoe_sendmsg(struct socket *
goto end;
- skb = sock_wmalloc(sk, total_len + dev->hard_header_len + 32,
+ skb = sock_wmalloc(sk, total_len + dev->hard_header_len + 32 + NET_SKB_PAD,
0, GFP_KERNEL);
if (!skb) {
error = -ENOMEM;
@@ -869,7 +869,7 @@ static int pppoe_sendmsg(struct socket *
}
/* Reserve space for headers. */
- skb_reserve(skb, dev->hard_header_len);
+ skb_reserve(skb, dev->hard_header_len + NET_SKB_PAD);
skb_reset_network_header(skb);
skb->dev = dev;

View File

@@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
__u16 tc_index; /* traffic control index */
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4524,6 +4524,9 @@ static enum gro_result dev_gro_receive(s
@@ -4535,6 +4535,9 @@ static enum gro_result dev_gro_receive(s
enum gro_result ret;
int grow;
@@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!(skb->dev->features & NETIF_F_GRO))
goto normal;
@@ -5812,6 +5815,48 @@ static void __netdev_adjacent_dev_unlink
@@ -5823,6 +5826,48 @@ static void __netdev_adjacent_dev_unlink
&upper_dev->adj_list.lower);
}
@@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int __netdev_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev, bool master,
void *upper_priv, void *upper_info)
@@ -6010,6 +6055,8 @@ void netdev_upper_dev_unlink(struct net_
@@ -6021,6 +6066,8 @@ void netdev_upper_dev_unlink(struct net_
list_for_each_entry(i, &upper_dev->all_adj_list.upper, list)
__netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr);
@@ -102,7 +102,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
&changeupper_info.info);
}
@@ -6610,6 +6657,7 @@ int dev_set_mac_address(struct net_devic
@@ -6621,6 +6668,7 @@ int dev_set_mac_address(struct net_devic
if (err)
return err;
dev->addr_assign_type = NET_ADDR_SET;

View File

@@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
/**
* ata_build_rw_tf - Build ATA taskfile for given read/write request
* @tf: Target ATA taskfile
@@ -4963,6 +4976,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
@@ -4964,6 +4977,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
if (tag < 0)
return NULL;
}
@@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
qc = __ata_qc_from_tag(ap, tag);
qc->tag = tag;
@@ -5865,6 +5881,9 @@ struct ata_port *ata_port_alloc(struct a
@@ -5866,6 +5882,9 @@ struct ata_port *ata_port_alloc(struct a
ap->stats.unhandled_irq = 1;
ap->stats.idle_irq = 1;
#endif
@@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
ata_sff_port_init(ap);
return ap;
@@ -5886,6 +5905,12 @@ static void ata_host_release(struct devi
@@ -5887,6 +5906,12 @@ static void ata_host_release(struct devi
kfree(ap->pmp_link);
kfree(ap->slave_link);
@@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
kfree(ap);
host->ports[i] = NULL;
}
@@ -6332,7 +6357,23 @@ int ata_host_register(struct ata_host *h
@@ -6333,7 +6358,23 @@ int ata_host_register(struct ata_host *h
host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
host->ports[i]->local_port_no = i + 1;
}

View File

@@ -13,7 +13,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1687,6 +1687,15 @@ config EMBEDDED
@@ -1694,6 +1694,15 @@ config EMBEDDED
an embedded system so certain expert options are available
for configuration.