summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0cddc0a)
Make /dev/kmem a config option; /dev/kmem is VERY rarely used, and when
used, it's generally for no good (rootkits tend to be the most common
users). With this config option, users have the choice to disable
/dev/kmem, saving some size as well.
A patch to disable /dev/kmem has been in the Fedora and RHEL kernels for
4+ years now without any known problems or legit users of /dev/kmem.
[akpm@linux-foundation.org: make CONFIG_DEVKMEM default to y]
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
information. For framebuffer console users, please refer to
<file:Documentation/fb/fbcon.txt>.
information. For framebuffer console users, please refer to
<file:Documentation/fb/fbcon.txt>.
+config DEVKMEM
+ bool "/dev/kmem virtual device support"
+ default y
+ help
+ Say Y here if you want to support the /dev/kmem device. The
+ /dev/kmem device is rarely used, but can be used for certain
+ kind of kernel debugging operations.
+ When in doubt, say "N".
+
config SERIAL_NONSTANDARD
bool "Non-standard serial port support"
depends on HAS_IOMEM
config SERIAL_NONSTANDARD
bool "Non-standard serial port support"
depends on HAS_IOMEM
static int mmap_kmem(struct file * file, struct vm_area_struct * vma)
{
unsigned long pfn;
static int mmap_kmem(struct file * file, struct vm_area_struct * vma)
{
unsigned long pfn;
vma->vm_pgoff = pfn;
return mmap_mem(file, vma);
}
vma->vm_pgoff = pfn;
return mmap_mem(file, vma);
}
#ifdef CONFIG_CRASH_DUMP
/*
#ifdef CONFIG_CRASH_DUMP
/*
extern long vread(char *buf, char *addr, unsigned long count);
extern long vwrite(char *buf, char *addr, unsigned long count);
extern long vread(char *buf, char *addr, unsigned long count);
extern long vwrite(char *buf, char *addr, unsigned long count);
/*
* This function reads the *virtual* memory as seen by the kernel.
*/
/*
* This function reads the *virtual* memory as seen by the kernel.
*/
*ppos = p;
return virtr + wrote;
}
*ppos = p;
return virtr + wrote;
}
#ifdef CONFIG_DEVPORT
static ssize_t read_port(struct file * file, char __user * buf,
#ifdef CONFIG_DEVPORT
static ssize_t read_port(struct file * file, char __user * buf,
.get_unmapped_area = get_unmapped_area_mem,
};
.get_unmapped_area = get_unmapped_area_mem,
};
static const struct file_operations kmem_fops = {
.llseek = memory_lseek,
.read = read_kmem,
static const struct file_operations kmem_fops = {
.llseek = memory_lseek,
.read = read_kmem,
.open = open_kmem,
.get_unmapped_area = get_unmapped_area_mem,
};
.open = open_kmem,
.get_unmapped_area = get_unmapped_area_mem,
};
static const struct file_operations null_fops = {
.llseek = null_lseek,
static const struct file_operations null_fops = {
.llseek = null_lseek,
filp->f_mapping->backing_dev_info =
&directly_mappable_cdev_bdi;
break;
filp->f_mapping->backing_dev_info =
&directly_mappable_cdev_bdi;
break;
case 2:
filp->f_op = &kmem_fops;
filp->f_mapping->backing_dev_info =
&directly_mappable_cdev_bdi;
break;
case 2:
filp->f_op = &kmem_fops;
filp->f_mapping->backing_dev_info =
&directly_mappable_cdev_bdi;
break;
case 3:
filp->f_op = &null_fops;
break;
case 3:
filp->f_op = &null_fops;
break;
const struct file_operations *fops;
} devlist[] = { /* list of minor devices */
{1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops},
const struct file_operations *fops;
} devlist[] = { /* list of minor devices */
{1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops},
{2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops},
{2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops},
{3, "null", S_IRUGO | S_IWUGO, &null_fops},
#ifdef CONFIG_DEVPORT
{4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops},
{3, "null", S_IRUGO | S_IWUGO, &null_fops},
#ifdef CONFIG_DEVPORT
{4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops},