From: Linus Torvalds <torvalds@linux-foundation.org>
To: "V.Radhakrishnan" <rk@atr-labs.com>, Ingo Molnar <mingo@elte.hu>
Cc: Linux Kernel Mailing List <Linux-kernel@vger.kernel.org>
Subject: Re: Patch [1/1] minor bugfix in 2.6.26/arch/x86/mm/pat.c - caused problems in mmap() of /dev/mem character file
Date: Thu, 17 Jul 2008 10:27:03 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.1.10.0807171025110.2959@woody.linux-foundation.org> (raw)
In-Reply-To: <1216315516.2324.10.camel@atlas>
On Thu, 17 Jul 2008, V.Radhakrishnan wrote:
>
> The above #ifdef must be actually #ifndef and not #ifdef
> The bug does not allow a valid user (root) from accessing /dev/mem even
> though the CONFIG_PROMISC_DEVMEM is NOT selected.
The real bug is that we shouldn't have "double negatives", and certainly
not negative config options. Making that "promiscuous /dev/mem" option a
negated thing as a config option was bad.
Ingo, over to you..
Linus
> --- arch/x86/mm/pat.c.orig 2008-07-17 22:04:18.000000000 +0530
> +++ arch/x86/mm/pat.c 2008-07-17 22:43:39.000000000 +0530
> @@ -471,7 +475,7 @@ pgprot_t phys_mem_access_prot(struct fil
> return vma_prot;
> }
>
> -#ifdef CONFIG_NONPROMISC_DEVMEM
> +#ifndef CONFIG_NONPROMISC_DEVMEM
> /* This check is done in drivers/char/mem.c in case of NONPROMISC_DEVMEM*/
> static inline int range_is_allowed(unsigned long pfn, unsigned long size)
> {
> @@ -586,4 +590,3 @@ void unmap_devmem(unsigned long pfn, uns
next prev parent reply other threads:[~2008-07-17 17:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-17 17:25 Patch [1/1] minor bugfix in 2.6.26/arch/x86/mm/pat.c - caused problems in mmap() of /dev/mem character file V.Radhakrishnan
2008-07-17 17:27 ` Linus Torvalds [this message]
2008-07-17 22:39 ` Ingo Molnar
2008-07-18 2:04 ` V.Radhakrishnan
2008-07-19 22:05 ` Arjan van de Ven
2008-07-20 15:50 ` V.Radhakrishnan
2008-07-20 15:56 ` Arjan van de Ven
2008-07-19 22:47 ` Arjan van de Ven
2008-07-20 6:37 ` Ingo Molnar
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=alpine.LFD.1.10.0807171025110.2959@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=Linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rk@atr-labs.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