]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 Sep 2023 08:19:47 +0000 (10:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 Sep 2023 08:19:47 +0000 (10:19 +0200)
added patches:
erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
series

queue-5.4/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch [new file with mode: 0644]
queue-5.4/series [new file with mode: 0644]

diff --git a/queue-5.4/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch b/queue-5.4/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
new file mode 100644 (file)
index 0000000..7b22364
--- /dev/null
@@ -0,0 +1,50 @@
+From hsiangkao@linux.alibaba.com  Sat Sep  2 09:30:52 2023
+From: Gao Xiang <hsiangkao@linux.alibaba.com>
+Date: Thu, 31 Aug 2023 19:29:58 +0800
+Subject: erofs: ensure that the post-EOF tails are all zeroed
+To: stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: linux-erofs@lists.ozlabs.org, Gao Xiang <hsiangkao@linux.alibaba.com>, keltargw <keltar.gw@gmail.com>
+Message-ID: <20230831112959.99884-6-hsiangkao@linux.alibaba.com>
+
+From: Gao Xiang <hsiangkao@linux.alibaba.com>
+
+commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.
+
+This was accidentally fixed up in commit e4c1cf523d82 but we can't
+take the full change due to other dependancy issues, so here is just
+the actual bugfix that is needed.
+
+[Background]
+
+keltargw reported an issue [1] that with mmaped I/Os, sometimes the
+tail of the last page (after file ends) is not filled with zeroes.
+
+The root cause is that such tail page could be wrongly selected for
+inplace I/Os so the zeroed part will then be filled with compressed
+data instead of zeroes.
+
+A simple fix is to avoid doing inplace I/Os for such tail parts,
+actually that was already fixed upstream in commit e4c1cf523d82
+("erofs: tidy up z_erofs_do_read_page()") by accident.
+
+[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com
+
+Reported-by: keltargw <keltar.gw@gmail.com>
+Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
+Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/erofs/zdata.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/fs/erofs/zdata.c
++++ b/fs/erofs/zdata.c
+@@ -639,6 +639,8 @@ hitted:
+       cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
+       if (!(map->m_flags & EROFS_MAP_MAPPED)) {
+               zero_user_segment(page, cur, end);
++              ++spiltted;
++              tight = false;
+               goto next_part;
+       }
diff --git a/queue-5.4/series b/queue-5.4/series
new file mode 100644 (file)
index 0000000..855aaa0
--- /dev/null
@@ -0,0 +1 @@
+erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch