mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Kelly <martin@martingkelly.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org, mingo@redhat.com,
	hpa@zytor.com, akpm@linux-foundation.org, rientjes@google.com,
	david.vrabel@citrix.com, Martin Kelly <martkell@amazon.com>
Subject: Re: [PATCH v2] x86, e820: panic on sanitizing invalid memory map
Date: Tue, 21 Oct 2014 06:29:38 -0700	[thread overview]
Message-ID: <54465FC2.1030106@martingkelly.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1410211043150.5308@nanos>

On 10/21/2014 01:56 AM, Thomas Gleixner wrote:
>> This patch changes the behavior so that sanitize_e820_map is a void
>> function. When the provided memory map has length 1 or it is sanitized
>> (both ok cases), it returns nothing. If the provided memory map is
>> invalid, then it panics.
> 
> So you break wilfully default_machine_specific_memory_setup() and
> probably some other places. Are you sure about that?
> 

I was concerned about exactly that kind of breakage, so my first patch
merely separated out the return values and added some appropriate error
checking:
https://lkml.org/lkml/2014/10/13/514

I then asked whether there are valid cases for ignoring an invalid map
and continuing on, but I didn't receive a reply, so I took my best
guess. It appears I missed some fallback code
(default_machine_specific_memory_setup). That said, most cases don't
appear to have fallback code and will hit issues later on if the BIOS
map is invalid (e.g. Xen).

Thomas, do you see any issues with a revision that separates out the
return values (0 for a map with 1 entry, -1 for a map with invalid
entries) and adds checks in the callers, where appropriate?

Thanks,
Martin

  reply	other threads:[~2014-10-21 13:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21  2:37 Martin Kelly
2014-10-21  8:56 ` Thomas Gleixner
2014-10-21 13:29   ` Martin Kelly [this message]
2014-10-21 19:44     ` Thomas Gleixner
2014-10-22  3:15       ` Martin Kelly

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=54465FC2.1030106@martingkelly.com \
    --to=martin@martingkelly.com \
    --cc=akpm@linux-foundation.org \
    --cc=david.vrabel@citrix.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martkell@amazon.com \
    --cc=mingo@redhat.com \
    --cc=rientjes@google.com \
    --cc=tglx@linutronix.de \
    --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

Powered by JetHome