<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/next/linux-next.git/drivers/block/zram, branch master</title>
<subtitle>The linux-next integration testing tree</subtitle>
<id>https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/atom?h=master</id>
<link rel='self' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/'/>
<updated>2026-09-14T07:56:18+00:00</updated>
<entry>
<title>Merge https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable into for-next</title>
<updated>2026-09-14T07:56:18+00:00</updated>
<author>
<name>David Hildenbrand (Arm)</name>
<email>david@kernel.org</email>
</author>
<published>2026-09-14T07:56:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=e8f8b4208efcf553a99a959dc35a079ffb4afe8b'/>
<id>urn:sha1:e8f8b4208efcf553a99a959dc35a079ffb4afe8b</id>
<content type='text'>
Signed-off-by: David Hildenbrand (Arm) &lt;david@kernel.org&gt;
</content>
</entry>
<entry>
<title>zram: convert to SG-list zsmalloc object read API</title>
<updated>2026-09-14T04:32:37+00:00</updated>
<author>
<name>Sergey Senozhatsky</name>
<email>senozhatsky@chromium.org</email>
</author>
<published>2026-09-07T10:57:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3de3d4336b8cdc18aae2d90fbfdc6ab6dc0b2836'/>
<id>urn:sha1:3de3d4336b8cdc18aae2d90fbfdc6ab6dc0b2836</id>
<content type='text'>
Patch series "zsmallc: remove old object read API".

zram remains the only user of old zsmalloc object read API.  This series
removes the old API and converts zram to use the new SG-list based API.


This patch (of 2):

zram remains the last user of old zsmalloc object read API, that performed
linearisation on the zsmalloc side.  There is a new SG-list API, that has
a bunch of benefits.  Switch zram to SG-list zsmalloc object read API.

Link: https://lore.kernel.org/20260907105739.1793316-1-senozhatsky@chromium.org
Link: https://lore.kernel.org/20260907105739.1793316-2-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Nhat Pham &lt;nphamcs@gmail.com&gt;
</content>
</entry>
<entry>
<title>zram: remove unreachable kernel_read_file_from_path() return check</title>
<updated>2026-09-14T04:31:54+00:00</updated>
<author>
<name>Sergey Senozhatsky</name>
<email>senozhatsky@chromium.org</email>
</author>
<published>2026-09-01T05:13:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=e210325ccb66273da3ec41cb8ce22b28b3e318f7'/>
<id>urn:sha1:e210325ccb66273da3ec41cb8ce22b28b3e318f7</id>
<content type='text'>
Sashiko reported that:
kernel_read_file_from_path() returns negative error for zero-sized
files, so we cannot have "sz == 0" return, remove it and use a
generic error message instead.

Link: https://lore.kernel.org/20260901051335.2202390-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Haoqin Huang &lt;haoqinhuang7@gmail.com&gt;
</content>
</entry>
<entry>
<title>zram: fix idle age_sec underflow in idle_store()</title>
<updated>2026-09-14T04:31:17+00:00</updated>
<author>
<name>Hao Jia</name>
<email>jiahao1@lixiang.com</email>
</author>
<published>2026-08-28T08:31:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=113f937e8d4d34dad9a1944e1b19b05737f27b4e'/>
<id>urn:sha1:113f937e8d4d34dad9a1944e1b19b05737f27b4e</id>
<content type='text'>
After commit 2e8ff2f51dde ("zram: use u32 for entry ac_time tracking"),
idle_store() computes the idle cutoff as:

	cutoff = ktime_sub((u32)ktime_get_boottime_seconds(), age_sec);

Because the left operand is cast to u32, when age_sec exceeds the current
uptime the subtraction wraps modulo 2^32 and the huge result is
zero-extended into the s64 cutoff.  mark_idle() then marks every entry as
idle instead of matching nothing.  For instance, running

	echo 86400 &gt; /sys/block/zramX/idle

on a machine up for only two minutes marks all newly written pages idle
and hands them to idle writeback and recompression.

No slot can have been accessed before the system booted, so an age_sec
that reaches back past uptime cannot match any slot.  Return early in that
case, without walking the table or taking any slot locks.

Track the cutoff as time64_t rather than ktime_t.  Both cutoff and ac_time
are boot-time values in seconds, so a plain arithmetic comparison against
ac_time in mark_idle() is correct and no ktime helpers are needed.

Link: https://lore.kernel.org/20260828083149.45760-1-jiahao.kernel@gmail.com
Fixes: 2e8ff2f51dde ("zram: use u32 for entry ac_time tracking")
Signed-off-by: Hao Jia &lt;jiahao1@lixiang.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Suggested-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: Brian Geffon &lt;bgeffon@google.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
</content>
</entry>
<entry>
<title>treewide: refresh kmalloc_obj() conversions</title>
<updated>2026-09-05T04:37:00+00:00</updated>
<author>
<name>Kees Cook</name>
<email>kees+treewide@kernel.org</email>
</author>
<published>2026-09-02T22:31:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d'/>
<id>urn:sha1:3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d</id>
<content type='text'>
This is another run of the Coccinelle script for converting kmalloc()
family of allocations to kmalloc_obj() via the existing rules in
scripts/coccinelle/api/kmalloc_objs.cocci

This catches both the set of kmalloc() uses added since the first
kmalloc_obj() conversions in v7.0 and adds a large group missed in the
first pass due to Coccinelle not interacting well with the cleanup.h
scoped_...() family of macros[1]. I worked around this with spatch's
"--macro-file" argument to a file with all the scoped_...() macros mapped
to Coccinelle's YACFE_ITERATOR[2] as that was the closest viable control
flow indicator I could find.

Build tested allmodconfig on x86, arm64, arm, loongarch, mips, powerpc,
riscv, and s390 with no new warnings.

Link: https://lore.kernel.org/lkml/202609021314.8A9C0B8@keescook/ [1]
Link: https://github.com/coccinelle/coccinelle/blob/master/standard.h [2]
Signed-off-by: Kees Cook &lt;kees+treewide@kernel.org&gt;
</content>
</entry>
<entry>
<title>zram: fix slot lock bit position on big-endian 64-bit</title>
<updated>2026-08-25T01:43:19+00:00</updated>
<author>
<name>David Carlier</name>
<email>devnexen@gmail.com</email>
</author>
<published>2026-08-10T20:22:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a8b5875741d416703e19ad8eeac6fce8a12bd6e4'/>
<id>urn:sha1:a8b5875741d416703e19ad8eeac6fce8a12bd6e4</id>
<content type='text'>
The slot lock is a bit operation on the whole __lock word, which flags and
ac_time alias as two u32s.  On little-endian the lock bit lands in the
position ZRAM_ENTRY_LOCK reserves in flags, so the aliasing works out.  On
64-bit big-endian it lands in ac_time instead: with
ZRAM_TRACK_ENTRY_ACTIME enabled, storing the access time from
mark_slot_accessed() or slot_free() wipes out the held lock bit, letting
another CPU take the same slot lock; an access time value with that bit
set makes the slot look locked forever.

Shift the lock bit into the flags half of the word on big-endian 64-bit.

Link: https://lore.kernel.org/20260810202241.2436603-1-devnexen@gmail.com
Fixes: 2e8ff2f51dde ("zram: use u32 for entry ac_time tracking")
Signed-off-by: David Carlier &lt;devnexen@gmail.com&gt;
Reviewed-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>zram: switch to unsigned long indexing</title>
<updated>2026-08-25T01:43:06+00:00</updated>
<author>
<name>Sergey Senozhatsky</name>
<email>senozhatsky@chromium.org</email>
</author>
<published>2026-08-06T03:16:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=184bf187c45ba6c1141aa7fe10bf10f85d5a7634'/>
<id>urn:sha1:184bf187c45ba6c1141aa7fe10bf10f85d5a7634</id>
<content type='text'>
zram has always used "unsigned int" for (page) index calculations, which
unnecessarily limited max zram disksize.

Switch to "unsigned long" and permit much larger zram devices.

Link: https://lore.kernel.org/20260806031640.536615-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Suggested-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Co-developed-by: Longlong Xia &lt;xialonglong2025@163.com&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>zram: fix out-of-bounds access in read_block_state()</title>
<updated>2026-08-25T01:43:05+00:00</updated>
<author>
<name>Longlong Xia</name>
<email>xialonglong@kylinos.cn</email>
</author>
<published>2026-08-04T06:59:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=391f057f44a51cc9418da5cba78b014324174264'/>
<id>urn:sha1:391f057f44a51cc9418da5cba78b014324174264</id>
<content type='text'>
read_block_state() calculates nr_pages before taking dev_lock.  If the
device is reset and reinitialized with a smaller disksize before lock
acquisition, nr_pages still describes the old table.  The subsequent loop
can then call slot_lock() past the end of the newly allocated table.

Read disksize after acquiring dev_lock and checking that the device is
initialized.  The read lock then keeps the table and its bound stable for
the duration of the scan.

Link: https://lore.kernel.org/20260804065919.3970386-3-xialonglong2025@163.com
Fixes: c0265342bff4 ("zram: introduce zram memory tracking")
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Longlong Xia &lt;xialonglong@kylinos.cn&gt;
Reviewed-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>zram: fix out-of-bounds access in writeback_store()</title>
<updated>2026-08-25T01:43:05+00:00</updated>
<author>
<name>Longlong Xia</name>
<email>xialonglong@kylinos.cn</email>
</author>
<published>2026-08-04T06:59:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=894913e2d35c46ff19a77530907771ae57862b96'/>
<id>urn:sha1:894913e2d35c46ff19a77530907771ae57862b96</id>
<content type='text'>
Patch series "zram: fix stale scan bounds after reinitialization".

Both writeback_store() and read_block_state() derive their table scan
bounds from zram-&gt;disksize before acquiring dev_lock.  If the device is
reset and reinitialized with a smaller disksize between that read and lock
acquisition, the bound can describe the old table while the scan operates
on the new one.  This can lead to out-of-bounds slot accesses.

Move both bound calculations under dev_lock so each bound remains
consistent with the table throughout its scan.  Keep the fixes separate
because the affected interfaces originate from different commits and can
be backported independently.


This patch (of 2):

writeback_store() calculates the table scan bounds before taking dev_lock.
A reset followed by reconfiguration with a smaller disksize can therefore
replace zram-&gt;table while writeback_store() is waiting for the lock.  Once
it acquires the lock, it sees an initialized device but scans the new
table using the old upper bound, resulting in an out-of-bounds access.

Calculate the number of pages while holding dev_lock so the scan bound
matches the table protected by the lock.

Link: https://lore.kernel.org/20260804065919.3970386-1-xialonglong2025@163.com
Link: https://lore.kernel.org/20260804065919.3970386-2-xialonglong2025@163.com
Fixes: a939888ec38b ("zram: support idle/huge page writeback")
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Longlong Xia &lt;xialonglong@kylinos.cn&gt;
Reviewed-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>zram: reset per-priority params when changing algorithm before init</title>
<updated>2026-08-25T01:43:05+00:00</updated>
<author>
<name>Haoqin Huang</name>
<email>haoqinhuang@tencent.com</email>
</author>
<published>2026-08-04T09:38:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=702c5a799db20e49fe67cdfa27bac65374ad00ab'/>
<id>urn:sha1:702c5a799db20e49fe67cdfa27bac65374ad00ab</id>
<content type='text'>
Parameters validated against one algorithm may be invalid for another
(e.g.  lz4 accepts level=65535 but zstd does not).  Although algorithm
changes are blocked after disksize is set, they are allowed before device
initialization.  Reset per-priority params on algorithm change so that
stale parameters do not silently carry over.

Link: https://lore.kernel.org/20260804093841.67920-6-haoqinhuang7@gmail.com
Signed-off-by: Haoqin Huang &lt;haoqinhuang@tencent.com&gt;
Signed-off-by: Rongwei Wang &lt;zigiwang@tencent.com&gt;
Reviewed-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Tested-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: David Sterba &lt;dsterba@suse.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Nick Terrell &lt;terrelln@fb.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
</feed>
