All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: Zack Rusin <zack.rusin@broadcom.com>, sashiko-reviews@lists.linux.dev
Cc: x86@kernel.org, Ajay Kaher <ajay.kaher@broadcom.com>,
	Kees Cook <kees@kernel.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Dave Young <ruirui.yang@linux.dev>,
	Stephen Brennan <stephen.s.brennan@oracle.com>,
	Bo Gan <bo.gan@broadcom.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Brennan Lamoreaux <brennan.lamoreaux@broadcom.com>,
	linux-doc@vger.kernel.org,
	Joel Granados <joel.granados@kernel.org>,
	Alexey Makhalov <alexey.makhalov@broadcom.com>,
	Eugenio Perez <eperezma@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Thomas Gleixner <tglx@kernel.org>, Petr Mladek <pmladek@suse.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Baoquan He <baoquan.he@linux.dev>,
	virtualization@lists.linux.dev,
	Steven Rostedt <rostedt@goodmis.org>,
	Maaz Mombasawala <maaz.mombasawala@broadcom.com>,
	Borislav Petkov <bp@alien8.de>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Michael Kelley <mhklinux@outlook.com>,
	Jonathan Corbet <corbet@lwn.net>,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	Ian Forbes <ian.forbes@broadcom.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Pratyush Yadav <pratyush@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mike Rapoport <rppt@kernel.org>
Subject: Re: [PATCH v2 2/6] crash: Notify pre-kdump callbacks before switching kernels
Date: Mon, 19 Oct 2026 12:53:00 +0206	[thread overview]
Message-ID: <87v76yotln.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <CABQX2QNHSjP+FFppUR1ohthwvCjWNA2ozOuZtnwwdNu7WGaV0g@mail.gmail.com>

On 2026-09-28, Zack Rusin <zack.rusin@broadcom.com> wrote:
>> > @@ -139,6 +140,7 @@ void __noclone __crash_kexec(struct pt_regs *regs)
>> >                       struct pt_regs fixed_regs;
>> >
>> >                       crash_setup_regs(&fixed_regs, regs);
>> > +                     panic_notify_pre_kdump(NULL);
>>
>> [Severity: Medium]
>> Will this cause pre-kdump notifiers to receive a NULL message pointer instead
>> of the expected panic message?
>>
>> If a system panic occurs and kexec is configured with the default setting of
>> crash_kexec_post_notifiers=0, vpanic() triggers __crash_kexec(NULL) before
>> reaching its own explicit panic_notify_pre_kdump(buf):
>>
>> kernel/panic.c:vpanic() {
>>     ...
>>     if (!_crash_kexec_post_notifiers)
>>         __crash_kexec(NULL);
>>     ...
>>     panic_notify_pre_kdump(buf);
>> }
>>
>> When this happens, __crash_kexec() will invoke panic_notify_pre_kdump() with
>> a NULL message pointer. This permanently consumes the once-per-boot guard,
>> and any callback relying on the documented msg parameter will experience
>> data loss or potential NULL dereferences, violating the API contract that
>> promises the panic message during a panic.
>
> afaict Sashiko gets tripped up here by the doc from the previous
> email. Nothing in this series dereferences the msg. The only callback
> is the VMware logger in patch 4, which ignores the argument. It reads
> the printk buffer, where vpanic() has already written the panic line.

If you are not using the argument, why are you providing it in your new
API? Just drop the argument. If any future pre_kdump panic notifiers
need additional information, they can adjust the API appropriately.

John Ogness


WARNING: multiple messages have this Message-ID (diff)
From: John Ogness <john.ogness@linutronix.de>
To: Zack Rusin <zack.rusin@broadcom.com>, sashiko-reviews@lists.linux.dev
Cc: Petr Mladek <pmladek@suse.com>, Baoquan He <baoquan.he@linux.dev>,
	Mike Rapoport <rppt@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Pratyush Yadav <pratyush@kernel.org>,
	Dave Young <ruirui.yang@linux.dev>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Kees Cook <kees@kernel.org>,
	linux-doc@vger.kernel.org, Shuah Khan <skhan@linuxfoundation.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	linux-kernel@vger.kernel.org,
	Ian Forbes <ian.forbes@broadcom.com>,
	Borislav Petkov <bp@alien8.de>,
	Joel Granados <joel.granados@kernel.org>,
	Brennan Lamoreaux <brennan.lamoreaux@broadcom.com>,
	"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
	Ajay Kaher <ajay.kaher@broadcom.com>,
	Bo Gan <bo.gan@broadcom.com>,
	virtualization@lists.linux.dev,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	Maaz Mombasawala <maaz.mombasawala@broadcom.com>,
	Alexey Makhalov <alexey.makhalov@broadcom.com>,
	Thomas Gleixner <tglx@kernel.org>,
	Stephen Brennan <stephen.s.brennan@oracle.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Randy Dunlap <rdunlap@infradead.org>,
	Michael Kelley <mhklinux@outlook.com>,
	Eugenio Perez <eperezma@redhat.com>,
	kexec@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH v2 2/6] crash: Notify pre-kdump callbacks before switching kernels
Date: Mon, 19 Oct 2026 12:53:00 +0206	[thread overview]
Message-ID: <87v76yotln.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <CABQX2QNHSjP+FFppUR1ohthwvCjWNA2ozOuZtnwwdNu7WGaV0g@mail.gmail.com>

On 2026-09-28, Zack Rusin <zack.rusin@broadcom.com> wrote:
>> > @@ -139,6 +140,7 @@ void __noclone __crash_kexec(struct pt_regs *regs)
>> >                       struct pt_regs fixed_regs;
>> >
>> >                       crash_setup_regs(&fixed_regs, regs);
>> > +                     panic_notify_pre_kdump(NULL);
>>
>> [Severity: Medium]
>> Will this cause pre-kdump notifiers to receive a NULL message pointer instead
>> of the expected panic message?
>>
>> If a system panic occurs and kexec is configured with the default setting of
>> crash_kexec_post_notifiers=0, vpanic() triggers __crash_kexec(NULL) before
>> reaching its own explicit panic_notify_pre_kdump(buf):
>>
>> kernel/panic.c:vpanic() {
>>     ...
>>     if (!_crash_kexec_post_notifiers)
>>         __crash_kexec(NULL);
>>     ...
>>     panic_notify_pre_kdump(buf);
>> }
>>
>> When this happens, __crash_kexec() will invoke panic_notify_pre_kdump() with
>> a NULL message pointer. This permanently consumes the once-per-boot guard,
>> and any callback relying on the documented msg parameter will experience
>> data loss or potential NULL dereferences, violating the API contract that
>> promises the panic message during a panic.
>
> afaict Sashiko gets tripped up here by the doc from the previous
> email. Nothing in this series dereferences the msg. The only callback
> is the VMware logger in patch 4, which ignores the argument. It reads
> the printk buffer, where vpanic() has already written the panic line.

If you are not using the argument, why are you providing it in your new
API? Just drop the argument. If any future pre_kdump panic notifiers
need additional information, they can adjust the API appropriately.

John Ogness

  reply	other threads:[~2026-10-19 10:47 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 17:55 [PATCH v2 0/6] panic, x86/vmware: Preserve crash logs before kdump Zack Rusin
2026-09-28 17:55 ` Zack Rusin
2026-09-28 17:55 ` [PATCH v2 1/6] panic: Add a notifier chain for pre-kdump callbacks Zack Rusin
2026-09-28 17:55   ` Zack Rusin
2026-09-28 18:04   ` sashiko-bot
2026-09-28 18:04     ` sashiko-bot
2026-10-19 22:05   ` Guilherme G. Piccoli
2026-10-20 12:01     ` Petr Mladek
2026-10-20 13:20       ` Petr Mladek
2026-10-20 14:30       ` Petr Mladek
2026-10-20 16:37         ` Petr Mladek
2026-09-28 17:55 ` [PATCH v2 2/6] crash: Notify pre-kdump callbacks before switching kernels Zack Rusin
2026-09-28 17:55   ` Zack Rusin
2026-09-28 18:08   ` sashiko-bot
2026-09-28 18:08     ` sashiko-bot
2026-09-28 18:40     ` Zack Rusin
2026-09-28 18:40       ` Zack Rusin
2026-09-28 18:40       ` Zack Rusin
2026-10-19 10:47       ` John Ogness [this message]
2026-10-19 10:47         ` John Ogness
2026-10-20 12:10   ` Petr Mladek
2026-10-20 12:10     ` Petr Mladek
2026-09-28 17:55 ` [PATCH v2 3/6] panic: Allow postponing pre-kdump notifiers Zack Rusin
2026-09-28 17:55   ` Zack Rusin
2026-09-28 18:04   ` sashiko-bot
2026-09-28 18:04     ` sashiko-bot
2026-10-19 22:07   ` Guilherme G. Piccoli
2026-10-20 12:28   ` Petr Mladek
2026-10-20 12:28     ` Petr Mladek
2026-09-28 17:55 ` [PATCH v2 4/6] x86/vmware: Add a bounded pre-kdump log sender Zack Rusin
2026-09-28 17:55   ` Zack Rusin
2026-09-28 18:07   ` sashiko-bot
2026-09-28 18:07     ` sashiko-bot
2026-09-28 17:55 ` [PATCH v2 5/6] x86/vmware: Add the vmware_record_panic_msg sysctl Zack Rusin
2026-09-28 17:55   ` Zack Rusin
2026-09-28 18:06   ` sashiko-bot
2026-09-28 18:06     ` sashiko-bot
2026-09-28 17:55 ` [PATCH v2 6/6] x86/vmware: Report guest crashes after kmsg dumpers Zack Rusin
2026-09-28 17:55   ` Zack Rusin
2026-09-28 18:03   ` sashiko-bot
2026-09-28 18:03     ` sashiko-bot
2026-09-28 20:39 ` [PATCH v2 0/6] panic, x86/vmware: Preserve crash logs before kdump Bradley Morgan
2026-09-28 20:39   ` Bradley Morgan
2026-10-14 17:07   ` Zack Rusin
2026-10-14 17:07     ` Zack Rusin

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=87v76yotln.fsf@jogness.linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=ajay.kaher@broadcom.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexey.makhalov@broadcom.com \
    --cc=baoquan.he@linux.dev \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bo.gan@broadcom.com \
    --cc=bp@alien8.de \
    --cc=brennan.lamoreaux@broadcom.com \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=eperezma@redhat.com \
    --cc=hpa@zytor.com \
    --cc=ian.forbes@broadcom.com \
    --cc=joel.granados@kernel.org \
    --cc=kees@kernel.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maaz.mombasawala@broadcom.com \
    --cc=mhklinux@outlook.com \
    --cc=mingo@redhat.com \
    --cc=mst@redhat.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=pmladek@suse.com \
    --cc=pratyush@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=rppt@kernel.org \
    --cc=ruirui.yang@linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=senozhatsky@chromium.org \
    --cc=skhan@linuxfoundation.org \
    --cc=stephen.s.brennan@oracle.com \
    --cc=tglx@kernel.org \
    --cc=virtualization@lists.linux.dev \
    --cc=x86@kernel.org \
    --cc=zack.rusin@broadcom.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.