From: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
kees@kernel.org, tony.luck@intel.com, kernel-dev@igalia.com,
kernel@gpiccoli.net
Subject: Re: [PATCH] pstore/ftrace: Factor KASLR offset in the core kernel instruction addresses
Date: Fri, 13 Mar 2026 17:57:35 -0300 [thread overview]
Message-ID: <b88aa1bd-5b7c-a31b-fea6-3886099e2fec@igalia.com> (raw)
In-Reply-To: <20260313162831.32b52b6a@gandalf.local.home>
On 13/03/2026 17:28, Steven Rostedt wrote:
> [...]
>
> You can look at what ftrace does with the persistent ring buffer. It adds
> the offset data to a "scratch pad" that is saved in the persistent memory.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/trace.c#n5352
>
> If you know your memory isn't reset over reboots, you can create a
> "persistent ring buffer" via the kernel command line:
>
> reserve_mem=20M:2M:trace trace_instance=boot_map@trace
>
> Read more about it here: https://docs.kernel.org/trace/debugging.html
>
> Then on reboot, the persistent ring buffer lives here:
>
> /sys/kernel/tracing/instances/boot_map/
>
> You can enable tracing just like any other instance:
>
> # echo 1 > /sys/kernel/tracing/instances/boot_map/tracing_on
> # echo function_graph > /sys/kernel/tracing/instances/boot_map/current_tracer
> # cat /sys/kernel/tracing/instances/boot_map/trace
>
> Then reboot, if the memory wasn't corrupted or reset, the instance will
> have everything from the last boot, right to where it rebooted the machine.
>
> There's a file that shows the indexes of the kernel from the previous boot:
>
> # cat /sys/kernel/tracing/instances/boot_map/last_boot_info
> ffffffffa6000000 [kernel]
> ffffffffc0400000 drm
[...]
Hi Steve, this is very interesting! Thanks for pointing that
infrastructure. And I'm glad it confirms my impression that the full fix
of that isn't trivial heh
So, are you suggesting to use the ftrace infrastructure in the
pstore/ftrace? Well, seeing how mature the ftrace infra is with regards
the persistent ring buffer, I'd say pstore/ftrace+ramoops gets useless
now heh
The usage then for pstore/ftrace would be more with other backends,
really low memory cases like ERST or UEFI, for example, in embedded
maybe. And in this case, saving the full modules name table + offsets
could incur some precious memory consumption and/or performance impact.
Or maybe I'm talking nonsense and this would be quite OK ... guess worth
taking a look.
I'll wait a bit more to see what pstore maintainers think about that, if
is worth to have the very simple KASLR fix or a bit more engineered
solution that factors modules as well.
Thanks again,
Guilherme
next prev parent reply other threads:[~2026-03-13 20:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 20:00 Guilherme G. Piccoli
2026-03-13 20:22 ` Guilherme G. Piccoli
2026-03-13 20:28 ` Steven Rostedt
2026-03-13 20:57 ` Guilherme G. Piccoli [this message]
2026-03-15 14:09 ` Steven Rostedt
2026-03-15 15:02 ` Guilherme G. Piccoli
2026-03-28 21:47 ` Guilherme G. Piccoli
2026-03-31 21:48 ` Kees Cook
2026-04-01 22:28 ` Guilherme G. Piccoli
2026-04-09 16:13 ` Guilherme G. Piccoli
2026-04-07 3:58 ` kernel test robot
2026-04-09 16:31 ` Kees Cook
2026-04-09 18:57 ` Guilherme G. Piccoli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b88aa1bd-5b7c-a31b-fea6-3886099e2fec@igalia.com \
--to=gpiccoli@igalia.com \
--cc=kees@kernel.org \
--cc=kernel-dev@igalia.com \
--cc=kernel@gpiccoli.net \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®