]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jan 2019 08:55:12 +0000 (09:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jan 2019 08:55:12 +0000 (09:55 +0100)
added patches:
f2fs-fix-validation-of-the-block-count-in-sanity_check_raw_super.patch
media-v4l2-tpg-array-index-could-become-negative.patch
media-vivid-free-bitmap_cap-when-updating-std-timings-etc.patch
mips-align-kernel-load-address-to-64kb.patch
mips-ensure-pmd_present-returns-false-after-pmd_mknotpresent.patch
mips-octeon-mark-rgmii-interface-disabled-on-octeon-iii.patch
serial-uartps-fix-interrupt-mask-issue-to-handle-the-rx-interrupts-properly.patch

queue-4.9/f2fs-fix-validation-of-the-block-count-in-sanity_check_raw_super.patch [new file with mode: 0644]
queue-4.9/media-v4l2-tpg-array-index-could-become-negative.patch [new file with mode: 0644]
queue-4.9/media-vivid-free-bitmap_cap-when-updating-std-timings-etc.patch [new file with mode: 0644]
queue-4.9/mips-align-kernel-load-address-to-64kb.patch [new file with mode: 0644]
queue-4.9/mips-ensure-pmd_present-returns-false-after-pmd_mknotpresent.patch [new file with mode: 0644]
queue-4.9/mips-octeon-mark-rgmii-interface-disabled-on-octeon-iii.patch [new file with mode: 0644]
queue-4.9/serial-uartps-fix-interrupt-mask-issue-to-handle-the-rx-interrupts-properly.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/f2fs-fix-validation-of-the-block-count-in-sanity_check_raw_super.patch b/queue-4.9/f2fs-fix-validation-of-the-block-count-in-sanity_check_raw_super.patch
new file mode 100644 (file)
index 0000000..9d5f4d7
--- /dev/null
@@ -0,0 +1,57 @@
+From 88960068f25fcc3759455d85460234dcc9d43fef Mon Sep 17 00:00:00 2001
+From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+Date: Sat, 22 Dec 2018 11:22:26 +0100
+Subject: f2fs: fix validation of the block count in sanity_check_raw_super
+
+From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+
+commit 88960068f25fcc3759455d85460234dcc9d43fef upstream.
+
+Treat "block_count" from struct f2fs_super_block as 64-bit little endian
+value in sanity_check_raw_super() because struct f2fs_super_block
+declares "block_count" as "__le64".
+
+This fixes a bug where the superblock validation fails on big endian
+devices with the following error:
+  F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0)
+  F2FS-fs (sda1): Can't find valid F2FS filesystem in 1th superblock
+  F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0)
+  F2FS-fs (sda1): Can't find valid F2FS filesystem in 2th superblock
+As result of this the partition cannot be mounted.
+
+With this patch applied the superblock validation works fine and the
+partition can be mounted again:
+  F2FS-fs (sda1): Mounted with checkpoint version = 7c84
+
+My little endian x86-64 hardware was able to mount the partition without
+this fix.
+To confirm that mounting f2fs filesystems works on big endian machines
+again I tested this on a 32-bit MIPS big endian (lantiq) device.
+
+Fixes: 0cfe75c5b01199 ("f2fs: enhance sanity_check_raw_super() to avoid potential overflows")
+Cc: stable@vger.kernel.org
+Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+Reviewed-by: Chao Yu <yuchao0@huawei.com>
+Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/f2fs/super.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/fs/f2fs/super.c
++++ b/fs/f2fs/super.c
+@@ -1427,10 +1427,10 @@ static int sanity_check_raw_super(struct
+               return 1;
+       }
+-      if (segment_count > (le32_to_cpu(raw_super->block_count) >> 9)) {
++      if (segment_count > (le64_to_cpu(raw_super->block_count) >> 9)) {
+               f2fs_msg(sb, KERN_INFO,
+-                      "Wrong segment_count / block_count (%u > %u)",
+-                      segment_count, le32_to_cpu(raw_super->block_count));
++                      "Wrong segment_count / block_count (%u > %llu)",
++                      segment_count, le64_to_cpu(raw_super->block_count));
+               return 1;
+       }
diff --git a/queue-4.9/media-v4l2-tpg-array-index-could-become-negative.patch b/queue-4.9/media-v4l2-tpg-array-index-could-become-negative.patch
new file mode 100644 (file)
index 0000000..3bf37ee
--- /dev/null
@@ -0,0 +1,33 @@
+From e5f71a27fa12c1a1b02ad478a568e76260f1815e Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Date: Thu, 8 Nov 2018 11:12:47 -0500
+Subject: media: v4l2-tpg: array index could become negative
+
+From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+
+commit e5f71a27fa12c1a1b02ad478a568e76260f1815e upstream.
+
+text[s] is a signed char, so using that as index into the font8x16 array
+can result in negative indices. Cast it to u8 to be safe.
+
+Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Reported-by: syzbot+ccf0a61ed12f2a7313ee@syzkaller.appspotmail.com
+Cc: <stable@vger.kernel.org>      # for v4.7 and up
+Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/common/v4l2-tpg/v4l2-tpg-core.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
++++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
+@@ -1618,7 +1618,7 @@ typedef struct { u16 __; u8 _; } __packe
+               unsigned s;     \
+       \
+               for (s = 0; s < len; s++) {     \
+-                      u8 chr = font8x16[text[s] * 16 + line]; \
++                      u8 chr = font8x16[(u8)text[s] * 16 + line];     \
+       \
+                       if (hdiv == 2 && tpg->hflip) { \
+                               pos[3] = (chr & (0x01 << 6) ? fg : bg); \
diff --git a/queue-4.9/media-vivid-free-bitmap_cap-when-updating-std-timings-etc.patch b/queue-4.9/media-vivid-free-bitmap_cap-when-updating-std-timings-etc.patch
new file mode 100644 (file)
index 0000000..6483924
--- /dev/null
@@ -0,0 +1,33 @@
+From 560ccb75c2caa6b1039dec1a53cd2ef526f5bf03 Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Date: Fri, 9 Nov 2018 08:37:44 -0500
+Subject: media: vivid: free bitmap_cap when updating std/timings/etc.
+
+From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+
+commit 560ccb75c2caa6b1039dec1a53cd2ef526f5bf03 upstream.
+
+When vivid_update_format_cap() is called it should free any overlay
+bitmap since the compose size will change.
+
+Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Reported-by: syzbot+0cc8e3cc63ca373722c6@syzkaller.appspotmail.com
+Cc: <stable@vger.kernel.org>      # for v3.18 and up
+Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/platform/vivid/vivid-vid-cap.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/media/platform/vivid/vivid-vid-cap.c
++++ b/drivers/media/platform/vivid/vivid-vid-cap.c
+@@ -452,6 +452,8 @@ void vivid_update_format_cap(struct vivi
+               tpg_s_rgb_range(&dev->tpg, v4l2_ctrl_g_ctrl(dev->rgb_range_cap));
+               break;
+       }
++      vfree(dev->bitmap_cap);
++      dev->bitmap_cap = NULL;
+       vivid_update_quality(dev);
+       tpg_reset_source(&dev->tpg, dev->src_rect.width, dev->src_rect.height, dev->field_cap);
+       dev->crop_cap = dev->src_rect;
diff --git a/queue-4.9/mips-align-kernel-load-address-to-64kb.patch b/queue-4.9/mips-align-kernel-load-address-to-64kb.patch
new file mode 100644 (file)
index 0000000..d33dbff
--- /dev/null
@@ -0,0 +1,57 @@
+From bec0de4cfad21bd284dbddee016ed1767a5d2823 Mon Sep 17 00:00:00 2001
+From: Huacai Chen <chenhc@lemote.com>
+Date: Thu, 15 Nov 2018 15:53:56 +0800
+Subject: MIPS: Align kernel load address to 64KB
+
+From: Huacai Chen <chenhc@lemote.com>
+
+commit bec0de4cfad21bd284dbddee016ed1767a5d2823 upstream.
+
+KEXEC needs the new kernel's load address to be aligned on a page
+boundary (see sanity_check_segment_list()), but on MIPS the default
+vmlinuz load address is only explicitly aligned to 16 bytes.
+
+Since the largest PAGE_SIZE supported by MIPS kernels is 64KB, increase
+the alignment calculated by calc_vmlinuz_load_addr to 64KB.
+
+Signed-off-by: Huacai Chen <chenhc@lemote.com>
+Signed-off-by: Paul Burton <paul.burton@mips.com>
+Patchwork: https://patchwork.linux-mips.org/patch/21131/
+Cc: Ralf Baechle <ralf@linux-mips.org>
+Cc: James Hogan <james.hogan@mips.com>
+Cc: Steven J . Hill <Steven.Hill@cavium.com>
+Cc: linux-mips@linux-mips.org
+Cc: Fuxin Zhang <zhangfx@lemote.com>
+Cc: Zhangjin Wu <wuzhangjin@gmail.com>
+Cc: <stable@vger.kernel.org> # 2.6.36+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/mips/boot/compressed/calc_vmlinuz_load_addr.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
++++ b/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
+@@ -13,6 +13,7 @@
+ #include <stdint.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include "../../../../include/linux/sizes.h"
+ int main(int argc, char *argv[])
+ {
+@@ -45,11 +46,11 @@ int main(int argc, char *argv[])
+       vmlinuz_load_addr = vmlinux_load_addr + vmlinux_size;
+       /*
+-       * Align with 16 bytes: "greater than that used for any standard data
+-       * types by a MIPS compiler." -- See MIPS Run Linux (Second Edition).
++       * Align with 64KB: KEXEC needs load sections to be aligned to PAGE_SIZE,
++       * which may be as large as 64KB depending on the kernel configuration.
+        */
+-      vmlinuz_load_addr += (16 - vmlinux_size % 16);
++      vmlinuz_load_addr += (SZ_64K - vmlinux_size % SZ_64K);
+       printf("0x%llx\n", vmlinuz_load_addr);
diff --git a/queue-4.9/mips-ensure-pmd_present-returns-false-after-pmd_mknotpresent.patch b/queue-4.9/mips-ensure-pmd_present-returns-false-after-pmd_mknotpresent.patch
new file mode 100644 (file)
index 0000000..ce51d21
--- /dev/null
@@ -0,0 +1,44 @@
+From 92aa0718c9fa5160ad2f0e7b5bffb52f1ea1e51a Mon Sep 17 00:00:00 2001
+From: Huacai Chen <chenhc@lemote.com>
+Date: Thu, 15 Nov 2018 15:53:54 +0800
+Subject: MIPS: Ensure pmd_present() returns false after pmd_mknotpresent()
+
+From: Huacai Chen <chenhc@lemote.com>
+
+commit 92aa0718c9fa5160ad2f0e7b5bffb52f1ea1e51a upstream.
+
+This patch is borrowed from ARM64 to ensure pmd_present() returns false
+after pmd_mknotpresent(). This is needed for THP.
+
+References: 5bb1cc0ff9a6 ("arm64: Ensure pmd_present() returns false after pmd_mknotpresent()")
+Reviewed-by: James Hogan <jhogan@kernel.org>
+Signed-off-by: Huacai Chen <chenhc@lemote.com>
+Signed-off-by: Paul Burton <paul.burton@mips.com>
+Patchwork: https://patchwork.linux-mips.org/patch/21135/
+Cc: Ralf Baechle <ralf@linux-mips.org>
+Cc: James Hogan <james.hogan@mips.com>
+Cc: Steven J . Hill <Steven.Hill@cavium.com>
+Cc: linux-mips@linux-mips.org
+Cc: Fuxin Zhang <zhangfx@lemote.com>
+Cc: Zhangjin Wu <wuzhangjin@gmail.com>
+Cc: <stable@vger.kernel.org> # 3.8+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/mips/include/asm/pgtable-64.h |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/arch/mips/include/asm/pgtable-64.h
++++ b/arch/mips/include/asm/pgtable-64.h
+@@ -193,6 +193,11 @@ static inline int pmd_bad(pmd_t pmd)
+ static inline int pmd_present(pmd_t pmd)
+ {
++#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
++      if (unlikely(pmd_val(pmd) & _PAGE_HUGE))
++              return pmd_val(pmd) & _PAGE_PRESENT;
++#endif
++
+       return pmd_val(pmd) != (unsigned long) invalid_pte_table;
+ }
diff --git a/queue-4.9/mips-octeon-mark-rgmii-interface-disabled-on-octeon-iii.patch b/queue-4.9/mips-octeon-mark-rgmii-interface-disabled-on-octeon-iii.patch
new file mode 100644 (file)
index 0000000..2a19b1c
--- /dev/null
@@ -0,0 +1,46 @@
+From edefae94b7b9f10d5efe32dece5a36e9d9ecc29e Mon Sep 17 00:00:00 2001
+From: Aaro Koskinen <aaro.koskinen@iki.fi>
+Date: Wed, 2 Jan 2019 20:43:01 +0200
+Subject: MIPS: OCTEON: mark RGMII interface disabled on OCTEON III
+
+From: Aaro Koskinen <aaro.koskinen@iki.fi>
+
+commit edefae94b7b9f10d5efe32dece5a36e9d9ecc29e upstream.
+
+Commit 885872b722b7 ("MIPS: Octeon: Add Octeon III CN7xxx
+interface detection") added RGMII interface detection for OCTEON III,
+but it results in the following logs:
+
+[    7.165984] ERROR: Unsupported Octeon model in __cvmx_helper_rgmii_probe
+[    7.173017] ERROR: Unsupported Octeon model in __cvmx_helper_rgmii_probe
+
+The current RGMII routines are valid only for older OCTEONS that
+use GMX/ASX hardware blocks. On later chips AGL should be used,
+but support for that is missing in the mainline. Until that is added,
+mark the interface as disabled.
+
+Fixes: 885872b722b7 ("MIPS: Octeon: Add Octeon III CN7xxx interface detection")
+Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
+Signed-off-by: Paul Burton <paul.burton@mips.com>
+Cc: Ralf Baechle <ralf@linux-mips.org>
+Cc: James Hogan <jhogan@kernel.org>
+Cc: linux-mips@vger.kernel.org
+Cc: stable@vger.kernel.org # 4.7+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/mips/cavium-octeon/executive/cvmx-helper.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/mips/cavium-octeon/executive/cvmx-helper.c
++++ b/arch/mips/cavium-octeon/executive/cvmx-helper.c
+@@ -290,7 +290,8 @@ static cvmx_helper_interface_mode_t __cv
+       case 3:
+               return CVMX_HELPER_INTERFACE_MODE_LOOP;
+       case 4:
+-              return CVMX_HELPER_INTERFACE_MODE_RGMII;
++              /* TODO: Implement support for AGL (RGMII). */
++              return CVMX_HELPER_INTERFACE_MODE_DISABLED;
+       default:
+               return CVMX_HELPER_INTERFACE_MODE_DISABLED;
+       }
diff --git a/queue-4.9/serial-uartps-fix-interrupt-mask-issue-to-handle-the-rx-interrupts-properly.patch b/queue-4.9/serial-uartps-fix-interrupt-mask-issue-to-handle-the-rx-interrupts-properly.patch
new file mode 100644 (file)
index 0000000..95c0fb5
--- /dev/null
@@ -0,0 +1,42 @@
+From 260683137ab5276113fc322fdbbc578024185fee Mon Sep 17 00:00:00 2001
+From: Nava kishore Manne <nava.manne@xilinx.com>
+Date: Tue, 18 Dec 2018 13:18:42 +0100
+Subject: serial: uartps: Fix interrupt mask issue to handle the RX interrupts properly
+
+From: Nava kishore Manne <nava.manne@xilinx.com>
+
+commit 260683137ab5276113fc322fdbbc578024185fee upstream.
+
+This patch Correct the RX interrupt mask value to handle the
+RX interrupts properly.
+
+Fixes: c8dbdc842d30 ("serial: xuartps: Rewrite the interrupt handling logic")
+Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Michal Simek <michal.simek@xilinx.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/xilinx_uartps.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/tty/serial/xilinx_uartps.c
++++ b/drivers/tty/serial/xilinx_uartps.c
+@@ -128,7 +128,7 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout
+ #define CDNS_UART_IXR_RXTRIG  0x00000001 /* RX FIFO trigger interrupt */
+ #define CDNS_UART_IXR_RXFULL  0x00000004 /* RX FIFO full interrupt. */
+ #define CDNS_UART_IXR_RXEMPTY 0x00000002 /* RX FIFO empty interrupt. */
+-#define CDNS_UART_IXR_MASK    0x00001FFF /* Valid bit mask */
++#define CDNS_UART_IXR_RXMASK  0x000021e7 /* Valid RX bit mask */
+       /*
+        * Do not enable parity error interrupt for the following
+@@ -362,7 +362,7 @@ static irqreturn_t cdns_uart_isr(int irq
+               cdns_uart_handle_tx(dev_id);
+               isrstatus &= ~CDNS_UART_IXR_TXEMPTY;
+       }
+-      if (isrstatus & CDNS_UART_IXR_MASK)
++      if (isrstatus & CDNS_UART_IXR_RXMASK)
+               cdns_uart_handle_rx(dev_id, isrstatus);
+       spin_unlock(&port->lock);
index fd33f1be64e677257b31908de581cbeab83a3f73..9fb0c0181b38296a2577a010a31afc286e13414a 100644 (file)
@@ -57,3 +57,10 @@ cdc-acm-fix-abnormal-data-rx-issue-for-mediatek-preloader.patch
 btrfs-fix-fsync-of-files-with-multiple-hard-links-in-new-directories.patch
 btrfs-run-delayed-items-before-dropping-the-snapshot.patch
 powerpc-tm-set-msr-just-prior-to-recheckpoint.patch
+f2fs-fix-validation-of-the-block-count-in-sanity_check_raw_super.patch
+serial-uartps-fix-interrupt-mask-issue-to-handle-the-rx-interrupts-properly.patch
+media-vivid-free-bitmap_cap-when-updating-std-timings-etc.patch
+media-v4l2-tpg-array-index-could-become-negative.patch
+mips-ensure-pmd_present-returns-false-after-pmd_mknotpresent.patch
+mips-align-kernel-load-address-to-64kb.patch
+mips-octeon-mark-rgmii-interface-disabled-on-octeon-iii.patch