diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-18 22:06:10 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-18 22:06:10 +0000 |
commit | aba4e552a2f2c1492441acbccedd8e0a4c53f916 (patch) | |
tree | 23921efb2b4af590160f034a89ff3da2ecca6e47 /ipc | |
parent | 9e17e1aa1cf1cb497d2f67147a51831888affcf3 (diff) |
Merge with Linux 2.3.43.
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/shm.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -840,6 +840,15 @@ static struct page * shm_nopage(struct vm_area_struct * shmd, unsigned long addr idx = (address - shmd->vm_start) >> PAGE_SHIFT; idx += shmd->vm_pgoff; + /* + * A shared mapping past the last page of the file is an error + * and results in a SIGBUS, so logically a shared mapping past + * the end of a shared memory segment should result in SIGBUS + * as well. + */ + if (idx >= shp->shm_npages) { + return NULL; + } down(&shp->sem); if(shp != shm_lock(shp->id)) BUG(); |