<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/erofs/decompressor.c, branch linux-5.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-08-17T13:14:16Z</updated>
<entry>
<title>erofs: avoid consecutive detection for Highmem memory</title>
<updated>2022-08-17T13:14:16Z</updated>
<author>
<name>Gao Xiang</name>
</author>
<published>2022-07-08T10:10:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4b3dd6659694cc8dba31e9efdcd834dc741e10d2'/>
<id>urn:sha1:4b3dd6659694cc8dba31e9efdcd834dc741e10d2</id>
<content type='text'>
[ Upstream commit 448b5a1548d87c246c3d0c3df8480d3c6eb6c11a ]

Currently, vmap()s are avoided if physical addresses are
consecutive for decompressed buffers.

I observed that is very common for 4KiB pclusters since the
numbers of decompressed pages are almost 2 or 3.

However, such detection doesn't work for Highmem pages on
32-bit machines, let's fix it now.

Reported-by: Liu Jinbao &lt;liujinbao1@xiaomi.com&gt;
Fixes: 7fc45dbc938a ("staging: erofs: introduce generic decompression backend")
Link: https://lore.kernel.org/r/20220708101001.21242-1-hsiangkao@linux.alibaba.com
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>erofs: fix buffer copy overflow of ztailpacking feature</title>
<updated>2022-05-17T15:38:14Z</updated>
<author>
<name>Gao Xiang</name>
</author>
<published>2022-05-12T11:58:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dcbe6803fffd387f72b48c2373b5f5ed12a5804b'/>
<id>urn:sha1:dcbe6803fffd387f72b48c2373b5f5ed12a5804b</id>
<content type='text'>
I got some KASAN report as below:

[   46.959738] ==================================================================
[   46.960430] BUG: KASAN: use-after-free in z_erofs_shifted_transform+0x2bd/0x370
[   46.960430] Read of size 4074 at addr ffff8880300c2f8e by task fssum/188
...
[   46.960430] Call Trace:
[   46.960430]  &lt;TASK&gt;
[   46.960430]  dump_stack_lvl+0x41/0x5e
[   46.960430]  print_report.cold+0xb2/0x6b7
[   46.960430]  ? z_erofs_shifted_transform+0x2bd/0x370
[   46.960430]  kasan_report+0x8a/0x140
[   46.960430]  ? z_erofs_shifted_transform+0x2bd/0x370
[   46.960430]  kasan_check_range+0x14d/0x1d0
[   46.960430]  memcpy+0x20/0x60
[   46.960430]  z_erofs_shifted_transform+0x2bd/0x370
[   46.960430]  z_erofs_decompress_pcluster+0xaae/0x1080

The root cause is that the tail pcluster won't be a complete filesystem
block anymore. So if ztailpacking is used, the second part of an
uncompressed tail pcluster may not be ``rq-&gt;pageofs_out``.

Fixes: ab749badf9f4 ("erofs: support unaligned data decompression")
Fixes: cecf864d3d76 ("erofs: support inline data decompression")
Reviewed-by: Yue Hu &lt;huyue2@coolpad.com&gt;
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Link: https://lore.kernel.org/r/20220512115833.24175-1-hsiangkao@linux.alibaba.com
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>erofs: do not prompt for risk any more when using big pcluster</title>
<updated>2022-05-17T15:38:02Z</updated>
<author>
<name>Yue Hu</name>
</author>
<published>2022-04-07T05:05:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1e59af07c7f361bbe64779ea93546f88f433b912'/>
<id>urn:sha1:1e59af07c7f361bbe64779ea93546f88f433b912</id>
<content type='text'>
The big pcluster feature has been merged for a year, it has been mostly
stable now.

Signed-off-by: Yue Hu &lt;huyue2@coolpad.com&gt;
Reviewed-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Link: https://lore.kernel.org/r/20220407050505.12683-1-huyue2@coolpad.com
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>erofs: support unaligned data decompression</title>
<updated>2021-12-30T16:48:43Z</updated>
<author>
<name>Gao Xiang</name>
</author>
<published>2021-12-28T05:46:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ab749badf9f41f32509cd103391b81ea7e684b76'/>
<id>urn:sha1:ab749badf9f41f32509cd103391b81ea7e684b76</id>
<content type='text'>
Previously, compressed data was assumed as block-aligned. This
should be changed due to in-block tail-packing inline data.

Link: https://lore.kernel.org/r/20211228054604.114518-4-hsiangkao@linux.alibaba.com
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Yue Hu &lt;huyue2@yulong.com&gt;
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>erofs: introduce z_erofs_fixup_insize</title>
<updated>2021-12-28T22:42:07Z</updated>
<author>
<name>Gao Xiang</name>
</author>
<published>2021-12-28T05:46:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=10e5f6e482e18dcdee9a9b7ff1a66f4977dd1ec2'/>
<id>urn:sha1:10e5f6e482e18dcdee9a9b7ff1a66f4977dd1ec2</id>
<content type='text'>
To prepare for the upcoming ztailpacking feature, introduce
z_erofs_fixup_insize() and pageofs_in to wrap up the process
to get the exact compressed size via zero padding.

Link: https://lore.kernel.org/r/20211228054604.114518-3-hsiangkao@linux.alibaba.com
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>erofs: tidy up z_erofs_lz4_decompress</title>
<updated>2021-12-28T22:41:59Z</updated>
<author>
<name>Gao Xiang</name>
</author>
<published>2021-12-28T05:46:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d67aee76d41861cda99b1ea13f8bf33fd06c5f20'/>
<id>urn:sha1:d67aee76d41861cda99b1ea13f8bf33fd06c5f20</id>
<content type='text'>
To prepare for the upcoming ztailpacking feature and further
cleanups, introduce a unique z_erofs_lz4_decompress_ctx to keep
the context, including inpages, outpages and oend, which are
frequently used by the lz4 decompressor.

No logic changes.

Link: https://lore.kernel.org/r/20211228054604.114518-2-hsiangkao@linux.alibaba.com
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>erofs: rename lz4_0pading to zero_padding</title>
<updated>2021-12-01T13:28:00Z</updated>
<author>
<name>Huang Jianan</name>
</author>
<published>2021-11-12T16:09:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7e508f2ca8bbda8cabbd4753bc727a7f66837a12'/>
<id>urn:sha1:7e508f2ca8bbda8cabbd4753bc727a7f66837a12</id>
<content type='text'>
Renaming lz4_0padding to zero_padding globally since LZMA and later
algorithms also need that.

Link: https://lore.kernel.org/r/20211112160935.19394-1-jnhuang95@gmail.com
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Huang Jianan &lt;huangjianan@oppo.com&gt;
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>erofs: don't trigger WARN() when decompression fails</title>
<updated>2021-10-31T13:00:28Z</updated>
<author>
<name>Gao Xiang</name>
</author>
<published>2021-10-25T07:43:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a0961f351d82d43ab0b845304caa235dfe249ae9'/>
<id>urn:sha1:a0961f351d82d43ab0b845304caa235dfe249ae9</id>
<content type='text'>
syzbot reported a WARNING [1] due to corrupted compressed data.

As Dmitry said, "If this is not a kernel bug, then the code should
not use WARN. WARN if for kernel bugs and is recognized as such by
all testing systems and humans."

[1] https://lore.kernel.org/r/000000000000b3586105cf0ff45e@google.com

Link: https://lore.kernel.org/r/20211025074311.130395-1-hsiangkao@linux.alibaba.com
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Reported-by: syzbot+d8aaffc3719597e8cfb4@syzkaller.appspotmail.com
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>erofs: get rid of -&gt;lru usage</title>
<updated>2021-10-25T00:22:59Z</updated>
<author>
<name>Gao Xiang</name>
</author>
<published>2021-10-22T09:01:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eaa9172ad988b3ef5c59a051c825706252d435e1'/>
<id>urn:sha1:eaa9172ad988b3ef5c59a051c825706252d435e1</id>
<content type='text'>
Currently, -&gt;lru is a way to arrange non-LRU pages and has some
in-kernel users. In order to minimize noticable issues of page
reclaim and cache thrashing under high memory presure, limited
temporary pages were all chained with -&gt;lru and can be reused
during the request. However, it seems that -&gt;lru could be removed
when folio is landing.

Let's use page-&gt;private to chain temporary pages for now instead
and transform EROFS formally after the topic of the folio / file
page design is finalized.

Link: https://lore.kernel.org/r/20211022090120.14675-1-hsiangkao@linux.alibaba.com
Cc: Matthew Wilcox &lt;willy@infradead.org&gt;
Reviewed-by: Kent Overstreet &lt;kent.overstreet@gmail.com&gt;
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>erofs: lzma compression support</title>
<updated>2021-10-19T15:44:30Z</updated>
<author>
<name>Gao Xiang</name>
</author>
<published>2021-10-10T21:31:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=622ceaddb7649ca328832f50ba1400af778d75fa'/>
<id>urn:sha1:622ceaddb7649ca328832f50ba1400af778d75fa</id>
<content type='text'>
Add MicroLZMA support in order to maximize compression ratios for
specific scenarios. For example, it's useful for low-end embedded
boards and as a secondary algorithm in a file for specific access
patterns.

MicroLZMA is a new container format for raw LZMA1, which was created
by Lasse Collin aiming to minimize old LZMA headers and get rid of
unnecessary EOPM (end of payload marker) as well as to enable
fixed-sized output compression, especially for 4KiB pclusters.

Similar to LZ4, inplace I/O approach is used to minimize runtime
memory footprint when dealing with I/O. Overlapped decompression is
handled with 1) bounced buffer for data under processing or 2) extra
short-lived pages from the on-stack pagepool which will be shared in
the same read request (128KiB for example).

Link: https://lore.kernel.org/r/20211010213145.17462-8-xiang@kernel.org
Acked-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
</feed>
