From: Michal Hocko <mhocko@suse.cz>
To: Venki Pallipadi <venki@google.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH resend] x86, PAT: honor CONFIG_STRICT_DEVMEM if pat is disabled
Date: Tue, 2 Aug 2011 10:03:15 +0200 [thread overview]
Message-ID: <20110802080315.GA9473@tiehlicka.suse.cz> (raw)
In-Reply-To: <CABeCy1Y6ZO3igfRhdDQTSS0i2w9k2WTtJYwWUxuRT56UG9Zd8Q@mail.gmail.com>
On Mon 01-08-11 16:33:18, Venki Pallipadi wrote:
> On Fri, Jul 22, 2011 at 2:01 AM, Michal Hocko <mhocko@suse.cz> wrote:
> >
> > since 0124cecf (x86, PAT: disable /dev/mem mmap RAM with PAT) we are
> > disabling access to the system RAM as if STRICT_DEVMEM was enabled by
> > default. If we, however, disable pat by nopat kernel parameter we can
> > access that memory without considering CONFIG_STRICT_DEVMEM.
>
> Looking at the code, I don't think this problem exists. Code in pat.c
> disables /dev/mem mmap only when !CONFIG_STRICT_DEVMEM.
Ahh yes, you are right. I got confused by having two separate
range_is_allowed functions and didn't realize which one is called from
which context.
mmap_mem
-> range_is_allowed [drivers/char/mem.c]
-EPERM
-> phys_mem_access_prot_allowed
-> range_is_allowed [arch/x86/mm/pat.c]
So we really get stopped at the first check and do not get to the later
one.
While we are at it. {read,write}_mem checks only range_is_allowed (mem.c
version) and it doesn't call phys_mem_access_prot_allowed so we do not
consider PAT. {read,write}_kmem doesn't check the range at all.
Is this correct?
Why do we care _only_ about mmap?
Thanks
--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic
next prev parent reply other threads:[~2011-08-02 8:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20110801094611.AAF738A95F@mx2.suse.de>
2011-08-01 23:33 ` Venki Pallipadi
2011-08-02 8:03 ` Michal Hocko [this message]
2011-08-02 16:33 ` Venki Pallipadi
2011-08-02 17:02 ` Michal Hocko
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=20110802080315.GA9473@tiehlicka.suse.cz \
--to=mhocko@suse.cz \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=venki@google.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
all inboxes | Powered by JetHome®