<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/pstore/zone.c, branch linux-rolling-lts</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-lts</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-lts'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-05-09T19:09:58Z</updated>
<entry>
<title>pstore/zone: rewrite some comments for better understanding</title>
<updated>2025-05-09T19:09:58Z</updated>
<author>
<name>Eugen Hristev</name>
</author>
<published>2025-01-17T08:42:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d679c2e1e8d96f71f85e2ef3877407d264212cc3'/>
<id>urn:sha1:d679c2e1e8d96f71f85e2ef3877407d264212cc3</id>
<content type='text'>
Rewrite some comments to make it more clear and easier to understand;
fix typos.

Signed-off-by: Eugen Hristev &lt;eugen.hristev@linaro.org&gt;
Link: https://lore.kernel.org/r/20241224154405.295840-1-eugen.hristev@linaro.org
Link: https://lore.kernel.org/r/20250117084228.3218024-1-eugen.hristev@linaro.org
Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>pstore/zone: avoid dereferencing zero sized ptr after init zones</title>
<updated>2025-01-10T16:51:46Z</updated>
<author>
<name>Eugen Hristev</name>
</author>
<published>2025-01-10T12:57:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=067cdf020329a07dd8ee1574c3086998343b1b2b'/>
<id>urn:sha1:067cdf020329a07dd8ee1574c3086998343b1b2b</id>
<content type='text'>
In psz_init_zones, if the requested area has a total_size less than
record_size, kcalloc will be called with c == 0 and will return
ZERO_SIZE_PTR.
Further, this will lead to an oops.

With this patch, in this scenario, it will look like this :
[    6.865545] pstore_zone:     total size : 28672 Bytes
[    6.865547] pstore_zone:     kmsg size : 65536 Bytes
[    6.865549] pstore_zone:     pmsg size : 0 Bytes
[    6.865551] pstore_zone:     console size : 0 Bytes
[    6.865553] pstore_zone:     ftrace size : 0 Bytes
[    6.872095] pstore_zone: zone dmesg total_size too small
[    6.878234] pstore_zone: alloc zones failed

Signed-off-by: Eugen Hristev &lt;eugen.hristev@linaro.org&gt;
Link: https://lore.kernel.org/r/20250110125714.2594719-1-eugen.hristev@linaro.org
Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>pstore/zone: Don't clear memory twice</title>
<updated>2024-03-09T20:33:22Z</updated>
<author>
<name>Christophe JAILLET</name>
</author>
<published>2024-03-09T08:24:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c8d25d696f526a42ad8cf615dc1131c0b00c662e'/>
<id>urn:sha1:c8d25d696f526a42ad8cf615dc1131c0b00c662e</id>
<content type='text'>
There is no need to call memset(..., 0, ...) on memory allocated by
kcalloc(). It is already zeroed.

Remove the redundant call.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Link: https://lore.kernel.org/r/fa2597400051c18c6ca11187b0e4b906729991b2.1709972649.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>pstore/zone: Add a null pointer check to the psz_kmsg_read</title>
<updated>2024-02-22T18:37:22Z</updated>
<author>
<name>Kunwu Chan</name>
</author>
<published>2024-01-18T10:02:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=98bc7e26e14fbb26a6abf97603d59532475e97f8'/>
<id>urn:sha1:98bc7e26e14fbb26a6abf97603d59532475e97f8</id>
<content type='text'>
kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure. Ensure the allocation was successful
by checking the pointer validity.

Signed-off-by: Kunwu Chan &lt;chentao@kylinos.cn&gt;
Link: https://lore.kernel.org/r/20240118100206.213928-1-chentao@kylinos.cn
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>pstore/zone: Use GFP_ATOMIC to allocate zone buffer</title>
<updated>2022-10-17T20:14:10Z</updated>
<author>
<name>Qiujun Huang</name>
</author>
<published>2022-09-04T15:17:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=99b3b837855b987563bcfb397cf9ddd88262814b'/>
<id>urn:sha1:99b3b837855b987563bcfb397cf9ddd88262814b</id>
<content type='text'>
There is a case found when triggering a panic_on_oom, pstore fails to dump
kmsg. Because psz_kmsg_write_record can't get the new buffer.

Handle this by using GFP_ATOMIC to allocate a buffer at lower watermark.

Signed-off-by: Qiujun Huang &lt;hqjagain@gmail.com&gt;
Fixes: 335426c6dcdd ("pstore/zone: Provide way to skip "broken" zone for MTD devices")
Cc: WeiXiong Liao &lt;gmpy.liaowx@gmail.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/CAJRQjofRCF7wjrYmw3D7zd5QZnwHQq+F8U-mJDJ6NZ4bddYdLA@mail.gmail.com
</content>
</entry>
<entry>
<title>pstore/zone: cleanup "rcnt" type</title>
<updated>2022-06-23T15:27:52Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2022-06-23T13:40:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2c09d1443b9b8b6e25bfb2acf51ad442cf9b314e'/>
<id>urn:sha1:2c09d1443b9b8b6e25bfb2acf51ad442cf9b314e</id>
<content type='text'>
The info-&gt;read() function returns ssize_t.  That means that info-&gt;read()
either returns either negative error codes or a positive number
representing the bytes read.

The "rcnt" variable should be declared as ssize_t as well.  Most places
do this correctly but psz_kmsg_recover_meta() needed to be fixed.

This code casts the "rcnt" to int.  That is unnecessary when "rcnt"
is already signed.  It's also slightly wrong because if info-&gt;read()
returned a very high (more than INT_MAX) number of bytes then this might
treat that as an error.  This bug cannot happen in real life, so it
doesn't affect run time, but static checkers correctly complain that it
is wrong.

fs/pstore/zone.c:366 psz_kmsg_recover_data() warn: casting 'rcnt' truncates high bits

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/YrRtPSFHDVJzV6d+@kili
</content>
</entry>
<entry>
<title>pstore/zone: fix a kernel-doc markup</title>
<updated>2021-01-21T21:06:00Z</updated>
<author>
<name>Mauro Carvalho Chehab</name>
</author>
<published>2021-01-14T08:04:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4fd15eaf429a1e7de9d653f0ff2e8a50733495b8'/>
<id>urn:sha1:4fd15eaf429a1e7de9d653f0ff2e8a50733495b8</id>
<content type='text'>
The documented struct is psz_head and not psz_buffer.

Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
Link: https://lore.kernel.org/r/a67ca4d12c3ef277dadb9e0d0df8450158e637cc.1610610937.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>pstore/zone: cap the maximum device size</title>
<updated>2020-12-01T19:32:55Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2020-10-16T13:20:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cbf82e35031b135928f36e72c6d166e935530b6a'/>
<id>urn:sha1:cbf82e35031b135928f36e72c6d166e935530b6a</id>
<content type='text'>
Introduce an abritrary 128MiB cap to avoid malloc failures when using
a larger block device.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: WeiXiong Liao &lt;gmpy.liaowx@gmail.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20201016132047.3068029-2-hch@lst.de
</content>
</entry>
<entry>
<title>treewide: Use fallthrough pseudo-keyword</title>
<updated>2020-08-23T22:36:59Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
</author>
<published>2020-08-23T22:36:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=df561f6688fef775baa341a0f5d960becd248b11'/>
<id>urn:sha1:df561f6688fef775baa341a0f5d960becd248b11</id>
<content type='text'>
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
</content>
</entry>
<entry>
<title>pstore/blk: Support non-block storage devices</title>
<updated>2020-06-01T02:49:00Z</updated>
<author>
<name>WeiXiong Liao</name>
</author>
<published>2020-03-25T08:55:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7dcb7848ba110ff192efc917d1a6de66b4c9ca4f'/>
<id>urn:sha1:7dcb7848ba110ff192efc917d1a6de66b4c9ca4f</id>
<content type='text'>
Add support for non-block devices (e.g. MTD). A non-block driver calls
pstore_blk_register_device() to register iself.

In addition, pstore/zone is updated to handle non-block devices,
where an erase must be done before a write. Without this, there is no
way to remove records stored to an MTD.

Signed-off-by: WeiXiong Liao &lt;liaoweixiong@allwinnertech.com&gt;
Link: https://lore.kernel.org/lkml/20200511233229.27745-10-keescook@chromium.org/
Co-developed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
</feed>
