OSDN Git Service
(root)
/
linux-kernel-docs
/
linux-2.4.36.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
hfsplus: fix Buffer overflow with a corrupted image
[linux-kernel-docs/linux-2.4.36.git]
/
ipc
/
shm.c
diff --git
a/ipc/shm.c
b/ipc/shm.c
index
1df0577
..
36cb09a
100644
(file)
--- a/
ipc/shm.c
+++ b/
ipc/shm.c
@@
-161,6
+161,8
@@
static int shm_mmap(struct file * file, struct vm_area_struct * vma)
{
UPDATE_ATIME(file->f_dentry->d_inode);
vma->vm_ops = &shm_vm_ops;
+ if (!(vma->vm_flags & VM_WRITE))
+ vma->vm_flags &= ~VM_MAYWRITE;
shm_inc(file->f_dentry->d_inode->i_ino);
return 0;
}