<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/pstore/ram.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>2024-12-01T23:12:43Z</updated>
<entry>
<title>Get rid of 'remove_new' relic from platform driver struct</title>
<updated>2024-12-01T23:12:43Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2024-12-01T23:12:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e70140ba0d2b1a30467d4af6bcfe761327b9ec95'/>
<id>urn:sha1:e70140ba0d2b1a30467d4af6bcfe761327b9ec95</id>
<content type='text'>
The continual trickle of small conversion patches is grating on me, and
is really not helping.  Just get rid of the 'remove_new' member
function, which is just an alias for the plain 'remove', and had a
comment to that effect:

  /*
   * .remove_new() is a relic from a prototype conversion of .remove().
   * New drivers are supposed to implement .remove(). Once all drivers are
   * converted to not use .remove_new any more, it will be dropped.
   */

This was just a tree-wide 'sed' script that replaced '.remove_new' with
'.remove', with some care taken to turn a subsequent tab into two tabs
to make things line up.

I did do some minimal manual whitespace adjustment for places that used
spaces to line things up.

Then I just removed the old (sic) .remove_new member function, and this
is the end result.  No more unnecessary conversion noise.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>pstore/ramoops: Add ramoops.mem_name= command line option</title>
<updated>2024-06-19T15:05:14Z</updated>
<author>
<name>Steven Rostedt (Google)</name>
</author>
<published>2024-06-13T15:55:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9d814eebb1ae9742e7fd7f39730653b16326bd4'/>
<id>urn:sha1:d9d814eebb1ae9742e7fd7f39730653b16326bd4</id>
<content type='text'>
Add a method to find a region specified by reserve_mem=nn:align:name for
ramoops. Adding a kernel command line parameter:

  reserve_mem=12M:4096:oops ramoops.mem_name=oops

Will use the size and location defined by the memmap parameter where it
finds the memory and labels it "oops". The "oops" in the ramoops option
is used to search for it.

This allows for arbitrary RAM to be used for ramoops if it is known that
the memory is not cleared on kernel crashes or soft reboots.

Tested-by: Guilherme G. Piccoli &lt;gpiccoli@igalia.com&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
Acked-by: Kees Cook &lt;kees@kernel.org&gt;
Link: https://lore.kernel.org/r/20240613155527.591647061@goodmis.org
Signed-off-by: Mike Rapoport (IBM) &lt;rppt@kernel.org&gt;
</content>
</entry>
<entry>
<title>pstore/ram: Register to module device table</title>
<updated>2024-02-22T18:37:21Z</updated>
<author>
<name>Nícolas F. R. A. Prado</name>
</author>
<published>2024-01-10T21:05:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=12dc54f568d4f589fd49d7c143cca0cc5fa221fd'/>
<id>urn:sha1:12dc54f568d4f589fd49d7c143cca0cc5fa221fd</id>
<content type='text'>
Register the compatible for this module on the module device table so
it can be automatically loaded when a matching DT node is present,
allowing logging of panics and oopses without any intervention.

Signed-off-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Link: https://lore.kernel.org/r/20240110210600.787703-2-nfraprado@collabora.com
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>pstore/ram: Fix crash when setting number of cpus to an odd number</title>
<updated>2023-12-08T22:15:00Z</updated>
<author>
<name>Weichen Chen</name>
</author>
<published>2023-02-24T02:36:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d49270a04623ce3c0afddbf3e984cb245aa48e9c'/>
<id>urn:sha1:d49270a04623ce3c0afddbf3e984cb245aa48e9c</id>
<content type='text'>
When the number of cpu cores is adjusted to 7 or other odd numbers,
the zone size will become an odd number.
The address of the zone will become:
    addr of zone0 = BASE
    addr of zone1 = BASE + zone_size
    addr of zone2 = BASE + zone_size*2
    ...
The address of zone1/3/5/7 will be mapped to non-alignment va.
Eventually crashes will occur when accessing these va.

So, use ALIGN_DOWN() to make sure the zone size is even
to avoid this bug.

Signed-off-by: Weichen Chen &lt;weichen.chen@mediatek.com&gt;
Reviewed-by: Matthias Brugger &lt;matthias.bgg@gmail.com&gt;
Tested-by: "Guilherme G. Piccoli" &lt;gpiccoli@igalia.com&gt;
Link: https://lore.kernel.org/r/20230224023632.6840-1-weichen.chen@mediatek.com
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>pstore: Support record sizes larger than kmalloc() limit</title>
<updated>2023-08-17T22:18:24Z</updated>
<author>
<name>Yuxiao Zhang</name>
</author>
<published>2023-06-27T20:25:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=104fd0b5e948157f8e8ac88a20b46ba8641d4e95'/>
<id>urn:sha1:104fd0b5e948157f8e8ac88a20b46ba8641d4e95</id>
<content type='text'>
Currently pstore record buffers are allocated using kmalloc() which has
a maximum size based on page size. If a large "pmsg-size" module
parameter is specified, pmsg will fail to copy the contents since
memdup_user() is limited to kmalloc() allocation sizes.

Since we don't need physically contiguous memory for any of the pstore
record buffers, use kvzalloc() to avoid such limitations in the core of
pstore and in the ram backend, and explicitly read from userspace using
vmemdup_user(). This also means that any other backends that want to
(or do already) support larger record sizes will Just Work now.

Signed-off-by: Yuxiao Zhang &lt;yuxiaozhang@google.com&gt;
Link: https://lore.kernel.org/r/20230627202540.881909-2-yuxiaozhang@google.com
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/ram: Convert to platform remove callback returning void</title>
<updated>2023-05-10T21:06:00Z</updated>
<author>
<name>Uwe Kleine-König</name>
</author>
<published>2023-04-01T12:00:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=48f2c681df4329b50fc92516c10e0398ca127242'/>
<id>urn:sha1:48f2c681df4329b50fc92516c10e0398ca127242</id>
<content type='text'>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Reviewed-by: Guilherme G. Piccoli &lt;gpiccoli@igalia.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20230401120000.2487153-1-u.kleine-koenig@pengutronix.de
</content>
</entry>
<entry>
<title>pstore: Properly assign mem_type property</title>
<updated>2022-12-23T18:34:25Z</updated>
<author>
<name>Luca Stefani</name>
</author>
<published>2022-12-22T13:10:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=beca3e311a49cd3c55a056096531737d7afa4361'/>
<id>urn:sha1:beca3e311a49cd3c55a056096531737d7afa4361</id>
<content type='text'>
If mem-type is specified in the device tree
it would end up overriding the record_size
field instead of populating mem_type.

As record_size is currently parsed after the
improper assignment with default size 0 it
continued to work as expected regardless of the
value found in the device tree.

Simply changing the target field of the struct
is enough to get mem-type working as expected.

Fixes: 9d843e8fafc7 ("pstore: Add mem_type property DT parsing support")
Cc: stable@vger.kernel.org
Signed-off-by: Luca Stefani &lt;luca@osomprivacy.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20221222131049.286288-1-luca@osomprivacy.com
</content>
</entry>
<entry>
<title>pstore/ram: Fix error return code in ramoops_probe()</title>
<updated>2022-12-02T23:16:59Z</updated>
<author>
<name>Wang Yufen</name>
</author>
<published>2022-12-02T08:22:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e1fce564900f8734edf15b87f028c57e14f6e28d'/>
<id>urn:sha1:e1fce564900f8734edf15b87f028c57e14f6e28d</id>
<content type='text'>
In the if (dev_of_node(dev) &amp;&amp; !pdata) path, the "err" may be assigned a
value of 0, so the error return code -EINVAL may be incorrectly set
to 0. To fix set valid return code before calling to goto.

Fixes: 35da60941e44 ("pstore/ram: add Device Tree bindings")
Signed-off-by: Wang Yufen &lt;wangyufen@huawei.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/1669969374-46582-1-git-send-email-wangyufen@huawei.com
</content>
</entry>
<entry>
<title>pstore/ram: Set freed addresses to NULL</title>
<updated>2022-10-19T16:25:39Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2022-10-11T20:01:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=06b4e09aab6c1ae6b3991a729d2fcb31e358e7f3'/>
<id>urn:sha1:06b4e09aab6c1ae6b3991a729d2fcb31e358e7f3</id>
<content type='text'>
For good measure, set all the freed addresses to NULL when managing
przs.

Cc: Anton Vorontsov &lt;anton@enomsg.org&gt;
Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-and-tested-by: Guilherme G. Piccoli &lt;gpiccoli@igalia.com&gt;
Link: https://lore.kernel.org/r/20221011200112.731334-5-keescook@chromium.org
</content>
</entry>
<entry>
<title>pstore/ram: Move internal definitions out of kernel-wide include</title>
<updated>2022-10-17T20:14:32Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2022-10-11T20:01:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8bd4da0f0626ae9a82099d3d99cd6efd4355879b'/>
<id>urn:sha1:8bd4da0f0626ae9a82099d3d99cd6efd4355879b</id>
<content type='text'>
Most of the details of the ram backend are entirely internal to the
backend itself. Leave only what is needed to instantiate a ram backend
in the kernel-wide header.

Cc: Anton Vorontsov &lt;anton@enomsg.org&gt;
Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-and-tested-by: Guilherme G. Piccoli &lt;gpiccoli@igalia.com&gt;
Link: https://lore.kernel.org/r/20221011200112.731334-4-keescook@chromium.org
</content>
</entry>
</feed>
