From: Borislav Petkov <bp@alien8.de>
To: Pingfan Liu <kernelfans@gmail.com>
Cc: x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Baoquan He <bhe@redhat.com>, Will Deacon <will.deacon@arm.com>,
Nicolas Pitre <nico@linaro.org>, Vivek Goyal <vgoyal@redhat.com>,
Chao Fan <fanc.fnst@cn.fujitsu.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Hari Bathini <hbathini@linux.vnet.ibm.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 2/2] x86/boot/KASLR: skip the specified crashkernel region
Date: Wed, 17 Apr 2019 18:06:18 +0200 [thread overview]
Message-ID: <20190417160618.GG20492@zn.tnic> (raw)
In-Reply-To: <CAFgQCTuDVk+Zav0v-WfPmEjmuOW-P+n3x9SmZj54ky-FJ82_+Q@mail.gmail.com>
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.
Well, that is bad design. parse_crashkernel_simple() should return a
*separate* distinct value which denotes that @offset hasn't been passed.
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) {
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.
next prev parent reply other threads:[~2019-04-17 16:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-08 5:58 [PATCH v4 0/2] x86/boot/KASLR: skip the specified crashkernel region Pingfan Liu
2019-04-08 5:58 ` [PATCH v4 1/2] kernel/crash_core: separate the parsing routines to lib/parse_crashkernel.c Pingfan Liu
2019-04-16 19:01 ` Borislav Petkov
2019-04-17 5:48 ` Pingfan Liu
2019-04-08 5:58 ` [PATCH v4 2/2] x86/boot/KASLR: skip the specified crashkernel region Pingfan Liu
2019-04-16 19:01 ` Borislav Petkov
2019-04-17 5:53 ` Pingfan Liu
2019-04-17 16:06 ` Borislav Petkov [this message]
2019-04-18 7:56 ` Pingfan Liu
2019-04-18 12:32 ` Borislav Petkov
2019-05-06 10:08 ` Pingfan 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=20190417160618.GG20492@zn.tnic \
--to=bp@alien8.de \
--cc=ard.biesheuvel@linaro.org \
--cc=bhe@redhat.com \
--cc=fanc.fnst@cn.fujitsu.com \
--cc=hbathini@linux.vnet.ibm.com \
--cc=hpa@zytor.com \
--cc=kernelfans@gmail.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nico@linaro.org \
--cc=tglx@linutronix.de \
--cc=vgoyal@redhat.com \
--cc=will.deacon@arm.com \
--cc=x86@kernel.org \
/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