<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/pstore/platform.c, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-04-08T12:05:32Z</updated>
<entry>
<title>pstore: Don't use semaphores in always-atomic-context code</title>
<updated>2022-04-08T12:05:32Z</updated>
<author>
<name>Jann Horn</name>
</author>
<published>2022-03-14T18:59:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2338a14caa44fa65452a6f516c92c90b2c5656d1'/>
<id>urn:sha1:2338a14caa44fa65452a6f516c92c90b2c5656d1</id>
<content type='text'>
commit 8126b1c73108bc691f5643df19071a59a69d0bc6 upstream.

pstore_dump() is *always* invoked in atomic context (nowadays in an RCU
read-side critical section, before that under a spinlock).
It doesn't make sense to try to use semaphores here.

This is mostly a revert of commit ea84b580b955 ("pstore: Convert buf_lock
to semaphore"), except that two parts aren't restored back exactly as they
were:

 - keep the lock initialization in pstore_register
 - in efi_pstore_write(), always set the "block" flag to false
 - omit "is_locked", that was unnecessary since
   commit 959217c84c27 ("pstore: Actually give up during locking failure")
 - fix the bailout message

The actual problem that the buggy commit was trying to address may have
been that the use of preemptible() in efi_pstore_write() was wrong - it
only looks at preempt_count() and the state of IRQs, but __rcu_read_lock()
doesn't touch either of those under CONFIG_PREEMPT_RCU.
(Sidenote: CONFIG_PREEMPT_RCU means that the scheduler can preempt tasks in
RCU read-side critical sections, but you're not allowed to actively
block/reschedule.)

Lockdep probably never caught the problem because it's very rare that you
actually hit the contended case, so lockdep always just sees the
down_trylock(), not the down_interruptible(), and so it can't tell that
there's a problem.

Fixes: ea84b580b955 ("pstore: Convert buf_lock to semaphore")
Cc: stable@vger.kernel.org
Acked-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Jann Horn &lt;jannh@google.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20220314185953.2068993-1-jannh@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>lib: zstd: Add kernel-specific API</title>
<updated>2021-11-09T00:55:21Z</updated>
<author>
<name>Nick Terrell</name>
</author>
<published>2020-09-11T23:49:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cf30f6a5f0c60ec98a637b836bef6915f602c6ab'/>
<id>urn:sha1:cf30f6a5f0c60ec98a637b836bef6915f602c6ab</id>
<content type='text'>
This patch:
- Moves `include/linux/zstd.h` -&gt; `include/linux/zstd_lib.h`
- Updates modified zstd headers to yearless copyright
- Adds a new API in `include/linux/zstd.h` that is functionally
  equivalent to the in-use subset of the current API. Functions are
  renamed to avoid symbol collisions with zstd, to make it clear it is
  not the upstream zstd API, and to follow the kernel style guide.
- Updates all callers to use the new API.

There are no functional changes in this patch. Since there are no
functional change, I felt it was okay to update all the callers in a
single patch. Once the API is approved, the callers are mechanically
changed.

This patch is preparing for the 3rd patch in this series, which updates
zstd to version 1.4.10. Since the upstream zstd API is no longer exposed
to callers, the update can happen transparently.

Signed-off-by: Nick Terrell &lt;terrelln@fb.com&gt;
Tested By: Paul Jones &lt;paul@pauljones.id.au&gt;
Tested-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Tested-by: Sedat Dilek &lt;sedat.dilek@gmail.com&gt; # LLVM/Clang v13.0.0 on x86-64
Tested-by: Jean-Denis Girard &lt;jd.girard@sysnux.pf&gt;
</content>
</entry>
<entry>
<title>printk: introduce a kmsg_dump iterator</title>
<updated>2021-03-08T10:43:27Z</updated>
<author>
<name>John Ogness</name>
</author>
<published>2021-03-03T10:15:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f9f3f02db98bbe678a8e57fe9432b196174744a3'/>
<id>urn:sha1:f9f3f02db98bbe678a8e57fe9432b196174744a3</id>
<content type='text'>
Rather than storing the iterator information in the registered
kmsg_dumper structure, create a separate iterator structure. The
kmsg_dump_iter structure can reside on the stack of the caller, thus
allowing lockless use of the kmsg_dump functions.

Update code that accesses the kernel logs using the kmsg_dumper
structure to use the new kmsg_dump_iter structure. For kmsg_dumpers,
this also means adding a call to kmsg_dump_rewind() to initialize
the iterator.

All this is in preparation for removal of @logbuf_lock.

Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt; # pstore
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20210303101528.29901-13-john.ogness@linutronix.de
</content>
</entry>
<entry>
<title>pstore: Fix typo in compression option name</title>
<updated>2021-02-18T20:27:49Z</updated>
<author>
<name>Jiri Bohac</name>
</author>
<published>2021-02-18T11:15:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=19d8e9149c27b689c6224f5c84b96a159342195a'/>
<id>urn:sha1:19d8e9149c27b689c6224f5c84b96a159342195a</id>
<content type='text'>
Both pstore_compress() and decompress_record() use a mistyped config
option name ("PSTORE_COMPRESSION" instead of "PSTORE_COMPRESS"). As
a result compression and decompression of pstore records was always
disabled.

Use the correct config option name.

Signed-off-by: Jiri Bohac &lt;jbohac@suse.cz&gt;
Fixes: fd49e03280e5 ("pstore: Fix linking when crypto API disabled")
Acked-by: Matteo Croce &lt;mcroce@microsoft.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210218111547.johvp5klpv3xrpnn@dwarf.suse.cz
</content>
</entry>
<entry>
<title>pstore: Move kmsg_bytes default into Kconfig</title>
<updated>2020-12-01T20:09:17Z</updated>
<author>
<name>Vasile-Laurentiu Stanimir</name>
</author>
<published>2020-11-04T13:05:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=26fecbf7602dd69b649914e61526bd67c557fece'/>
<id>urn:sha1:26fecbf7602dd69b649914e61526bd67c557fece</id>
<content type='text'>
While kmsg_bytes can be set for pstore via mount, if a crash occurs
before the mount only partial console log will be stored as kmsg_bytes
defaults to a potentially different hardcoded value in the kernel
(PSTORE_DEFAULT_KMSG_BYTES). This makes it impossible to analyze valuable
post-mortem data especially on the embedded development or in the process
of bringing up new boards. Change this value to be a Kconfig option
with the default of old PSTORE_DEFAULT_KMSG_BYTES

Signed-off-by: Vasile-Laurentiu Stanimir &lt;vasile-laurentiu.stanimir@windriver.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>pstore: Fix linking when crypto API disabled</title>
<updated>2020-07-07T02:42:31Z</updated>
<author>
<name>Matteo Croce</name>
</author>
<published>2020-07-07T02:37:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd49e03280e596e54edb93a91bc96170f8e97e4a'/>
<id>urn:sha1:fd49e03280e596e54edb93a91bc96170f8e97e4a</id>
<content type='text'>
When building a kernel with CONFIG_PSTORE=y and CONFIG_CRYPTO not set,
a build error happens:

    ld: fs/pstore/platform.o: in function `pstore_dump':
    platform.c:(.text+0x3f9): undefined reference to `crypto_comp_compress'
    ld: fs/pstore/platform.o: in function `pstore_get_backend_records':
    platform.c:(.text+0x784): undefined reference to `crypto_comp_decompress'

This because some pstore code uses crypto_comp_(de)compress regardless
of the CONFIG_CRYPTO status. Fix it by wrapping the (de)compress usage
by IS_ENABLED(CONFIG_PSTORE_COMPRESS)

Signed-off-by: Matteo Croce &lt;mcroce@linux.microsoft.com&gt;
Link: https://lore.kernel.org/lkml/20200706234045.9516-1-mcroce@linux.microsoft.com
Fixes: cb3bee0369bc ("pstore: Use crypto compress API")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>pstore/platform: Pass max_reason to kmesg dump</title>
<updated>2020-05-30T17:34:03Z</updated>
<author>
<name>Pavel Tatashin</name>
</author>
<published>2020-05-05T15:45:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3524e688b8ee50b0edc76f0e020727eb6c684dbc'/>
<id>urn:sha1:3524e688b8ee50b0edc76f0e020727eb6c684dbc</id>
<content type='text'>
Add a new member to struct pstore_info for passing information about
kmesg dump maximum reason. This allows a finer control of what kmesg
dumps are sent to pstore storage backends.

Those backends that do not explicitly set this field (keeping it equal to
0), get the default behavior: store only Oopses and Panics, or everything
if the printk.always_kmsg_dump boot param is set.

Signed-off-by: Pavel Tatashin &lt;pasha.tatashin@soleen.com&gt;
Link: https://lore.kernel.org/lkml/20200515184434.8470-5-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>printk: Introduce kmsg_dump_reason_str()</title>
<updated>2020-05-30T17:34:03Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2020-05-08T02:36:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fb13cb8a0482105a415e24042209d02a684255e2'/>
<id>urn:sha1:fb13cb8a0482105a415e24042209d02a684255e2</id>
<content type='text'>
The pstore subsystem already had a private version of this function.
With the coming addition of the pstore/zone driver, this needs to be
shared. As it really should live with printk, move it there instead.

Link: https://lore.kernel.org/lkml/20200515184434.8470-4-keescook@chromium.org/
Acked-by: Petr Mladek &lt;pmladek@suse.com&gt;
Acked-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Reviewed-by: Pavel Tatashin &lt;pasha.tatashin@soleen.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>printk: Collapse shutdown types into a single dump reason</title>
<updated>2020-05-30T17:34:03Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2020-05-15T18:05:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d3cf962dd1a95df868c547b090bfc4c7977f4be'/>
<id>urn:sha1:6d3cf962dd1a95df868c547b090bfc4c7977f4be</id>
<content type='text'>
To turn the KMSG_DUMP_* reasons into a more ordered list, collapse
the redundant KMSG_DUMP_(RESTART|HALT|POWEROFF) reasons into
KMSG_DUMP_SHUTDOWN. The current users already don't meaningfully
distinguish between them, so there's no need to, as discussed here:
https://lore.kernel.org/lkml/CA+CK2bAPv5u1ih5y9t5FUnTyximtFCtDYXJCpuyjOyHNOkRdqw@mail.gmail.com/

Link: https://lore.kernel.org/lkml/20200515184434.8470-2-keescook@chromium.org/
Reviewed-by: Pavel Tatashin &lt;pasha.tatashin@soleen.com&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt; (powerpc)
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>pstore/platform: Move module params after declarations</title>
<updated>2020-05-30T17:34:02Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2020-05-08T16:25:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d973f7d83dc7360597373536b34e80eea306d15f'/>
<id>urn:sha1:d973f7d83dc7360597373536b34e80eea306d15f</id>
<content type='text'>
It is easier to see how module params are used if they're near the
variables they use.

Link: https://lore.kernel.org/lkml/20200510202436.63222-4-keescook@chromium.org/
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
</feed>
