From: Sasha Levin Date: Fri, 23 Nov 2018 12:46:10 +0000 (-0500) Subject: AUTOSEL patches for 3.18 X-Git-Tag: v3.18.127~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=40f9ff02ad6471cf4d8498c58faf72cab1fd2286;p=thirdparty%2Fkernel%2Fstable-queue.git AUTOSEL patches for 3.18 Signed-off-by: Sasha Levin --- diff --git a/queue-3.18/clk-samsung-exynos5420-enable-peris-clocks-for-suspe.patch b/queue-3.18/clk-samsung-exynos5420-enable-peris-clocks-for-suspe.patch new file mode 100644 index 00000000000..b386d202735 --- /dev/null +++ b/queue-3.18/clk-samsung-exynos5420-enable-peris-clocks-for-suspe.patch @@ -0,0 +1,34 @@ +From 1a9c58e73e73f566379c8784485dc7b0220cf8bf Mon Sep 17 00:00:00 2001 +From: Marek Szyprowski +Date: Mon, 24 Sep 2018 13:01:20 +0200 +Subject: clk: samsung: exynos5420: Enable PERIS clocks for suspend + +[ Upstream commit b33228029d842269e17bba591609e83ed422005d ] + +Ensure that clocks for core SoC modules (including TZPC0..9 modules) +are enabled for suspend/resume cycle. This fixes suspend/resume +support on Exynos5422-based Odroid XU3/XU4 boards. + +Suggested-by: Joonyoung Shim +Signed-off-by: Marek Szyprowski +Signed-off-by: Sylwester Nawrocki +Signed-off-by: Sasha Levin +--- + drivers/clk/samsung/clk-exynos5420.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c +index 848d602efc06..c810b3be6b48 100644 +--- a/drivers/clk/samsung/clk-exynos5420.c ++++ b/drivers/clk/samsung/clk-exynos5420.c +@@ -273,6 +273,7 @@ static const struct samsung_clk_reg_dump exynos5420_set_clksrc[] = { + { .offset = SRC_MASK_ISP, .value = 0x11111000, }, + { .offset = GATE_BUS_DISP1, .value = 0xffffffff, }, + { .offset = GATE_IP_PERIC, .value = 0xffffffff, }, ++ { .offset = GATE_IP_PERIS, .value = 0xffffffff, }, + }; + + static int exynos5420_clk_suspend(void) +-- +2.17.1 + diff --git a/queue-3.18/fs-exofs-fix-potential-memory-leak-in-mount-option-p.patch b/queue-3.18/fs-exofs-fix-potential-memory-leak-in-mount-option-p.patch new file mode 100644 index 00000000000..b33a031b040 --- /dev/null +++ b/queue-3.18/fs-exofs-fix-potential-memory-leak-in-mount-option-p.patch @@ -0,0 +1,44 @@ +From 29871908bf652e213009ca3f4c2d7faf4415a816 Mon Sep 17 00:00:00 2001 +From: Chengguang Xu +Date: Wed, 13 Jun 2018 12:05:13 +0800 +Subject: fs/exofs: fix potential memory leak in mount option parsing + +[ Upstream commit 515f1867addaba49c1c6ac73abfaffbc192c1db4 ] + +There are some cases can cause memory leak when parsing +option 'osdname'. + +Signed-off-by: Chengguang Xu +Signed-off-by: Al Viro +Signed-off-by: Sasha Levin +--- + fs/exofs/super.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/fs/exofs/super.c b/fs/exofs/super.c +index 95965503afcb..e3f9cf332304 100644 +--- a/fs/exofs/super.c ++++ b/fs/exofs/super.c +@@ -100,6 +100,7 @@ static int parse_options(char *options, struct exofs_mountopt *opts) + token = match_token(p, tokens, args); + switch (token) { + case Opt_name: ++ kfree(opts->dev_name); + opts->dev_name = match_strdup(&args[0]); + if (unlikely(!opts->dev_name)) { + EXOFS_ERR("Error allocating dev_name"); +@@ -868,8 +869,10 @@ static struct dentry *exofs_mount(struct file_system_type *type, + int ret; + + ret = parse_options(data, &opts); +- if (ret) ++ if (ret) { ++ kfree(opts.dev_name); + return ERR_PTR(ret); ++ } + + if (!opts.dev_name) + opts.dev_name = dev_name; +-- +2.17.1 + diff --git a/queue-3.18/hfs-prevent-btree-data-loss-on-root-split.patch b/queue-3.18/hfs-prevent-btree-data-loss-on-root-split.patch new file mode 100644 index 00000000000..9d6650b5d4d --- /dev/null +++ b/queue-3.18/hfs-prevent-btree-data-loss-on-root-split.patch @@ -0,0 +1,49 @@ +From e877e97f98969152e118cdae023b9135a3e18025 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ernesto=20A=2E=20Fern=C3=A1ndez?= + +Date: Tue, 30 Oct 2018 15:06:07 -0700 +Subject: hfs: prevent btree data loss on root split +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ Upstream commit d057c036672f33d43a5f7344acbb08cf3a8a0c09 ] + +This bug is triggered whenever hfs_brec_update_parent() needs to split +the root node. The height of the btree is not increased, which leaves +the new node orphaned and its records lost. It is not possible for this +to happen on a valid hfs filesystem because the index nodes have fixed +length keys. + +For reasons I ignore, the hfs module does have support for a number of +hfsplus features. A corrupt btree header may report variable length +keys and trigger this bug, so it's better to fix it. + +Link: http://lkml.kernel.org/r/9750b1415685c4adca10766895f6d5ef12babdb0.1535682463.git.ernesto.mnd.fernandez@gmail.com +Signed-off-by: Ernesto A. Fernández +Cc: Christoph Hellwig +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + fs/hfs/brec.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/fs/hfs/brec.c b/fs/hfs/brec.c +index 2a6f3c67cb3f..2e713673df42 100644 +--- a/fs/hfs/brec.c ++++ b/fs/hfs/brec.c +@@ -424,6 +424,10 @@ skip: + if (new_node) { + __be32 cnid; + ++ if (!new_node->parent) { ++ hfs_btree_inc_height(tree); ++ new_node->parent = tree->root; ++ } + fd->bnode = hfs_bnode_find(tree, new_node->parent); + /* create index key and entry */ + hfs_bnode_read_key(new_node, fd->search_key, 14); +-- +2.17.1 + diff --git a/queue-3.18/hfsplus-prevent-btree-data-loss-on-root-split.patch b/queue-3.18/hfsplus-prevent-btree-data-loss-on-root-split.patch new file mode 100644 index 00000000000..287e664858f --- /dev/null +++ b/queue-3.18/hfsplus-prevent-btree-data-loss-on-root-split.patch @@ -0,0 +1,63 @@ +From 79b3d6ab4192479d21c4f6cebad0ae022c456c52 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ernesto=20A=2E=20Fern=C3=A1ndez?= + +Date: Tue, 30 Oct 2018 15:06:00 -0700 +Subject: hfsplus: prevent btree data loss on root split +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ Upstream commit 0a3021d4f5295aa073c7bf5c5e4de60a2e292578 ] + +Creating, renaming or deleting a file may cause catalog corruption and +data loss. This bug is randomly triggered by xfstests generic/027, but +here is a faster reproducer: + + truncate -s 50M fs.iso + mkfs.hfsplus fs.iso + mount fs.iso /mnt + i=100 + while [ $i -le 150 ]; do + touch /mnt/$i &>/dev/null + ((++i)) + done + i=100 + while [ $i -le 150 ]; do + mv /mnt/$i /mnt/$(perl -e "print $i x82") &>/dev/null + ((++i)) + done + umount /mnt + fsck.hfsplus -n fs.iso + +The bug is triggered whenever hfs_brec_update_parent() needs to split the +root node. The height of the btree is not increased, which leaves the new +node orphaned and its records lost. + +Link: http://lkml.kernel.org/r/26d882184fc43043a810114258f45277752186c7.1535682461.git.ernesto.mnd.fernandez@gmail.com +Signed-off-by: Ernesto A. Fernández +Cc: Christoph Hellwig +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + fs/hfsplus/brec.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c +index 754fdf8c6356..1002a0c08319 100644 +--- a/fs/hfsplus/brec.c ++++ b/fs/hfsplus/brec.c +@@ -427,6 +427,10 @@ skip: + if (new_node) { + __be32 cnid; + ++ if (!new_node->parent) { ++ hfs_btree_inc_height(tree); ++ new_node->parent = tree->root; ++ } + fd->bnode = hfs_bnode_find(tree, new_node->parent); + /* create index key and entry */ + hfs_bnode_read_key(new_node, fd->search_key, 14); +-- +2.17.1 + diff --git a/queue-3.18/i2c-omap-enable-for-arch_k3.patch b/queue-3.18/i2c-omap-enable-for-arch_k3.patch new file mode 100644 index 00000000000..990aa6e91af --- /dev/null +++ b/queue-3.18/i2c-omap-enable-for-arch_k3.patch @@ -0,0 +1,33 @@ +From c418a966ecbf65f23bafe411de2dd649ff801a8f Mon Sep 17 00:00:00 2001 +From: Vignesh R +Date: Fri, 9 Nov 2018 16:44:11 +0530 +Subject: i2c: omap: Enable for ARCH_K3 + +[ Upstream commit 5b277402deac0691226a947df71c581686bd4020 ] + +Allow I2C_OMAP to be built for K3 platforms. + +Signed-off-by: Vignesh R +Reviewed-by: Grygorii Strashko +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig +index 06e99eb64295..6ced9382bf02 100644 +--- a/drivers/i2c/busses/Kconfig ++++ b/drivers/i2c/busses/Kconfig +@@ -607,7 +607,7 @@ config I2C_OCORES + + config I2C_OMAP + tristate "OMAP I2C adapter" +- depends on ARCH_OMAP ++ depends on ARCH_OMAP || ARCH_K3 + default y if MACH_OMAP_H3 || MACH_OMAP_OSK + help + If you say yes to this option, support will be included for the +-- +2.17.1 + diff --git a/queue-3.18/lib-raid6-fix-arm64-test-build.patch b/queue-3.18/lib-raid6-fix-arm64-test-build.patch new file mode 100644 index 00000000000..d529e4715c3 --- /dev/null +++ b/queue-3.18/lib-raid6-fix-arm64-test-build.patch @@ -0,0 +1,46 @@ +From 2b432d0e96ce94657dd8771e1cb171566d5a0e45 Mon Sep 17 00:00:00 2001 +From: Jeremy Linton +Date: Mon, 5 Nov 2018 18:14:41 -0600 +Subject: lib/raid6: Fix arm64 test build + +[ Upstream commit 313a06e636808387822af24c507cba92703568b1 ] + +The lib/raid6/test fails to build the neon objects +on arm64 because the correct machine type is 'aarch64'. + +Once this is correctly enabled, the neon recovery objects +need to be added to the build. + +Reviewed-by: Ard Biesheuvel +Signed-off-by: Jeremy Linton +Signed-off-by: Catalin Marinas +Signed-off-by: Sasha Levin +--- + lib/raid6/test/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/raid6/test/Makefile b/lib/raid6/test/Makefile +index 29090f3db677..28c089cb13f1 100644 +--- a/lib/raid6/test/Makefile ++++ b/lib/raid6/test/Makefile +@@ -26,7 +26,7 @@ ifeq ($(ARCH),arm) + CFLAGS += -I../../../arch/arm/include -mfpu=neon + HAS_NEON = yes + endif +-ifeq ($(ARCH),arm64) ++ifeq ($(ARCH),aarch64) + CFLAGS += -I../../../arch/arm64/include + HAS_NEON = yes + endif +@@ -37,7 +37,7 @@ ifeq ($(IS_X86),yes) + gcc -c -x assembler - >&/dev/null && \ + rm ./-.o && echo -DCONFIG_AS_AVX2=1) + else ifeq ($(HAS_NEON),yes) +- OBJS += neon.o neon1.o neon2.o neon4.o neon8.o ++ OBJS += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o + CFLAGS += -DCONFIG_KERNEL_MODE_NEON=1 + else + HAS_ALTIVEC := $(shell printf '\#include \nvector int a;\n' |\ +-- +2.17.1 + diff --git a/queue-3.18/reiserfs-propagate-errors-from-fill_with_dentries-pr.patch b/queue-3.18/reiserfs-propagate-errors-from-fill_with_dentries-pr.patch new file mode 100644 index 00000000000..7b9ca3269ed --- /dev/null +++ b/queue-3.18/reiserfs-propagate-errors-from-fill_with_dentries-pr.patch @@ -0,0 +1,76 @@ +From 07de97c619b593ad8e0e9f08ecdb1d8e7ae18229 Mon Sep 17 00:00:00 2001 +From: Jann Horn +Date: Tue, 30 Oct 2018 15:06:38 -0700 +Subject: reiserfs: propagate errors from fill_with_dentries() properly + +[ Upstream commit b10298d56c9623f9b173f19959732d3184b35f4f ] + +fill_with_dentries() failed to propagate errors up to +reiserfs_for_each_xattr() properly. Plumb them through. + +Note that reiserfs_for_each_xattr() is only used by +reiserfs_delete_xattrs() and reiserfs_chown_xattrs(). The result of +reiserfs_delete_xattrs() is discarded anyway, the only difference there is +whether a warning is printed to dmesg. The result of +reiserfs_chown_xattrs() does matter because it can block chowning of the +file to which the xattrs belong; but either way, the resulting state can +have misaligned ownership, so my patch doesn't improve things greatly. + +Credit for making me look at this code goes to Al Viro, who pointed out +that the ->actor calling convention is suboptimal and should be changed. + +Link: http://lkml.kernel.org/r/20180802163335.83312-1-jannh@google.com +Signed-off-by: Jann Horn +Reviewed-by: Andrew Morton +Cc: Jeff Mahoney +Cc: Eric Biggers +Cc: Al Viro +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + fs/reiserfs/xattr.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c +index 59b29acb6419..0ec755043174 100644 +--- a/fs/reiserfs/xattr.c ++++ b/fs/reiserfs/xattr.c +@@ -184,6 +184,7 @@ struct reiserfs_dentry_buf { + struct dir_context ctx; + struct dentry *xadir; + int count; ++ int err; + struct dentry *dentries[8]; + }; + +@@ -205,6 +206,7 @@ fill_with_dentries(void *buf, const char *name, int namelen, loff_t offset, + + dentry = lookup_one_len(name, dbuf->xadir, namelen); + if (IS_ERR(dentry)) { ++ dbuf->err = PTR_ERR(dentry); + return PTR_ERR(dentry); + } else if (!dentry->d_inode) { + /* A directory entry exists, but no file? */ +@@ -213,6 +215,7 @@ fill_with_dentries(void *buf, const char *name, int namelen, loff_t offset, + "not found for file %s.\n", + dentry->d_name.name, dbuf->xadir->d_name.name); + dput(dentry); ++ dbuf->err = -EIO; + return -EIO; + } + +@@ -260,6 +263,10 @@ static int reiserfs_for_each_xattr(struct inode *inode, + err = reiserfs_readdir_inode(dir->d_inode, &buf.ctx); + if (err) + break; ++ if (buf.err) { ++ err = buf.err; ++ break; ++ } + if (!buf.count) + break; + for (i = 0; !err && i < buf.count && buf.dentries[i]; i++) { +-- +2.17.1 + diff --git a/queue-3.18/s390-vdso-add-missing-force-to-build-targets.patch b/queue-3.18/s390-vdso-add-missing-force-to-build-targets.patch new file mode 100644 index 00000000000..ce931cc72ed --- /dev/null +++ b/queue-3.18/s390-vdso-add-missing-force-to-build-targets.patch @@ -0,0 +1,80 @@ +From 13049a08e5a4f2a000ad39ff33e0d8e2d43414f0 Mon Sep 17 00:00:00 2001 +From: Vasily Gorbik +Date: Fri, 19 Oct 2018 15:37:01 +0200 +Subject: s390/vdso: add missing FORCE to build targets + +[ Upstream commit b44b136a3773d8a9c7853f8df716bd1483613cbb ] + +According to Documentation/kbuild/makefiles.txt all build targets using +if_changed should use FORCE as well. Add missing FORCE to make sure +vdso targets are rebuild properly when not just immediate prerequisites +have changed but also when build command differs. + +Reviewed-by: Philipp Rudo +Signed-off-by: Vasily Gorbik +Signed-off-by: Martin Schwidefsky +Signed-off-by: Sasha Levin +--- + arch/s390/kernel/vdso32/Makefile | 6 +++--- + arch/s390/kernel/vdso64/Makefile | 6 +++--- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/arch/s390/kernel/vdso32/Makefile b/arch/s390/kernel/vdso32/Makefile +index 8ad2b34ad151..6661bfc2b3b4 100644 +--- a/arch/s390/kernel/vdso32/Makefile ++++ b/arch/s390/kernel/vdso32/Makefile +@@ -29,7 +29,7 @@ GCOV_PROFILE := n + $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so + + # link rule for the .so file, .lds has to be first +-$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) ++$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) FORCE + $(call if_changed,vdso32ld) + + # strip rule for the .so file +@@ -38,12 +38,12 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE + $(call if_changed,objcopy) + + # assembly rules for the .S files +-$(obj-vdso32): %.o: %.S ++$(obj-vdso32): %.o: %.S FORCE + $(call if_changed_dep,vdso32as) + + # actual build commands + quiet_cmd_vdso32ld = VDSO32L $@ +- cmd_vdso32ld = $(CC) $(c_flags) -Wl,-T $^ -o $@ ++ cmd_vdso32ld = $(CC) $(c_flags) -Wl,-T $(filter %.lds %.o,$^) -o $@ + quiet_cmd_vdso32as = VDSO32A $@ + cmd_vdso32as = $(CC) $(a_flags) -c -o $@ $< + +diff --git a/arch/s390/kernel/vdso64/Makefile b/arch/s390/kernel/vdso64/Makefile +index 2a8ddfd12a5b..5b7712f8eb4f 100644 +--- a/arch/s390/kernel/vdso64/Makefile ++++ b/arch/s390/kernel/vdso64/Makefile +@@ -29,7 +29,7 @@ GCOV_PROFILE := n + $(obj)/vdso64_wrapper.o : $(obj)/vdso64.so + + # link rule for the .so file, .lds has to be first +-$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) ++$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) FORCE + $(call if_changed,vdso64ld) + + # strip rule for the .so file +@@ -38,12 +38,12 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE + $(call if_changed,objcopy) + + # assembly rules for the .S files +-$(obj-vdso64): %.o: %.S ++$(obj-vdso64): %.o: %.S FORCE + $(call if_changed_dep,vdso64as) + + # actual build commands + quiet_cmd_vdso64ld = VDSO64L $@ +- cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $^ -o $@ ++ cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $(filter %.lds %.o,$^) -o $@ + quiet_cmd_vdso64as = VDSO64A $@ + cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $< + +-- +2.17.1 + diff --git a/queue-3.18/series b/queue-3.18/series index 872bf152281..f979cc013f2 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -1 +1,10 @@ net-gro-reset-skb-pkt_type-in-napi_reuse_skb.patch +reiserfs-propagate-errors-from-fill_with_dentries-pr.patch +hfs-prevent-btree-data-loss-on-root-split.patch +hfsplus-prevent-btree-data-loss-on-root-split.patch +um-give-start_idle_thread-a-return-code.patch +fs-exofs-fix-potential-memory-leak-in-mount-option-p.patch +clk-samsung-exynos5420-enable-peris-clocks-for-suspe.patch +s390-vdso-add-missing-force-to-build-targets.patch +lib-raid6-fix-arm64-test-build.patch +i2c-omap-enable-for-arch_k3.patch diff --git a/queue-3.18/um-give-start_idle_thread-a-return-code.patch b/queue-3.18/um-give-start_idle_thread-a-return-code.patch new file mode 100644 index 00000000000..f8cf5388508 --- /dev/null +++ b/queue-3.18/um-give-start_idle_thread-a-return-code.patch @@ -0,0 +1,40 @@ +From e21b3841ff858d03dd135d85a41e240bbe07604d Mon Sep 17 00:00:00 2001 +From: Richard Weinberger +Date: Fri, 15 Jun 2018 16:42:56 +0200 +Subject: um: Give start_idle_thread() a return code + +[ Upstream commit 7ff1e34bbdc15acab823b1ee4240e94623d50ee8 ] + +Fixes: +arch/um/os-Linux/skas/process.c:613:1: warning: control reaches end of +non-void function [-Wreturn-type] + +longjmp() never returns but gcc still warns that the end of the function +can be reached. +Add a return code and debug aid to detect this impossible case. + +Signed-off-by: Richard Weinberger +Signed-off-by: Sasha Levin +--- + arch/um/os-Linux/skas/process.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c +index 908579f2b0ab..258e741f61a8 100644 +--- a/arch/um/os-Linux/skas/process.c ++++ b/arch/um/os-Linux/skas/process.c +@@ -694,6 +694,11 @@ int start_idle_thread(void *stack, jmp_buf *switch_buf) + fatal_sigsegv(); + } + longjmp(*switch_buf, 1); ++ ++ /* unreachable */ ++ printk(UM_KERN_ERR "impossible long jump!"); ++ fatal_sigsegv(); ++ return 0; + } + + void initial_thread_cb_skas(void (*proc)(void *), void *arg) +-- +2.17.1 +