mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Michal Hocko <mhocko@suse.com>
Subject: Access to non-RAM pages
Date: Wed, 29 Aug 2018 14:10:53 +0200	[thread overview]
Message-ID: <3009b28a-971c-920a-9184-900f1f3b2203@suse.com> (raw)

Running as a Xen guest a customer's system experienced problems due
to load_unaligned_zeropad() hitting a ballooned memory page. The
8 byte read was meant to read the last 4 bytes from a kernel page
and should have returned 4 zero bytes for the not allocated page
after that.

In order not to split huge direct map pages The Xen balloon driver
doesn't remove ballooned pages from the direct map. The memory page
is removed from the EPT, of course, but a bug in the hypervisor would
emulate the 8 byte read wrong by returning all bytes as 0xff, leading
to above mentioned problems.

While this bug can be repaired in Xen I'm rather sure it is dangerous
to rely on load_unaligned_zeropad() doing the right thing when crossing
page boundaries. Trying to access an invalid page is handled fine, but
what happens if the next page is a MMIO area? Reading from that might
have strange side effects.

While being very unlikely I still believe this is possible. Any
thoughts?

Michal asked me to bring this up for a wider audience.


Juergen

             reply	other threads:[~2018-08-29 12:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29 12:10 Juergen Gross [this message]
2018-08-31 21:18 ` Jiri Kosina
2018-09-01 10:47   ` Juergen Gross
2018-09-01 17:13     ` Al Viro
2018-09-01 21:48       ` Jiri Kosina
2018-09-01 17:27   ` Linus Torvalds
2018-09-01 18:06     ` Linus Torvalds
2018-09-03  0:48       ` Benjamin Herrenschmidt
2018-09-03  0:55         ` Benjamin Herrenschmidt
2018-09-03  1:38           ` Linus Torvalds
2018-09-03  1:42             ` Linus Torvalds
2018-09-03  2:00               ` Benjamin Herrenschmidt
2018-09-03  2:10                 ` Linus Torvalds
2018-09-03  2:25                   ` Benjamin Herrenschmidt
2018-09-03  2:47                     ` Linus Torvalds
2018-09-03  2:52                       ` Linus Torvalds
2018-09-03  3:44                         ` Benjamin Herrenschmidt
2018-09-03  5:08                   ` Juergen Gross
2018-09-03  6:05                   ` Jiri Kosina
2018-09-03 10:36                   ` Will Deacon
2018-09-03  1:44             ` Benjamin Herrenschmidt
2018-09-03  1:46             ` Benjamin Herrenschmidt

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=3009b28a-971c-920a-9184-900f1f3b2203@suse.com \
    --to=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®