git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NFSD: Support IPv6 addresses in write_failover_ip()
[safe/jmp/linux-2.6]
/
mm
/
mmap.c
diff --git
a/mm/mmap.c
b/mm/mmap.c
index
2c1c2cb
..
34579b2
100644
(file)
--- a/
mm/mmap.c
+++ b/
mm/mmap.c
@@
-88,6
+88,9
@@
int sysctl_overcommit_ratio = 50; /* default is 50% */
int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT;
struct percpu_counter vm_committed_as;
int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT;
struct percpu_counter vm_committed_as;
+/* amount of vm to protect from userspace access */
+unsigned long mmap_min_addr = CONFIG_DEFAULT_MMAP_MIN_ADDR;
+
/*
* Check that a process has enough memory to allocate a new virtual
* mapping. 0 means there is enough memory for the allocation to
/*
* Check that a process has enough memory to allocate a new virtual
* mapping. 0 means there is enough memory for the allocation to
@@
-1220,8
+1223,7
@@
munmap_back:
if (correct_wcount)
atomic_inc(&inode->i_writecount);
out:
if (correct_wcount)
atomic_inc(&inode->i_writecount);
out:
- if (vm_flags & VM_EXEC)
- perf_counter_mmap(addr, len, pgoff, file);
+ perf_counter_mmap(vma);
mm->total_vm += len >> PAGE_SHIFT;
vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
mm->total_vm += len >> PAGE_SHIFT;
vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
@@
-1756,12
+1758,6
@@
static void remove_vma_list(struct mm_struct *mm, struct vm_area_struct *vma)
do {
long nrpages = vma_pages(vma);
do {
long nrpages = vma_pages(vma);
- if (vma->vm_flags & VM_EXEC) {
- perf_counter_munmap(vma->vm_start,
- nrpages << PAGE_SHIFT,
- vma->vm_pgoff, vma->vm_file);
- }
-
mm->total_vm -= nrpages;
vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages);
vma = remove_vma(vma);
mm->total_vm -= nrpages;
vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages);
vma = remove_vma(vma);
@@
-2315,6
+2311,8
@@
int install_special_mapping(struct mm_struct *mm,
mm->total_vm += len >> PAGE_SHIFT;
mm->total_vm += len >> PAGE_SHIFT;
+ perf_counter_mmap(vma);
+
return 0;
}
return 0;
}