mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: davidm@hpl.hp.com, David Mosberger <davidm@napali.hpl.hp.com>,
	Andrew Morton <akpm@osdl.org>,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] prevent "dd if=/dev/mem" crash
Date: Mon, 20 Oct 2003 11:48:27 -0700	[thread overview]
Message-ID: <16276.11771.903857.778036@napali.hpl.hp.com> (raw)
In-Reply-To: <200310200917.11074.bjorn.helgaas@hp.com>

>>>>> On Mon, 20 Oct 2003 09:17:10 -0600, Bjorn Helgaas <bjorn.helgaas@hp.com> said:

  Bjorn> On Friday 17 October 2003 6:21 pm, David Mosberger wrote:
  >> What about memory-mapped device registers?  Isn't all memory
  >> physically contiguous on x86 and that's why the "p >=
  >> __pa(high_memory)" test saves you from that?

  Bjorn> As others have mentioned, using read/write on /dev/mem to get
  Bjorn> at memory-mapped registers is unlikely to work on ia64
  Bjorn> anyway, because read/write use cacheable mappings.  Using
  Bjorn> mmap does work (using uncacheable mappings), and my patch
  Bjorn> doesn't change that path.

True, I just find this whole thing rather disgusting: different
behavior for read/write vs. mmap; but you're right, it's nothing
new and probably the most pragmatic "solution".

  Bjorn> I bet that ia32 does have page tables for this case, and that
  Bjorn> an attempt to read non-existent physical memory will cause a
  Bjorn> TLB miss from which copy_*_user() can easily recover.

True, but even this doesn't help for MMIO space, where a device may
decode less than a full page.  So you'd still end up accessing address
holes.  Just that x86 returns garbage in that case (I think).

	--david

  reply	other threads:[~2003-10-20 18:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-17 22:10 Bjorn Helgaas
2003-10-17 22:23 ` Matt Mackall
2003-10-17 22:50 ` Andrew Morton
2003-10-17 23:25   ` Bjorn Helgaas
2003-10-17 23:55     ` Andrew Morton
2003-10-18  0:15       ` William Lee Irwin III
2003-10-18  0:21       ` David Mosberger
2003-10-18  0:49         ` Andrew Morton
2003-10-18  1:31           ` Matt Chapman
2003-10-18  1:41             ` Andrew Morton
2003-10-18  1:48           ` David Mosberger
2003-10-18  2:01             ` Andrew Morton
2003-10-18  2:01             ` Matt Chapman
2003-10-19 11:25           ` Eric W. Biederman
2003-10-19 19:01             ` William Lee Irwin III
2003-10-20 15:17         ` Bjorn Helgaas
2003-10-20 18:48           ` David Mosberger [this message]
2003-10-20 15:58         ` fielding PCI bus timeouts - was: " Rich Altmaier
2003-10-20 17:42       ` [RFC] " Bjorn Helgaas
2003-10-23 21:05         ` Bjorn Helgaas
2003-10-19 18:17   ` Pavel Machek
2003-10-23  8:33     ` Martin Pool
2003-10-23  9:31       ` Zoltan Menyhart
2003-10-17 22:19 Luck, Tony
2003-10-17 22:40 ` Andreas Schwab

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=16276.11771.903857.778036@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.com \
    --cc=akpm@osdl.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=davidm@hpl.hp.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®