|
@@ -141,6 +141,10 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
|
|
if (start + size <= start)
|
|
if (start + size <= start)
|
|
return err;
|
|
return err;
|
|
|
|
|
|
|
|
+ /* Does pgoff wrap? */
|
|
|
|
+ if (pgoff + (size >> PAGE_SHIFT) < pgoff)
|
|
|
|
+ return err;
|
|
|
|
+
|
|
/* Can we represent this offset inside this architecture's pte's? */
|
|
/* Can we represent this offset inside this architecture's pte's? */
|
|
#if PTE_FILE_MAX_BITS < BITS_PER_LONG
|
|
#if PTE_FILE_MAX_BITS < BITS_PER_LONG
|
|
if (pgoff + (size >> PAGE_SHIFT) >= (1UL << PTE_FILE_MAX_BITS))
|
|
if (pgoff + (size >> PAGE_SHIFT) >= (1UL << PTE_FILE_MAX_BITS))
|