linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arjan@linux.intel.com (Arjan van de Ven)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] arm64: add alignment fault hanling
Date: Tue, 16 Feb 2016 13:31:36 -0800	[thread overview]
Message-ID: <56C39538.6090009@linux.intel.com> (raw)
In-Reply-To: <CA+55aFw-86k4gY46Et=e02HQQSxjUK2Jfz0SJz8tWtk5P8YZFA@mail.gmail.com>

On 2/16/2016 10:50 AM, Linus Torvalds wrote:
> On Tue, Feb 16, 2016 at 9:04 AM, Will Deacon <will.deacon@arm.com> wrote:
>> [replying to self and adding some x86 people]
>>
>> Background: Euntaik reports a problem where userspace has ended up with
>> a memory page mapped adjacent to an MMIO page (e.g. from /dev/mem or a
>> PCI memory bar from someplace in /sys). strncpy_from_user happens with
>> the word-at-a-time implementation, and we end up reading into the MMIO
>> page.

how does this work if the adjacent page is not accessible?
or has some other magic fault handler, or is on an NFS filesystem where
the server is rebooting?

isn't the general rule for such basic functions "don't touch memory unless you KNOW it is there"



> Of course, no actual real program will do that for mixing MMIO and
> non-MMIO, and so we might obviously add code to always add a guard
> page for the normal case when a specific address isn't asked for. So
> as a heuristic to make sure it doesn't happen by mistake it possibly
> makes sense.

but what happens to the read if the page isn't present?
or is execute-only or .. or ..

  reply	other threads:[~2016-02-16 21:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16  4:44 [PATCH v2] arm64: add alignment fault hanling EunTaik Lee
2016-02-16 10:31 ` Will Deacon
2016-02-16 10:57   ` Robin Murphy
2016-02-16 12:21     ` Catalin Marinas
2016-02-16 16:00       ` Will Deacon
2016-02-16 17:04         ` Will Deacon
2016-02-16 18:50           ` Linus Torvalds
2016-02-16 21:31             ` Arjan van de Ven [this message]
2016-02-16 23:04               ` Catalin Marinas
     [not found]               ` <CA+55aFz+ttJoEG_WkpkwV=+Wunzxpj9NoHobq-8oFZS0HEEyeA@mail.gmail.com>
2016-02-17  0:28                 ` Linus Torvalds
2016-02-19 18:14             ` Catalin Marinas
2016-02-19 22:09               ` Linus Torvalds
2016-02-16 17:09         ` Catalin Marinas
2016-02-16 17:11 ` Catalin Marinas

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=56C39538.6090009@linux.intel.com \
    --to=arjan@linux.intel.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).