Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104308
b: refs/heads/master
c: d092633
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Jul 20, 2008
1 parent 9e320e9 commit 6b26a1b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 723edb5060855ef36ddeca51a070784b0e0d16df
refs/heads/master: d092633bff3b19faffc480fe9810805e7792a029
9 changes: 5 additions & 4 deletions trunk/arch/x86/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ config TRACE_IRQFLAGS_SUPPORT

source "lib/Kconfig.debug"

config PROMISC_DEVMEM
bool "Allow unlimited access to /dev/mem"
default y
config STRICT_DEVMEM
bool "Filter access to /dev/mem"
help
If this option is left on, you allow userspace (root) access to all
of memory, including kernel and userspace memory. Accidental
access to this is obviously disastrous, but specific access can
be used by people debugging the kernel.
be used by people debugging the kernel. Note that with PAT support
enabled, even in this case there are restrictions on /dev/mem
use due to the cache aliasing requirements.

If this option is switched on, the /dev/mem file only allows
userspace access to PCI space and the BIOS code and data regions.
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/configs/i386_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2047,7 +2047,7 @@ CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
# CONFIG_SAMPLES is not set
# CONFIG_KGDB is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_NONPROMISC_DEVMEM is not set
# CONFIG_STRICT_DEVMEM is not set
CONFIG_EARLY_PRINTK=y
CONFIG_DEBUG_STACKOVERFLOW=y
CONFIG_DEBUG_STACK_USAGE=y
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/configs/x86_64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,7 @@ CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
# CONFIG_SAMPLES is not set
# CONFIG_KGDB is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_NONPROMISC_DEVMEM is not set
# CONFIG_STRICT_DEVMEM is not set
CONFIG_EARLY_PRINTK=y
CONFIG_DEBUG_STACKOVERFLOW=y
CONFIG_DEBUG_STACK_USAGE=y
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/x86/mm/pat.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
return vma_prot;
}

#ifndef CONFIG_PROMISC_DEVMEM
/* This check is done in drivers/char/mem.c in case of !PROMISC_DEVMEM*/
#ifdef CONFIG_STRICT_DEVMEM
/* This check is done in drivers/char/mem.c in case of STRICT_DEVMEM*/
static inline int range_is_allowed(unsigned long pfn, unsigned long size)
{
return 1;
Expand All @@ -398,7 +398,7 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
}
return 1;
}
#endif /* CONFIG_PROMISC_DEVMEM */
#endif /* CONFIG_STRICT_DEVMEM */

int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
unsigned long size, pgprot_t *vma_prot)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
}
#endif

#ifndef CONFIG_PROMISC_DEVMEM
#ifdef CONFIG_STRICT_DEVMEM
static inline int range_is_allowed(unsigned long pfn, unsigned long size)
{
u64 from = ((u64)pfn) << PAGE_SHIFT;
Expand Down

0 comments on commit 6b26a1b

Please sign in to comment.