Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Joe Korty <joe.korty@concurrent-rt.com>, Tao Liu <ltao@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	kexec@lists.infradead.org, Khalid Aziz <khalid@gonehiking.org>,
	Hariprasad Nellitheertha <hari@in.ibm.com>,
	Tim Deegan <tjd21@cl.cam.ac.uk>,
	Hongyan Xia <hongyxia@amazon.com>,
	David Hildenbrand <david@redhat.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: Re: [CFT][PATCH] kexec: Remove the error prone kernel_version function
Date: Sat, 17 Apr 2021 09:18:18 +0200	[thread overview]
Message-ID: <20210417071817.GA2573@vergenet.net> (raw)
In-Reply-To: <YHaqPwaFRB8u+TiN@MiWiFi-RA69-srv> <20210412172435.GA37849@zipoli.concurrrent-rt.com>

On Mon, Apr 12, 2021 at 01:24:35PM -0400, Joe Korty wrote:
> On Fri, Apr 09, 2021 at 11:22:51AM -0500, Eric W. Biederman wrote:
> > 
> > During kexec there are two kernel versions at play.  The version of
> > the running kernel and the version of the kernel that will be booted.
> > 
> > On powerpc it appears people have been using the version of the
> > running kernel to attempt to detect properties of the kernel to be
> > booted which is just wrong.  As the linux kernel version that is being
> > detected is a no longer supported kernel just remove that buggy and
> > confused code.
> > 
> > On x86_64 the kernel_version is used to compute the starting virtual
> > address of the running kernel so a proper core dump may be generated.
> > Using the kernel_version stopped working a while ago when the starting
> > virtual address  became randomized.
> > 
> > The old code was kept for the case where the kernel was not built with
> > randomization support, but there is nothing in reading /proc/kcore
> > that won't work to detect the starting virtual address even there.
> > In fact /proc/kcore must have the starting virtual address or a
> > debugger can not make sense of the running kernel.
> > 
> > So just make computing the starting virtual address on x86_64
> > unconditional.  With a hard coded fallback just in case something went
> > wrong.
> > 
> > Doing something with kernel_version() has become important as recent
> > stable kernels have seen the minor version to > 255.  Just removing
> > kernel_version() looks like the best option.
> > 
> > Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
> > ---
> > 
> > Can folks please test this patch and verify that it works.  I really
> > think simply removing the problem code is going to be a much more robust
> > solution than papering over the bug.

...

> [ Sorry this has taken so long --jak ]
> 
> Successful dump was acquired using a hand-built 4.4.262-kdump kernel.
> The new kdump tools were installed in /usr/local, and a modified kdumpctl
> (making it use the new tools) was put in in /tmp/kdumpctl.  When I do:
>  
>     kdumpctl start
>     echo c >/proc/sysrq
> 
> I get the 'Unsupported utsname.release' error message, and the 'echo c'
> fails to create a dump directory in /var/crash.  When I do:
> 
>     /tmp/kdumpctl start
>     echo c >/proc/sysrq
> 
> I no longer get the 'Unsupported' error message and a dump directory
> appears in /var/crash.  I did not test if the dump itself was good.
> 
> Tested-by: Joe Korty <joe.korty@conurrent-rt.com>
> 

On Wed, Apr 14, 2021 at 04:39:27PM +0800, Tao Liu wrote:
> On Fri, Apr 09, 2021 at 11:22:51AM -0500, Eric W. Biederman wrote:

...

> Hello Eric,
> 
> I have the patch tested in the following cases:
> 
> x86_64,  kernel 5.11.11,      KASLR off;
> x86_64,  kernel 5.11.11,      KASLR on;
> x86_64,  kernel 5.12.0-rc7,   KASLR off;
> x86_64,  kernel 5.12.0-rc7,   KASLR on;
> 
> All cases are good to me, I can dump the vmcores and
> get them analyzed in crash-utility successfully.

Thanks,

It looks like this has requested some testing, as requested by Eric.
I've gone ahead and applied this patch.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2021-04-17  7:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 15:46 [PATCH] kexec-tools: fix failure when kernel version patchlevel >255 Joe Korty
2021-04-09 16:22 ` [CFT][PATCH] kexec: Remove the error prone kernel_version function Eric W. Biederman
2021-04-12 17:24   ` Joe Korty
2021-04-17  7:18     ` Simon Horman [this message]
2021-04-14  8:39   ` Tao Liu

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=20210417071817.GA2573@vergenet.net \
    --to=horms@verge.net.au \
    --cc=david@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=geert+renesas@glider.be \
    --cc=hari@in.ibm.com \
    --cc=hongyxia@amazon.com \
    --cc=joe.korty@concurrent-rt.com \
    --cc=kexec@lists.infradead.org \
    --cc=khalid@gonehiking.org \
    --cc=ltao@redhat.com \
    --cc=tjd21@cl.cam.ac.uk \
    /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