From: Andi Kleen <andi@firstfloor.org>
To: Marco Stornelli <marco.stornelli@gmail.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
Linux Embedded <linux-embedded@vger.kernel.org>,
Linux FS Devel <linux-fsdevel@vger.kernel.org>,
Tim Bird <tim.bird@am.sony.com>,
linux-mm@kvack.org
Subject: Re: [PATCH 14(16] pramfs: memory protection
Date: Sun, 10 Oct 2010 18:46:46 +0200 [thread overview]
Message-ID: <87aamm3si1.fsf@basil.nowhere.org> (raw)
In-Reply-To: <4CB1EBA2.8090409@gmail.com> (Marco Stornelli's message of "Sun, 10 Oct 2010 18:36:50 +0200")
Marco Stornelli <marco.stornelli@gmail.com> writes:
> +
> + do {
> + pgd = pgd_offset(&init_mm, address);
> + if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
> + goto out;
> +
> + pud = pud_offset(pgd, address);
> + if (pud_none(*pud) || unlikely(pud_bad(*pud)))
> + goto out;
> +
> + pmd = pmd_offset(pud, address);
> + if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
> + goto out;
> +
> + ptep = pte_offset_kernel(pmd, addr);
> + pte = *ptep;
> + if (pte_present(pte)) {
This won't work at all on x86 because you don't handle large
pages.
And it doesn't work on x86-64 because the first 2GB are double
mapped (direct and kernel text mapping)
Thirdly I expect it won't either on architectures that map
the direct mapping with special registers (like IA64 or MIPS)
I'm not sure this is very useful anyways. It doesn't protect
against stray DMA and it doesn't protect against writes through
broken user PTEs.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-10-10 16:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-10 16:36 Marco Stornelli
2010-10-10 16:46 ` Andi Kleen [this message]
2010-10-11 6:57 ` Marco Stornelli
2010-10-11 17:32 ` Marco Stornelli
2010-10-12 7:45 ` Andi Kleen
2010-10-12 10:47 ` Marco Stornelli
2010-10-12 11:56 ` Andi Kleen
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=87aamm3si1.fsf@basil.nowhere.org \
--to=andi@firstfloor.org \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=marco.stornelli@gmail.com \
--cc=tim.bird@am.sony.com \
/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