[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFgQCTsPGp3vwDYndXR2Qk=t2X9Gqg-82KicoAKLon+TgkkAWg@mail.gmail.com>
Date: Thu, 18 Apr 2019 15:56:09 +0800
From: Pingfan Liu <kernelfans@...il.com>
To: Borislav Petkov <bp@...en8.de>
Cc: x86@...nel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, Baoquan He <bhe@...hat.com>,
Will Deacon <will.deacon@....com>,
Nicolas Pitre <nico@...aro.org>,
Vivek Goyal <vgoyal@...hat.com>,
Chao Fan <fanc.fnst@...fujitsu.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Hari Bathini <hbathini@...ux.vnet.ibm.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 2/2] x86/boot/KASLR: skip the specified crashkernel region
On Thu, Apr 18, 2019 at 12:06 AM Borislav Petkov <bp@...en8.de> wrote:
>
> On Wed, Apr 17, 2019 at 01:53:37PM +0800, Pingfan Liu wrote:
> > Take __parse_crashkernel()->parse_crashkernel_simple() for example. If
> > no offset given, then it still return 0, but crash_base is dangling.
Sorry for misleading, I made a mistake. In
parse_crashkernel()->__parse_crashkernel(), { *crash_size = 0;
*crash_base = 0;}. Hence no need to initialize crash_base in
handle_crashkernel_options().
>
> Well, that is bad design. parse_crashkernel_simple() should return a
> *separate* distinct value which denotes that @offset hasn't been passed.
Then in my case, either no @offset or invalid argument will keep
"*crash_base = 0", and KASLR does not care about either of them.
>
> Please fix that by having it return 1 or something else positive to
> denote that there wasn't an [@offset] given.
>
> And then correct that crap here:
>
> static void __init reserve_crashkernel(void)
> {
> ...
>
> ret = parse_crashkernel(boot_command_line, total_mem, &crash_size, &crash_base);
> if (ret != 0 || crash_size <= 0) {
It is not elegant. Will try a separate patch to fix it firstly.
Thanks,
Pingfan
>
> where *two*! variables are used as return values from a single function.
> That's just sloppy.
>
> Thx.
>
> --
> Regards/Gruss,
> Boris.
>
> Good mailing practices for 400: avoid top-posting and trim the reply.
Powered by blists - more mailing lists