From: Sourabh Jain <sourabhjain@linux.ibm.com>
To: Hari Bathini <hbathini@linux.ibm.com>, linuxppc-dev@lists.ozlabs.org
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>,
Mahesh Salgaonkar <mahesh@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
Shivang Upadhyay <shivangu@linux.ibm.com>,
Aditya Gupta <adityag@linux.ibm.com>
Subject: Re: [PATCH v3 1/2] powerpc/crash: fix backup region offset update to elfcorehdr
Date: Thu, 12 Mar 2026 16:14:06 +0530 [thread overview]
Message-ID: <09ad3753-76c3-4f08-b62a-de2f911c7635@linux.ibm.com> (raw)
In-Reply-To: <37e21f51-5872-4498-aed6-6db4dd874b11@linux.ibm.com>
On 12/03/26 14:06, Hari Bathini wrote:
>
>
> On 12/03/26 2:00 pm, Sourabh Jain wrote:
>> update_backup_region_phdr() in file_load_64.c iterates over all the
>> program headers in the kdump kernel’s elfcorehdr and updates the
>> p_offset of the program header whose physical address starts at 0.
>>
>> However, the loop logic is incorrect because the program header pointer
>> is not updated during iteration. Since elfcorehdr typically contains
>> PT_NOTE entries first, the PT_LOAD program header with physical address
>> 0 is never reached. As a result, its p_offset is not updated to point to
>> the backup region.
>>
>> Because of this behavior, the capture kernel exports the first 64 KB of
>> the crashed kernel’s memory at offset 0, even though that memory
>> actually lives in the backup region. When a crash happens, purgatory
>> copies the first 64 KB of the crashed kernel’s memory into the backup
>> region so the capture kernel can safely use it.
>>
>> This has not caused problems so far because the first 64 KB is usually
>> identical in both the crashed and capture kernels. However, this is
>> just an assumption and is not guaranteed to always hold true.
>>
>> Fix update_backup_region_phdr() to correctly update the p_offset of the
>> program header with a starting physical address of 0 by correcting the
>> logic used to iterate over the program headers.
>>
>
> Thanks for fixing this.
> Looks good to me.
>
> Reviewed-by: Hari Bathini <hbathini@linux.ibm.com>
Thanks for the review Hari.
- Sourabh Jain
next prev parent reply other threads:[~2026-03-12 10:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 8:30 [PATCH v3 0/2] powerpc/crash: backup region offset update to eflcorehdr Sourabh Jain
2026-03-12 8:30 ` [PATCH v3 1/2] powerpc/crash: fix backup region offset update to elfcorehdr Sourabh Jain
2026-03-12 8:36 ` Hari Bathini
2026-03-12 10:44 ` Sourabh Jain [this message]
2026-03-12 8:30 ` [PATCH v3 2/2] powerpc/crash: Update backup region offset in elfcorehdr on memory hotplug Sourabh Jain
2026-04-08 4:29 ` [PATCH v3 0/2] powerpc/crash: backup region offset update to eflcorehdr Madhavan Srinivasan
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=09ad3753-76c3-4f08-b62a-de2f911c7635@linux.ibm.com \
--to=sourabhjain@linux.ibm.com \
--cc=adityag@linux.ibm.com \
--cc=hbathini@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mahesh@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=ritesh.list@gmail.com \
--cc=shivangu@linux.ibm.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