From 7adb8c71f771784588cfce7899fa7372cd4b111a Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Tue, 16 Jun 2020 15:37:44 +0200 Subject: [PATCH] kernel: bump 4.9 to 4.9.227 Refreshed all patches. Altered patches: - 201-extra_optimization.patch Fixes: - CVE-2020-10757 Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- ...or-releasing-multiple-instances-of-a.patch | 2 +- ...c_page_frag-to-page_frag_alloc-and-_.patch | 4 ++-- ..._frag-functions-to-__page_frag_cache.patch | 6 +++--- ...90-net-generalize-napi_complete_done.patch | 2 +- .../hack-4.9/207-disable-modorder.patch | 4 ++-- .../generic/hack-4.9/220-gc_sections.patch | 2 +- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- .../pending-4.9/201-extra_optimization.patch | 12 ++++------- .../332-arc-add-OWRTDTB-section.patch | 4 ++-- ...ng-with-source-address-failed-policy.patch | 20 +++++++++---------- 11 files changed, 29 insertions(+), 33 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index f7d73cdcf8..257644dee7 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .223 +LINUX_VERSION-4.9 = .227 LINUX_VERSION-4.14 = .180 -LINUX_KERNEL_HASH-4.9.223 = cf5300e6f5d8c66c2bed8f00d53f9c58103731809862427012e4010f5d782ae5 +LINUX_KERNEL_HASH-4.9.227 = 38c485b411a14e825f8a66a5c2e64f1480397325a5f692b4929f68d228070c5f LINUX_KERNEL_HASH-4.14.180 = 444ef973d9b6a6ea174e4a9086f0aea980d8575d13302e431ad688f22e27ed0e remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/generic/backport-4.9/040-mm-add-support-for-releasing-multiple-instances-of-a.patch b/target/linux/generic/backport-4.9/040-mm-add-support-for-releasing-multiple-instances-of-a.patch index 4656bb1db3..f919aa2203 100644 --- a/target/linux/generic/backport-4.9/040-mm-add-support-for-releasing-multiple-instances-of-a.patch +++ b/target/linux/generic/backport-4.9/040-mm-add-support-for-releasing-multiple-instances-of-a.patch @@ -52,7 +52,7 @@ Signed-off-by: Linus Torvalds extern void __free_page_frag(void *addr); --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -3935,6 +3935,20 @@ static struct page *__page_frag_refill(s +@@ -3936,6 +3936,20 @@ static struct page *__page_frag_refill(s return page; } diff --git a/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch b/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch index 03481d13c8..7dd86b5a65 100644 --- a/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch +++ b/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch @@ -63,7 +63,7 @@ Signed-off-by: Linus Torvalds void *napi_alloc_frag(unsigned int fragsz); --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -3949,8 +3949,8 @@ void __page_frag_drain(struct page *page +@@ -3950,8 +3950,8 @@ void __page_frag_drain(struct page *page } EXPORT_SYMBOL(__page_frag_drain); @@ -74,7 +74,7 @@ Signed-off-by: Linus Torvalds { unsigned int size = PAGE_SIZE; struct page *page; -@@ -4001,19 +4001,19 @@ refill: +@@ -4002,19 +4002,19 @@ refill: return nc->va + offset; } diff --git a/target/linux/generic/backport-4.9/042-mm-rename-__page_frag-functions-to-__page_frag_cache.patch b/target/linux/generic/backport-4.9/042-mm-rename-__page_frag-functions-to-__page_frag_cache.patch index cb2bdfc7ee..5a1cfcdef5 100644 --- a/target/linux/generic/backport-4.9/042-mm-rename-__page_frag-functions-to-__page_frag_cache.patch +++ b/target/linux/generic/backport-4.9/042-mm-rename-__page_frag-functions-to-__page_frag_cache.patch @@ -33,7 +33,7 @@ Signed-off-by: Linus Torvalds extern void page_frag_free(void *addr); --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -3914,8 +3914,8 @@ EXPORT_SYMBOL(free_pages); +@@ -3915,8 +3915,8 @@ EXPORT_SYMBOL(free_pages); * drivers to provide a backing region of memory for use as either an * sk_buff->head, or to be used in the "frags" portion of skb_shared_info. */ @@ -44,7 +44,7 @@ Signed-off-by: Linus Torvalds { struct page *page = NULL; gfp_t gfp = gfp_mask; -@@ -3935,19 +3935,20 @@ static struct page *__page_frag_refill(s +@@ -3936,19 +3936,20 @@ static struct page *__page_frag_refill(s return page; } @@ -68,7 +68,7 @@ Signed-off-by: Linus Torvalds void *page_frag_alloc(struct page_frag_cache *nc, unsigned int fragsz, gfp_t gfp_mask) -@@ -3958,7 +3959,7 @@ void *page_frag_alloc(struct page_frag_c +@@ -3959,7 +3960,7 @@ void *page_frag_alloc(struct page_frag_c if (unlikely(!nc->va)) { refill: diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index 712348c835..2de053f354 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -657,7 +657,7 @@ Signed-off-by: David S. Miller gfar_write(®s->rstat, gfargrp->rstat); --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c -@@ -3303,7 +3303,7 @@ static int ucc_geth_poll(struct napi_str +@@ -3304,7 +3304,7 @@ static int ucc_geth_poll(struct napi_str howmany += ucc_geth_rx(ugeth, i, budget - howmany); if (howmany < budget) { diff --git a/target/linux/generic/hack-4.9/207-disable-modorder.patch b/target/linux/generic/hack-4.9/207-disable-modorder.patch index 62f67ac95d..d07c38f19e 100644 --- a/target/linux/generic/hack-4.9/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.9/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1240,7 +1240,6 @@ all: modules +@@ -1245,7 +1245,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild -@@ -1270,7 +1269,6 @@ _modinst_: +@@ -1275,7 +1274,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.9/220-gc_sections.patch b/target/linux/generic/hack-4.9/220-gc_sections.patch index e795d666df..8da4a36205 100644 --- a/target/linux/generic/hack-4.9/220-gc_sections.patch +++ b/target/linux/generic/hack-4.9/220-gc_sections.patch @@ -43,7 +43,7 @@ Signed-off-by: Gabor Juhos -endif - ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE - KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION) + KBUILD_CFLAGS += -Os $(EXTRA_OPTIMIZATION) else --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig diff --git a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 0f6ce1f802..56b70697ee 100644 --- a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -5924,7 +5924,7 @@ static void __ref alloc_node_mem_map(str +@@ -5925,7 +5925,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) diff --git a/target/linux/generic/pending-4.9/201-extra_optimization.patch b/target/linux/generic/pending-4.9/201-extra_optimization.patch index 813951158c..cf17cd76ac 100644 --- a/target/linux/generic/pending-4.9/201-extra_optimization.patch +++ b/target/linux/generic/pending-4.9/201-extra_optimization.patch @@ -14,19 +14,15 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -658,12 +658,12 @@ KBUILD_CFLAGS += $(call cc-option,-fdata +@@ -658,9 +658,9 @@ KBUILD_CFLAGS += $(call cc-option,-fdata endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE --KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) -+KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION) - else - ifdef CONFIG_PROFILE_ALL_BRANCHES --KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) -+KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION) +-KBUILD_CFLAGS += -Os ++KBUILD_CFLAGS += -Os $(EXTRA_OPTIMIZATION) else -KBUILD_CFLAGS += -O2 +KBUILD_CFLAGS += -O2 -fno-reorder-blocks -fno-tree-ch $(EXTRA_OPTIMIZATION) endif - endif + # Tell gcc to never replace conditional load with a non-conditional one diff --git a/target/linux/generic/pending-4.9/332-arc-add-OWRTDTB-section.patch b/target/linux/generic/pending-4.9/332-arc-add-OWRTDTB-section.patch index 6f248343ab..66455a6b2e 100644 --- a/target/linux/generic/pending-4.9/332-arc-add-OWRTDTB-section.patch +++ b/target/linux/generic/pending-4.9/332-arc-add-OWRTDTB-section.patch @@ -38,7 +38,7 @@ Signed-off-by: Alexey Brodkin ;---------------------------------------------------------------- --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c -@@ -404,6 +404,8 @@ static inline bool uboot_arg_invalid(uns +@@ -405,6 +405,8 @@ static inline bool uboot_arg_invalid(uns /* We always pass 0 as magic from U-boot */ #define UBOOT_MAGIC_VALUE 0 @@ -47,7 +47,7 @@ Signed-off-by: Alexey Brodkin void __init handle_uboot_args(void) { bool use_embedded_dtb = true; -@@ -444,7 +446,7 @@ ignore_uboot_args: +@@ -445,7 +447,7 @@ ignore_uboot_args: #endif if (use_embedded_dtb) { diff --git a/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index b9c7aa06c9..f71aac4956 100644 --- a/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -141,7 +141,7 @@ Signed-off-by: Jonas Gorski static const struct rt6_info ip6_blk_hole_entry_template = { .dst = { .__refcnt = ATOMIC_INIT(1), -@@ -1970,6 +1987,11 @@ static struct rt6_info *ip6_route_info_c +@@ -1972,6 +1989,11 @@ static struct rt6_info *ip6_route_info_c rt->dst.output = ip6_pkt_prohibit_out; rt->dst.input = ip6_pkt_prohibit; break; @@ -153,7 +153,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: case RTN_UNREACHABLE: default: -@@ -2613,6 +2635,17 @@ static int ip6_pkt_prohibit_out(struct n +@@ -2615,6 +2637,17 @@ static int ip6_pkt_prohibit_out(struct n return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -171,7 +171,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -2850,7 +2883,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -2852,7 +2885,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -181,7 +181,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -3223,6 +3257,9 @@ static int rt6_fill_node(struct net *net +@@ -3225,6 +3259,9 @@ static int rt6_fill_node(struct net *net case -EACCES: rtm->rtm_type = RTN_PROHIBIT; break; @@ -191,7 +191,7 @@ Signed-off-by: Jonas Gorski case -EAGAIN: rtm->rtm_type = RTN_THROW; break; -@@ -3499,6 +3536,8 @@ static int ip6_route_dev_notify(struct n +@@ -3501,6 +3538,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -200,7 +200,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3510,6 +3549,7 @@ static int ip6_route_dev_notify(struct n +@@ -3512,6 +3551,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put(net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put(net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -208,7 +208,7 @@ Signed-off-by: Jonas Gorski in6_dev_put(net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -3725,6 +3765,17 @@ static int __net_init ip6_route_net_init +@@ -3727,6 +3767,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -226,7 +226,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -3743,6 +3794,8 @@ out: +@@ -3745,6 +3796,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -235,7 +235,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -3760,6 +3813,7 @@ static void __net_exit ip6_route_net_exi +@@ -3762,6 +3815,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -3833,6 +3887,9 @@ void __init ip6_route_init_special_entri +@@ -3835,6 +3889,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); -- 2.30.2