]> git.ipfire.org Git - people/ms/linux.git/blobdiff - mm/filemap.c
Importing "grsecurity-3.1-3.19.2-201503201903.patch"
[people/ms/linux.git] / mm / filemap.c
index 673e4581a2e541b44b02cd8ef201772dad5311a1..71920139556e814c3d4b940cb1a5550312ae975d 100644 (file)
@@ -2097,7 +2097,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
        struct address_space *mapping = file->f_mapping;
 
        if (!mapping->a_ops->readpage)
-               return -ENOEXEC;
+               return -ENODEV;
        file_accessed(file);
        vma->vm_ops = &generic_file_vm_ops;
        return 0;
@@ -2275,6 +2275,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
                         *pos = i_size_read(inode);
 
                if (limit != RLIM_INFINITY) {
+                       gr_learn_resource(current, RLIMIT_FSIZE,*pos, 0);
                        if (*pos >= limit) {
                                send_sig(SIGXFSZ, current, 0);
                                return -EFBIG;