]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jan 2021 16:58:03 +0000 (17:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jan 2021 16:58:03 +0000 (17:58 +0100)
added patches:
dmaengine-at_hdmac-add-missing-kfree-call-in-at_dma_xlate.patch
dmaengine-at_hdmac-add-missing-put_device-call-in-at_dma_xlate.patch
dmaengine-at_hdmac-substitute-kzalloc-with-kmalloc.patch
kdev_t-always-inline-major-minor-helper-functions.patch
revert-drm-amd-display-fix-memory-leaks-in-s3-resume.patch
revert-mtd-spinand-fix-oob-read.patch

queue-5.4/dmaengine-at_hdmac-add-missing-kfree-call-in-at_dma_xlate.patch [new file with mode: 0644]
queue-5.4/dmaengine-at_hdmac-add-missing-put_device-call-in-at_dma_xlate.patch [new file with mode: 0644]
queue-5.4/dmaengine-at_hdmac-substitute-kzalloc-with-kmalloc.patch [new file with mode: 0644]
queue-5.4/kdev_t-always-inline-major-minor-helper-functions.patch [new file with mode: 0644]
queue-5.4/revert-drm-amd-display-fix-memory-leaks-in-s3-resume.patch [new file with mode: 0644]
queue-5.4/revert-mtd-spinand-fix-oob-read.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/dmaengine-at_hdmac-add-missing-kfree-call-in-at_dma_xlate.patch b/queue-5.4/dmaengine-at_hdmac-add-missing-kfree-call-in-at_dma_xlate.patch
new file mode 100644 (file)
index 0000000..5ebcf82
--- /dev/null
@@ -0,0 +1,33 @@
+From e097eb7473d9e70da9e03276f61cd392ccb9d79f Mon Sep 17 00:00:00 2001
+From: Yu Kuai <yukuai3@huawei.com>
+Date: Mon, 17 Aug 2020 19:57:28 +0800
+Subject: dmaengine: at_hdmac: add missing kfree() call in at_dma_xlate()
+
+From: Yu Kuai <yukuai3@huawei.com>
+
+commit e097eb7473d9e70da9e03276f61cd392ccb9d79f upstream.
+
+If memory allocation for 'atslave' succeed, at_dma_xlate() doesn't have a
+corresponding kfree() in exception handling. Thus add kfree() for this
+function implementation.
+
+Fixes: bbe89c8e3d59 ("at_hdmac: move to generic DMA binding")
+Signed-off-by: Yu Kuai <yukuai3@huawei.com>
+Link: https://lore.kernel.org/r/20200817115728.1706719-4-yukuai3@huawei.com
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/dma/at_hdmac.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/dma/at_hdmac.c
++++ b/drivers/dma/at_hdmac.c
+@@ -1708,6 +1708,7 @@ static struct dma_chan *at_dma_xlate(str
+       chan = dma_request_channel(mask, at_dma_filter, atslave);
+       if (!chan) {
+               put_device(&dmac_pdev->dev);
++              kfree(atslave);
+               return NULL;
+       }
diff --git a/queue-5.4/dmaengine-at_hdmac-add-missing-put_device-call-in-at_dma_xlate.patch b/queue-5.4/dmaengine-at_hdmac-add-missing-put_device-call-in-at_dma_xlate.patch
new file mode 100644 (file)
index 0000000..bc09f07
--- /dev/null
@@ -0,0 +1,49 @@
+From 3832b78b3ec2cf51e07102f9b4480e343459b20f Mon Sep 17 00:00:00 2001
+From: Yu Kuai <yukuai3@huawei.com>
+Date: Mon, 17 Aug 2020 19:57:27 +0800
+Subject: dmaengine: at_hdmac: add missing put_device() call in at_dma_xlate()
+
+From: Yu Kuai <yukuai3@huawei.com>
+
+commit 3832b78b3ec2cf51e07102f9b4480e343459b20f upstream.
+
+If of_find_device_by_node() succeed, at_dma_xlate() doesn't have a
+corresponding put_device(). Thus add put_device() to fix the exception
+handling for this function implementation.
+
+Fixes: bbe89c8e3d59 ("at_hdmac: move to generic DMA binding")
+Signed-off-by: Yu Kuai <yukuai3@huawei.com>
+Link: https://lore.kernel.org/r/20200817115728.1706719-3-yukuai3@huawei.com
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/dma/at_hdmac.c |    8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/drivers/dma/at_hdmac.c
++++ b/drivers/dma/at_hdmac.c
+@@ -1674,8 +1674,10 @@ static struct dma_chan *at_dma_xlate(str
+       dma_cap_set(DMA_SLAVE, mask);
+       atslave = kmalloc(sizeof(*atslave), GFP_KERNEL);
+-      if (!atslave)
++      if (!atslave) {
++              put_device(&dmac_pdev->dev);
+               return NULL;
++      }
+       atslave->cfg = ATC_DST_H2SEL_HW | ATC_SRC_H2SEL_HW;
+       /*
+@@ -1704,8 +1706,10 @@ static struct dma_chan *at_dma_xlate(str
+       atslave->dma_dev = &dmac_pdev->dev;
+       chan = dma_request_channel(mask, at_dma_filter, atslave);
+-      if (!chan)
++      if (!chan) {
++              put_device(&dmac_pdev->dev);
+               return NULL;
++      }
+       atchan = to_at_dma_chan(chan);
+       atchan->per_if = dma_spec->args[0] & 0xff;
diff --git a/queue-5.4/dmaengine-at_hdmac-substitute-kzalloc-with-kmalloc.patch b/queue-5.4/dmaengine-at_hdmac-substitute-kzalloc-with-kmalloc.patch
new file mode 100644 (file)
index 0000000..ff39087
--- /dev/null
@@ -0,0 +1,33 @@
+From a6e7f19c910068cb54983f36acebedb376f3a9ac Mon Sep 17 00:00:00 2001
+From: Tudor Ambarus <tudor.ambarus@microchip.com>
+Date: Thu, 23 Jan 2020 14:03:02 +0000
+Subject: dmaengine: at_hdmac: Substitute kzalloc with kmalloc
+
+From: Tudor Ambarus <tudor.ambarus@microchip.com>
+
+commit a6e7f19c910068cb54983f36acebedb376f3a9ac upstream.
+
+All members of the structure are initialized below in the function,
+there is no need to use kzalloc.
+
+Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
+Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
+Link: https://lore.kernel.org/r/20200123140237.125799-1-tudor.ambarus@microchip.com
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/dma/at_hdmac.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/dma/at_hdmac.c
++++ b/drivers/dma/at_hdmac.c
+@@ -1673,7 +1673,7 @@ static struct dma_chan *at_dma_xlate(str
+       dma_cap_zero(mask);
+       dma_cap_set(DMA_SLAVE, mask);
+-      atslave = kzalloc(sizeof(*atslave), GFP_KERNEL);
++      atslave = kmalloc(sizeof(*atslave), GFP_KERNEL);
+       if (!atslave)
+               return NULL;
diff --git a/queue-5.4/kdev_t-always-inline-major-minor-helper-functions.patch b/queue-5.4/kdev_t-always-inline-major-minor-helper-functions.patch
new file mode 100644 (file)
index 0000000..79ddd02
--- /dev/null
@@ -0,0 +1,104 @@
+From aa8c7db494d0a83ecae583aa193f1134ef25d506 Mon Sep 17 00:00:00 2001
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+Date: Tue, 29 Dec 2020 15:14:55 -0800
+Subject: kdev_t: always inline major/minor helper functions
+
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+
+commit aa8c7db494d0a83ecae583aa193f1134ef25d506 upstream.
+
+Silly GCC doesn't always inline these trivial functions.
+
+Fixes the following warning:
+
+  arch/x86/kernel/sys_ia32.o: warning: objtool: cp_stat64()+0xd8: call to new_encode_dev() with UACCESS enabled
+
+Link: https://lkml.kernel.org/r/984353b44a4484d86ba9f73884b7306232e25e30.1608737428.git.jpoimboe@redhat.com
+Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Reported-by: Randy Dunlap <rdunlap@infradead.org>
+Acked-by: Randy Dunlap <rdunlap@infradead.org> [build-tested]
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/kdev_t.h |   22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+--- a/include/linux/kdev_t.h
++++ b/include/linux/kdev_t.h
+@@ -21,61 +21,61 @@
+       })
+ /* acceptable for old filesystems */
+-static inline bool old_valid_dev(dev_t dev)
++static __always_inline bool old_valid_dev(dev_t dev)
+ {
+       return MAJOR(dev) < 256 && MINOR(dev) < 256;
+ }
+-static inline u16 old_encode_dev(dev_t dev)
++static __always_inline u16 old_encode_dev(dev_t dev)
+ {
+       return (MAJOR(dev) << 8) | MINOR(dev);
+ }
+-static inline dev_t old_decode_dev(u16 val)
++static __always_inline dev_t old_decode_dev(u16 val)
+ {
+       return MKDEV((val >> 8) & 255, val & 255);
+ }
+-static inline u32 new_encode_dev(dev_t dev)
++static __always_inline u32 new_encode_dev(dev_t dev)
+ {
+       unsigned major = MAJOR(dev);
+       unsigned minor = MINOR(dev);
+       return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
+ }
+-static inline dev_t new_decode_dev(u32 dev)
++static __always_inline dev_t new_decode_dev(u32 dev)
+ {
+       unsigned major = (dev & 0xfff00) >> 8;
+       unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00);
+       return MKDEV(major, minor);
+ }
+-static inline u64 huge_encode_dev(dev_t dev)
++static __always_inline u64 huge_encode_dev(dev_t dev)
+ {
+       return new_encode_dev(dev);
+ }
+-static inline dev_t huge_decode_dev(u64 dev)
++static __always_inline dev_t huge_decode_dev(u64 dev)
+ {
+       return new_decode_dev(dev);
+ }
+-static inline int sysv_valid_dev(dev_t dev)
++static __always_inline int sysv_valid_dev(dev_t dev)
+ {
+       return MAJOR(dev) < (1<<14) && MINOR(dev) < (1<<18);
+ }
+-static inline u32 sysv_encode_dev(dev_t dev)
++static __always_inline u32 sysv_encode_dev(dev_t dev)
+ {
+       return MINOR(dev) | (MAJOR(dev) << 18);
+ }
+-static inline unsigned sysv_major(u32 dev)
++static __always_inline unsigned sysv_major(u32 dev)
+ {
+       return (dev >> 18) & 0x3fff;
+ }
+-static inline unsigned sysv_minor(u32 dev)
++static __always_inline unsigned sysv_minor(u32 dev)
+ {
+       return dev & 0x3ffff;
+ }
diff --git a/queue-5.4/revert-drm-amd-display-fix-memory-leaks-in-s3-resume.patch b/queue-5.4/revert-drm-amd-display-fix-memory-leaks-in-s3-resume.patch
new file mode 100644 (file)
index 0000000..4c40216
--- /dev/null
@@ -0,0 +1,40 @@
+From alexdeucher@gmail.com  Wed Jan  6 17:47:17 2021
+From: Alex Deucher <alexdeucher@gmail.com>
+Date: Tue,  5 Jan 2021 11:45:45 -0500
+Subject: Revert "drm/amd/display: Fix memory leaks in S3 resume"
+To: amd-gfx@lists.freedesktop.org
+Cc: Alex Deucher <alexander.deucher@amd.com>, Stylon Wang <stylon.wang@amd.com>, Harry Wentland <harry.wentland@amd.com>, Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>, Andre Tomt <andre@tomt.net>, Oleksandr Natalenko <oleksandr@natalenko.name>, stable@vger.kernel.org
+Message-ID: <20210105164545.963036-1-alexander.deucher@amd.com>
+
+From: Alex Deucher <alexdeucher@gmail.com>
+
+This reverts commit a135a1b4c4db1f3b8cbed9676a40ede39feb3362.
+
+This leads to blank screens on some boards after replugging a
+display.  Revert until we understand the root cause and can
+fix both the leak and the blank screen after replug.
+
+Cc: Stylon Wang <stylon.wang@amd.com>
+Cc: Harry Wentland <harry.wentland@amd.com>
+Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Cc: Andre Tomt <andre@tomt.net>
+Cc: Oleksandr Natalenko <oleksandr@natalenko.name>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -1434,8 +1434,7 @@ amdgpu_dm_update_connector_after_detect(
+                       drm_connector_update_edid_property(connector,
+                                                          aconnector->edid);
+-                      aconnector->num_modes = drm_add_edid_modes(connector, aconnector->edid);
+-                      drm_connector_list_update(connector);
++                      drm_add_edid_modes(connector, aconnector->edid);
+                       if (aconnector->dc_link->aux_mode)
+                               drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux,
diff --git a/queue-5.4/revert-mtd-spinand-fix-oob-read.patch b/queue-5.4/revert-mtd-spinand-fix-oob-read.patch
new file mode 100644 (file)
index 0000000..5e4d78c
--- /dev/null
@@ -0,0 +1,38 @@
+From nbd@nbd.name  Wed Jan  6 17:49:44 2021
+From: Felix Fietkau <nbd@nbd.name>
+Date: Tue,  5 Jan 2021 11:18:21 +0100
+Subject: Revert "mtd: spinand: Fix OOB read"
+To: stable@vger.kernel.org
+Cc: gregkh@linuxfoundation.org, Miquel Raynal <miquel.raynal@bootlin.com>
+Message-ID: <20210105101821.47138-1-nbd@nbd.name>
+
+From: Felix Fietkau <nbd@nbd.name>
+
+This reverts stable commit baad618d078c857f99cc286ea249e9629159901f.
+
+This commit is adding lines to spinand_write_to_cache_op, wheras the upstream
+commit 868cbe2a6dcee451bd8f87cbbb2a73cf463b57e5 that this was supposed to
+backport was touching spinand_read_from_cache_op.
+It causes a crash on writing OOB data by attempting to write to read-only
+kernel memory.
+
+Cc: Miquel Raynal <miquel.raynal@bootlin.com>
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mtd/nand/spi/core.c |    4 ----
+ 1 file changed, 4 deletions(-)
+
+--- a/drivers/mtd/nand/spi/core.c
++++ b/drivers/mtd/nand/spi/core.c
+@@ -317,10 +317,6 @@ static int spinand_write_to_cache_op(str
+               buf += ret;
+       }
+-      if (req->ooblen)
+-              memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs,
+-                     req->ooblen);
+-
+       return 0;
+ }
index 9c03404433e5d0a27e69fa36cebcf927b465c704..99880e6df6d2a9278468cdba8f35fd289ca82625 100644 (file)
@@ -1,2 +1,6 @@
 revert-drm-amd-display-fix-memory-leaks-in-s3-resume.patch
 revert-mtd-spinand-fix-oob-read.patch
+dmaengine-at_hdmac-substitute-kzalloc-with-kmalloc.patch
+dmaengine-at_hdmac-add-missing-put_device-call-in-at_dma_xlate.patch
+dmaengine-at_hdmac-add-missing-kfree-call-in-at_dma_xlate.patch
+kdev_t-always-inline-major-minor-helper-functions.patch