<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/pstore/zone.c, branch linux-6.0.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-6.0.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-6.0.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-01-04T10:26:28+00:00</updated>
<entry>
<title>pstore/zone: Use GFP_ATOMIC to allocate zone buffer</title>
<updated>2023-01-04T10:26:28+00:00</updated>
<author>
<name>Qiujun Huang</name>
<email>hqjagain@gmail.com</email>
</author>
<published>2022-09-04T15:17:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1b0087d5c7c7283cefce42de3ece0e2212a7c076'/>
<id>urn:sha1:1b0087d5c7c7283cefce42de3ece0e2212a7c076</id>
<content type='text'>
commit 99b3b837855b987563bcfb397cf9ddd88262814b upstream.

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
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pstore/zone: cleanup "rcnt" type</title>
<updated>2022-06-23T15:27:52+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2022-06-23T13:40:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.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:00+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab+huawei@kernel.org</email>
</author>
<published>2021-01-14T08:04:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.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:55+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-10-16T13:20:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.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:59+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2020-08-23T22:36:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.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:00+00:00</updated>
<author>
<name>WeiXiong Liao</name>
<email>liaoweixiong@allwinnertech.com</email>
</author>
<published>2020-03-25T08:55:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.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>
<entry>
<title>pstore/zone: Provide way to skip "broken" zone for MTD devices</title>
<updated>2020-06-01T02:48:56+00:00</updated>
<author>
<name>WeiXiong Liao</name>
<email>liaoweixiong@allwinnertech.com</email>
</author>
<published>2020-03-25T08:55:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=335426c6dcdd338d6b7c939c2da15fc9c5dd4959'/>
<id>urn:sha1:335426c6dcdd338d6b7c939c2da15fc9c5dd4959</id>
<content type='text'>
One requirement to support MTD devices in pstore/zone is having a
way to declare certain regions as broken. Add this support to
pstore/zone.

The MTD driver should return -ENOMSG when encountering a bad region,
which tells pstore/zone to skip and try the next one.

Signed-off-by: WeiXiong Liao &lt;liaoweixiong@allwinnertech.com&gt;
Link: https://lore.kernel.org/lkml/20200511233229.27745-8-keescook@chromium.org/
Co-developed-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Link: //lore.kernel.org/lkml/20200512173801.222666-1-colin.king@canonical.com
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>pstore/zone,blk: Add ftrace frontend support</title>
<updated>2020-05-30T17:34:03+00:00</updated>
<author>
<name>WeiXiong Liao</name>
<email>liaoweixiong@allwinnertech.com</email>
</author>
<published>2020-03-25T08:55:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=34327e9fd213414b35eb70aa512c4e39b2095907'/>
<id>urn:sha1:34327e9fd213414b35eb70aa512c4e39b2095907</id>
<content type='text'>
Support backend for ftrace. To enable ftrace backend, just make
ftrace_size be greater than 0 and a multiple of 4096.

Signed-off-by: WeiXiong Liao &lt;liaoweixiong@allwinnertech.com&gt;
Link: https://lore.kernel.org/lkml/20200511233229.27745-6-keescook@chromium.org/
Co-developed-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Link: https://lore.kernel.org/lkml/20200512170719.221514-1-colin.king@canonical.com
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>pstore/zone,blk: Add console frontend support</title>
<updated>2020-05-30T17:34:03+00:00</updated>
<author>
<name>WeiXiong Liao</name>
<email>liaoweixiong@allwinnertech.com</email>
</author>
<published>2020-03-25T08:55:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cc9c4d1b5597167f8e8c92f6b61e1cda6d01884d'/>
<id>urn:sha1:cc9c4d1b5597167f8e8c92f6b61e1cda6d01884d</id>
<content type='text'>
Support backend for console. To enable console backend, just make
console_size be greater than 0 and a multiple of 4096.

Signed-off-by: WeiXiong Liao &lt;liaoweixiong@allwinnertech.com&gt;
Link: https://lore.kernel.org/lkml/20200511233229.27745-5-keescook@chromium.org/
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>pstore/zone,blk: Add support for pmsg frontend</title>
<updated>2020-05-30T17:34:03+00:00</updated>
<author>
<name>WeiXiong Liao</name>
<email>liaoweixiong@allwinnertech.com</email>
</author>
<published>2020-03-25T08:54:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0dc068265a1c5923ffebf40388fbe93050a77ad1'/>
<id>urn:sha1:0dc068265a1c5923ffebf40388fbe93050a77ad1</id>
<content type='text'>
Add pmsg support to pstore/blk (through pstore/zone). To enable, pmsg_size
must be greater than 0 and a multiple of 4096.

Signed-off-by: WeiXiong Liao &lt;liaoweixiong@allwinnertech.com&gt;
Link: https://lore.kernel.org/lkml/20200511233229.27745-4-keescook@chromium.org/
Co-developed-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Link: https://lore.kernel.org/lkml/20200512171932.222102-1-colin.king@canonical.com
Co-developed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
</feed>
