aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/filemap.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 9940895f734c..188cf5fd3e8d 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1300,7 +1300,7 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1300 1300
1301 size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 1301 size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
1302 if (vmf->pgoff >= size) 1302 if (vmf->pgoff >= size)
1303 goto outside_data_content; 1303 return VM_FAULT_SIGBUS;
1304 1304
1305 /* If we don't want any read-ahead, don't bother */ 1305 /* If we don't want any read-ahead, don't bother */
1306 if (VM_RandomReadHint(vma)) 1306 if (VM_RandomReadHint(vma))
@@ -1377,7 +1377,7 @@ retry_find:
1377 if (unlikely(vmf->pgoff >= size)) { 1377 if (unlikely(vmf->pgoff >= size)) {
1378 unlock_page(page); 1378 unlock_page(page);
1379 page_cache_release(page); 1379 page_cache_release(page);
1380 goto outside_data_content; 1380 return VM_FAULT_SIGBUS;
1381 } 1381 }
1382 1382
1383 /* 1383 /*
@@ -1388,15 +1388,6 @@ retry_find:
1388 vmf->page = page; 1388 vmf->page = page;
1389 return ret | VM_FAULT_LOCKED; 1389 return ret | VM_FAULT_LOCKED;
1390 1390
1391outside_data_content:
1392 /*
1393 * An external ptracer can access pages that normally aren't
1394 * accessible..
1395 */
1396 if (vma->vm_mm == current->mm)
1397 return VM_FAULT_SIGBUS;
1398
1399 /* Fall through to the non-read-ahead case */
1400no_cached_page: 1391no_cached_page:
1401 /* 1392 /*
1402 * We're only likely to ever get here if MADV_RANDOM is in 1393 * We're only likely to ever get here if MADV_RANDOM is in