MIPS: kernel: Reserve exception base early to prevent corruption
[sfrench/cifs-2.6.git] / mm / madvise.c
index 0938fd3ad2281a191cd41db3ec9fe951a4a1b5e3..df692d2e35d4ae3a9b38caaa574fc14451d2504e 100644 (file)
@@ -539,8 +539,9 @@ static inline bool can_do_pageout(struct vm_area_struct *vma)
         * otherwise we'd be including shared non-exclusive mappings, which
         * opens a side channel.
         */
-       return inode_owner_or_capable(file_inode(vma->vm_file)) ||
-               inode_permission(file_inode(vma->vm_file), MAY_WRITE) == 0;
+       return inode_owner_or_capable(&init_user_ns,
+                                     file_inode(vma->vm_file)) ||
+              file_permission(vma->vm_file, MAY_WRITE) == 0;
 }
 
 static long madvise_pageout(struct vm_area_struct *vma,