From 9950c632b2e1d1cf81377d81f3eaba6220789e14 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 27 Dec 2018 21:51:09 +0800 Subject: [PATCH] kernel: update upsteam patch --- ...e-protect-delay-slot-emulation-pages.patch | 119 ++++++++++++++++++ ...fix-cache-flushing-for-highmem-pages.patch | 30 ----- ...-uninitialized-delayed_work-lockdep-.patch | 62 +++++++++ ...-generic-parsing-of-linux-part-probe.patch | 6 +- .../400-mtd-add-rootfs-split-support.patch | 30 ++--- ...for-different-partition-parser-types.patch | 4 +- ...arsers-for-rootfs-and-firmware-split.patch | 12 +- .../404-mtd-add-more-helper-functions.patch | 8 +- .../411-mtd-partial_eraseblock_write.patch | 10 +- .../412-mtd-partial_eraseblock_unlock.patch | 2 +- ...-mtd-core-add-get_mtd_device_by_node.patch | 4 +- .../530-jffs2_make_lzma_available.patch | 2 +- .../pending-4.14/831-ledtrig_netdev.patch | 74 ----------- 13 files changed, 212 insertions(+), 151 deletions(-) create mode 100644 target/linux/generic/backport-4.14/096-mips-math-emu-Write-protect-delay-slot-emulation-pages.patch delete mode 100644 target/linux/generic/pending-4.14/100-MIPS-fix-cache-flushing-for-highmem-pages.patch create mode 100644 target/linux/generic/pending-4.14/142-jffs2-Fix-use-of-uninitialized-delayed_work-lockdep-.patch delete mode 100644 target/linux/generic/pending-4.14/831-ledtrig_netdev.patch diff --git a/target/linux/generic/backport-4.14/096-mips-math-emu-Write-protect-delay-slot-emulation-pages.patch b/target/linux/generic/backport-4.14/096-mips-math-emu-Write-protect-delay-slot-emulation-pages.patch new file mode 100644 index 000000000..f428285a6 --- /dev/null +++ b/target/linux/generic/backport-4.14/096-mips-math-emu-Write-protect-delay-slot-emulation-pages.patch @@ -0,0 +1,119 @@ +From adcc81f148d733b7e8e641300c5590a2cdc13bf3 Mon Sep 17 00:00:00 2001 +From: Paul Burton +Date: Thu, 20 Dec 2018 17:45:43 +0000 +Subject: MIPS: math-emu: Write-protect delay slot emulation pages + +Mapping the delay slot emulation page as both writeable & executable +presents a security risk, in that if an exploit can write to & jump into +the page then it can be used as an easy way to execute arbitrary code. + +Prevent this by mapping the page read-only for userland, and using +access_process_vm() with the FOLL_FORCE flag to write to it from +mips_dsemul(). + +This will likely be less efficient due to copy_to_user_page() performing +cache maintenance on a whole page, rather than a single line as in the +previous use of flush_cache_sigtramp(). However this delay slot +emulation code ought not to be running in any performance critical paths +anyway so this isn't really a problem, and we can probably do better in +copy_to_user_page() anyway in future. + +A major advantage of this approach is that the fix is small & simple to +backport to stable kernels. + +Reported-by: Andy Lutomirski +Signed-off-by: Paul Burton +Fixes: 432c6bacbd0c ("MIPS: Use per-mm page to execute branch delay slot instructions") +Cc: stable@vger.kernel.org # v4.8+ +Cc: linux-mips@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Cc: Rich Felker +Cc: David Daney +--- + arch/mips/kernel/vdso.c | 4 ++-- + arch/mips/math-emu/dsemul.c | 38 ++++++++++++++++++++------------------ + 2 files changed, 22 insertions(+), 20 deletions(-) + +--- a/arch/mips/kernel/vdso.c ++++ b/arch/mips/kernel/vdso.c +@@ -126,8 +126,8 @@ int arch_setup_additional_pages(struct l + + /* Map delay slot emulation page */ + base = mmap_region(NULL, STACK_TOP, PAGE_SIZE, +- VM_READ|VM_WRITE|VM_EXEC| +- VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC, ++ VM_READ | VM_EXEC | ++ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC, + 0, NULL); + if (IS_ERR_VALUE(base)) { + ret = base; +--- a/arch/mips/math-emu/dsemul.c ++++ b/arch/mips/math-emu/dsemul.c +@@ -214,8 +214,9 @@ int mips_dsemul(struct pt_regs *regs, mi + { + int isa16 = get_isa16_mode(regs->cp0_epc); + mips_instruction break_math; +- struct emuframe __user *fr; +- int err, fr_idx; ++ unsigned long fr_uaddr; ++ struct emuframe fr; ++ int fr_idx, ret; + + /* NOP is easy */ + if (ir == 0) +@@ -250,27 +251,31 @@ int mips_dsemul(struct pt_regs *regs, mi + fr_idx = alloc_emuframe(); + if (fr_idx == BD_EMUFRAME_NONE) + return SIGBUS; +- fr = &dsemul_page()[fr_idx]; + + /* Retrieve the appropriately encoded break instruction */ + break_math = BREAK_MATH(isa16); + + /* Write the instructions to the frame */ + if (isa16) { +- err = __put_user(ir >> 16, +- (u16 __user *)(&fr->emul)); +- err |= __put_user(ir & 0xffff, +- (u16 __user *)((long)(&fr->emul) + 2)); +- err |= __put_user(break_math >> 16, +- (u16 __user *)(&fr->badinst)); +- err |= __put_user(break_math & 0xffff, +- (u16 __user *)((long)(&fr->badinst) + 2)); ++ union mips_instruction _emul = { ++ .halfword = { ir >> 16, ir } ++ }; ++ union mips_instruction _badinst = { ++ .halfword = { break_math >> 16, break_math } ++ }; ++ ++ fr.emul = _emul.word; ++ fr.badinst = _badinst.word; + } else { +- err = __put_user(ir, &fr->emul); +- err |= __put_user(break_math, &fr->badinst); ++ fr.emul = ir; ++ fr.badinst = break_math; + } + +- if (unlikely(err)) { ++ /* Write the frame to user memory */ ++ fr_uaddr = (unsigned long)&dsemul_page()[fr_idx]; ++ ret = access_process_vm(current, fr_uaddr, &fr, sizeof(fr), ++ FOLL_FORCE | FOLL_WRITE); ++ if (unlikely(ret != sizeof(fr))) { + MIPS_FPU_EMU_INC_STATS(errors); + free_emuframe(fr_idx, current->mm); + return SIGBUS; +@@ -282,10 +287,7 @@ int mips_dsemul(struct pt_regs *regs, mi + atomic_set(¤t->thread.bd_emu_frame, fr_idx); + + /* Change user register context to execute the frame */ +- regs->cp0_epc = (unsigned long)&fr->emul | isa16; +- +- /* Ensure the icache observes our newly written frame */ +- flush_cache_sigtramp((unsigned long)&fr->emul); ++ regs->cp0_epc = fr_uaddr | isa16; + + return 0; + } diff --git a/target/linux/generic/pending-4.14/100-MIPS-fix-cache-flushing-for-highmem-pages.patch b/target/linux/generic/pending-4.14/100-MIPS-fix-cache-flushing-for-highmem-pages.patch deleted file mode 100644 index b1c65f7cd..000000000 --- a/target/linux/generic/pending-4.14/100-MIPS-fix-cache-flushing-for-highmem-pages.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Felix Fietkau -Subject: MIPS: fix cache flushing for highmem pages - -Most cache flush ops were no-op for highmem pages. This led to nasty -segfaults and (in the case of page_address(page) == NULL) kernel -crashes. - -Fix this by always flushing highmem pages using kmap/kunmap_atomic -around the actual cache flush. This might be a bit inefficient, but at -least it's stable. - -Signed-off-by: Felix Fietkau ---- - ---- a/arch/mips/mm/cache.c -+++ b/arch/mips/mm/cache.c -@@ -116,6 +116,13 @@ void __flush_anon_page(struct page *page - { - unsigned long addr = (unsigned long) page_address(page); - -+ if (PageHighMem(page)) { -+ addr = (unsigned long)kmap_atomic(page); -+ flush_data_cache_page(addr); -+ __kunmap_atomic((void *)addr); -+ return; -+ } -+ - if (pages_do_alias(addr, vmaddr)) { - if (page_mapcount(page) && !Page_dcache_dirty(page)) { - void *kaddr; diff --git a/target/linux/generic/pending-4.14/142-jffs2-Fix-use-of-uninitialized-delayed_work-lockdep-.patch b/target/linux/generic/pending-4.14/142-jffs2-Fix-use-of-uninitialized-delayed_work-lockdep-.patch new file mode 100644 index 000000000..05f83ccfc --- /dev/null +++ b/target/linux/generic/pending-4.14/142-jffs2-Fix-use-of-uninitialized-delayed_work-lockdep-.patch @@ -0,0 +1,62 @@ +From a788c5272769ddbcdbab297cf386413eeac04463 Mon Sep 17 00:00:00 2001 +From: Daniel Santos +Date: Fri, 19 Oct 2018 03:30:20 -0500 +Subject: [PATCH] jffs2: Fix use of uninitialized delayed_work, lockdep + breakage + +jffs2_sync_fs makes the assumption that if CONFIG_JFFS2_FS_WRITEBUFFER +is defined then a write buffer is available and has been initialized. +However, this does is not the case when the mtd device has no +out-of-band buffer: + +int jffs2_nand_flash_setup(struct jffs2_sb_info *c) +{ + if (!c->mtd->oobsize) + return 0; +... + +The resulting call to cancel_delayed_work_sync passing a uninitialized +(but zeroed) delayed_work struct forces lockdep to become disabled. + +[ 90.050639] overlayfs: upper fs does not support tmpfile. +[ 90.652264] INFO: trying to register non-static key. +[ 90.662171] the code is fine but needs lockdep annotation. +[ 90.673090] turning off the locking correctness validator. +[ 90.684021] CPU: 0 PID: 1762 Comm: mount_root Not tainted 4.14.63 #0 +[ 90.696672] Stack : 00000000 00000000 80d8f6a2 00000038 805f0000 80444600 8fe364f4 805dfbe7 +[ 90.713349] 80563a30 000006e2 8068370c 00000001 00000000 00000001 8e2fdc48 ffffffff +[ 90.730020] 00000000 00000000 80d90000 00000000 00000106 00000000 6465746e 312e3420 +[ 90.746690] 6b636f6c 03bf0000 f8000000 20676e69 00000000 80000000 00000000 8e2c2a90 +[ 90.763362] 80d90000 00000001 00000000 8e2c2a90 00000003 80260dc0 08052098 80680000 +[ 90.780033] ... +[ 90.784902] Call Trace: +[ 90.789793] [<8000f0d8>] show_stack+0xb8/0x148 +[ 90.798659] [<8005a000>] register_lock_class+0x270/0x55c +[ 90.809247] [<8005cb64>] __lock_acquire+0x13c/0xf7c +[ 90.818964] [<8005e314>] lock_acquire+0x194/0x1dc +[ 90.828345] [<8003f27c>] flush_work+0x200/0x24c +[ 90.837374] [<80041dfc>] __cancel_work_timer+0x158/0x210 +[ 90.847958] [<801a8770>] jffs2_sync_fs+0x20/0x54 +[ 90.857173] [<80125cf4>] iterate_supers+0xf4/0x120 +[ 90.866729] [<80158fc4>] sys_sync+0x44/0x9c +[ 90.875067] [<80014424>] syscall_common+0x34/0x58 + +Signed-off-by: Daniel Santos +Reviewed-by: Hou Tao +Signed-off-by: Boris Brezillon +--- + fs/jffs2/super.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/jffs2/super.c ++++ b/fs/jffs2/super.c +@@ -101,7 +101,8 @@ static int jffs2_sync_fs(struct super_bl + struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); + + #ifdef CONFIG_JFFS2_FS_WRITEBUFFER +- cancel_delayed_work_sync(&c->wbuf_dwork); ++ if (jffs2_is_writebuffered(c)) ++ cancel_delayed_work_sync(&c->wbuf_dwork); + #endif + + mutex_lock(&c->alloc_sem); diff --git a/target/linux/generic/pending-4.14/161-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/generic/pending-4.14/161-mtd-part-add-generic-parsing-of-linux-part-probe.patch index 8e5ecec63..9625a5112 100644 --- a/target/linux/generic/pending-4.14/161-mtd-part-add-generic-parsing-of-linux-part-probe.patch +++ b/target/linux/generic/pending-4.14/161-mtd-part-add-generic-parsing-of-linux-part-probe.patch @@ -110,7 +110,7 @@ Signed-off-by: Hauke Mehrtens #include #include -@@ -834,6 +835,37 @@ void deregister_mtd_parser(struct mtd_pa +@@ -844,6 +845,37 @@ void deregister_mtd_parser(struct mtd_pa } EXPORT_SYMBOL_GPL(deregister_mtd_parser); @@ -148,7 +148,7 @@ Signed-off-by: Hauke Mehrtens /* * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you * are changing this array! -@@ -983,6 +1015,13 @@ int parse_mtd_partitions(struct mtd_info +@@ -993,6 +1025,13 @@ int parse_mtd_partitions(struct mtd_info struct mtd_partitions pparts = { }; struct mtd_part_parser *parser; int ret, err = 0; @@ -162,7 +162,7 @@ Signed-off-by: Hauke Mehrtens if (!types) types = mtd_is_partition(master) ? default_subpartition_types : -@@ -1024,6 +1063,7 @@ int parse_mtd_partitions(struct mtd_info +@@ -1034,6 +1073,7 @@ int parse_mtd_partitions(struct mtd_info if (ret < 0 && !err) err = ret; } diff --git a/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch index 68737803d..5f8899ea6 100644 --- a/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch +++ b/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch @@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau /* * Given a pointer to the MTD object in the mtd_part structure, we can retrieve * the pointer to that structure. -@@ -658,6 +662,7 @@ int mtd_add_partition(struct mtd_info *p +@@ -668,6 +672,7 @@ int mtd_add_partition(struct mtd_info *p mutex_unlock(&mtd_partitions_mutex); add_mtd_device(&new->mtd); @@ -68,7 +68,7 @@ Signed-off-by: Felix Fietkau mtd_add_partition_attrs(new); -@@ -736,6 +741,35 @@ int mtd_del_partition(struct mtd_info *m +@@ -746,6 +751,29 @@ int mtd_del_partition(struct mtd_info *m } EXPORT_SYMBOL_GPL(mtd_del_partition); @@ -82,11 +82,6 @@ Signed-off-by: Felix Fietkau +{ +} + -+void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, -+ int offset, int size) -+{ -+} -+ +static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part) +{ + static int rootfs_found = 0; @@ -94,17 +89,16 @@ Signed-off-by: Felix Fietkau + if (rootfs_found) + return; + -+ if (!strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) && -+ IS_ENABLED(CONFIG_MTD_SPLIT_FIRMWARE)) ++ if (IS_ENABLED(CONFIG_MTD_SPLIT_FIRMWARE) && ++ !strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) && ++ !of_find_property(mtd_get_of_node(&part->mtd), "compatible", NULL)) + split_firmware(master, part); -+ -+ arch_split_mtd_part(master, part->mtd.name, part->offset, -+ part->mtd.size); +} ++ /* * This function, given a master MTD object and a partition table, creates * and registers slave MTD objects which are bound to the master according to -@@ -767,6 +801,7 @@ int add_mtd_partitions(struct mtd_info * +@@ -777,6 +805,7 @@ int add_mtd_partitions(struct mtd_info * mutex_unlock(&mtd_partitions_mutex); add_mtd_device(&slave->mtd); @@ -112,13 +106,3 @@ Signed-off-by: Felix Fietkau mtd_add_partition_attrs(slave); /* Look for subpartitions */ parse_mtd_partitions(&slave->mtd, parts[i].types, NULL); ---- a/include/linux/mtd/partitions.h -+++ b/include/linux/mtd/partitions.h -@@ -110,5 +110,7 @@ int mtd_add_partition(struct mtd_info *m - long long offset, long long length); - int mtd_del_partition(struct mtd_info *master, int partno); - uint64_t mtd_get_device_size(const struct mtd_info *mtd); -+extern void __weak arch_split_mtd_part(struct mtd_info *master, -+ const char *name, int offset, int size); - - #endif diff --git a/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch b/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch index a48ae87ea..359c4c167 100644 --- a/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch +++ b/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch @@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos /* * Given a pointer to the MTD object in the mtd_part structure, we can retrieve -@@ -741,6 +745,36 @@ int mtd_del_partition(struct mtd_info *m +@@ -751,6 +755,36 @@ int mtd_del_partition(struct mtd_info *m } EXPORT_SYMBOL_GPL(mtd_del_partition); @@ -57,7 +57,7 @@ Signed-off-by: Gabor Juhos #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME #define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME #else -@@ -1118,6 +1152,61 @@ void mtd_part_parser_cleanup(struct mtd_ +@@ -1122,6 +1156,61 @@ void mtd_part_parser_cleanup(struct mtd_ } } diff --git a/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch b/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch index 3c105b2a4..e87066335 100644 --- a/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch +++ b/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch @@ -10,15 +10,15 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -783,6 +783,7 @@ run_parsers_by_type(struct mtd_part *sla +@@ -793,6 +793,7 @@ run_parsers_by_type(struct mtd_part *sla static void split_firmware(struct mtd_info *master, struct mtd_part *part) { + run_parsers_by_type(part, MTD_PARSER_TYPE_FIRMWARE); } - void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, -@@ -797,6 +798,12 @@ static void mtd_partition_split(struct m + static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part) +@@ -802,6 +803,12 @@ static void mtd_partition_split(struct m if (rootfs_found) return; @@ -28,9 +28,9 @@ Signed-off-by: Gabor Juhos + rootfs_found = 1; + } + - if (!strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) && - IS_ENABLED(CONFIG_MTD_SPLIT_FIRMWARE)) - split_firmware(master, part); + if (IS_ENABLED(CONFIG_MTD_SPLIT_FIRMWARE) && + !strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) && + !of_find_property(mtd_get_of_node(&part->mtd), "compatible", NULL)) --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h @@ -75,6 +75,8 @@ struct mtd_part_parser_data { diff --git a/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch b/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch index b37563c90..94c59df01 100644 --- a/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch +++ b/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -1231,6 +1231,24 @@ int mtd_is_partition(const struct mtd_in +@@ -1235,6 +1235,24 @@ int mtd_is_partition(const struct mtd_in } EXPORT_SYMBOL_GPL(mtd_is_partition); @@ -38,7 +38,7 @@ Signed-off-by: Gabor Juhos { --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h -@@ -493,6 +493,24 @@ static inline uint32_t mtd_mod_by_eb(uin +@@ -494,6 +494,24 @@ static inline uint32_t mtd_mod_by_eb(uin return do_div(sz, mtd->erasesize); } @@ -72,5 +72,5 @@ Signed-off-by: Gabor Juhos +struct mtd_info *mtdpart_get_master(const struct mtd_info *mtd); +uint64_t mtdpart_get_offset(const struct mtd_info *mtd); uint64_t mtd_get_device_size(const struct mtd_info *mtd); - extern void __weak arch_split_mtd_part(struct mtd_info *master, - const char *name, int offset, int size); + + #endif diff --git a/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch index a99508310..3b862dae6 100644 --- a/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch +++ b/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau /* Our partition linked list */ static LIST_HEAD(mtd_partitions); static DEFINE_MUTEX(mtd_partitions_mutex); -@@ -246,13 +248,61 @@ static int part_erase(struct mtd_info *m +@@ -255,13 +257,61 @@ static int part_erase(struct mtd_info *m struct mtd_part *part = mtd_to_part(mtd); int ret; @@ -81,7 +81,7 @@ Signed-off-by: Felix Fietkau return ret; } -@@ -260,6 +310,25 @@ void mtd_erase_callback(struct erase_inf +@@ -269,6 +319,25 @@ void mtd_erase_callback(struct erase_inf { if (instr->mtd->_erase == part_erase) { struct mtd_part *part = mtd_to_part(instr->mtd); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) instr->fail_addr -= part->offset; -@@ -574,19 +643,22 @@ static struct mtd_part *allocate_partiti +@@ -584,19 +653,22 @@ static struct mtd_part *allocate_partiti remainder = do_div(tmp, wr_alignment); if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { /* Doesn't start on a boundary of major erase size */ @@ -123,8 +123,8 @@ Signed-off-by: Felix Fietkau + slave->mtd.erasesize = slave->mtd.size; } -- tmp = slave->mtd.size; -+ tmp = slave->offset + slave->mtd.size; +- tmp = part_absolute_offset(parent) + slave->mtd.size; ++ tmp = part_absolute_offset(parent) + slave->offset + slave->mtd.size; remainder = do_div(tmp, wr_alignment); if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { - slave->mtd.flags &= ~MTD_WRITEABLE; diff --git a/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch index 1e8c90931..3ac3496c6 100644 --- a/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch +++ b/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch @@ -20,7 +20,7 @@ Signed-off-by: Tim Harvey --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -348,7 +348,16 @@ static int part_lock(struct mtd_info *mt +@@ -357,7 +357,16 @@ static int part_lock(struct mtd_info *mt static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) { struct mtd_part *part = mtd_to_part(mtd); diff --git a/target/linux/generic/pending-4.14/495-mtd-core-add-get_mtd_device_by_node.patch b/target/linux/generic/pending-4.14/495-mtd-core-add-get_mtd_device_by_node.patch index b9c6bd012..2886742d4 100644 --- a/target/linux/generic/pending-4.14/495-mtd-core-add-get_mtd_device_by_node.patch +++ b/target/linux/generic/pending-4.14/495-mtd-core-add-get_mtd_device_by_node.patch @@ -17,7 +17,7 @@ Reviewed-by: Miquel Raynal --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c -@@ -922,6 +922,44 @@ out_unlock: +@@ -924,6 +924,44 @@ out_unlock: } EXPORT_SYMBOL_GPL(get_mtd_device_nm); @@ -64,7 +64,7 @@ Reviewed-by: Miquel Raynal mutex_lock(&mtd_table_mutex); --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h -@@ -579,6 +579,8 @@ extern struct mtd_info *get_mtd_device(s +@@ -580,6 +580,8 @@ extern struct mtd_info *get_mtd_device(s extern int __get_mtd_device(struct mtd_info *mtd); extern void __put_mtd_device(struct mtd_info *mtd); extern struct mtd_info *get_mtd_device_nm(const char *name); diff --git a/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch b/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch index 4e1dfbe77..834876fa8 100644 --- a/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch +++ b/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch @@ -244,7 +244,7 @@ Signed-off-by: Alexandros C. Couloumbis +} --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c -@@ -370,14 +370,41 @@ static int __init init_jffs2_fs(void) +@@ -371,14 +371,41 @@ static int __init init_jffs2_fs(void) BUILD_BUG_ON(sizeof(struct jffs2_raw_inode) != 68); BUILD_BUG_ON(sizeof(struct jffs2_raw_summary) != 32); diff --git a/target/linux/generic/pending-4.14/831-ledtrig_netdev.patch b/target/linux/generic/pending-4.14/831-ledtrig_netdev.patch deleted file mode 100644 index a12e6dba9..000000000 --- a/target/linux/generic/pending-4.14/831-ledtrig_netdev.patch +++ /dev/null @@ -1,74 +0,0 @@ -From: Alexey Brodkin -Subject: usb: Remove annoying warning about bogus URB - -When ath9k-htc Wi-Fi dongle is used with generic OHCI controller -infinite stream of warnings appears in debug console like this: --------------------------->8---------------------- -usb 1-1: new full-speed USB device number 2 using ohci-platform -usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested -usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: -51008 -------------[ cut here ]------------ -WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449 -usb_submit_urb+0x1b4/0x498() -usb 1-1: BOGUS urb xfer, pipe 1 != type 3 -Modules linked in: -CPU: 0 PID: 19 Comm: kworker/0:1 Not tainted -4.4.0-rc4-00017-g00e2d79-dirty #3 -Workqueue: events request_firmware_work_func - -Stack Trace: -arc_unwind_core.constprop.1+0xa4/0x110 ----[ end trace 649ef8c342817fc2 ]--- -------------[ cut here ]------------ -WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449 -usb_submit_urb+0x1b4/0x498() -usb 1-1: BOGUS urb xfer, pipe 1 != type 3 -Modules linked in: -CPU: 0 PID: 19 Comm: kworker/0:1 Tainted: G W -4.4.0-rc4-00017-g00e2d79-dirty #3 -Workqueue: events request_firmware_work_func - -Stack Trace: -arc_unwind_core.constprop.1+0xa4/0x110 ----[ end trace 649ef8c342817fc3 ]--- -------------[ cut here ]------------ --------------------------->8---------------------- - -There're some discussions in mailing lists proposing to disable -that particular check alltogether and magically all seem to work -fine with muted warning. - -Anyways new thread on that regard could be found here: -http://lists.infradead.org/pipermail/linux-snps-arc/2016-July/001310.html - -Let's see what comes out of that new discussion, hopefully patching -of generic USB stuff won't be required then. - -Signed-off-by: Alexey Brodkin ---- - drivers/leds/Makefile | 1 + - drivers/leds/trigger/Kconfig | 7 +++++++ - 2 files changed, 8 insertions(+) - ---- a/drivers/leds/Makefile -+++ b/drivers/leds/Makefile -@@ -82,3 +82,4 @@ obj-$(CONFIG_LEDS_USER) += uleds.o - - # LED Triggers - obj-$(CONFIG_LEDS_TRIGGERS) += trigger/ -+obj-$(CONFIG_LEDS_TRIGGER_NETDEV) += ledtrig-netdev.o ---- a/drivers/leds/trigger/Kconfig -+++ b/drivers/leds/trigger/Kconfig -@@ -126,4 +126,11 @@ config LEDS_TRIGGER_PANIC - a different trigger. - If unsure, say Y. - -+config LEDS_TRIGGER_NETDEV -+ tristate "LED Netdev Trigger" -+ depends on NET && LEDS_TRIGGERS -+ help -+ This allows LEDs to be controlled by network device activity. -+ If unsure, say Y. -+ - endif # LEDS_TRIGGERS